commit
stringlengths 40
40
| subject
stringlengths 4
1.73k
| repos
stringlengths 5
127k
| old_file
stringlengths 2
751
| new_file
stringlengths 2
751
| new_contents
stringlengths 1
8.98k
| old_contents
stringlengths 0
6.59k
| license
stringclasses 13
values | lang
stringclasses 23
values |
---|---|---|---|---|---|---|---|---|
f23d49fa51e9c99edf194cecf68d695a5dd3be90
|
Update Index.cshtml
|
ucdavis/Anlab,ucdavis/Anlab,ucdavis/Anlab,ucdavis/Anlab
|
Anlab.Mvc/Views/Home/Index.cshtml
|
Anlab.Mvc/Views/Home/Index.cshtml
|
@{
ViewData["Title"] = "Home Page";
}
<div class="col-8">
<div class="alert alert-info">
<button type="button" class="close" data-dismiss="alert">×</button>
Update posted: December 8, 2020<br /><br />
<strong>Please Note Holiday Closure Information:</strong><br /><br />
The Lab will be closed from December 24 - January 1<br />
Please arrange sample deliveries by noon on December 23 if possible.<br />
We will reopen with normal business hours on Monday, January 4.<br /><br />
<strong>Also Note:</strong><br /><br />
The emergency arrangement for wine testing is concluding.
Results for samples already received will be reported soon but we are no longer accepting new samples.
</div>
<p class="lead">The UC Davis Analytical Laboratory is a core support facility of the UC Davis College of Agriculture and Environmental Sciences.</p>
<p>The laboratory is located in Hoagland Hall with a Sample Receiving area in nearby Hoagland Annex. </p>
<p>The laboratory performs analyses on selected chemical constituents of soil, plant, water and
waste water, and feed in support of agricultural and environmental research.</p>
<p>For new clients, please note the drop-down menu under “Lab Information” which contains
an “Order Completion Help” section to help guide you in creating a work order. Also helpful
under the “Lab Information” drop-down menu is the “Methods of Analysis” section which provides
brief descriptions of our current methods.</p>
<p>Please feel free to contact the lab with any questions.</p>
</div>
<div class="col-4">
<address>
<p>UC Davis Analytical Lab<br> University of California Davis, California <br> 95616-5270 <br>
Phone: <span style="white-space: nowrap">(530) 752-0147</span> <br>
Fax: <span style="white-space: nowrap">(530) 752-9892</span> <br>
Email: <a href="mailto:anlab@ucdavis.edu">anlab@ucdavis.edu</a></p>
<p>Receiving Hours: 8am - 5pm M - F, </br> except University holidays </br>
Sample Receiving Area: Hoagland Annex, </br>Phone: 530-752-0266</p>
</address>
</div>
|
@{
ViewData["Title"] = "Home Page";
}
<div class="col-8">
<div class="alert alert-info">
<button type="button" class="close" data-dismiss="alert">×</button>
Update posted: December 8, 2020<br /><br />
<strong>Please Note Holiday Closure Information:</strong><br /><br />
The Lab will be closed from December 24 - January 1<br />
Please arrange sample delieveries by noon on December 23 if possible.<br />
We will reopen with normal business hours on Monday, January 4.<br /><br />
<strong>Also Note:</strong><br /><br />
The emergency arrangement for wine testing is concluding.
Results for samples already received will be reported soon but we are no longer accepting new samples.
</div>
<p class="lead">The UC Davis Analytical Laboratory is a core support facility of the UC Davis College of Agriculture and Environmental Sciences.</p>
<p>The laboratory is located in Hoagland Hall with a Sample Receiving area in nearby Hoagland Annex. </p>
<p>The laboratory performs analyses on selected chemical constituents of soil, plant, water and
waste water, and feed in support of agricultural and environmental research.</p>
<p>For new clients, please note the drop-down menu under “Lab Information” which contains
an “Order Completion Help” section to help guide you in creating a work order. Also helpful
under the “Lab Information” drop-down menu is the “Methods of Analysis” section which provides
brief descriptions of our current methods.</p>
<p>Please feel free to contact the lab with any questions.</p>
</div>
<div class="col-4">
<address>
<p>UC Davis Analytical Lab<br> University of California Davis, California <br> 95616-5270 <br>
Phone: <span style="white-space: nowrap">(530) 752-0147</span> <br>
Fax: <span style="white-space: nowrap">(530) 752-9892</span> <br>
Email: <a href="mailto:anlab@ucdavis.edu">anlab@ucdavis.edu</a></p>
<p>Receiving Hours: 8am - 5pm M - F, </br> except University holidays </br>
Sample Receiving Area: Hoagland Annex, </br>Phone: 530-752-0266</p>
</address>
</div>
|
mit
|
C#
|
2b9f4823e82aa68df0a58ec21d1f29fc4d3b6dad
|
Update BackgroundMusic.cs
|
erdenbatuhan/Venture
|
Assets/Scripts/BackgroundMusic.cs
|
Assets/Scripts/BackgroundMusic.cs
|
//
// BackgroundMusic.cs
// Venture
//
// Created by Batuhan Erden.
// Copyright © 2016 Batuhan Erden. All rights reserved.
//
using UnityEngine;
using System.Collections;
public class BackgroundMusic : MonoBehaviour {
public static float volume = 0.5f;
private void Start() {
if (GameMaster.loggedUser == null)
GetComponent<AudioSource>().Play();
else
Destroy(gameObject);
}
private void Update() {
GetComponent<AudioSource>().volume = volume;
}
private void Awake() {
DontDestroyOnLoad(transform.gameObject);
}
}
|
//
// BackgroundMusic.cs
// A Vaila Ball - Computer
//
// Created by Batuhan Erden.
// Copyright © 2016 Batuhan Erden. All rights reserved.
//
using UnityEngine;
using System.Collections;
public class BackgroundMusic : MonoBehaviour {
public static float volume = 0.5f;
private void Start() {
if (GameMaster.loggedUser == null)
GetComponent<AudioSource>().Play();
else
Destroy(gameObject);
}
private void Update() {
GetComponent<AudioSource>().volume = volume;
}
private void Awake() {
DontDestroyOnLoad(transform.gameObject);
}
}
|
mit
|
C#
|
f6642f3fdfdc1d7ef77822f5ebac1e5e11e8961d
|
Update BaseShapeViewModelExtensions.cs
|
wieslawsoltes/Core2D,wieslawsoltes/Core2D,wieslawsoltes/Core2D,wieslawsoltes/Core2D
|
src/Core2D/ViewModels/Shapes/BaseShapeViewModelExtensions.cs
|
src/Core2D/ViewModels/Shapes/BaseShapeViewModelExtensions.cs
|
#nullable enable
using System.Collections.Generic;
using System.Linq;
namespace Core2D.ViewModels.Shapes
{
public static class BaseShapeViewModelExtensions
{
public static IEnumerable<BaseShapeViewModel> GetAllShapes(this IEnumerable<BaseShapeViewModel>? shapes)
{
if (shapes is null)
{
yield break;
}
foreach (var shape in shapes)
{
if (shape is GroupShapeViewModel groupShape)
{
foreach (var s in GetAllShapes(groupShape.Shapes))
{
yield return s;
}
yield return shape;
}
else
{
yield return shape;
}
}
}
public static IEnumerable<T> GetAllShapes<T>(this IEnumerable<BaseShapeViewModel>? shapes)
{
return GetAllShapes(shapes).Where(s => s is T).Cast<T>();
}
}
}
|
#nullable disable
using System.Collections.Generic;
using System.Linq;
namespace Core2D.ViewModels.Shapes
{
public static class BaseShapeViewModelExtensions
{
public static IEnumerable<BaseShapeViewModel> GetAllShapes(this IEnumerable<BaseShapeViewModel> shapes)
{
if (shapes is null)
{
yield break;
}
foreach (var shape in shapes)
{
if (shape is GroupShapeViewModel groupShape)
{
foreach (var s in GetAllShapes(groupShape.Shapes))
{
yield return s;
}
yield return shape;
}
else
{
yield return shape;
}
}
}
public static IEnumerable<T> GetAllShapes<T>(this IEnumerable<BaseShapeViewModel> shapes)
{
return GetAllShapes(shapes)?.Where(s => s is T).Cast<T>();
}
}
}
|
mit
|
C#
|
153130aa5ab237f8f97b3f0eca1f08ff53a4dbd9
|
Remove need to call Close()
|
arnovb-github/CmcLibNet
|
CmcLibNet.Export/IExportEngine.cs
|
CmcLibNet.Export/IExportEngine.cs
|
using System.Runtime.InteropServices;
namespace Vovin.CmcLibNet.Export
{
/// <summary>
/// interface for ExportEngine.
/// </summary>
[ComVisible(true)]
[Guid("F7E7295C-7151-41BC-BACE-4CB789EDA5B1")]
public interface IExportEngine : IExportEngineEvents
{
/// <summary>
/// Controls the export settings.
/// </summary>
IExportSettings Settings { get; }
/// <summary>
/// Export a view.
/// </summary>
/// <param name="viewName">Commence view name (case-sensitive). Pass an empty string to use the active view, if any. Note that not all view types can be exported.</param>
/// <param name="fileName">Fully qualified filename.</param>
/// <param name="settings"><see cref="IExportSettings"/></param>
void ExportView(string viewName, string fileName, IExportSettings settings = null);
/// <summary>
/// Export a category.
/// </summary>
/// <param name="categoryName">Commence category name.</param>
/// <param name="fileName">Fully qualified filename.</param>
/// <param name="settings"><see cref="IExportSettings"/></param>
void ExportCategory(string categoryName, string fileName, IExportSettings settings = null);
/// <summary>
/// Not needed, does nothing.
/// </summary>
void Close();
}
}
|
using System.Runtime.InteropServices;
namespace Vovin.CmcLibNet.Export
{
/// <summary>
/// interface for ExportEngine.
/// </summary>
[ComVisible(true)]
[Guid("F7E7295C-7151-41BC-BACE-4CB789EDA5B1")]
public interface IExportEngine : IExportEngineEvents
{
/// <summary>
/// Controls the export settings.
/// </summary>
IExportSettings Settings { get; }
/// <summary>
/// Export a view.
/// </summary>
/// <param name="viewName">Commence view name (case-sensitive). Pass an empty string to use the active view, if any. Note that not all view types can be exported.</param>
/// <param name="fileName">Fully qualified filename.</param>
/// <param name="settings"><see cref="IExportSettings"/></param>
void ExportView(string viewName, string fileName, IExportSettings settings = null);
/// <summary>
/// Export a category.
/// </summary>
/// <param name="categoryName">Commence category name.</param>
/// <param name="fileName">Fully qualified filename.</param>
/// <param name="settings"><see cref="IExportSettings"/></param>
void ExportCategory(string categoryName, string fileName, IExportSettings settings = null);
/// <summary>
/// Close any references to Commence. The object should be disposed after this.
/// </summary>
/// <remarks>When used from within a Commence Form Script, failing to call the <c>Close</c> method will leave the commence.exe process running in the background when the user closes Commence. IMPORTANT: this also happens when an unhandled exception (a 'script error') occurs. The Commence process then has to be closed manually from the Windows Task Manager. Be careful to implement proper error handling.
/// <para>When the assembly is called from a.NET application, there is rarely a need to call this method, unless you want to explicitly release COM references and/or release memory. It can be useful in some cases, because Commence may complain about running out of memory before the Garbage Collector has a chance to kick in.</para>
/// <para>Technical details: calling this method tells the assembly to release all COM handles (called 'RCW' for 'runtime callable wrapper') to Commence that are open. This is needed because when the object reference to this assembly is set to Nothing (in VB), the .NET assembly may not be notified and will think they are still in use. Garbage Collection will therefore not release them, and the commence.exe process will not be terminated.</para>
/// </remarks>
void Close();
}
}
|
mit
|
C#
|
2de6ec2526b935f1a23235149f9d6a6539c1b7c6
|
fix routing from rider to driver [#136036659]
|
revaturelabs/revashare-svc-webapi
|
revashare-svc-webapi/revashare-svc-webapi.Client/Controllers/DriverController.cs
|
revashare-svc-webapi/revashare-svc-webapi.Client/Controllers/DriverController.cs
|
using revashare_svc_webapi.Logic.Interfaces;
using revashare_svc_webapi.Logic.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
namespace revashare_svc_webapi.Client.Controllers {
[RoutePrefix("driver")]
public class DriverController : ApiController {
private readonly IDriverRepository repo;
public DriverController(IDriverRepository repo) {
this.repo = repo;
}
[HttpPost]
[Route("report")]
public HttpResponseMessage Post([FromBody]FlagDTO flag) {
try {
return Request.CreateResponse(HttpStatusCode.OK, this.repo.ReportRider(flag));
}
catch (Exception) {
return Request.CreateResponse(HttpStatusCode.BadRequest);
}
}
[HttpPut]
[Route("update/vehicle")]
public HttpResponseMessage Put([FromBody]VehicleDTO vehicle) {
try {
return Request.CreateResponse(HttpStatusCode.OK, this.repo.UpdateVehicleInfo(vehicle));
}
catch (Exception) {
return Request.CreateResponse(HttpStatusCode.BadRequest);
}
}
}
}
|
using revashare_svc_webapi.Logic.Interfaces;
using revashare_svc_webapi.Logic.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
namespace revashare_svc_webapi.Client.Controllers {
[RoutePrefix("rider")]
public class DriverController : ApiController {
private readonly IDriverRepository repo;
public DriverController(IDriverRepository repo) {
this.repo = repo;
}
[HttpPost]
[Route("report")]
public HttpResponseMessage Post([FromBody]FlagDTO flag) {
try {
return Request.CreateResponse(HttpStatusCode.OK, this.repo.ReportRider(flag));
}
catch (Exception) {
return Request.CreateResponse(HttpStatusCode.BadRequest);
}
}
[HttpPut]
[Route("update/vehicle")]
public HttpResponseMessage Put([FromBody]VehicleDTO vehicle) {
try {
return Request.CreateResponse(HttpStatusCode.OK, this.repo.UpdateVehicleInfo(vehicle));
}
catch (Exception) {
return Request.CreateResponse(HttpStatusCode.BadRequest);
}
}
}
}
|
mit
|
C#
|
ecf768b90d96195b4574016a214e68d7cd69158e
|
Move ordering if types around
|
zanetdev/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,Glimpse/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,Glimpse/Glimpse.Prototype,Glimpse/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,zanetdev/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,Glimpse/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,zanetdev/Glimpse.Prototype,zanetdev/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype
|
src/Glimpse.Agent.AspNet.Mvc/Messages/BeforeActionMessage.cs
|
src/Glimpse.Agent.AspNet.Mvc/Messages/BeforeActionMessage.cs
|
namespace Glimpse.Agent.AspNet.Mvc.Messages
{
public class BeforeActionMessage : IActionRouteFoundMessage
{
public string ActionId { get; set; }
public string DisplayName { get; set; }
public string ActionName { get; set; }
public string ControllerName { get; set; }
public RouteData RouteData { get; set; }
}
}
|
namespace Glimpse.Agent.AspNet.Mvc.Messages
{
public class BeforeActionMessage : IActionRouteFoundMessage
{
public string ActionId { get; set; }
public string DisplayName { get; set; }
public RouteData RouteData { get; set; }
public string ActionName { get; set; }
public string ControllerName { get; set; }
}
}
|
mit
|
C#
|
0efb5e2e8252eb59733deff88aec1d6ce818500a
|
Fix HandleQueuedPackageEditsJob to use ExecuteTask
|
JetBrains/ReSharperGallery,ScottShingler/NuGetGallery,grenade/NuGetGallery_download-count-patch,skbkontur/NuGetGallery,JetBrains/ReSharperGallery,ScottShingler/NuGetGallery,JetBrains/ReSharperGallery,KuduApps/NuGetGallery,grenade/NuGetGallery_download-count-patch,mtian/SiteExtensionGallery,mtian/SiteExtensionGallery,skbkontur/NuGetGallery,KuduApps/NuGetGallery,projectkudu/SiteExtensionGallery,projectkudu/SiteExtensionGallery,mtian/SiteExtensionGallery,projectkudu/SiteExtensionGallery,KuduApps/NuGetGallery,grenade/NuGetGallery_download-count-patch,ScottShingler/NuGetGallery,KuduApps/NuGetGallery,KuduApps/NuGetGallery,skbkontur/NuGetGallery
|
src/NuGetGallery.Backend/Jobs/HandleQueuedPackageEditsJob.cs
|
src/NuGetGallery.Backend/Jobs/HandleQueuedPackageEditsJob.cs
|
using System;
using System.ComponentModel.Composition;
using System.Data.SqlClient;
using NuGetGallery.Operations.Tasks;
namespace NuGetGallery.Backend.Jobs
{
[Export(typeof(WorkerJob))]
public class HandleQueuedPackageEditsJob : WorkerJob
{
public override TimeSpan Period
{
get
{
return TimeSpan.FromSeconds(30);
}
}
public override void RunOnce()
{
ExecuteTask(new HandleQueuedPackageEditsTask
{
ConnectionString = new SqlConnectionStringBuilder(Settings.MainConnectionString),
StorageAccount = Settings.MainStorage,
WhatIf = Settings.WhatIf
});
}
}
}
|
using System;
using System.ComponentModel.Composition;
using System.Data.SqlClient;
using NuGetGallery.Operations.Tasks;
namespace NuGetGallery.Backend.Jobs
{
[Export(typeof(WorkerJob))]
public class HandleQueuedPackageEditsJob : WorkerJob
{
public override TimeSpan Period
{
get
{
return TimeSpan.FromSeconds(30);
}
}
public override void RunOnce()
{
new HandleQueuedPackageEditsTask
{
ConnectionString = new SqlConnectionStringBuilder(Settings.MainConnectionString),
StorageAccount = Settings.MainStorage,
WhatIf = Settings.WhatIf
}.Execute();
}
}
}
|
apache-2.0
|
C#
|
f1074050e6e3ca9aa67aacf7baf151682e7509e2
|
Update version number.
|
Damnae/storybrew
|
editor/Properties/AssemblyInfo.cs
|
editor/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("storybrew editor")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("storybrew editor")]
[assembly: AssemblyCopyright("Copyright © Damnae 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("ff59aeea-c133-4bf8-8a0b-620a3c99022b")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.82.*")]
|
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("storybrew editor")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("storybrew editor")]
[assembly: AssemblyCopyright("Copyright © Damnae 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("ff59aeea-c133-4bf8-8a0b-620a3c99022b")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.81.*")]
|
mit
|
C#
|
ae0fda1072a9764a934769745515c7d891934047
|
Remove unnecessary method overrides
|
StefanoFiumara/Harry-Potter-Unity
|
Assets/Scripts/HarryPotterUnity/Cards/Transfiguration/Items/ColourChangingInk.cs
|
Assets/Scripts/HarryPotterUnity/Cards/Transfiguration/Items/ColourChangingInk.cs
|
using System.Linq;
using JetBrains.Annotations;
namespace HarryPotterUnity.Cards.Transfiguration.Items
{
[UsedImplicitly]
public class ColourChangingInk : BaseItem
{
public override bool CanPerformInPlayAction()
{
return Player.CanUseActions() && Player.Hand.Cards.Count > 0;
}
public override void OnSelectedAction()
{
var cardsInHand = Player.Hand.Cards.ToList();
int cardCount = cardsInHand.Count;
Player.Hand.RemoveAll( cardsInHand );
Player.Deck.AddAll( cardsInHand );
while (cardCount-- > 0)
{
Player.Deck.DrawCard();
}
Player.UseActions();
}
}
}
|
using System.Collections.Generic;
using System.Linq;
using HarryPotterUnity.Cards.Interfaces;
using JetBrains.Annotations;
using UnityEngine;
namespace HarryPotterUnity.Cards.Transfiguration.Items
{
[UsedImplicitly]
public class ColourChangingInk : BaseItem
{
public override bool CanPerformInPlayAction()
{
return Player.CanUseActions() && Player.Hand.Cards.Count > 0;
}
public override void OnSelectedAction()
{
var cardsInHand = Player.Hand.Cards.ToList();
int cardCount = cardsInHand.Count;
Player.Hand.RemoveAll( cardsInHand );
Player.Deck.AddAll( cardsInHand );
while (cardCount-- > 0)
{
Player.Deck.DrawCard();
}
Player.UseActions();
}
public override void OnInPlayBeforeTurnAction() { }
public override void OnInPlayAfterTurnAction() { }
public override void OnEnterInPlayAction() { }
public override void OnExitInPlayAction() { }
}
}
|
mit
|
C#
|
f337eb31133e88d7bcafe99f67edeeb147eee5eb
|
Fix Bottle.direction to string type via Creer re-raun
|
siggame/Joueur.cs,siggame/Joueur.cs,JacobFischer/Joueur.cs,JacobFischer/Joueur.cs
|
Games/Saloon/Bottle.cs
|
Games/Saloon/Bottle.cs
|
// A bottle thrown by a bartender at a Tile.
// DO NOT MODIFY THIS FILE
// Never try to directly create an instance of this class, or modify its member variables.
// Instead, you should only be reading its variables and calling its functions.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
// <<-- Creer-Merge: usings -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.
// you can add addtional using(s) here
// <<-- /Creer-Merge: usings -->>
namespace Joueur.cs.Games.Saloon
{
/// <summary>
/// A bottle thrown by a bartender at a Tile.
/// </summary>
class Bottle : Saloon.GameObject
{
#region Properties
/// <summary>
/// The Direction this Bottle is flying and will move to between turns, can be 'North', 'East', 'South', or 'West'.
/// </summary>
public string Direction { get; protected set; }
/// <summary>
/// The direction any Cowboys hit by this will move, can be 'North', 'East', 'South', or 'West'.
/// </summary>
public string DrunkDirection { get; protected set; }
/// <summary>
/// True if this Bottle has impacted and has been destroyed (removed from the Game). False if still in the game flying through the saloon.
/// </summary>
public bool IsDestroyed { get; protected set; }
/// <summary>
/// The Tile this bottle is currently flying over.
/// </summary>
public Saloon.Tile Tile { get; protected set; }
// <<-- Creer-Merge: properties -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.
// you can add addtional properties(s) here. None of them will be tracked or updated by the server.
// <<-- /Creer-Merge: properties -->>
#endregion
#region Methods
/// <summary>
/// Creates a new instance of Bottle. Used during game initialization, do not call directly.
/// </summary>
protected Bottle() : base()
{
}
// <<-- Creer-Merge: methods -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.
// you can add addtional method(s) here.
// <<-- /Creer-Merge: methods -->>
#endregion
}
}
|
// A bottle thrown by a bartender at a Tile.
// DO NOT MODIFY THIS FILE
// Never try to directly create an instance of this class, or modify its member variables.
// Instead, you should only be reading its variables and calling its functions.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
// <<-- Creer-Merge: usings -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.
// you can add addtional using(s) here
// <<-- /Creer-Merge: usings -->>
namespace Joueur.cs.Games.Saloon
{
/// <summary>
/// A bottle thrown by a bartender at a Tile.
/// </summary>
class Bottle : Saloon.GameObject
{
#region Properties
/// <summary>
/// The Direction this Bottle is flying and will move to between turns, can be 'North', 'East', 'South', or 'West'.
/// </summary>
public Saloon.Tile Direction { get; protected set; }
/// <summary>
/// The direction any Cowboys hit by this will move, can be 'North', 'East', 'South', or 'West'.
/// </summary>
public string DrunkDirection { get; protected set; }
/// <summary>
/// True if this Bottle has impacted and has been destroyed (removed from the Game). False if still in the game flying through the saloon.
/// </summary>
public bool IsDestroyed { get; protected set; }
/// <summary>
/// The Tile this bottle is currently flying over.
/// </summary>
public Saloon.Tile Tile { get; protected set; }
// <<-- Creer-Merge: properties -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.
// you can add addtional properties(s) here. None of them will be tracked or updated by the server.
// <<-- /Creer-Merge: properties -->>
#endregion
#region Methods
/// <summary>
/// Creates a new instance of Bottle. Used during game initialization, do not call directly.
/// </summary>
protected Bottle() : base()
{
}
// <<-- Creer-Merge: methods -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.
// you can add addtional method(s) here.
// <<-- /Creer-Merge: methods -->>
#endregion
}
}
|
mit
|
C#
|
51bddd4a0ff00fce883583852a2d225d5b41117c
|
Rename functions, and add NextInt.
|
NeoAdonis/osu,peppy/osu,UselessToucan/osu,ppy/osu,smoogipoo/osu,peppy/osu,peppy/osu,UselessToucan/osu,NeoAdonis/osu,UselessToucan/osu,smoogipoo/osu,peppy/osu-new,ppy/osu,smoogipooo/osu,NeoAdonis/osu,smoogipoo/osu,ppy/osu
|
osu.Game/Utils/StatelessRNG.cs
|
osu.Game/Utils/StatelessRNG.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
namespace osu.Game.Utils
{
/// <summary>
/// Provides a fast stateless function that can be used in randomly-looking visual elements.
/// </summary>
public static class StatelessRNG
{
private static ulong mix(ulong x)
{
unchecked
{
x ^= x >> 33;
x *= 0xff51afd7ed558ccd;
x ^= x >> 33;
x *= 0xc4ceb9fe1a85ec53;
x ^= x >> 33;
return x;
}
}
/// <summary>
/// Generate a random 64-bit unsigned integer from given seed.
/// </summary>
/// <param name="seed">
/// The seed value of this random number generator.
/// </param>
/// <param name="series">
/// The series number.
/// Different values are computed for the same seed in different series.
/// </param>
public static ulong NextUlong(int seed, int series = 0)
{
unchecked
{
//
var combined = ((ulong)(uint)series << 32) | (uint)seed;
// The xor operation is to not map (0, 0) to 0.
return mix(combined ^ 0x12345678);
}
}
/// <summary>
/// Generate a random integer in range [0, maxValue) from given seed.
/// </summary>
/// <param name="maxValue">
/// The number of possible results.
/// </param>
/// <param name="seed">
/// The seed value of this random number generator.
/// </param>
/// <param name="series">
/// The series number.
/// Different values are computed for the same seed in different series.
/// </param>
public static int NextInt(int maxValue, int seed, int series = 0)
{
if (maxValue <= 0) throw new ArgumentOutOfRangeException(nameof(maxValue));
return (int)(NextUlong(seed, series) % (ulong)maxValue);
}
/// <summary>
/// Compute a random floating point value between 0 and 1 (excluding 1) from given seed and series number.
/// </summary>
/// <param name="seed">
/// The seed value of this random number generator.
/// </param>
/// <param name="series">
/// The series number.
/// Different values are computed for the same seed in different series.
/// </param>
public static float NextSingle(int seed, int series = 0) =>
(float)(NextUlong(seed, series) & ((1 << 24) - 1)) / (1 << 24); // float has 24-bit precision
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
namespace osu.Game.Utils
{
/// <summary>
/// Provides a fast stateless function that can be used in randomly-looking visual elements.
/// </summary>
public static class StatelessRNG
{
private static ulong mix(ulong x)
{
unchecked
{
x ^= x >> 33;
x *= 0xff51afd7ed558ccd;
x ^= x >> 33;
x *= 0xc4ceb9fe1a85ec53;
x ^= x >> 33;
return x;
}
}
/// <summary>
/// Compute an integer from given seed and series number.
/// </summary>
/// <param name="seed">
/// The seed value of this random number generator.
/// </param>
/// <param name="series">
/// The series number.
/// Different values are computed for the same seed in different series.
/// </param>
public static ulong Get(int seed, int series = 0) =>
unchecked(mix(((ulong)(uint)series << 32) | ((uint)seed ^ 0x12345678)));
/// <summary>
/// Compute a floating point value between 0 and 1 (excluding 1) from given seed and series number.
/// </summary>
/// <param name="seed">
/// The seed value of this random number generator.
/// </param>
/// <param name="series">
/// The series number.
/// Different values are computed for the same seed in different series.
/// </param>
public static float GetSingle(int seed, int series = 0) =>
(float)(Get(seed, series) & ((1 << 24) - 1)) / (1 << 24); // float has 24-bit precision
}
}
|
mit
|
C#
|
87c4d3c53ec0404b240a6195487f9783fd3fa4ff
|
Cover case-insensitive child component parameter names in E2E test
|
aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore
|
test/testapps/BasicTestApp/CounterComponentUsingChild.cshtml
|
test/testapps/BasicTestApp/CounterComponentUsingChild.cshtml
|
<h1>Counter</h1>
<!-- Note: passing 'Message' parameter with lowercase name to show it's case insensitive -->
<p>Current count: <MessageComponent message=@currentCount.ToString() /></p>
<button @onclick(IncrementCount)>Click me</button>
@functions {
int currentCount = 0;
void IncrementCount()
{
currentCount++;
}
}
|
<h1>Counter</h1>
<p>Current count: <MessageComponent Message=@currentCount.ToString() /></p>
<button @onclick(IncrementCount)>Click me</button>
@functions {
int currentCount = 0;
void IncrementCount()
{
currentCount++;
}
}
|
apache-2.0
|
C#
|
50f27a9b407ef9fae78a2f09d98501fc1d283376
|
Rename AdcPin interface
|
treehopper-electronics/treehopper-sdk,treehopper-electronics/treehopper-sdk,treehopper-electronics/treehopper-sdk,treehopper-electronics/treehopper-sdk,treehopper-electronics/treehopper-sdk,treehopper-electronics/treehopper-sdk
|
NET/API/Treehopper/IAdcPin.cs
|
NET/API/Treehopper/IAdcPin.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Treehopper
{
public interface AdcPin
{
void MakeAnalogIn();
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Treehopper
{
public interface IAdcPin
{
void MakeAnalogIn();
}
}
|
mit
|
C#
|
e63bbe88828bc73a0e500afacea34450f34965ad
|
add prompt
|
vogon/nomic,vogon/nomic,vogon/nomic
|
Nomic/LocalConsoleReplView.cs
|
Nomic/LocalConsoleReplView.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Nomic
{
internal sealed class LocalConsoleReplView : IReplView
{
internal LocalConsoleReplView() { }
async Task<string> IReplView.Read()
{
Console.Write("nomic> ");
Console.Out.Flush();
string result = await Console.In.ReadLineAsync();
return result;
}
async Task IReplView.Print(dynamic result)
{
await Console.Out.WriteLineAsync(result.ToString());
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Nomic
{
internal sealed class LocalConsoleReplView : IReplView
{
internal LocalConsoleReplView() { }
async Task<string> IReplView.Read()
{
string result = await Console.In.ReadLineAsync();
return result;
}
async Task IReplView.Print(dynamic result)
{
await Console.Out.WriteLineAsync(result.ToString());
}
}
}
|
mit
|
C#
|
81dac383d3100b4b59cae580a2c6a668ba40a7be
|
Add cleandatabase call in global steps
|
SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice
|
src/SFA.DAS.EAS.Transactions.AcceptanceTests/Steps/CommonSteps/GlobalTestSteps.cs
|
src/SFA.DAS.EAS.Transactions.AcceptanceTests/Steps/CommonSteps/GlobalTestSteps.cs
|
using Moq;
using SFA.DAS.EAS.TestCommon.DbCleanup;
using SFA.DAS.EAS.TestCommon.DependencyResolution;
using SFA.DAS.EAS.Web;
using SFA.DAS.EAS.Web.Authentication;
using SFA.DAS.Messaging;
using StructureMap;
using TechTalk.SpecFlow;
namespace SFA.DAS.EAS.Transactions.AcceptanceTests.Steps.CommonSteps
{
[Binding]
public static class GlobalTestSteps
{
private static Mock<IMessagePublisher> _messagePublisher;
private static Mock<IOwinWrapper> _owinWrapper;
private static Container _container;
private static Mock<ICookieService> _cookieService;
[AfterTestRun()]
public static void Arrange()
{
_messagePublisher = new Mock<IMessagePublisher>();
_owinWrapper = new Mock<IOwinWrapper>();
_cookieService = new Mock<ICookieService>();
_container = IoC.CreateContainer(_messagePublisher, _owinWrapper, _cookieService);
var cleanDownDb = _container.GetInstance<ICleanDatabase>();
cleanDownDb.Execute().Wait();
var cleanDownTransactionDb = _container.GetInstance<ICleanTransactionsDatabase>();
cleanDownTransactionDb.Execute().Wait();
}
}
}
|
using Moq;
using SFA.DAS.EAS.TestCommon.DbCleanup;
using SFA.DAS.EAS.TestCommon.DependencyResolution;
using SFA.DAS.EAS.Web;
using SFA.DAS.EAS.Web.Authentication;
using SFA.DAS.Messaging;
using StructureMap;
using TechTalk.SpecFlow;
namespace SFA.DAS.EAS.Transactions.AcceptanceTests.Steps.CommonSteps
{
[Binding]
public static class GlobalTestSteps
{
private static Mock<IMessagePublisher> _messagePublisher;
private static Mock<IOwinWrapper> _owinWrapper;
private static Container _container;
private static Mock<ICookieService> _cookieService;
[AfterTestRun()]
public static void Arrange()
{
_messagePublisher = new Mock<IMessagePublisher>();
_owinWrapper = new Mock<IOwinWrapper>();
_cookieService = new Mock<ICookieService>();
_container = IoC.CreateContainer(_messagePublisher, _owinWrapper, _cookieService);
var cleanDownDb = _container.GetInstance<ICleanDatabase>();
cleanDownDb.Execute().Wait();
}
}
}
|
mit
|
C#
|
5fd521ea016a9ae17ee3cc46c5dc3bcb2487e9a1
|
Change SafeMemoryMappedFileHandle to use IntPtr.Zero instead of new IntPtr(0)
|
cydhaselton/corefx,zmaruo/corefx,twsouthwick/corefx,cartermp/corefx,alexperovich/corefx,rajansingh10/corefx,Jiayili1/corefx,viniciustaveira/corefx,MaggieTsang/corefx,vrassouli/corefx,cartermp/corefx,richlander/corefx,zhenlan/corefx,stephenmichaelf/corefx,iamjasonp/corefx,shimingsg/corefx,ravimeda/corefx,alexandrnikitin/corefx,marksmeltzer/corefx,alexandrnikitin/corefx,vrassouli/corefx,nchikanov/corefx,pallavit/corefx,Yanjing123/corefx,Winsto/corefx,jmhardison/corefx,mmitche/corefx,ericstj/corefx,tijoytom/corefx,jhendrixMSFT/corefx,oceanho/corefx,VPashkov/corefx,CloudLens/corefx,tijoytom/corefx,mokchhya/corefx,mellinoe/corefx,chaitrakeshav/corefx,twsouthwick/corefx,vidhya-bv/corefx-sorting,bitcrazed/corefx,twsouthwick/corefx,Petermarcu/corefx,parjong/corefx,twsouthwick/corefx,shahid-pk/corefx,dtrebbien/corefx,nbarbettini/corefx,jmhardison/corefx,gregg-miskelly/corefx,chenkennt/corefx,popolan1986/corefx,SGuyGe/corefx,nbarbettini/corefx,larsbj1988/corefx,shana/corefx,stone-li/corefx,mafiya69/corefx,brett25/corefx,arronei/corefx,rahku/corefx,s0ne0me/corefx,billwert/corefx,the-dwyer/corefx,jhendrixMSFT/corefx,YoupHulsebos/corefx,shrutigarg/corefx,fgreinacher/corefx,BrennanConroy/corefx,nelsonsar/corefx,mafiya69/corefx,wtgodbe/corefx,benpye/corefx,nchikanov/corefx,KrisLee/corefx,shmao/corefx,shimingsg/corefx,shrutigarg/corefx,marksmeltzer/corefx,lggomez/corefx,andyhebear/corefx,manu-silicon/corefx,Ermiar/corefx,richlander/corefx,Chrisboh/corefx,Priya91/corefx-1,ravimeda/corefx,chenkennt/corefx,MaggieTsang/corefx,shimingsg/corefx,matthubin/corefx,Chrisboh/corefx,shana/corefx,marksmeltzer/corefx,kkurni/corefx,benpye/corefx,parjong/corefx,mokchhya/corefx,nelsonsar/corefx,billwert/corefx,josguil/corefx,matthubin/corefx,krk/corefx,kyulee1/corefx,oceanho/corefx,Priya91/corefx-1,kyulee1/corefx,larsbj1988/corefx,tijoytom/corefx,akivafr123/corefx,manu-silicon/corefx,the-dwyer/corefx,larsbj1988/corefx,josguil/corefx,mafiya69/corefx,mafiya69/corefx,Alcaro/corefx,rjxby/corefx,shimingsg/corefx,chenxizhang/corefx,JosephTremoulet/corefx,nelsonsar/corefx,tstringer/corefx,krytarowski/corefx,alexperovich/corefx,gabrielPeart/corefx,EverlessDrop41/corefx,DnlHarvey/corefx,parjong/corefx,dotnet-bot/corefx,uhaciogullari/corefx,khdang/corefx,krytarowski/corefx,matthubin/corefx,fgreinacher/corefx,vidhya-bv/corefx-sorting,nchikanov/corefx,erpframework/corefx,mokchhya/corefx,Chrisboh/corefx,Ermiar/corefx,dotnet-bot/corefx,stormleoxia/corefx,ptoonen/corefx,dotnet-bot/corefx,zhenlan/corefx,popolan1986/corefx,twsouthwick/corefx,seanshpark/corefx,dkorolev/corefx,matthubin/corefx,VPashkov/corefx,andyhebear/corefx,fernando-rodriguez/corefx,rjxby/corefx,JosephTremoulet/corefx,Petermarcu/corefx,MaggieTsang/corefx,vs-team/corefx,fgreinacher/corefx,the-dwyer/corefx,s0ne0me/corefx,akivafr123/corefx,ericstj/corefx,ViktorHofer/corefx,benjamin-bader/corefx,ellismg/corefx,bpschoch/corefx,scott156/corefx,uhaciogullari/corefx,s0ne0me/corefx,nchikanov/corefx,seanshpark/corefx,iamjasonp/corefx,MaggieTsang/corefx,dotnet-bot/corefx,arronei/corefx,rajansingh10/corefx,nbarbettini/corefx,stephenmichaelf/corefx,gkhanna79/corefx,690486439/corefx,rubo/corefx,stormleoxia/corefx,shimingsg/corefx,mmitche/corefx,dotnet-bot/corefx,stone-li/corefx,pallavit/corefx,rjxby/corefx,cartermp/corefx,fgreinacher/corefx,fffej/corefx,heXelium/corefx,rahku/corefx,krk/corefx,khdang/corefx,pallavit/corefx,mmitche/corefx,pgavlin/corefx,dhoehna/corefx,cartermp/corefx,pallavit/corefx,cartermp/corefx,alexperovich/corefx,PatrickMcDonald/corefx,YoupHulsebos/corefx,kkurni/corefx,comdiv/corefx,josguil/corefx,destinyclown/corefx,jcme/corefx,chaitrakeshav/corefx,gabrielPeart/corefx,fffej/corefx,anjumrizwi/corefx,chaitrakeshav/corefx,seanshpark/corefx,tijoytom/corefx,spoiledsport/corefx,billwert/corefx,Jiayili1/corefx,gkhanna79/corefx,ravimeda/corefx,CherryCxldn/corefx,brett25/corefx,jlin177/corefx,bitcrazed/corefx,Jiayili1/corefx,scott156/corefx,cydhaselton/corefx,jlin177/corefx,comdiv/corefx,stephenmichaelf/corefx,shmao/corefx,vrassouli/corefx,SGuyGe/corefx,krytarowski/corefx,shahid-pk/corefx,jeremymeng/corefx,cartermp/corefx,jlin177/corefx,alphonsekurian/corefx,lggomez/corefx,mazong1123/corefx,DnlHarvey/corefx,ptoonen/corefx,tstringer/corefx,janhenke/corefx,popolan1986/corefx,Petermarcu/corefx,ViktorHofer/corefx,comdiv/corefx,cnbin/corefx,krk/corefx,ericstj/corefx,heXelium/corefx,ViktorHofer/corefx,krk/corefx,claudelee/corefx,alexandrnikitin/corefx,shiftkey-tester/corefx,YoupHulsebos/corefx,ptoonen/corefx,mellinoe/corefx,axelheer/corefx,stormleoxia/corefx,mmitche/corefx,huanjie/corefx,Frank125/corefx,shmao/corefx,rjxby/corefx,comdiv/corefx,shmao/corefx,wtgodbe/corefx,marksmeltzer/corefx,axelheer/corefx,Ermiar/corefx,tstringer/corefx,mmitche/corefx,Yanjing123/corefx,Chrisboh/corefx,shmao/corefx,seanshpark/corefx,lggomez/corefx,vs-team/corefx,ptoonen/corefx,gkhanna79/corefx,YoupHulsebos/corefx,marksmeltzer/corefx,yizhang82/corefx,yizhang82/corefx,cydhaselton/corefx,shiftkey-tester/corefx,elijah6/corefx,EverlessDrop41/corefx,dkorolev/corefx,thiagodin/corefx,alexperovich/corefx,Jiayili1/corefx,vijaykota/corefx,stone-li/corefx,brett25/corefx,dhoehna/corefx,dkorolev/corefx,zhenlan/corefx,the-dwyer/corefx,anjumrizwi/corefx,gkhanna79/corefx,the-dwyer/corefx,claudelee/corefx,rjxby/corefx,jeremymeng/corefx,shahid-pk/corefx,gkhanna79/corefx,yizhang82/corefx,gregg-miskelly/corefx,vs-team/corefx,axelheer/corefx,ericstj/corefx,Jiayili1/corefx,Yanjing123/corefx,cnbin/corefx,jhendrixMSFT/corefx,rahku/corefx,Petermarcu/corefx,tstringer/corefx,s0ne0me/corefx,uhaciogullari/corefx,690486439/corefx,lydonchandra/corefx,ravimeda/corefx,SGuyGe/corefx,Ermiar/corefx,tstringer/corefx,benpye/corefx,destinyclown/corefx,MaggieTsang/corefx,nbarbettini/corefx,adamralph/corefx,vidhya-bv/corefx-sorting,scott156/corefx,BrennanConroy/corefx,spoiledsport/corefx,jhendrixMSFT/corefx,pgavlin/corefx,mokchhya/corefx,bitcrazed/corefx,erpframework/corefx,misterzik/corefx,iamjasonp/corefx,zhangwenquan/corefx,mmitche/corefx,Jiayili1/corefx,Winsto/corefx,adamralph/corefx,bpschoch/corefx,stephenmichaelf/corefx,n1ghtmare/corefx,n1ghtmare/corefx,mellinoe/corefx,690486439/corefx,nchikanov/corefx,DnlHarvey/corefx,benpye/corefx,parjong/corefx,ericstj/corefx,tijoytom/corefx,bitcrazed/corefx,jcme/corefx,gkhanna79/corefx,pallavit/corefx,manu-silicon/corefx,scott156/corefx,manu-silicon/corefx,chaitrakeshav/corefx,anjumrizwi/corefx,mellinoe/corefx,ViktorHofer/corefx,zhangwenquan/corefx,alphonsekurian/corefx,dhoehna/corefx,mellinoe/corefx,Jiayili1/corefx,billwert/corefx,heXelium/corefx,JosephTremoulet/corefx,ptoonen/corefx,alexperovich/corefx,heXelium/corefx,dhoehna/corefx,mazong1123/corefx,axelheer/corefx,rjxby/corefx,lydonchandra/corefx,yizhang82/corefx,lggomez/corefx,shiftkey-tester/corefx,elijah6/corefx,jlin177/corefx,Alcaro/corefx,tstringer/corefx,PatrickMcDonald/corefx,viniciustaveira/corefx,690486439/corefx,weltkante/corefx,jcme/corefx,manu-silicon/corefx,MaggieTsang/corefx,stephenmichaelf/corefx,jhendrixMSFT/corefx,dhoehna/corefx,benpye/corefx,ellismg/corefx,jhendrixMSFT/corefx,pallavit/corefx,benjamin-bader/corefx,yizhang82/corefx,Alcaro/corefx,n1ghtmare/corefx,weltkante/corefx,richlander/corefx,ellismg/corefx,zhangwenquan/corefx,weltkante/corefx,DnlHarvey/corefx,shrutigarg/corefx,iamjasonp/corefx,nchikanov/corefx,cnbin/corefx,FiveTimesTheFun/corefx,SGuyGe/corefx,marksmeltzer/corefx,jcme/corefx,claudelee/corefx,kkurni/corefx,andyhebear/corefx,Ermiar/corefx,akivafr123/corefx,nbarbettini/corefx,fernando-rodriguez/corefx,EverlessDrop41/corefx,ptoonen/corefx,dtrebbien/corefx,mokchhya/corefx,krk/corefx,parjong/corefx,mazong1123/corefx,dtrebbien/corefx,FiveTimesTheFun/corefx,xuweixuwei/corefx,parjong/corefx,pgavlin/corefx,kyulee1/corefx,akivafr123/corefx,dhoehna/corefx,ptoonen/corefx,rajansingh10/corefx,andyhebear/corefx,alexandrnikitin/corefx,billwert/corefx,zmaruo/corefx,ellismg/corefx,dotnet-bot/corefx,stephenmichaelf/corefx,shimingsg/corefx,parjong/corefx,FiveTimesTheFun/corefx,VPashkov/corefx,zhenlan/corefx,richlander/corefx,jmhardison/corefx,wtgodbe/corefx,xuweixuwei/corefx,billwert/corefx,krytarowski/corefx,janhenke/corefx,vs-team/corefx,dtrebbien/corefx,jeremymeng/corefx,Petermarcu/corefx,PatrickMcDonald/corefx,gabrielPeart/corefx,fernando-rodriguez/corefx,spoiledsport/corefx,ViktorHofer/corefx,dsplaisted/corefx,ViktorHofer/corefx,DnlHarvey/corefx,axelheer/corefx,wtgodbe/corefx,misterzik/corefx,billwert/corefx,pgavlin/corefx,bpschoch/corefx,zhangwenquan/corefx,Alcaro/corefx,SGuyGe/corefx,benjamin-bader/corefx,alexperovich/corefx,cnbin/corefx,janhenke/corefx,PatrickMcDonald/corefx,rajansingh10/corefx,janhenke/corefx,khdang/corefx,iamjasonp/corefx,oceanho/corefx,uhaciogullari/corefx,rubo/corefx,mafiya69/corefx,the-dwyer/corefx,gregg-miskelly/corefx,erpframework/corefx,Chrisboh/corefx,khdang/corefx,rubo/corefx,fffej/corefx,mazong1123/corefx,DnlHarvey/corefx,weltkante/corefx,richlander/corefx,kkurni/corefx,alexandrnikitin/corefx,thiagodin/corefx,shahid-pk/corefx,benjamin-bader/corefx,khdang/corefx,Ermiar/corefx,chenxizhang/corefx,larsbj1988/corefx,stone-li/corefx,mazong1123/corefx,jeremymeng/corefx,KrisLee/corefx,dsplaisted/corefx,janhenke/corefx,Priya91/corefx-1,stone-li/corefx,shahid-pk/corefx,claudelee/corefx,Frank125/corefx,stephenmichaelf/corefx,elijah6/corefx,weltkante/corefx,nbarbettini/corefx,chenxizhang/corefx,viniciustaveira/corefx,JosephTremoulet/corefx,zhenlan/corefx,richlander/corefx,zmaruo/corefx,brett25/corefx,misterzik/corefx,Priya91/corefx-1,vidhya-bv/corefx-sorting,twsouthwick/corefx,cydhaselton/corefx,Frank125/corefx,jcme/corefx,Chrisboh/corefx,iamjasonp/corefx,seanshpark/corefx,huanjie/corefx,seanshpark/corefx,seanshpark/corefx,Petermarcu/corefx,bpschoch/corefx,rahku/corefx,wtgodbe/corefx,jcme/corefx,jmhardison/corefx,viniciustaveira/corefx,mokchhya/corefx,dsplaisted/corefx,CherryCxldn/corefx,rjxby/corefx,YoupHulsebos/corefx,elijah6/corefx,shahid-pk/corefx,benpye/corefx,CloudLens/corefx,josguil/corefx,tijoytom/corefx,BrennanConroy/corefx,weltkante/corefx,shmao/corefx,cydhaselton/corefx,Yanjing123/corefx,Yanjing123/corefx,cydhaselton/corefx,iamjasonp/corefx,lydonchandra/corefx,kyulee1/corefx,gkhanna79/corefx,rahku/corefx,oceanho/corefx,elijah6/corefx,rahku/corefx,huanjie/corefx,cydhaselton/corefx,JosephTremoulet/corefx,richlander/corefx,mafiya69/corefx,Winsto/corefx,KrisLee/corefx,SGuyGe/corefx,the-dwyer/corefx,jhendrixMSFT/corefx,chenkennt/corefx,ViktorHofer/corefx,mazong1123/corefx,vidhya-bv/corefx-sorting,alphonsekurian/corefx,mazong1123/corefx,ellismg/corefx,alphonsekurian/corefx,PatrickMcDonald/corefx,alphonsekurian/corefx,arronei/corefx,vijaykota/corefx,twsouthwick/corefx,shana/corefx,dhoehna/corefx,weltkante/corefx,krytarowski/corefx,shana/corefx,lggomez/corefx,xuweixuwei/corefx,shmao/corefx,krytarowski/corefx,Priya91/corefx-1,krk/corefx,erpframework/corefx,janhenke/corefx,jlin177/corefx,destinyclown/corefx,lggomez/corefx,nelsonsar/corefx,akivafr123/corefx,vijaykota/corefx,ericstj/corefx,ericstj/corefx,wtgodbe/corefx,CloudLens/corefx,KrisLee/corefx,benjamin-bader/corefx,josguil/corefx,rahku/corefx,fffej/corefx,CherryCxldn/corefx,krk/corefx,marksmeltzer/corefx,Petermarcu/corefx,manu-silicon/corefx,wtgodbe/corefx,CloudLens/corefx,huanjie/corefx,Frank125/corefx,YoupHulsebos/corefx,Priya91/corefx-1,vrassouli/corefx,nchikanov/corefx,ravimeda/corefx,zhenlan/corefx,zmaruo/corefx,benjamin-bader/corefx,mellinoe/corefx,manu-silicon/corefx,shimingsg/corefx,gabrielPeart/corefx,thiagodin/corefx,dotnet-bot/corefx,alphonsekurian/corefx,zhenlan/corefx,YoupHulsebos/corefx,kkurni/corefx,shiftkey-tester/corefx,n1ghtmare/corefx,stone-li/corefx,JosephTremoulet/corefx,yizhang82/corefx,axelheer/corefx,jlin177/corefx,jlin177/corefx,alexperovich/corefx,kkurni/corefx,gregg-miskelly/corefx,DnlHarvey/corefx,CherryCxldn/corefx,rubo/corefx,ravimeda/corefx,shrutigarg/corefx,stormleoxia/corefx,MaggieTsang/corefx,dkorolev/corefx,jeremymeng/corefx,nbarbettini/corefx,yizhang82/corefx,elijah6/corefx,josguil/corefx,lggomez/corefx,bitcrazed/corefx,stone-li/corefx,ravimeda/corefx,elijah6/corefx,thiagodin/corefx,lydonchandra/corefx,n1ghtmare/corefx,khdang/corefx,alphonsekurian/corefx,ellismg/corefx,mmitche/corefx,anjumrizwi/corefx,tijoytom/corefx,Ermiar/corefx,adamralph/corefx,690486439/corefx,krytarowski/corefx,VPashkov/corefx,rubo/corefx,JosephTremoulet/corefx
|
src/System.IO.MemoryMappedFiles/src/Microsoft/Win32/SafeMemoryMappedFileHandle.cs
|
src/System.IO.MemoryMappedFiles/src/Microsoft/Win32/SafeMemoryMappedFileHandle.cs
|
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Runtime.InteropServices;
using System.Security;
namespace Microsoft.Win32.SafeHandles
{
// Reliability notes:
// ReleaseHandle has reliability guarantee of Cer.Success, as defined by SafeHandle.
// It gets prepared as a CER at instance construction time.
[SecurityCritical]
public sealed class SafeMemoryMappedFileHandle : SafeHandle
{
internal SafeMemoryMappedFileHandle() : base(IntPtr.Zero, true) { }
internal SafeMemoryMappedFileHandle(IntPtr handle, bool ownsHandle)
: base(IntPtr.Zero, ownsHandle)
{
SetHandle(handle);
}
override protected bool ReleaseHandle()
{
return Interop.mincore.CloseHandle(handle);
}
public override bool IsInvalid
{
[SecurityCritical]
get
{
return handle == IntPtr.Zero || handle == new IntPtr(-1);
}
}
}
}
|
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Runtime.InteropServices;
using System.Security;
namespace Microsoft.Win32.SafeHandles
{
// Reliability notes:
// ReleaseHandle has reliability guarantee of Cer.Success, as defined by SafeHandle.
// It gets prepared as a CER at instance construction time.
[SecurityCritical]
public sealed class SafeMemoryMappedFileHandle : SafeHandle
{
internal SafeMemoryMappedFileHandle() : base(IntPtr.Zero, true) { }
internal SafeMemoryMappedFileHandle(IntPtr handle, bool ownsHandle)
: base(IntPtr.Zero, ownsHandle)
{
SetHandle(handle);
}
override protected bool ReleaseHandle()
{
return Interop.mincore.CloseHandle(handle);
}
public override bool IsInvalid
{
[SecurityCritical]
get
{
return handle == new IntPtr(0) || handle == new IntPtr(-1);
}
}
}
}
|
mit
|
C#
|
28fc9b9b6da9d05000863686de70c8956c0b6268
|
Allow instantiating jQueryPosition
|
nikhilk/scriptsharp,x335/scriptsharp,nikhilk/scriptsharp,x335/scriptsharp,x335/scriptsharp,nikhilk/scriptsharp
|
src/Libraries/jQuery/jQuery.Core/jQueryPosition.cs
|
src/Libraries/jQuery/jQuery.Core/jQueryPosition.cs
|
// jQueryPosition.cs
// Script#/Libraries/jQuery/Core
// This source code is subject to terms and conditions of the Apache License, Version 2.0.
//
using System;
using System.Runtime.CompilerServices;
using System.Collections;
namespace jQueryApi {
/// <summary>
/// Provides information about the position of an element.
/// </summary>
[ScriptImport]
[ScriptIgnoreNamespace]
[ScriptName("Object")]
public sealed class jQueryPosition {
public jQueryPosition() {
}
public jQueryPosition(params object[] nameValuePairs) {
}
/// <summary>
/// Gets the left coordinate.
/// </summary>
[ScriptField]
public int Left {
get {
return 0;
}
set {
}
}
/// <summary>
/// Gets the top coordinate.
/// </summary>
[ScriptField]
public int Top {
get {
return 0;
}
set {
}
}
public static implicit operator Dictionary(jQueryPosition position) {
return null;
}
}
}
|
// jQueryPosition.cs
// Script#/Libraries/jQuery/Core
// This source code is subject to terms and conditions of the Apache License, Version 2.0.
//
using System;
using System.Runtime.CompilerServices;
using System.Collections;
namespace jQueryApi {
/// <summary>
/// Provides information about the position of an element.
/// </summary>
[ScriptImport]
[ScriptIgnoreNamespace]
public sealed class jQueryPosition {
private jQueryPosition() {
}
/// <summary>
/// Gets the left coordinate.
/// </summary>
[ScriptField]
public int Left {
get {
return 0;
}
}
/// <summary>
/// Gets the top coordinate.
/// </summary>
[ScriptField]
public int Top {
get {
return 0;
}
}
public static implicit operator Dictionary(jQueryPosition position) {
return null;
}
}
}
|
apache-2.0
|
C#
|
6afbc78395fdfe1266ee43ddedd7c4758d29cfce
|
Make Orchard.Core.Common.Utilities.LazyField<T> [Obsolete]
|
jagraz/Orchard,hbulzy/Orchard,dcinzona/Orchard,LaserSrl/Orchard,yersans/Orchard,Codinlab/Orchard,angelapper/Orchard,SouleDesigns/SouleDesigns.Orchard,jtkech/Orchard,escofieldnaxos/Orchard,OrchardCMS/Orchard,arminkarimi/Orchard,grapto/Orchard.CloudBust,IDeliverable/Orchard,aaronamm/Orchard,patricmutwiri/Orchard,jagraz/Orchard,brownjordaninternational/OrchardCMS,TalaveraTechnologySolutions/Orchard,brownjordaninternational/OrchardCMS,aaronamm/Orchard,hannan-azam/Orchard,jersiovic/Orchard,xkproject/Orchard,neTp9c/Orchard,omidnasri/Orchard,Lombiq/Orchard,AndreVolksdorf/Orchard,fortunearterial/Orchard,jimasp/Orchard,openbizgit/Orchard,brownjordaninternational/OrchardCMS,Praggie/Orchard,johnnyqian/Orchard,mvarblow/Orchard,Ermesx/Orchard,yersans/Orchard,geertdoornbos/Orchard,dburriss/Orchard,dcinzona/Orchard,li0803/Orchard,xiaobudian/Orchard,luchaoshuai/Orchard,jchenga/Orchard,armanforghani/Orchard,AdvantageCS/Orchard,Ermesx/Orchard,jtkech/Orchard,LaserSrl/Orchard,SouleDesigns/SouleDesigns.Orchard,AndreVolksdorf/Orchard,SzymonSel/Orchard,geertdoornbos/Orchard,vairam-svs/Orchard,jchenga/Orchard,phillipsj/Orchard,marcoaoteixeira/Orchard,patricmutwiri/Orchard,tobydodds/folklife,hhland/Orchard,smartnet-developers/Orchard,sfmskywalker/Orchard,omidnasri/Orchard,smartnet-developers/Orchard,yersans/Orchard,TaiAivaras/Orchard,fassetar/Orchard,jerryshi2007/Orchard,grapto/Orchard.CloudBust,Fogolan/OrchardForWork,hannan-azam/Orchard,yersans/Orchard,dburriss/Orchard,fassetar/Orchard,kouweizhong/Orchard,Dolphinsimon/Orchard,m2cms/Orchard,armanforghani/Orchard,andyshao/Orchard,KeithRaven/Orchard,Lombiq/Orchard,dozoft/Orchard,TalaveraTechnologySolutions/Orchard,marcoaoteixeira/Orchard,xiaobudian/Orchard,Inner89/Orchard,brownjordaninternational/OrchardCMS,kgacova/Orchard,spraiin/Orchard,Fogolan/OrchardForWork,SzymonSel/Orchard,neTp9c/Orchard,aaronamm/Orchard,TaiAivaras/Orchard,TalaveraTechnologySolutions/Orchard,fortunearterial/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,hbulzy/Orchard,sfmskywalker/Orchard,dozoft/Orchard,li0803/Orchard,marcoaoteixeira/Orchard,geertdoornbos/Orchard,omidnasri/Orchard,IDeliverable/Orchard,bedegaming-aleksej/Orchard,openbizgit/Orchard,SzymonSel/Orchard,Codinlab/Orchard,Dolphinsimon/Orchard,gcsuk/Orchard,m2cms/Orchard,jtkech/Orchard,harmony7/Orchard,Inner89/Orchard,spraiin/Orchard,enspiral-dev-academy/Orchard,jersiovic/Orchard,enspiral-dev-academy/Orchard,MetSystem/Orchard,arminkarimi/Orchard,Dolphinsimon/Orchard,armanforghani/Orchard,johnnyqian/Orchard,ehe888/Orchard,ehe888/Orchard,LaserSrl/Orchard,abhishekluv/Orchard,Lombiq/Orchard,AdvantageCS/Orchard,ehe888/Orchard,angelapper/Orchard,harmony7/Orchard,omidnasri/Orchard,andyshao/Orchard,jagraz/Orchard,jersiovic/Orchard,Praggie/Orchard,Anton-Am/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,TalaveraTechnologySolutions/Orchard,m2cms/Orchard,hannan-azam/Orchard,Ermesx/Orchard,alejandroaldana/Orchard,emretiryaki/Orchard,johnnyqian/Orchard,vairam-svs/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,Praggie/Orchard,li0803/Orchard,tobydodds/folklife,jimasp/Orchard,escofieldnaxos/Orchard,neTp9c/Orchard,OrchardCMS/Orchard,stormleoxia/Orchard,oxwanawxo/Orchard,oxwanawxo/Orchard,JRKelso/Orchard,dburriss/Orchard,andyshao/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,aaronamm/Orchard,Inner89/Orchard,neTp9c/Orchard,spraiin/Orchard,sfmskywalker/Orchard,mvarblow/Orchard,DonnotRain/Orchard,JRKelso/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,xiaobudian/Orchard,hannan-azam/Orchard,tobydodds/folklife,ehe888/Orchard,phillipsj/Orchard,mvarblow/Orchard,SzymonSel/Orchard,johnnyqian/Orchard,alejandroaldana/Orchard,tobydodds/folklife,neTp9c/Orchard,harmony7/Orchard,jtkech/Orchard,grapto/Orchard.CloudBust,hbulzy/Orchard,Praggie/Orchard,escofieldnaxos/Orchard,Codinlab/Orchard,KeithRaven/Orchard,AdvantageCS/Orchard,xiaobudian/Orchard,gcsuk/Orchard,DonnotRain/Orchard,Inner89/Orchard,m2cms/Orchard,escofieldnaxos/Orchard,TalaveraTechnologySolutions/Orchard,jtkech/Orchard,enspiral-dev-academy/Orchard,jchenga/Orchard,spraiin/Orchard,rtpHarry/Orchard,Ermesx/Orchard,yersans/Orchard,kgacova/Orchard,fassetar/Orchard,bedegaming-aleksej/Orchard,Codinlab/Orchard,kgacova/Orchard,LaserSrl/Orchard,IDeliverable/Orchard,yonglehou/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,dozoft/Orchard,grapto/Orchard.CloudBust,TaiAivaras/Orchard,DonnotRain/Orchard,AdvantageCS/Orchard,jersiovic/Orchard,andyshao/Orchard,Ermesx/Orchard,luchaoshuai/Orchard,Dolphinsimon/Orchard,vairam-svs/Orchard,SouleDesigns/SouleDesigns.Orchard,gcsuk/Orchard,abhishekluv/Orchard,marcoaoteixeira/Orchard,sfmskywalker/Orchard,JRKelso/Orchard,TalaveraTechnologySolutions/Orchard,fortunearterial/Orchard,angelapper/Orchard,JRKelso/Orchard,xkproject/Orchard,jagraz/Orchard,smartnet-developers/Orchard,kgacova/Orchard,Fogolan/OrchardForWork,smartnet-developers/Orchard,gcsuk/Orchard,yonglehou/Orchard,ehe888/Orchard,tobydodds/folklife,patricmutwiri/Orchard,fassetar/Orchard,gcsuk/Orchard,jerryshi2007/Orchard,MetSystem/Orchard,LaserSrl/Orchard,dozoft/Orchard,armanforghani/Orchard,TalaveraTechnologySolutions/Orchard,TalaveraTechnologySolutions/Orchard,MetSystem/Orchard,omidnasri/Orchard,abhishekluv/Orchard,fortunearterial/Orchard,openbizgit/Orchard,harmony7/Orchard,Fogolan/OrchardForWork,AdvantageCS/Orchard,omidnasri/Orchard,stormleoxia/Orchard,Anton-Am/Orchard,li0803/Orchard,xkproject/Orchard,dburriss/Orchard,hhland/Orchard,DonnotRain/Orchard,Lombiq/Orchard,vairam-svs/Orchard,brownjordaninternational/OrchardCMS,kouweizhong/Orchard,alejandroaldana/Orchard,li0803/Orchard,emretiryaki/Orchard,TaiAivaras/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,aaronamm/Orchard,stormleoxia/Orchard,bedegaming-aleksej/Orchard,fassetar/Orchard,enspiral-dev-academy/Orchard,stormleoxia/Orchard,emretiryaki/Orchard,Serlead/Orchard,arminkarimi/Orchard,yonglehou/Orchard,alejandroaldana/Orchard,rtpHarry/Orchard,phillipsj/Orchard,oxwanawxo/Orchard,oxwanawxo/Orchard,sfmskywalker/Orchard,dcinzona/Orchard,jchenga/Orchard,sfmskywalker/Orchard,MetSystem/Orchard,Dolphinsimon/Orchard,rtpHarry/Orchard,OrchardCMS/Orchard,kouweizhong/Orchard,geertdoornbos/Orchard,Anton-Am/Orchard,hhland/Orchard,yonglehou/Orchard,yonglehou/Orchard,arminkarimi/Orchard,alejandroaldana/Orchard,m2cms/Orchard,xiaobudian/Orchard,bedegaming-aleksej/Orchard,arminkarimi/Orchard,hhland/Orchard,mvarblow/Orchard,IDeliverable/Orchard,SzymonSel/Orchard,Fogolan/OrchardForWork,grapto/Orchard.CloudBust,sfmskywalker/Orchard,angelapper/Orchard,dcinzona/Orchard,oxwanawxo/Orchard,Serlead/Orchard,stormleoxia/Orchard,patricmutwiri/Orchard,hannan-azam/Orchard,andyshao/Orchard,jerryshi2007/Orchard,SouleDesigns/SouleDesigns.Orchard,emretiryaki/Orchard,hbulzy/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,jchenga/Orchard,rtpHarry/Orchard,rtpHarry/Orchard,xkproject/Orchard,OrchardCMS/Orchard,dozoft/Orchard,AndreVolksdorf/Orchard,dburriss/Orchard,OrchardCMS/Orchard,patricmutwiri/Orchard,Anton-Am/Orchard,spraiin/Orchard,jersiovic/Orchard,JRKelso/Orchard,angelapper/Orchard,escofieldnaxos/Orchard,jimasp/Orchard,jagraz/Orchard,tobydodds/folklife,IDeliverable/Orchard,Serlead/Orchard,bedegaming-aleksej/Orchard,Serlead/Orchard,dcinzona/Orchard,johnnyqian/Orchard,abhishekluv/Orchard,luchaoshuai/Orchard,harmony7/Orchard,Praggie/Orchard,omidnasri/Orchard,Serlead/Orchard,luchaoshuai/Orchard,mvarblow/Orchard,AndreVolksdorf/Orchard,omidnasri/Orchard,MetSystem/Orchard,AndreVolksdorf/Orchard,abhishekluv/Orchard,marcoaoteixeira/Orchard,sfmskywalker/Orchard,KeithRaven/Orchard,emretiryaki/Orchard,hhland/Orchard,SouleDesigns/SouleDesigns.Orchard,KeithRaven/Orchard,grapto/Orchard.CloudBust,TaiAivaras/Orchard,Codinlab/Orchard,omidnasri/Orchard,DonnotRain/Orchard,openbizgit/Orchard,fortunearterial/Orchard,kgacova/Orchard,jimasp/Orchard,luchaoshuai/Orchard,kouweizhong/Orchard,kouweizhong/Orchard,jimasp/Orchard,xkproject/Orchard,jerryshi2007/Orchard,Anton-Am/Orchard,smartnet-developers/Orchard,vairam-svs/Orchard,phillipsj/Orchard,geertdoornbos/Orchard,Lombiq/Orchard,hbulzy/Orchard,openbizgit/Orchard,phillipsj/Orchard,KeithRaven/Orchard,enspiral-dev-academy/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,jerryshi2007/Orchard,Inner89/Orchard,armanforghani/Orchard,abhishekluv/Orchard
|
src/Orchard.Web/Core/Common/Utilities/LazyField.cs
|
src/Orchard.Web/Core/Common/Utilities/LazyField.cs
|
using System;
namespace Orchard.Core.Common.Utilities {
[Obsolete("Use Orchard.ContentManagement.Utilities.LazyField instead.")]
public class LazyField<T> {
private T _value;
private Func<T> _loader;
private Func<T, T> _setter;
public T Value {
get { return GetValue(); }
set { SetValue(value); }
}
public void Loader(Func<T> loader) {
_loader = loader;
}
public void Setter(Func<T, T> setter) {
_setter = setter;
}
private T GetValue() {
if (_loader != null) {
_value = _loader();
_loader = null;
}
return _value;
}
private void SetValue(T value) {
_loader = null;
if (_setter != null) {
_value = _setter(value);
}
else {
_value = value;
}
}
}
}
|
using System;
namespace Orchard.Core.Common.Utilities {
public class LazyField<T> {
private T _value;
private Func<T> _loader;
private Func<T, T> _setter;
public T Value {
get { return GetValue(); }
set { SetValue(value); }
}
public void Loader(Func<T> loader) {
_loader = loader;
}
public void Setter(Func<T, T> setter) {
_setter = setter;
}
private T GetValue() {
if (_loader != null) {
_value = _loader();
_loader = null;
}
return _value;
}
private void SetValue(T value) {
_loader = null;
if (_setter != null) {
_value = _setter(value);
}
else {
_value = value;
}
}
}
}
|
bsd-3-clause
|
C#
|
2328a53a9b643a9f7ea094e313743b19d3b9cf42
|
Set the recttransform on Awake instead of Onvalidate, as suggested in a pr comment. Also this fixes a bug which broke near interaction on device.
|
killerantz/HoloToolkit-Unity,killerantz/HoloToolkit-Unity,DDReaper/MixedRealityToolkit-Unity,killerantz/HoloToolkit-Unity,killerantz/HoloToolkit-Unity
|
Assets/MixedRealityToolkit.Services/InputSystem/NearInteractionTouchableUnityUI.cs
|
Assets/MixedRealityToolkit.Services/InputSystem/NearInteractionTouchableUnityUI.cs
|
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using System;
using System.Collections.Generic;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// Use a Unity UI RectTransform as touchable surface.
/// </summary>
[RequireComponent(typeof(RectTransform))]
public class NearInteractionTouchableUnityUI : BaseNearInteractionTouchable, INearInteractionTouchable
{
private RectTransform rectTransform;
public static IReadOnlyList<NearInteractionTouchableUnityUI> Instances => instances;
public Vector3 Forward => transform.TransformDirection(LocalForward);
// UnityUI forward is the direction you are looking when looking at it. Near Interaction forward is the direction the button or control faces, so the opposite of UnityUI forward.
public Vector3 LocalForward => -Vector3.forward;
public Vector3 LocalUp => Vector3.up;
// See comment for LocalForward. NearInteraction directions are rotated 180 degrees from UnityUI directions.
public Vector3 LocalRight => -Vector3.right;
public Vector3 LocalCenter => Vector3.zero;
public Vector2 Bounds => rectTransform.rect.size;
private static readonly List<NearInteractionTouchableUnityUI> instances = new List<NearInteractionTouchableUnityUI>();
private void Awake()
{
rectTransform = GetComponent<RectTransform>();
}
/// <inheritdoc />
public override float DistanceToTouchable(Vector3 samplePoint, out Vector3 normal)
{
normal = Forward;
Vector3 localPoint = transform.InverseTransformPoint(samplePoint);
// touchables currently can only be touched within the bounds of the rectangle.
// We return infinity to ensure that any point outside the bounds does not get touched.
if (!rectTransform.rect.Contains(localPoint))
{
return float.PositiveInfinity;
}
// Scale back to 3D space
localPoint = transform.TransformSize(localPoint);
return Math.Abs(localPoint.z);
}
protected void OnEnable()
{
instances.Add(this);
}
protected void OnDisable()
{
instances.Remove(this);
}
}
}
|
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using System;
using System.Collections.Generic;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// Use a Unity UI RectTransform as touchable surface.
/// </summary>
[RequireComponent(typeof(RectTransform))]
public class NearInteractionTouchableUnityUI : BaseNearInteractionTouchable, INearInteractionTouchable
{
private RectTransform rectTransform;
public static IReadOnlyList<NearInteractionTouchableUnityUI> Instances => instances;
public Vector3 Forward => transform.TransformDirection(LocalForward);
// UnityUI forward is the direction you are looking when looking at it. Near Interaction forward is the direction the button or control faces, so the opposite of UnityUI forward.
public Vector3 LocalForward => -Vector3.forward;
public Vector3 LocalUp => Vector3.up;
// See comment for LocalForward. NearInteraction directions are rotated 180 degrees from UnityUI directions.
public Vector3 LocalRight => -Vector3.right;
public Vector3 LocalCenter => Vector3.zero;
public Vector2 Bounds => rectTransform.rect.size;
private static readonly List<NearInteractionTouchableUnityUI> instances = new List<NearInteractionTouchableUnityUI>();
protected override void OnValidate()
{
base.OnValidate();
rectTransform = GetComponent<RectTransform>();
}
/// <inheritdoc />
public override float DistanceToTouchable(Vector3 samplePoint, out Vector3 normal)
{
normal = Forward;
Vector3 localPoint = transform.InverseTransformPoint(samplePoint);
// touchables currently can only be touched within the bounds of the rectangle.
// We return infinity to ensure that any point outside the bounds does not get touched.
if (!rectTransform.rect.Contains(localPoint))
{
return float.PositiveInfinity;
}
// Scale back to 3D space
localPoint = transform.TransformSize(localPoint);
return Math.Abs(localPoint.z);
}
protected void OnEnable()
{
instances.Add(this);
}
protected void OnDisable()
{
instances.Remove(this);
}
}
}
|
mit
|
C#
|
f6bff7cef5f81ee9f53434e0b3a715a2c80e5577
|
refactor seed method
|
vankooch/BrockAllen.MembershipReboot,rajendra1809/BrockAllen.MembershipReboot,eric-swann-q2/BrockAllen.MembershipReboot,rvdkooy/BrockAllen.MembershipReboot,DosGuru/MembershipReboot,brockallen/BrockAllen.MembershipReboot,tomascassidy/BrockAllen.MembershipReboot,vinneyk/BrockAllen.MembershipReboot
|
BrockAllen.MembershipReboot/Repository/EF/EFMembershipRebootDatabaseInitializer.cs
|
BrockAllen.MembershipReboot/Repository/EF/EFMembershipRebootDatabaseInitializer.cs
|
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Security.Claims;
using System.Text;
using System.Threading.Tasks;
namespace BrockAllen.MembershipReboot
{
class EFMembershipRebootDatabaseInitializer : CreateDatabaseIfNotExists<EFMembershipRebootDatabase>
{
public static void SeedContext(EFMembershipRebootDatabase context)
{
#if DEBUG
var adminAccount = UserAccount.Create("default", "admin", "admin123", "brockallen@gmail.com");
adminAccount.VerifyAccount(adminAccount.VerificationKey);
adminAccount.AddClaim(ClaimTypes.Role, "Administrator");
context.Users.Add(adminAccount);
#endif
}
protected override void Seed(EFMembershipRebootDatabase context)
{
SeedContext(context);
base.Seed(context);
}
}
}
|
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Security.Claims;
using System.Text;
using System.Threading.Tasks;
namespace BrockAllen.MembershipReboot
{
class EFMembershipRebootDatabaseInitializer : CreateDatabaseIfNotExists<EFMembershipRebootDatabase>
{
protected override void Seed(EFMembershipRebootDatabase context)
{
var adminAccount = UserAccount.Create("default", "admin", "admin123", "brockallen@gmail.com");
adminAccount.VerifyAccount(adminAccount.VerificationKey);
adminAccount.AddClaim(ClaimTypes.Role, "Administrator");
context.Users.Add(adminAccount);
base.Seed(context);
}
}
}
|
bsd-3-clause
|
C#
|
1388b7b8292510db74fffb49e932ed623b9a0ffa
|
fix to the stratum model
|
SwiftAusterity/NetMud,SwiftAusterity/NetMud,SwiftAusterity/NetMud,SwiftAusterity/NetMud,SwiftAusterity/NetMud
|
NetMud.Data/LookupData/Stratum.cs
|
NetMud.Data/LookupData/Stratum.cs
|
using NetMud.Data.System;
using NetMud.DataStructure.Base.Place;
using NetMud.DataStructure.Base.Supporting;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Web.Script.Serialization;
namespace NetMud.Data.LookupData
{
/// <summary>
/// Composes the various horizontal layers of worlds
/// </summary>
[Serializable]
public class Stratum : BackingDataPartial, IStratum
{
/// <summary>
/// Diameter of this stratum in meters
/// </summary>
public long Diameter { get; set; }
/// <summary>
/// What the various layers of the strata are typically composed of
/// </summary>
public Dictionary<string, IStratumLayer> Layers { get; set; }
/// <summary>
/// How hot it is in this stratum generally
/// </summary>
public Tuple<int, int> AmbientTemperatureRange { get; set; }
/// <summary>
/// How humid it is in this stratum generally
/// </summary>
public Tuple<int, int> AmbientHumidityRange { get; set; }
public Stratum()
{
//empty constructor
}
public Stratum(int lowTemp, int highTemp, int lowHumidity, int highHumidity, long diameter)
{
AmbientHumidityRange = new Tuple<int, int>(lowHumidity, highHumidity);
AmbientTemperatureRange = new Tuple<int, int>(lowTemp, highTemp);
Diameter = diameter;
}
}
/// <summary>
/// Defines layers of strata
/// </summary>
[Serializable]
public class StratumLayer : IStratumLayer
{
/// <summary>
/// Material for this layer, can be null for Air layer
/// </summary>
[ScriptIgnore]
[JsonIgnore]
public IMaterial BaseMaterial
{
get
{
if (_baseMaterial > -1)
return BackingDataCache.Get<IMaterial>(_baseMaterial);
return null;
}
set
{
if (value == null)
return;
_baseMaterial = value.ID;
}
}
[JsonProperty("BaseMaterial")]
private long _baseMaterial { get; set; }
/// <summary>
/// Lower Z bound for this layer
/// </summary>
public long LowerDepth { get; set; }
/// <summary>
/// Upper Z bound for this layer
/// </summary>
public long UpperDepth { get; set; }
}
}
|
using NetMud.Data.System;
using NetMud.DataStructure.Base.Place;
using NetMud.DataStructure.Base.Supporting;
using System;
using System.Collections.Generic;
namespace NetMud.Data.LookupData
{
[Serializable]
public class Stratum : BackingDataPartial, IStratum
{
/// <summary>
/// Diameter of this stratum in meters
/// </summary>
public long Diameter { get; set; }
/// <summary>
/// What the various layers of the strata are typically composed of
/// </summary>
public Dictionary<string, IStratumLayer> Layers { get; set; }
/// <summary>
/// How hot it is in this stratum generally
/// </summary>
public Tuple<int, int> AmbientTemperatureRange { get; set; }
/// <summary>
/// How humid it is in this stratum generally
/// </summary>
public Tuple<int, int> AmbientHumidityRange { get; set; }
}
/// <summary>
/// Defines layers of strata
/// </summary>
[Serializable]
public class StratumLayer : IStratumLayer
{
/// <summary>
/// Material for this layer, can be null for Air layer
/// </summary>
public IMaterial BaseMaterial { get; set; }
/// <summary>
/// Lower Z bound for this layer
/// </summary>
public long LowerDepth { get; set; }
/// <summary>
/// Upper Z bound for this layer
/// </summary>
public long UpperDepth { get; set; }
}
}
|
mit
|
C#
|
1fb0477fd3fdfee62d3be93801e97139036da26b
|
fix spacing?
|
kade-robertson/SharpThemes
|
SharpThemes/Utilities/Http.cs
|
SharpThemes/Utilities/Http.cs
|
using System;
using System.Net.Http;
using System.Threading.Tasks;
using ModernHttpClient;
namespace SharpThemes.Utilities
{
public static class Http
{
public static async Task<string> DoGet(string url) {
using (var client = new HttpClient(new NativeMessageHandler())) {
try {
return await client.GetStringAsync(url);
} catch (Exception ex) {
throw ex;
}
}
}
}
}
|
using System;
using System.Net.Http;
using System.Threading.Tasks;
using ModernHttpClient;
namespace SharpThemes.Utilities
{
public static class Http
{
public static async Task<string> DoGet(string url) {
using (var client = new HttpClient(new NativeMessageHandler())) {
return await client.GetStringAsync(url);
}
}
}
}
|
mit
|
C#
|
a33396a97a3de0749de64f93fe5dca48ecd0b41e
|
Remove navigatable attribute from MainViewModel.
|
nuitsjp/KAMISHIBAI
|
Sample/SampleBrowser/SampleBrowser.ViewModel/MainViewModel.cs
|
Sample/SampleBrowser/SampleBrowser.ViewModel/MainViewModel.cs
|
using Kamishibai;
using SampleBrowser.ViewModel.Page;
namespace SampleBrowser.ViewModel;
public class MainViewModel : INavigatedAsyncAware
{
private MenuItem _selectedMenuItem;
private readonly IPresentationService _presentationService;
public MainViewModel(IPresentationService presentationService)
{
_presentationService = presentationService;
_selectedMenuItem = SampleItems.First();
}
public IReadOnlyList<MenuItem> SampleItems { get; } = new List<MenuItem>
{
new ("Navigation", typeof(NavigationMenuViewModel))
};
public MenuItem SelectedMenuItem
{
get => _selectedMenuItem;
set
{
_selectedMenuItem = value;
_presentationService.NavigateAsync(_selectedMenuItem.ViewModel);
}
}
public Task OnNavigatedAsync()
{
return _presentationService.NavigateAsync(_selectedMenuItem.ViewModel);
}
}
|
using Kamishibai;
using SampleBrowser.ViewModel.Page;
namespace SampleBrowser.ViewModel;
[Navigatable]
public class MainViewModel : INavigatedAsyncAware
{
private MenuItem _selectedMenuItem;
private readonly IPresentationService _presentationService;
public MainViewModel(IPresentationService presentationService)
{
_presentationService = presentationService;
_selectedMenuItem = SampleItems.First();
}
public IReadOnlyList<MenuItem> SampleItems { get; } = new List<MenuItem>
{
new ("Navigation", typeof(NavigationMenuViewModel))
};
public MenuItem SelectedMenuItem
{
get => _selectedMenuItem;
set
{
_selectedMenuItem = value;
_presentationService.NavigateAsync(_selectedMenuItem.ViewModel);
}
}
public Task OnNavigatedAsync()
{
return _presentationService.NavigateAsync(_selectedMenuItem.ViewModel);
}
}
|
mit
|
C#
|
0a3f68ee76b2f2d96bcce43ca18d0c69d27a03b0
|
Introduce TimeoutError().
|
AIWolfSharp/AIWolf_NET,AIWolfSharp/AIWolfCore
|
AIWolfLib/Error.cs
|
AIWolfLib/Error.cs
|
//
// Error.cs
//
// Copyright (c) 2016 Takashi OTSUKI
//
// This software is released under the MIT License.
// http://opensource.org/licenses/mit-license.php
//
using System;
using System.Diagnostics;
namespace AIWolf.Lib
{
/// <summary>
/// Error handling class.
/// </summary>
public static class Error
{
/// <summary>
/// Writes an error message, then throws AIWolfRuntimeException on debug.
/// </summary>
/// <param name="message">Error message.</param>
public static void RuntimeError(params string[] messages)
{
string message = "";
if (messages.Length > 0)
{
message = messages[0];
}
ThrowRuntimeException(message);
foreach (var m in messages)
{
Console.Error.WriteLine(m);
}
}
[Conditional("DEBUG")]
static void ThrowRuntimeException(string message)
{
throw new AIWolfRuntimeException(message);
}
/// <summary>
/// Writes an error message, then throws TimeoutException on debug.
/// </summary>
/// <param name="message">Error message.</param>
public static void TimeoutError(params string[] messages)
{
string message = "";
if (messages.Length > 0)
{
message = messages[0];
}
ThrowTimeoutException(message);
foreach (var m in messages)
{
Console.Error.WriteLine(m);
}
}
[Conditional("DEBUG")]
static void ThrowTimeoutException(string message)
{
throw new TimeoutException(message);
}
}
}
|
//
// Error.cs
//
// Copyright (c) 2016 Takashi OTSUKI
//
// This software is released under the MIT License.
// http://opensource.org/licenses/mit-license.php
//
using System;
using System.Diagnostics;
namespace AIWolf.Lib
{
/// <summary>
/// Error handling class.
/// </summary>
public static class Error
{
/// <summary>
/// Writes an error message, then throws exception on debug.
/// </summary>
/// <param name="message">Error message.</param>
public static void RuntimeError(params string[] messages)
{
string message = "";
if (messages.Length > 0)
{
message = messages[0];
}
ThrowException(message);
foreach (var m in messages)
{
Console.Error.WriteLine(m);
}
}
[Conditional("DEBUG")]
static void ThrowException(string message)
{
throw new AIWolfRuntimeException(message);
}
}
}
|
mit
|
C#
|
ed4f6233f1dbd404b694d94ca32f201badd7dd45
|
Add docs to PropertyChangedBase, and create OnPropertyChanged method to integrate with Fody.PropertyChanged
|
canton7/Stylet,canton7/Stylet,cH40z-Lord/Stylet,cH40z-Lord/Stylet
|
Stylet/PropertyChangedBase.cs
|
Stylet/PropertyChangedBase.cs
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Linq.Expressions;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
namespace Stylet
{
public class PropertyChangedBase : INotifyPropertyChanged, INotifyPropertyChangedDispatcher
{
private Action<Action> _propertyChangedDispatcher = Execute.DefaultPropertyChangedDispatcher;
/// <summary>
/// Dispatcher to use to dispatch PropertyChanged events. Defaults to Execute.DefaultPropertyChangedDispatcher
/// </summary>
public virtual Action<Action> PropertyChangedDispatcher
{
get { return this._propertyChangedDispatcher; }
set { this._propertyChangedDispatcher = value; }
}
public event PropertyChangedEventHandler PropertyChanged;
/// <summary>
/// Refresh all properties
/// </summary>
public void Refresh()
{
this.NotifyOfPropertyChange(String.Empty);
}
/// <summary>
/// Raise a PropertyChanged notification from the property in the given expression, e.g. NotifyOfPropertyChange(() => this.Property)
/// </summary
/// <param name="property">Expression describing the property to raise a PropertyChanged notification for</param>
protected void NotifyOfPropertyChange<TProperty>(Expression<Func<TProperty>> property)
{
this.OnPropertyChanged(property.NameForProperty());
}
/// <summary>
/// Raise a PropertyChanged notification from the property with the given name
/// </summary>
/// <param name="propertyName">Name of the property to raise a PropertyChanged notification for. Defaults to the calling property</param>
protected virtual void NotifyOfPropertyChange([CallerMemberName] string propertyName = "")
{
this.OnPropertyChanged(propertyName);
}
/// <summary>
/// Fires the PropertyChanged notification.
/// </summary>
/// <remarks>Specially named so that Fody.PropertyChanged calls it</remarks>
/// <param name="propertyName">Name of the property to raise the notification for</param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected virtual void OnPropertyChanged(string propertyName)
{
var handler = this.PropertyChanged;
if (handler != null)
{
this.PropertyChangedDispatcher(() => handler(this, new PropertyChangedEventArgs(propertyName)));
}
}
/// <summary>
/// Takes, by reference, a field, and its new value. If field != value, will set field = value and raise a PropertyChanged notification
/// </summary>
/// <param name="field">Field to assign</param>
/// <param name="value">Value to assign to the field, if it differs</param>
/// <param name="propertyName">Name of the property to notify for. Defaults to the calling property</param>
protected virtual void SetAndNotify<T>(ref T field, T value, [CallerMemberName] string propertyName = "")
{
if (!EqualityComparer<T>.Default.Equals(field, value))
{
field = value;
this.NotifyOfPropertyChange(propertyName);
}
}
}
}
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Linq.Expressions;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
namespace Stylet
{
public class PropertyChangedBase : INotifyPropertyChanged, INotifyPropertyChangedDispatcher
{
private Action<Action> _propertyChangedDispatcher = Execute.DefaultPropertyChangedDispatcher;
public Action<Action> PropertyChangedDispatcher
{
get { return this._propertyChangedDispatcher; }
set { this._propertyChangedDispatcher = value; }
}
public event PropertyChangedEventHandler PropertyChanged;
public void Refresh()
{
this.NotifyOfPropertyChange(String.Empty);
}
protected void NotifyOfPropertyChange<TProperty>(Expression<Func<TProperty>> property)
{
this.NotifyOfPropertyChange(property.NameForProperty());
}
protected virtual void NotifyOfPropertyChange([CallerMemberName] string propertyName = "")
{
var handler = this.PropertyChanged;
if (handler != null)
{
this.PropertyChangedDispatcher(() => handler(this, new PropertyChangedEventArgs(propertyName)));
}
}
protected virtual void SetAndNotify<T>(ref T field, T value, [CallerMemberName] string propertyName = "")
{
if (Comparer<T>.Default.Compare(field, value) != 0)
{
field = value;
this.NotifyOfPropertyChange(propertyName);
}
}
}
}
|
mit
|
C#
|
13f459205c5d4450ba9bd0aa8a92a0c061d8dd36
|
add FileWriter Test
|
ufcpp/UnityTools
|
CopyDllsAfterBuildLocalTool/CopyDllsAfterBuildLocalToolUnitTest/FileWriterTest.cs
|
CopyDllsAfterBuildLocalTool/CopyDllsAfterBuildLocalToolUnitTest/FileWriterTest.cs
|
using CopyDllsAfterBuildLocalTool;
using System;
using System.IO;
using System.Linq;
using Xunit;
namespace CopyDllsAfterBuildLocalToolUnitTest
{
public class FileWriterTest : IDisposable
{
private readonly string _path;
// setup
public FileWriterTest()
{
_path = Path.Combine(Path.GetTempPath(), "FileWriterTest", Guid.NewGuid().ToString());
if (!Directory.Exists(_path))
Directory.CreateDirectory(_path);
}
// teardown
public void Dispose()
{
if (Directory.Exists(_path))
Directory.Delete(_path, true);
}
[Fact]
public void BinaryCompareTest()
{
var random = new Random();
var content = Enumerable.Range(0, 10).Select(x => (byte)random.Next(0, 254)).ToArray();
var mismatchContent = content.Append((byte)random.Next(0, 254)).ToArray();
// binary match item should be true
var a = Path.Combine(_path, "a");
File.WriteAllBytes(a, content);
using var fa = File.OpenRead(a);
Assert.True(FileWriter.Compare(content, fa));
// binary miss-match item should be false
var b = Path.Combine(_path, "b");
File.WriteAllBytes(b, mismatchContent);
using var fb = File.OpenRead(b);
Assert.False(FileWriter.Compare(content, fb));
}
[Fact]
public void Write_WriteCheckOption_BinaryEquality_Test()
{
var option = WriteCheckOption.BinaryEquality;
// Destination not exists should write.
var random = new Random();
var content = Enumerable.Range(0, 10).Select(x => (byte)random.Next(0, 254)).ToArray();
var a = Path.Combine(_path, "a");
Assert.True(FileWriter.Write(content, a, option));
// Binary match file should skipped.
Assert.False(FileWriter.Write(content, a, option));
// Binary mismatch file should write.
var mismatchContent = content.Append((byte)random.Next(0, 254)).ToArray();
Assert.True(FileWriter.Write(mismatchContent, a, option));
}
[Fact]
public void Write_WriteCheckOption_None_Test()
{
var option = WriteCheckOption.None;
// Destination not exists should write.
var random = new Random();
var content = Enumerable.Range(0, 10).Select(x => (byte)random.Next(0, 254)).ToArray();
var a = Path.Combine(_path, "a");
Assert.True(FileWriter.Write(content, a, option));
// Binary match file should write.
Assert.True(FileWriter.Write(content, a, option));
// Binary mismatch file should write.
var mismatchContent = content.Append((byte)random.Next(0, 254)).ToArray();
Assert.True(FileWriter.Write(mismatchContent, a, option));
}
}
}
|
using CopyDllsAfterBuildLocalTool;
using System;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Xunit;
namespace CopyDllsAfterBuildLocalToolUnitTest
{
public class FileWriterTest
{
// todo: add Binary Compare test
// todo: add Write test. Binary match file should skipped.
// todo: add Write test. Binary mismatch file should write.
// todo: add Write test. None CheckOption should write even if binary equals.
// todo: add Write test. None CheckOption should write if binary mismatch..
}
}
|
mit
|
C#
|
7c52ffb53e037bdf28fb3b5d056c4aa3f85793f4
|
rename method name
|
lemestrez/aspnetboilerplate,aspnetboilerplate/aspnetboilerplate,luchaoshuai/aspnetboilerplate,SXTSOFT/aspnetboilerplate,AlexGeller/aspnetboilerplate,beratcarsi/aspnetboilerplate,jaq316/aspnetboilerplate,oceanho/aspnetboilerplate,ryancyq/aspnetboilerplate,690486439/aspnetboilerplate,fengyeju/aspnetboilerplate,nineconsult/Kickoff2016Net,verdentk/aspnetboilerplate,Nongzhsh/aspnetboilerplate,yuzukwok/aspnetboilerplate,s-takatsu/aspnetboilerplate,4nonym0us/aspnetboilerplate,yuzukwok/aspnetboilerplate,ZhaoRd/aspnetboilerplate,andmattia/aspnetboilerplate,zquans/aspnetboilerplate,aspnetboilerplate/aspnetboilerplate,carldai0106/aspnetboilerplate,andmattia/aspnetboilerplate,Tobyee/aspnetboilerplate,ZhaoRd/aspnetboilerplate,yuzukwok/aspnetboilerplate,s-takatsu/aspnetboilerplate,nineconsult/Kickoff2016Net,zquans/aspnetboilerplate,4nonym0us/aspnetboilerplate,Tobyee/aspnetboilerplate,ShiningRush/aspnetboilerplate,ilyhacker/aspnetboilerplate,carldai0106/aspnetboilerplate,virtualcca/aspnetboilerplate,berdankoca/aspnetboilerplate,ryancyq/aspnetboilerplate,ShiningRush/aspnetboilerplate,aspnetboilerplate/aspnetboilerplate,jaq316/aspnetboilerplate,zclmoon/aspnetboilerplate,virtualcca/aspnetboilerplate,carldai0106/aspnetboilerplate,SXTSOFT/aspnetboilerplate,zquans/aspnetboilerplate,aspnetboilerplate/aspnetboilerplate,Nongzhsh/aspnetboilerplate,zclmoon/aspnetboilerplate,abdllhbyrktr/aspnetboilerplate,verdentk/aspnetboilerplate,verdentk/aspnetboilerplate,zclmoon/aspnetboilerplate,ryancyq/aspnetboilerplate,AlexGeller/aspnetboilerplate,s-takatsu/aspnetboilerplate,luchaoshuai/aspnetboilerplate,abdllhbyrktr/aspnetboilerplate,Tobyee/aspnetboilerplate,fengyeju/aspnetboilerplate,ilyhacker/aspnetboilerplate,ZhaoRd/aspnetboilerplate,Nongzhsh/aspnetboilerplate,AlexGeller/aspnetboilerplate,690486439/aspnetboilerplate,4nonym0us/aspnetboilerplate,virtualcca/aspnetboilerplate,andmattia/aspnetboilerplate,beratcarsi/aspnetboilerplate,carldai0106/aspnetboilerplate,lvjunlei/aspnetboilerplate,beratcarsi/aspnetboilerplate,fengyeju/aspnetboilerplate,jaq316/aspnetboilerplate,berdankoca/aspnetboilerplate,ryancyq/aspnetboilerplate,oceanho/aspnetboilerplate,abdllhbyrktr/aspnetboilerplate,lvjunlei/aspnetboilerplate,oceanho/aspnetboilerplate,690486439/aspnetboilerplate,lemestrez/aspnetboilerplate,SXTSOFT/aspnetboilerplate,berdankoca/aspnetboilerplate,ShiningRush/aspnetboilerplate,lvjunlei/aspnetboilerplate,ilyhacker/aspnetboilerplate,lemestrez/aspnetboilerplate
|
src/Abp.Web.Api.Swagger/Configuration/Startup/AbpSwaggerConfigurationExtensions.cs
|
src/Abp.Web.Api.Swagger/Configuration/Startup/AbpSwaggerConfigurationExtensions.cs
|
using Abp.WebApi.Swagger.Configuration;
namespace Abp.Configuration.Startup
{
/// <summary>
/// Defines extension methods to <see cref="IModuleConfigurations"/> to allow to configure Abp.Web.Api.Swagger module.
/// </summary>
public static class AbpSwaggerConfigurationExtensions
{
/// <summary>
/// Used to configure Abp.Web.Api.Swagger module.
/// </summary>
public static IAbpSwaggerModuleConfiguration AbpSwagger(this IModuleConfigurations configurations)
{
return configurations.AbpConfiguration.GetOrCreate("Modules.Abp.WebApi.Swagger", () => configurations.AbpConfiguration.IocManager.Resolve<IAbpSwaggerModuleConfiguration>());
}
}
}
|
using Abp.WebApi.Swagger.Configuration;
namespace Abp.Configuration.Startup
{
/// <summary>
/// Defines extension methods to <see cref="IModuleConfigurations"/> to allow to configure Abp.Web.Api.Swagger module.
/// </summary>
public static class AbpSwaggerConfigurationExtensions
{
/// <summary>
/// Used to configure Abp.Web.Api.Swagger module.
/// </summary>
public static IAbpSwaggerModuleConfiguration AbpWebApi(this IModuleConfigurations configurations)
{
return configurations.AbpConfiguration.GetOrCreate("Modules.Abp.WebApi.Swagger", () => configurations.AbpConfiguration.IocManager.Resolve<IAbpSwaggerModuleConfiguration>());
}
}
}
|
mit
|
C#
|
13dd99a8b6dab2e484837308d7a76a6ba737bd81
|
Switch BannerProvider to property.
|
antmicro/AntShell
|
AntShell/ShellSettings.cs
|
AntShell/ShellSettings.cs
|
/*
Copyright (c) 2013 Ant Micro <www.antmicro.com>
Authors:
* Mateusz Holenko (mholenko@antmicro.com)
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
using System;
namespace AntShell
{
public class ShellSettings
{
public Prompt NormalPrompt { get; set; }
public SearchPrompt SearchPrompt { get; set; }
public Func<string> BannerProvider { get; set; }
public bool UseBuiltinQuit { get; set; }
public bool UseBuiltinHelp { get; set; }
public bool UseBuiltinSave { get; set; }
public bool ForceVirtualCursor { get; set; }
public bool ClearScreen { get; set; }
public string HistorySavePath { get; set; }
public char DirectorySeparator { get; set; }
public ShellSettings()
{
UseBuiltinQuit = true;
UseBuiltinHelp = true;
UseBuiltinSave = true;
}
}
}
|
/*
Copyright (c) 2013 Ant Micro <www.antmicro.com>
Authors:
* Mateusz Holenko (mholenko@antmicro.com)
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
using System;
namespace AntShell
{
public class ShellSettings
{
public Prompt NormalPrompt { get; set; }
public SearchPrompt SearchPrompt { get; set; }
public Func<string> BannerProvider;
public bool UseBuiltinQuit { get; set; }
public bool UseBuiltinHelp { get; set; }
public bool UseBuiltinSave { get; set; }
public bool ForceVirtualCursor { get; set; }
public bool ClearScreen { get; set; }
public string HistorySavePath { get; set; }
public char DirectorySeparator { get; set; }
public ShellSettings()
{
UseBuiltinQuit = true;
UseBuiltinHelp = true;
UseBuiltinSave = true;
}
}
}
|
apache-2.0
|
C#
|
33c496f0cb3c8520878a0d27f8ca22f2fe539740
|
Comment fix.
|
dlemstra/Magick.NET,dlemstra/Magick.NET
|
Magick.NET.Web/Configuration/CacheControlMode.cs
|
Magick.NET.Web/Configuration/CacheControlMode.cs
|
//=================================================================================================
// Copyright 2013-2015 Dirk Lemstra <https://magick.codeplex.com/>
//
// Licensed under the ImageMagick License (the "License"); you may not use this file except in
// compliance with the License. You may obtain a copy of the License at
//
// http://www.imagemagick.org/script/license.php
//
// Unless required by applicable law or agreed to in writing, software distributed under the
// License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
// express or implied. See the License for the specific language governing permissions and
// limitations under the License.
//=================================================================================================
namespace ImageMagick.Web
{
/// <summary>
/// Specifies the mode to use for client caching.
/// </summary>
public enum CacheControlMode
{
/// <summary>
/// Does not add a max-age to the response.
/// </summary>
NoControl,
/// <summary>
/// Adds a Cache-Control: max-age=>nnn< header to the response based on the value
/// specified in the CacheControlMaxAge property.
/// </summary>
UseMaxAge
}
}
|
//=================================================================================================
// Copyright 2013-2015 Dirk Lemstra <https://magick.codeplex.com/>
//
// Licensed under the ImageMagick License (the "License"); you may not use this file except in
// compliance with the License. You may obtain a copy of the License at
//
// http://www.imagemagick.org/script/license.php
//
// Unless required by applicable law or agreed to in writing, software distributed under the
// License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
// express or implied. See the License for the specific language governing permissions and
// limitations under the License.
//=================================================================================================
namespace ImageMagick.Web
{
/// <summary>
/// Specifies the mode to use for client caching.
/// </summary>
public enum CacheControlMode
{
/// <summary>
/// Does not add a Expires to the response.
/// </summary>
NoControl,
/// <summary>
/// Adds a Cache-Control: max-age=>nnn< header to the response based on the value
/// specified in the CacheControlMaxAge property.
/// </summary>
UseMaxAge
}
}
|
apache-2.0
|
C#
|
ca151bba65ee855509531365b963d7b52b353676
|
Add NFluent-like versions
|
dirkrombauts/pickles,irfanah/pickles,magicmonty/pickles,picklesdoc/pickles,irfanah/pickles,ludwigjossieaux/pickles,blorgbeard/pickles,irfanah/pickles,picklesdoc/pickles,picklesdoc/pickles,magicmonty/pickles,magicmonty/pickles,blorgbeard/pickles,magicmonty/pickles,blorgbeard/pickles,ludwigjossieaux/pickles,dirkrombauts/pickles,ludwigjossieaux/pickles,picklesdoc/pickles,dirkrombauts/pickles,dirkrombauts/pickles,irfanah/pickles,blorgbeard/pickles
|
src/Pickles/Pickles.Test/AssertExtensions.cs
|
src/Pickles/Pickles.Test/AssertExtensions.cs
|
using System;
using System.Linq;
using System.Xml.Linq;
using NFluent;
using NFluent.Extensibility;
using NUnit.Framework;
using PicklesDoc.Pickles.Test.Extensions;
namespace PicklesDoc.Pickles.Test
{
public static class AssertExtensions
{
public static void HasAttribute(this ICheck<XElement> check, string name, string value)
{
var actual = ExtensibilityHelper.ExtractChecker(check).Value;
ShouldHaveAttribute(actual, name, value);
}
public static void ShouldHaveAttribute(this XElement element, string name, string value)
{
XAttribute xAttribute = element.Attributes().FirstOrDefault(attribute => attribute.Name.LocalName == name);
Check.That(xAttribute).IsNotNull();
// ReSharper disable once PossibleNullReferenceException
Check.That(xAttribute.Value).IsEqualTo(value);
}
public static void HasElement(this ICheck<XElement> check, string name)
{
var actual = ExtensibilityHelper.ExtractChecker(check).Value;
ShouldHaveElement(actual, name);
}
public static void ShouldHaveElement(this XElement element, string name)
{
Check.That(element.HasElement(name)).IsTrue();
}
public static void ShouldBeInInNamespace(this XElement element, string _namespace)
{
Check.That(element.Name.NamespaceName).IsEqualTo(_namespace);
}
public static void ShouldBeNamed(this XElement element, string name)
{
Check.That(element.Name.LocalName).IsEqualTo(name);
}
public static void ShouldDeepEquals(this XElement element, XElement other)
{
Assert.IsTrue(
XNode.DeepEquals(element, other),
"Expected:\r\n{0}\r\nActual:\r\n{1}\r\n",
element,
other);
}
}
}
|
using System;
using System.Linq;
using System.Xml.Linq;
using NFluent;
using NUnit.Framework;
using PicklesDoc.Pickles.Test.Extensions;
namespace PicklesDoc.Pickles.Test
{
public static class AssertExtensions
{
public static void ShouldHaveAttribute(this XElement element, string name, string value)
{
XAttribute xAttribute = element.Attributes().FirstOrDefault(attribute => attribute.Name.LocalName == name);
Check.That(xAttribute).IsNotNull();
// ReSharper disable once PossibleNullReferenceException
Check.That(xAttribute.Value).IsEqualTo(value);
}
public static void ShouldHaveElement(this XElement element, string name)
{
Check.That(element.HasElement(name)).IsTrue();
}
public static void ShouldBeInInNamespace(this XElement element, string _namespace)
{
Check.That(element.Name.NamespaceName).IsEqualTo(_namespace);
}
public static void ShouldBeNamed(this XElement element, string name)
{
Check.That(element.Name.LocalName).IsEqualTo(name);
}
public static void ShouldDeepEquals(this XElement element, XElement other)
{
Assert.IsTrue(
XNode.DeepEquals(element, other),
"Expected:\r\n{0}\r\nActual:\r\n{1}\r\n",
element,
other);
}
}
}
|
apache-2.0
|
C#
|
e9c3cba121655cca081431034348a3fc95059b6f
|
Add #region
|
hidari/WhatNeedToBeDone
|
WhatNeedToBeDone/ViewModels/TodoListViewModel.cs
|
WhatNeedToBeDone/ViewModels/TodoListViewModel.cs
|
using System;
using System.Collections.ObjectModel;
using System.Linq;
using Hidari0415.WhatNeedToBeDone.Common;
using Hidari0415.WhatNeedToBeDone.Models;
namespace Hidari0415.WhatNeedToBeDone.ViewModels
{
public class TodosViewModel: ViewModelBase
{
#region SelectedCount 変更通知プロパティ
private int _SelectedCount;
public int SelectedCount
{
get { return this._SelectedCount; }
set
{
this._SelectedCount = value;
this.RaisePropertyChanged("SelectedCount");
}
}
#endregion
#region UnCompletedCount 変更通知プロパティ
private int _UnCompletedCount;
public int UnCompletedCount
{
get { return _UnCompletedCount; }
set
{
this._UnCompletedCount = value;
this.RaisePropertyChanged("UnCompletedCount");
}
}
#endregion
public ObservableCollection<Todo> Todos { get; set; }
public TodosViewModel()
{
this.Todos = new ObservableCollection<Todo>();
}
#region DeleteSelectedCommand
private DelegateCommand _DeleteSelectedCommand;
public DelegateCommand DeleteSelectedCommand
{
get
{
if (this._DeleteSelectedCommand == null)
{
this._DeleteSelectedCommand = new DelegateCommand(this.DeleteSelected, this.CanDeleteSelected);
}
return this._DeleteSelectedCommand;
}
}
private bool CanDeleteSelected()
{
this.SelectedCount = this.Todos.Count<Todo>((t) => t.IsDone == true);
this.UnCompletedCount = this.Todos.Count - this.SelectedCount;
return this.SelectedCount > 0;
}
private void DeleteSelected()
{
for (int i = this.Todos.Count-1; i >=0 ; i--)
{
if (this.Todos[i].IsDone)
{
this.Todos.Remove(this.Todos[i]);
}
}
}
#endregion
}
}
|
using System;
using System.Collections.ObjectModel;
using System.Linq;
using Hidari0415.WhatNeedToBeDone.Common;
using Hidari0415.WhatNeedToBeDone.Models;
namespace Hidari0415.WhatNeedToBeDone.ViewModels
{
public class TodosViewModel: ViewModelBase
{
#region SelectedCount 変更通知プロパティ
private int _SelectedCount;
public int SelectedCount
{
get { return this._SelectedCount; }
set
{
this._SelectedCount = value;
this.RaisePropertyChanged("SelectedCount");
}
}
#endregion
private int _UnCompletedCount;
public int UnCompletedCount
{
get { return _UnCompletedCount; }
set
{
this._UnCompletedCount = value;
this.RaisePropertyChanged("UnCompletedCount");
}
}
public ObservableCollection<Todo> Todos { get; set; }
public TodosViewModel()
{
this.Todos = new ObservableCollection<Todo>();
}
#region DeleteSelectedCommand
private DelegateCommand _DeleteSelectedCommand;
public DelegateCommand DeleteSelectedCommand
{
get
{
if (this._DeleteSelectedCommand == null)
{
this._DeleteSelectedCommand = new DelegateCommand(this.DeleteSelected, this.CanDeleteSelected);
}
return this._DeleteSelectedCommand;
}
}
private bool CanDeleteSelected()
{
this.SelectedCount = this.Todos.Count<Todo>((t) => t.IsDone == true);
this.UnCompletedCount = this.Todos.Count - this.SelectedCount;
return this.SelectedCount > 0;
}
private void DeleteSelected()
{
for (int i = this.Todos.Count-1; i >=0 ; i--)
{
if (this.Todos[i].IsDone)
{
this.Todos.Remove(this.Todos[i]);
}
}
}
#endregion
}
}
|
mit
|
C#
|
c57fdfa5727a57f5d7b48f2572d0fb85dbfffe31
|
Remove unnecessary null check.
|
bartdesmet/roslyn,KirillOsenkov/roslyn,basoundr/roslyn,DustinCampbell/roslyn,ljw1004/roslyn,brettfo/roslyn,bkoelman/roslyn,AArnott/roslyn,tmeschter/roslyn,budcribar/roslyn,tannergooding/roslyn,panopticoncentral/roslyn,mavasani/roslyn,a-ctor/roslyn,lorcanmooney/roslyn,AnthonyDGreen/roslyn,jasonmalinowski/roslyn,akrisiun/roslyn,paulvanbrenk/roslyn,paulvanbrenk/roslyn,robinsedlaczek/roslyn,tmeschter/roslyn,TyOverby/roslyn,rgani/roslyn,mattscheffer/roslyn,vslsnap/roslyn,AmadeusW/roslyn,mgoertz-msft/roslyn,khellang/roslyn,pdelvo/roslyn,eriawan/roslyn,rgani/roslyn,CyrusNajmabadi/roslyn,SeriaWei/roslyn,stephentoub/roslyn,leppie/roslyn,gafter/roslyn,agocke/roslyn,mmitche/roslyn,nguerrera/roslyn,bartdesmet/roslyn,xasx/roslyn,amcasey/roslyn,srivatsn/roslyn,CaptainHayashi/roslyn,KevinH-MS/roslyn,ericfe-ms/roslyn,davkean/roslyn,Shiney/roslyn,vcsjones/roslyn,ValentinRueda/roslyn,a-ctor/roslyn,KevinRansom/roslyn,ValentinRueda/roslyn,physhi/roslyn,MattWindsor91/roslyn,natidea/roslyn,agocke/roslyn,wvdd007/roslyn,basoundr/roslyn,KevinH-MS/roslyn,tmat/roslyn,jeffanders/roslyn,shyamnamboodiripad/roslyn,MatthieuMEZIL/roslyn,MichalStrehovsky/roslyn,yeaicc/roslyn,drognanar/roslyn,mmitche/roslyn,gafter/roslyn,natidea/roslyn,AmadeusW/roslyn,michalhosala/roslyn,ErikSchierboom/roslyn,jeffanders/roslyn,tvand7093/roslyn,bbarry/roslyn,jhendrixMSFT/roslyn,bbarry/roslyn,stephentoub/roslyn,amcasey/roslyn,leppie/roslyn,Giftednewt/roslyn,jamesqo/roslyn,nguerrera/roslyn,Hosch250/roslyn,eriawan/roslyn,panopticoncentral/roslyn,physhi/roslyn,drognanar/roslyn,budcribar/roslyn,natgla/roslyn,SeriaWei/roslyn,sharadagrawal/Roslyn,xasx/roslyn,tvand7093/roslyn,zooba/roslyn,dotnet/roslyn,diryboy/roslyn,AlekseyTs/roslyn,jkotas/roslyn,cston/roslyn,budcribar/roslyn,khyperia/roslyn,shyamnamboodiripad/roslyn,OmarTawfik/roslyn,jaredpar/roslyn,brettfo/roslyn,OmarTawfik/roslyn,mattscheffer/roslyn,KiloBravoLima/roslyn,reaction1989/roslyn,mavasani/roslyn,davkean/roslyn,vslsnap/roslyn,srivatsn/roslyn,brettfo/roslyn,tannergooding/roslyn,robinsedlaczek/roslyn,dpoeschl/roslyn,sharadagrawal/Roslyn,dotnet/roslyn,vcsjones/roslyn,MattWindsor91/roslyn,weltkante/roslyn,Shiney/roslyn,heejaechang/roslyn,natidea/roslyn,kelltrick/roslyn,zooba/roslyn,wvdd007/roslyn,Hosch250/roslyn,aelij/roslyn,abock/roslyn,gafter/roslyn,ericfe-ms/roslyn,jeffanders/roslyn,drognanar/roslyn,balajikris/roslyn,michalhosala/roslyn,mgoertz-msft/roslyn,AArnott/roslyn,MatthieuMEZIL/roslyn,xasx/roslyn,genlu/roslyn,natgla/roslyn,physhi/roslyn,KevinRansom/roslyn,khellang/roslyn,xoofx/roslyn,jkotas/roslyn,TyOverby/roslyn,Pvlerick/roslyn,jkotas/roslyn,KevinRansom/roslyn,CyrusNajmabadi/roslyn,Giftednewt/roslyn,michalhosala/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,abock/roslyn,ljw1004/roslyn,a-ctor/roslyn,eriawan/roslyn,khyperia/roslyn,AmadeusW/roslyn,lorcanmooney/roslyn,jcouv/roslyn,jamesqo/roslyn,genlu/roslyn,AlekseyTs/roslyn,ericfe-ms/roslyn,KiloBravoLima/roslyn,zooba/roslyn,natgla/roslyn,bkoelman/roslyn,yeaicc/roslyn,cston/roslyn,basoundr/roslyn,diryboy/roslyn,tannergooding/roslyn,jaredpar/roslyn,genlu/roslyn,sharwell/roslyn,VSadov/roslyn,dpoeschl/roslyn,MichalStrehovsky/roslyn,dotnet/roslyn,CaptainHayashi/roslyn,nguerrera/roslyn,Shiney/roslyn,stephentoub/roslyn,sharwell/roslyn,tmeschter/roslyn,swaroop-sridhar/roslyn,reaction1989/roslyn,VSadov/roslyn,khellang/roslyn,jmarolf/roslyn,mmitche/roslyn,kelltrick/roslyn,KiloBravoLima/roslyn,AnthonyDGreen/roslyn,dpoeschl/roslyn,robinsedlaczek/roslyn,Pvlerick/roslyn,jmarolf/roslyn,mgoertz-msft/roslyn,vslsnap/roslyn,jhendrixMSFT/roslyn,ValentinRueda/roslyn,xoofx/roslyn,KirillOsenkov/roslyn,orthoxerox/roslyn,weltkante/roslyn,MattWindsor91/roslyn,bbarry/roslyn,balajikris/roslyn,leppie/roslyn,ErikSchierboom/roslyn,mavasani/roslyn,AArnott/roslyn,MichalStrehovsky/roslyn,jasonmalinowski/roslyn,cston/roslyn,abock/roslyn,akrisiun/roslyn,srivatsn/roslyn,davkean/roslyn,sharadagrawal/Roslyn,sharwell/roslyn,shyamnamboodiripad/roslyn,heejaechang/roslyn,CyrusNajmabadi/roslyn,jasonmalinowski/roslyn,panopticoncentral/roslyn,TyOverby/roslyn,ljw1004/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,mattwar/roslyn,amcasey/roslyn,ErikSchierboom/roslyn,mattwar/roslyn,jcouv/roslyn,akrisiun/roslyn,heejaechang/roslyn,AnthonyDGreen/roslyn,kelltrick/roslyn,DustinCampbell/roslyn,paulvanbrenk/roslyn,jmarolf/roslyn,jcouv/roslyn,tmat/roslyn,vcsjones/roslyn,diryboy/roslyn,jamesqo/roslyn,mattwar/roslyn,pdelvo/roslyn,aelij/roslyn,swaroop-sridhar/roslyn,DustinCampbell/roslyn,Hosch250/roslyn,bartdesmet/roslyn,balajikris/roslyn,SeriaWei/roslyn,agocke/roslyn,xoofx/roslyn,yeaicc/roslyn,bkoelman/roslyn,MatthieuMEZIL/roslyn,AlekseyTs/roslyn,swaroop-sridhar/roslyn,tvand7093/roslyn,pdelvo/roslyn,khyperia/roslyn,OmarTawfik/roslyn,weltkante/roslyn,jaredpar/roslyn,orthoxerox/roslyn,CaptainHayashi/roslyn,Giftednewt/roslyn,KevinH-MS/roslyn,aelij/roslyn,rgani/roslyn,MattWindsor91/roslyn,orthoxerox/roslyn,Pvlerick/roslyn,jhendrixMSFT/roslyn,VSadov/roslyn,lorcanmooney/roslyn,mattscheffer/roslyn,reaction1989/roslyn,tmat/roslyn,wvdd007/roslyn,KirillOsenkov/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008
|
src/Workspaces/Core/Portable/Shared/Extensions/ITypeInferenceServiceExtensions.cs
|
src/Workspaces/Core/Portable/Shared/Extensions/ITypeInferenceServiceExtensions.cs
|
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Linq;
using System.Threading;
using Microsoft.CodeAnalysis.LanguageServices;
using Microsoft.CodeAnalysis.Text;
using Roslyn.Utilities;
namespace Microsoft.CodeAnalysis.Shared.Extensions
{
internal static class ITypeInferenceServiceExtensions
{
public static INamedTypeSymbol InferDelegateType(
this ITypeInferenceService typeInferenceService,
SemanticModel semanticModel,
SyntaxNode expression,
CancellationToken cancellationToken)
{
var types = typeInferenceService.InferTypes(semanticModel, expression, cancellationToken);
var delegateTypes = types.Select(t => t.GetDelegateType(semanticModel.Compilation));
return delegateTypes.WhereNotNull().FirstOrDefault();
}
public static ITypeSymbol InferType(this ITypeInferenceService typeInferenceService,
SemanticModel semanticModel,
SyntaxNode expression,
bool objectAsDefault,
CancellationToken cancellationToken)
{
var types = typeInferenceService.InferTypes(semanticModel, expression, cancellationToken)
.WhereNotNull();
if (!types.Any())
{
return objectAsDefault ? semanticModel.Compilation.ObjectType : null;
}
return types.FirstOrDefault();
}
public static ITypeSymbol InferType(this ITypeInferenceService typeInferenceService,
SemanticModel semanticModel,
int position,
bool objectAsDefault,
CancellationToken cancellationToken)
{
var types = typeInferenceService.InferTypes(semanticModel, position, cancellationToken)
.WhereNotNull();
if (!types.Any())
{
return objectAsDefault ? semanticModel.Compilation.ObjectType : null;
}
return types.FirstOrDefault();
}
}
}
|
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Linq;
using System.Threading;
using Microsoft.CodeAnalysis.LanguageServices;
using Microsoft.CodeAnalysis.Text;
using Roslyn.Utilities;
namespace Microsoft.CodeAnalysis.Shared.Extensions
{
internal static class ITypeInferenceServiceExtensions
{
public static INamedTypeSymbol InferDelegateType(
this ITypeInferenceService typeInferenceService,
SemanticModel semanticModel,
SyntaxNode expression,
CancellationToken cancellationToken)
{
var types = typeInferenceService.InferTypes(semanticModel, expression, cancellationToken);
var delegateTypes = types.Select(t => t?.GetDelegateType(semanticModel.Compilation));
return delegateTypes.WhereNotNull().FirstOrDefault();
}
public static ITypeSymbol InferType(this ITypeInferenceService typeInferenceService,
SemanticModel semanticModel,
SyntaxNode expression,
bool objectAsDefault,
CancellationToken cancellationToken)
{
var types = typeInferenceService.InferTypes(semanticModel, expression, cancellationToken)
.WhereNotNull();
if (!types.Any())
{
return objectAsDefault ? semanticModel.Compilation.ObjectType : null;
}
return types.FirstOrDefault();
}
public static ITypeSymbol InferType(this ITypeInferenceService typeInferenceService,
SemanticModel semanticModel,
int position,
bool objectAsDefault,
CancellationToken cancellationToken)
{
var types = typeInferenceService.InferTypes(semanticModel, position, cancellationToken)
.WhereNotNull();
if (!types.Any())
{
return objectAsDefault ? semanticModel.Compilation.ObjectType : null;
}
return types.FirstOrDefault();
}
}
}
|
mit
|
C#
|
607a24fc896d0ff7cf56898e8cb1a35d13cf33e3
|
Fix class name
|
CamTechConsultants/CvsntGitImporter
|
CvsGitTest/RevisionTest.cs
|
CvsGitTest/RevisionTest.cs
|
/*
* John Hall <john.hall@xjtag.com>
* Copyright (c) Midas Yellow Ltd. All rights reserved.
*/
using System;
using CvsGitConverter;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace CvsGitTest
{
[TestClass]
public class RevisionTest
{
[TestMethod]
public void IsBranch_NonBranchRevision()
{
var r = Revision.Create("1.1");
Assert.IsFalse(r.IsBranch);
}
[TestMethod]
public void IsBranch_BranchRevision()
{
var r = Revision.Create("1.1.0.2");
Assert.IsTrue(r.IsBranch);
}
[TestMethod]
[ExpectedException(typeof(InvalidOperationException))]
public void BranchStem_MainRevision()
{
var r = Revision.Create("1.1");
var stem = r.BranchStem;
}
[TestMethod]
public void BranchStem_BranchRevision()
{
var r = Revision.Create("1.1.2.5");
var expected = Revision.Create("1.1.2");
Assert.AreEqual(r.BranchStem, expected);
}
[TestMethod]
public void BranchStem_Branchpoint()
{
var r = Revision.Create("1.1.0.6");
var expected = Revision.Create("1.1.6");
Assert.AreEqual(r.BranchStem, expected);
}
}
}
|
/*
* John Hall <john.hall@xjtag.com>
* Copyright (c) Midas Yellow Ltd. All rights reserved.
*/
using System;
using CvsGitConverter;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace CvsGitTest
{
[TestClass]
public class UnitTest1
{
[TestMethod]
public void IsBranch_NonBranchRevision()
{
var r = Revision.Create("1.1");
Assert.IsFalse(r.IsBranch);
}
[TestMethod]
public void IsBranch_BranchRevision()
{
var r = Revision.Create("1.1.0.2");
Assert.IsTrue(r.IsBranch);
}
[TestMethod]
[ExpectedException(typeof(InvalidOperationException))]
public void BranchStem_MainRevision()
{
var r = Revision.Create("1.1");
var stem = r.BranchStem;
}
[TestMethod]
public void BranchStem_BranchRevision()
{
var r = Revision.Create("1.1.2.5");
var expected = Revision.Create("1.1.2");
Assert.AreEqual(r.BranchStem, expected);
}
[TestMethod]
public void BranchStem_Branchpoint()
{
var r = Revision.Create("1.1.0.6");
var expected = Revision.Create("1.1.6");
Assert.AreEqual(r.BranchStem, expected);
}
}
}
|
mit
|
C#
|
fd089ec26474c3d87e6cb1f4acdc824af38cbfce
|
Remove AirTime Productions from the component menu
|
bartlomiejwolk/AnimationPathAnimator
|
Editor/ComponentCreator.cs
|
Editor/ComponentCreator.cs
|
/*
* Copyright (c) 2015 Bartłomiej Wołk (bartlomiejwolk@gmail.com).
*
* This file is part of the AnimationPath Animator Unity extension.
* Licensed under the MIT license. See LICENSE file in the project root folder.
*/
using AnimationPathTools.AnimatorComponent;
using AnimationPathTools.AnimatorEventsComponent;
using AnimationPathTools.AnimatorSynchronizerComponent;
using AnimationPathTools.AudioSynchronizerComponent;
using UnityEditor;
namespace AnimationPathTools {
public static class ComponentCreator {
[MenuItem("Component/AnimationPath Animator/AnimationPathAnimator")]
private static void AddAnimationPathAnimatorComponent() {
if (Selection.activeGameObject != null) {
Selection.activeGameObject.AddComponent(typeof(AnimationPathAnimator));
}
}
[MenuItem("Component/AnimationPath Animator/AnimatorEvents")]
private static void AddAnimatorEventsComponent() {
if (Selection.activeGameObject != null) {
Selection.activeGameObject.AddComponent(typeof(AnimatorEvents));
}
}
[MenuItem("Component/AnimationPath Animator/AnimatorSynchronizer")]
private static void AddAnimatorSynchronizerComponent() {
if (Selection.activeGameObject != null) {
Selection.activeGameObject.AddComponent(typeof(AnimatorSynchronizer));
}
}
[MenuItem("Component/AnimationPath Animator/AudioSynchronizer")]
private static void AddAudioSynchronizerComponent() {
if (Selection.activeGameObject != null) {
Selection.activeGameObject.AddComponent(typeof(AudioSynchronizer));
}
}
[MenuItem("Assets/Create/AnimationPath Animator/Animator Settings")]
private static void CreateAnimatorSettingsAsset() {
ScriptableObjectUtility.CreateAsset<AnimatorSettings>("AnimatorSettings");
}
[MenuItem("Assets/Create/AnimationPath Animator/AnimatorEvents Settings")]
private static void CreateAPEventsReflectionSettingsAsset() {
ScriptableObjectUtility.CreateAsset<AnimatorEventsSettings>("AnimatorEventsSettings");
}
[MenuItem("Assets/Create/AnimationPath Animator/Animation Path")]
private static void CreatePathAsset() {
ScriptableObjectUtility.CreateAsset<PathData>("AnimationPath");
}
}
}
|
/*
* Copyright (c) 2015 Bartłomiej Wołk (bartlomiejwolk@gmail.com).
*
* This file is part of the AnimationPath Animator Unity extension.
* Licensed under the MIT license. See LICENSE file in the project root folder.
*/
using AnimationPathTools.AnimatorComponent;
using AnimationPathTools.AnimatorEventsComponent;
using AnimationPathTools.AnimatorSynchronizerComponent;
using AnimationPathTools.AudioSynchronizerComponent;
using UnityEditor;
namespace AnimationPathTools {
public static class ComponentCreator {
[MenuItem("Component/AirTime Productions/AnimationPath Animator/AnimationPathAnimator")]
private static void AddAnimationPathAnimatorComponent() {
if (Selection.activeGameObject != null) {
Selection.activeGameObject.AddComponent(typeof(AnimationPathAnimator));
}
}
[MenuItem("Component/AirTime Productions/AnimationPath Animator/AnimatorEvents")]
private static void AddAnimatorEventsComponent() {
if (Selection.activeGameObject != null) {
Selection.activeGameObject.AddComponent(typeof(AnimatorEvents));
}
}
[MenuItem("Component/AirTime Productions/AnimationPath Animator/AnimatorSynchronizer")]
private static void AddAnimatorSynchronizerComponent() {
if (Selection.activeGameObject != null) {
Selection.activeGameObject.AddComponent(typeof(AnimatorSynchronizer));
}
}
[MenuItem("Component/AirTime Productions/AnimationPath Animator/AudioSynchronizer")]
private static void AddAudioSynchronizerComponent() {
if (Selection.activeGameObject != null) {
Selection.activeGameObject.AddComponent(typeof(AudioSynchronizer));
}
}
[MenuItem("Assets/Create/AirTime Productions/AnimationPath Animator/Animator Settings")]
private static void CreateAnimatorSettingsAsset() {
ScriptableObjectUtility.CreateAsset<AnimatorSettings>("AnimatorSettings");
}
[MenuItem("Assets/Create/AirTime Productions/AnimationPath Animator/AnimatorEvents Settings")]
private static void CreateAPEventsReflectionSettingsAsset() {
ScriptableObjectUtility.CreateAsset<AnimatorEventsSettings>("AnimatorEventsSettings");
}
[MenuItem("Assets/Create/AirTime Productions/AnimationPath Animator/Animation Path")]
private static void CreatePathAsset() {
ScriptableObjectUtility.CreateAsset<PathData>("AnimationPath");
}
}
}
|
mit
|
C#
|
00441f7be5573ae5d44b90d9f82a5826dcaf3e5f
|
更新版本号,Cache.Memcached v1.1.0 支持 .NET Core 2.0
|
JeffreySu/WeiXinMPSDK,lishewen/WeiXinMPSDK,lishewen/WeiXinMPSDK,jiehanlin/WeiXinMPSDK,down4u/WeiXinMPSDK,JeffreySu/WeiXinMPSDK,jiehanlin/WeiXinMPSDK,mc7246/WeiXinMPSDK,down4u/WeiXinMPSDK,mc7246/WeiXinMPSDK,down4u/WeiXinMPSDK,JeffreySu/WeiXinMPSDK,jiehanlin/WeiXinMPSDK,mc7246/WeiXinMPSDK,lishewen/WeiXinMPSDK
|
src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Memcached/Properties/AssemblyInfo.cs
|
src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Memcached/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Senparc.Weixin.Cache.Memcached")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Senparc.Weixin.Cache.Memcached")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//将 ComVisible 设置为 false 将使此程序集中的类型
//对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("5b729497-5323-41d7-a104-0632119bedde")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.0.*")]
//[assembly: AssemblyFileVersion("1.0.0.0")]
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Senparc.Weixin.Cache.Memcached")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Senparc.Weixin.Cache.Memcached")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//将 ComVisible 设置为 false 将使此程序集中的类型
//对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("5b729497-5323-41d7-a104-0632119bedde")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.3.0.*")]
//[assembly: AssemblyFileVersion("1.0.0.0")]
|
apache-2.0
|
C#
|
58c9655c4d883c56f232e070f46e45d30abb3beb
|
Fix RuntimeInformation tests according to the platform runs.
|
ericstj/corefx,billwert/corefx,krytarowski/corefx,BrennanConroy/corefx,ptoonen/corefx,nbarbettini/corefx,Jiayili1/corefx,stephenmichaelf/corefx,dhoehna/corefx,dotnet-bot/corefx,ravimeda/corefx,ptoonen/corefx,Ermiar/corefx,tijoytom/corefx,rahku/corefx,JosephTremoulet/corefx,zhenlan/corefx,wtgodbe/corefx,the-dwyer/corefx,weltkante/corefx,MaggieTsang/corefx,shimingsg/corefx,cydhaselton/corefx,yizhang82/corefx,shmao/corefx,ptoonen/corefx,krk/corefx,richlander/corefx,nchikanov/corefx,wtgodbe/corefx,Petermarcu/corefx,stone-li/corefx,nbarbettini/corefx,marksmeltzer/corefx,dotnet-bot/corefx,DnlHarvey/corefx,ptoonen/corefx,marksmeltzer/corefx,ravimeda/corefx,ravimeda/corefx,wtgodbe/corefx,marksmeltzer/corefx,jlin177/corefx,krytarowski/corefx,dhoehna/corefx,mazong1123/corefx,weltkante/corefx,billwert/corefx,cydhaselton/corefx,parjong/corefx,parjong/corefx,shmao/corefx,DnlHarvey/corefx,YoupHulsebos/corefx,the-dwyer/corefx,richlander/corefx,Ermiar/corefx,tijoytom/corefx,stone-li/corefx,DnlHarvey/corefx,parjong/corefx,krk/corefx,dhoehna/corefx,zhenlan/corefx,twsouthwick/corefx,lggomez/corefx,rahku/corefx,Ermiar/corefx,krytarowski/corefx,Ermiar/corefx,rjxby/corefx,zhenlan/corefx,DnlHarvey/corefx,jlin177/corefx,wtgodbe/corefx,shmao/corefx,alexperovich/corefx,lggomez/corefx,shmao/corefx,weltkante/corefx,alexperovich/corefx,krk/corefx,the-dwyer/corefx,yizhang82/corefx,Jiayili1/corefx,yizhang82/corefx,dhoehna/corefx,billwert/corefx,stephenmichaelf/corefx,nbarbettini/corefx,axelheer/corefx,alexperovich/corefx,dotnet-bot/corefx,gkhanna79/corefx,rubo/corefx,lggomez/corefx,seanshpark/corefx,lggomez/corefx,MaggieTsang/corefx,marksmeltzer/corefx,shimingsg/corefx,Jiayili1/corefx,elijah6/corefx,tijoytom/corefx,ptoonen/corefx,stone-li/corefx,krytarowski/corefx,dotnet-bot/corefx,fgreinacher/corefx,mmitche/corefx,mazong1123/corefx,ericstj/corefx,twsouthwick/corefx,ericstj/corefx,mmitche/corefx,ericstj/corefx,yizhang82/corefx,elijah6/corefx,fgreinacher/corefx,YoupHulsebos/corefx,mazong1123/corefx,rjxby/corefx,ptoonen/corefx,yizhang82/corefx,zhenlan/corefx,alexperovich/corefx,billwert/corefx,parjong/corefx,axelheer/corefx,mmitche/corefx,seanshpark/corefx,ptoonen/corefx,nbarbettini/corefx,nchikanov/corefx,BrennanConroy/corefx,krytarowski/corefx,nchikanov/corefx,alexperovich/corefx,shimingsg/corefx,cydhaselton/corefx,JosephTremoulet/corefx,nchikanov/corefx,fgreinacher/corefx,Jiayili1/corefx,axelheer/corefx,twsouthwick/corefx,Petermarcu/corefx,YoupHulsebos/corefx,dotnet-bot/corefx,nbarbettini/corefx,shimingsg/corefx,Petermarcu/corefx,zhenlan/corefx,stone-li/corefx,stephenmichaelf/corefx,seanshpark/corefx,DnlHarvey/corefx,zhenlan/corefx,mmitche/corefx,shmao/corefx,fgreinacher/corefx,weltkante/corefx,billwert/corefx,nbarbettini/corefx,JosephTremoulet/corefx,mmitche/corefx,yizhang82/corefx,rubo/corefx,rahku/corefx,ravimeda/corefx,stone-li/corefx,richlander/corefx,alexperovich/corefx,ericstj/corefx,rahku/corefx,rjxby/corefx,rahku/corefx,ViktorHofer/corefx,gkhanna79/corefx,ericstj/corefx,the-dwyer/corefx,tijoytom/corefx,dotnet-bot/corefx,stephenmichaelf/corefx,gkhanna79/corefx,twsouthwick/corefx,the-dwyer/corefx,dotnet-bot/corefx,Petermarcu/corefx,twsouthwick/corefx,JosephTremoulet/corefx,dhoehna/corefx,gkhanna79/corefx,marksmeltzer/corefx,Petermarcu/corefx,DnlHarvey/corefx,marksmeltzer/corefx,weltkante/corefx,shmao/corefx,Petermarcu/corefx,rjxby/corefx,ViktorHofer/corefx,DnlHarvey/corefx,twsouthwick/corefx,krk/corefx,Jiayili1/corefx,ericstj/corefx,nchikanov/corefx,JosephTremoulet/corefx,yizhang82/corefx,seanshpark/corefx,shimingsg/corefx,cydhaselton/corefx,elijah6/corefx,richlander/corefx,richlander/corefx,ravimeda/corefx,tijoytom/corefx,axelheer/corefx,shmao/corefx,MaggieTsang/corefx,elijah6/corefx,ViktorHofer/corefx,gkhanna79/corefx,cydhaselton/corefx,dhoehna/corefx,MaggieTsang/corefx,shimingsg/corefx,zhenlan/corefx,seanshpark/corefx,rubo/corefx,Petermarcu/corefx,gkhanna79/corefx,lggomez/corefx,jlin177/corefx,rjxby/corefx,krk/corefx,lggomez/corefx,richlander/corefx,mazong1123/corefx,cydhaselton/corefx,krk/corefx,Ermiar/corefx,nbarbettini/corefx,cydhaselton/corefx,BrennanConroy/corefx,seanshpark/corefx,mazong1123/corefx,MaggieTsang/corefx,jlin177/corefx,parjong/corefx,twsouthwick/corefx,gkhanna79/corefx,the-dwyer/corefx,mazong1123/corefx,nchikanov/corefx,elijah6/corefx,stephenmichaelf/corefx,rahku/corefx,YoupHulsebos/corefx,jlin177/corefx,rubo/corefx,richlander/corefx,stephenmichaelf/corefx,MaggieTsang/corefx,jlin177/corefx,axelheer/corefx,krk/corefx,mmitche/corefx,ravimeda/corefx,rjxby/corefx,stone-li/corefx,MaggieTsang/corefx,rubo/corefx,Ermiar/corefx,nchikanov/corefx,ViktorHofer/corefx,ViktorHofer/corefx,jlin177/corefx,krytarowski/corefx,stone-li/corefx,tijoytom/corefx,JosephTremoulet/corefx,axelheer/corefx,mmitche/corefx,stephenmichaelf/corefx,marksmeltzer/corefx,tijoytom/corefx,shimingsg/corefx,wtgodbe/corefx,JosephTremoulet/corefx,Ermiar/corefx,wtgodbe/corefx,YoupHulsebos/corefx,ViktorHofer/corefx,mazong1123/corefx,rjxby/corefx,YoupHulsebos/corefx,weltkante/corefx,billwert/corefx,dhoehna/corefx,ViktorHofer/corefx,alexperovich/corefx,ravimeda/corefx,elijah6/corefx,wtgodbe/corefx,seanshpark/corefx,parjong/corefx,rahku/corefx,elijah6/corefx,billwert/corefx,YoupHulsebos/corefx,parjong/corefx,weltkante/corefx,the-dwyer/corefx,krytarowski/corefx,Jiayili1/corefx,lggomez/corefx,Jiayili1/corefx
|
src/System.Runtime.InteropServices.RuntimeInformation/tests/DescriptionNameTests.cs
|
src/System.Runtime.InteropServices.RuntimeInformation/tests/DescriptionNameTests.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Reflection;
using Xunit;
namespace System.Runtime.InteropServices.RuntimeInformationTests
{
public class DescriptionNameTests
{
[Fact]
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework | TargetFrameworkMonikers.NetcoreUwp)]
public void VerifyRuntimeDebugNameOnNetCoreApp()
{
AssemblyFileVersionAttribute attr = (AssemblyFileVersionAttribute)(typeof(object).GetTypeInfo().Assembly.GetCustomAttribute(typeof(AssemblyFileVersionAttribute)));
string expected = string.Format(".NET Core {0}", attr.Version);
Assert.Equal(expected, RuntimeInformation.FrameworkDescription);
Assert.Same(RuntimeInformation.FrameworkDescription, RuntimeInformation.FrameworkDescription);
}
[Fact]
[SkipOnTargetFramework(TargetFrameworkMonikers.Netcoreapp | TargetFrameworkMonikers.NetcoreUwp)]
public void VerifyRuntimeDebugNameOnNetFramework()
{
AssemblyFileVersionAttribute attr = (AssemblyFileVersionAttribute)(typeof(object).GetTypeInfo().Assembly.GetCustomAttribute(typeof(AssemblyFileVersionAttribute)));
string expected = string.Format(".NET Framework {0}", attr.Version);
Assert.Equal(expected, RuntimeInformation.FrameworkDescription);
Assert.Same(RuntimeInformation.FrameworkDescription, RuntimeInformation.FrameworkDescription);
}
[Fact]
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework | TargetFrameworkMonikers.Netcoreapp)]
public void VerifyRuntimeDebugNameOnNetCoreUwp()
{
AssemblyFileVersionAttribute attr = (AssemblyFileVersionAttribute)(typeof(object).GetTypeInfo().Assembly.GetCustomAttribute(typeof(AssemblyFileVersionAttribute)));
string expected = string.Format(".NET Native {0}", attr.Version);
Assert.Equal(expected, RuntimeInformation.FrameworkDescription);
Assert.Same(RuntimeInformation.FrameworkDescription, RuntimeInformation.FrameworkDescription);
}
[Fact]
public void VerifyOSDescription()
{
Assert.NotNull(RuntimeInformation.OSDescription);
Assert.Same(RuntimeInformation.OSDescription, RuntimeInformation.OSDescription);
}
[Fact, PlatformSpecific(PlatformID.Windows)]
public void VerifyWindowsDebugName()
{
Assert.Contains("windows", RuntimeInformation.OSDescription, StringComparison.OrdinalIgnoreCase);
}
[Fact, PlatformSpecific(PlatformID.Linux)]
public void VerifyLinuxDebugName()
{
Assert.Contains("linux", RuntimeInformation.OSDescription, StringComparison.OrdinalIgnoreCase);
}
[Fact, PlatformSpecific(PlatformID.NetBSD)]
public void VerifyNetBSDDebugName()
{
Assert.Contains("netbsd", RuntimeInformation.OSDescription, StringComparison.OrdinalIgnoreCase);
}
[Fact, PlatformSpecific(PlatformID.OSX)]
public void VerifyOSXDebugName()
{
Assert.Contains("darwin", RuntimeInformation.OSDescription, StringComparison.OrdinalIgnoreCase);
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Reflection;
using Xunit;
namespace System.Runtime.InteropServices.RuntimeInformationTests
{
public class DescriptionNameTests
{
[Fact]
public void VerifyRuntimeDebugName()
{
AssemblyFileVersionAttribute attr = (AssemblyFileVersionAttribute)(typeof(object).GetTypeInfo().Assembly.GetCustomAttribute(typeof(AssemblyFileVersionAttribute)));
string expected = string.Format(".NET Core {0}", attr.Version);
Assert.Equal(expected, RuntimeInformation.FrameworkDescription);
Assert.Same(RuntimeInformation.FrameworkDescription, RuntimeInformation.FrameworkDescription);
}
[Fact]
public void VerifyOSDescription()
{
Assert.NotNull(RuntimeInformation.OSDescription);
Assert.Same(RuntimeInformation.OSDescription, RuntimeInformation.OSDescription);
}
[Fact, PlatformSpecific(PlatformID.Windows)]
public void VerifyWindowsDebugName()
{
Assert.Contains("windows", RuntimeInformation.OSDescription, StringComparison.OrdinalIgnoreCase);
}
[Fact, PlatformSpecific(PlatformID.Linux)]
public void VerifyLinuxDebugName()
{
Assert.Contains("linux", RuntimeInformation.OSDescription, StringComparison.OrdinalIgnoreCase);
}
[Fact, PlatformSpecific(PlatformID.NetBSD)]
public void VerifyNetBSDDebugName()
{
Assert.Contains("netbsd", RuntimeInformation.OSDescription, StringComparison.OrdinalIgnoreCase);
}
[Fact, PlatformSpecific(PlatformID.OSX)]
public void VerifyOSXDebugName()
{
Assert.Contains("darwin", RuntimeInformation.OSDescription, StringComparison.OrdinalIgnoreCase);
}
}
}
|
mit
|
C#
|
b3067e8dbc3b8277d657223b1a70a210cc3e1348
|
Delete an incomplete function from CubeBox script
|
RokKos/DragonHack2017
|
Assets/Scripts/CubeBox.cs
|
Assets/Scripts/CubeBox.cs
|
//Author: Rok Kos<kosrok97@gmail.com>
//File: CubeBox.cs
//File path: /D/Documents/Unity/DragonHack2017/CubeBox.cs
//Date: 20.05.2017
//Description: Scipt that controls cube box (9x9)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class CubeBox : MonoBehaviour {
public List<Button> otroci;
public int pozicija = -1;
public int stanje = 0; // 0 - empty, 1 - player 1, 2 - player 2
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
public bool triVVrsto () {
// Check rows
for (int i = 0; i < 3; ++i) {
if (otroci[i * 3].GetComponent<box_script>().stanje != 0 && otroci[i*3].GetComponent<box_script>().stanje == otroci[i * 3 + 1].GetComponent<box_script>().stanje && otroci[i * 3].GetComponent<box_script>().stanje == otroci[i * 3 + 2].GetComponent<box_script>().stanje) {
return true;
}
}
// Check columns
for (int i = 0; i < 3; ++i) {
if (otroci[i].GetComponent<box_script>().stanje != 0 && otroci[i].GetComponent<box_script>().stanje == otroci[i + 3].GetComponent<box_script>().stanje && otroci[i].GetComponent<box_script>().stanje == otroci[i + 6].GetComponent<box_script>().stanje) {
return true;
}
}
// Check diagonals
if (otroci[0].GetComponent<box_script>().stanje != 0 && otroci[0].GetComponent<box_script>().stanje == otroci[4].GetComponent<box_script>().stanje && otroci[0].GetComponent<box_script>().stanje == otroci[8].GetComponent<box_script>().stanje) {
return true;
}
if (otroci[2].GetComponent<box_script>().stanje != 0 && otroci[2].GetComponent<box_script>().stanje == otroci[4].GetComponent<box_script>().stanje && otroci[2].GetComponent<box_script>().stanje == otroci[6].GetComponent<box_script>().stanje) {
return true;
}
return false;
}
public void izpisiOtroke () {
for (int i = 0; i < 9; ++i) {
Debug.Log(i + " :" + otroci[i].GetComponent<box_script>().stanje);
}
}
}
|
//Author: Rok Kos<kosrok97@gmail.com>
//File: CubeBox.cs
//File path: /D/Documents/Unity/DragonHack2017/CubeBox.cs
//Date: 20.05.2017
//Description: Scipt that controls cube box (9x9)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class CubeBox : MonoBehaviour {
public List<Button> otroci;
public int pozicija = -1;
public int stanje = 0; // 0 - empty, 1 - player 1, 2 - player 2
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
public bool triVVrsto () {
// Check rows
for (int i = 0; i < 3; ++i) {
if (otroci[i * 3].GetComponent<box_script>().stanje != 0 && otroci[i*3].GetComponent<box_script>().stanje == otroci[i * 3 + 1].GetComponent<box_script>().stanje && otroci[i * 3].GetComponent<box_script>().stanje == otroci[i * 3 + 2].GetComponent<box_script>().stanje) {
return true;
}
}
// Check columns
for (int i = 0; i < 3; ++i) {
if (otroci[i].GetComponent<box_script>().stanje != 0 && otroci[i].GetComponent<box_script>().stanje == otroci[i + 3].GetComponent<box_script>().stanje && otroci[i].GetComponent<box_script>().stanje == otroci[i + 6].GetComponent<box_script>().stanje) {
return true;
}
}
// Check diagonals
if (otroci[0].GetComponent<box_script>().stanje != 0 && otroci[0].GetComponent<box_script>().stanje == otroci[4].GetComponent<box_script>().stanje && otroci[0].GetComponent<box_script>().stanje == otroci[8].GetComponent<box_script>().stanje) {
return true;
}
if (otroci[2].GetComponent<box_script>().stanje != 0 && otroci[2].GetComponent<box_script>().stanje == otroci[4].GetComponent<box_script>().stanje && otroci[2].GetComponent<box_script>().stanje == otroci[6].GetComponent<box_script>().stanje) {
return true;
}
return false;
}
public void izpisiOtroke () {
for (int i = 0; i < 9; ++i) {
Debug.Log(i + " :" + otroci[i].GetComponent<box_script>().stanje);
}
}
public IEnumerator fadeAnimacija() {
}
}
|
mit
|
C#
|
d23a6321768c8ad3cdb7d82f66b4905678751008
|
Expand bird flock randomization on forward axis
|
christiancrt/POVbird,christiancrt/POVbird
|
Flock/Assets/BirdTarget.cs
|
Flock/Assets/BirdTarget.cs
|
using UnityEngine;
using System.Collections;
public class BirdTarget : MonoBehaviour {
[SerializeField]
private int _flockSize = 5;
[SerializeField]
private GameObject _birdPrefab;
[SerializeField] private Vector3[] _path;
public Vector3[] Path { get { return _path; }}
private int _targetNode = 0;
public float Speed = 1.0f;
public Vector3 CurrentDir;
private float _sqrPositionEps = 0.2f; // Squared threshold for checking if we reached a node.
// Flock properties
public float DirChangeDeltaTime = 1.0f; // Time after which random direction changes should occur
public float MinDistance = 1f;
public float MaxDistance = 5f;
public float MaxHeadingDeviation = 30f; // degrees
public float MaxSpeedDeviation = 0.5f;
void NextTargetNode () {
_targetNode = (_targetNode + 1) % _path.Length;
CurrentDir = (_path[_targetNode] - transform.position).normalized;
}
// Use this for initialization
void Start () {
if (_path.Length < 2) {
throw new UnityException ("Not enough path nodes!");
}
transform.position = _path[0];
NextTargetNode ();
for (int i = 0; i < _flockSize; i++) {
Vector3 position = transform.position;
position.x += Random.Range (-5f, 5f);
position.y += Random.Range (-5f, 5f);
position.z += Random.Range (-5f, 5f);
GameObject newBird = (GameObject)Instantiate (_birdPrefab, position, transform.rotation);
newBird.GetComponent<BirdBehaviour> ().Target = gameObject;
}
}
// Update is called once per frame
void FixedUpdate () {
if ((_path[_targetNode] - transform.position).sqrMagnitude < _sqrPositionEps) {
NextTargetNode ();
}
transform.position += CurrentDir * Speed * Time.fixedDeltaTime;
}
}
|
using UnityEngine;
using System.Collections;
public class BirdTarget : MonoBehaviour {
[SerializeField]
private int _flockSize = 5;
[SerializeField]
private GameObject _birdPrefab;
[SerializeField] private Vector3[] _path;
public Vector3[] Path { get { return _path; }}
private int _targetNode = 0;
public float Speed = 1.0f;
public Vector3 CurrentDir;
private float _sqrPositionEps = 0.2f; // Squared threshold for checking if we reached a node.
// Flock properties
public float DirChangeDeltaTime = 1.0f; // Time after which random direction changes should occur
public float MinDistance = 1f;
public float MaxDistance = 5f;
public float MaxHeadingDeviation = 30f; // degrees
public float MaxSpeedDeviation = 0.5f;
void NextTargetNode () {
_targetNode = (_targetNode + 1) % _path.Length;
CurrentDir = (_path[_targetNode] - transform.position).normalized;
}
// Use this for initialization
void Start () {
if (_path.Length < 2) {
throw new UnityException ("Not enough path nodes!");
}
transform.position = _path[0];
NextTargetNode ();
for (int i = 0; i < _flockSize; i++) {
Vector3 position = transform.position;
position.x += Random.Range (-.2f, .2f);
position.y += Random.Range (-5f, 5f);
position.z += Random.Range (-5f, 5f);
GameObject newBird = (GameObject)Instantiate (_birdPrefab, position, transform.rotation);
newBird.GetComponent<BirdBehaviour> ().Target = gameObject;
}
}
// Update is called once per frame
void FixedUpdate () {
if ((_path[_targetNode] - transform.position).sqrMagnitude < _sqrPositionEps) {
NextTargetNode ();
}
transform.position += CurrentDir * Speed * Time.fixedDeltaTime;
}
}
|
cc0-1.0
|
C#
|
c2e2f04e26a1a52d84630d4cf8147062ff7773bb
|
Synchronize version with Nuget
|
cnurse/Naif.Data
|
src/Naif.Data/Properties/AssemblyInfo.cs
|
src/Naif.Data/Properties/AssemblyInfo.cs
|
using System.Reflection;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Naif.Data")]
[assembly: AssemblyDescription("Naif.Data")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Naif.Data")]
[assembly: AssemblyCopyright("Charles Nurse © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]
|
using System.Reflection;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Naif.Data")]
[assembly: AssemblyDescription("Naif.Data")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Naif.Data")]
[assembly: AssemblyCopyright("Charles Nurse © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
|
mit
|
C#
|
c492dbb492db2ad1f8eb7efb80a3fe3ed2daf919
|
fix bug
|
marihachi/MSharp
|
src/MSharp/Entity/Status.cs
|
src/MSharp/Entity/Status.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MSharp.Core.Utility;
namespace MSharp.Entity
{
/// <summary>
/// ステータスオブジェクトを表します。
/// </summary>
public class Status
{
/// <summary>
/// 新しいインスタンスを生成します。
/// </summary>
/// <param name="jsonString">UserオブジェクトのJSON文字列</param>
public Status(string jsonString)
{
var j = Json.Parse(jsonString);
this.AppId = j.appId.Value;
this.CreatedAt = null; //j.createdAt.Value;
this.Cursor = j.cursor.Value;
this.DisplayCreatedAt = j.displayCreatedAt.Value;
this.FavoritesCount = j.favoritesCount.Value;
this.Id = j.id.Value;
this.ImageUrls = new List<Uri>();
foreach (var imageUrl in j.imageUrls)
this.ImageUrls.Add(new Uri(imageUrl.Value));
this.InReplyToStatusId = j.inReplyToStatusId.Value;
this.IsImageAttached = j.isImageAttached.Value;
this.IsReply = j.isReply.Value;
this.IsRepostToStatus = j.isRepostToStatus.Value;
this.Replies = new List<string>();
foreach (var replie in j.replies)
if (replie.id != null)
this.Replies.Add(replie.id.Value);
else
this.Replies.Add(replie.Value);
this.RepliesCount = j.repliesCount.Value;
this.RepostFromStatusId = j.repostFromStatusId.Value;
this.RepostsCount = j.repostsCount.Value;
this.Tags = new List<string>();
foreach (var tag in j.tags)
this.Tags.Add(tag.Value);
this.Text = j.text.Value;
this.User = j.user != null ? new User(j.user.ToString()) : null;
this.UserId = j.userId.Value;
}
public string AppId { set; get; }
public DateTime? CreatedAt { set; get; }
public int? Cursor { private set; get; }
public string DisplayCreatedAt { set; get; }
public int FavoritesCount { set; get; }
public string Id { set; get; }
public List<Uri> ImageUrls { set; get; }
public string InReplyToStatusId { set; get; }
public bool IsImageAttached { set; get; }
public bool IsReply { set; get; }
public bool IsRepostToStatus { set; get; }
/// <summary>
/// そのステータスへの返信ID
/// </summary>
public List<string> Replies { set; get; }
public int RepliesCount { set; get; }
public string RepostFromStatusId { set; get; }
public int RepostsCount { set; get; }
public List<string> Tags { set; get; }
public string Text { private set; get; }
public User User { set; get; }
public string UserId { private set; get; }
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MSharp.Core.Utility;
namespace MSharp.Entity
{
/// <summary>
/// ステータスオブジェクトを表します。
/// </summary>
public class Status
{
/// <summary>
/// 新しいインスタンスを生成します。
/// </summary>
/// <param name="jsonString">UserオブジェクトのJSON文字列</param>
public Status(string jsonString)
{
var j = Json.Parse(jsonString);
this.AppId = j.appId.Value;
this.CreatedAt = null; //j.createdAt.Value;
this.Cursor = j.cursor.Value;
this.DisplayCreatedAt = j.displayCreatedAt.Value;
this.FavoritesCount = j.favoritesCount.Value;
this.Id = j.id.Value;
this.ImageUrls = new List<Uri>();
foreach (var imageUrl in j.imageUrls)
this.ImageUrls.Add(new Uri(imageUrl.Value));
this.InReplyToStatusId = j.inReplyToStatusId.Value;
this.IsImageAttached = j.isImageAttached.Value;
this.IsReply = j.isReply.Value;
this.IsRepostToStatus = j.isRepostToStatus.Value;
this.Replies = new List<string>();
foreach (var replie in j.replies)
if (replie.id != null)
this.Replies.Add(replie.id.Value);
else
this.Replies.Add(replie.Value);
this.RepliesCount = j.repliesCount.Value;
this.RepostFromStatusId = j.repostFromStatusId.Value;
this.RepostsCount = j.repostsCount.Value;
this.Tags = new List<string>();
foreach (var tag in j.tags)
this.Tags.Add(tag.Value);
this.Text = j.text.Value;
this.User = j.user.Value != null ? new User(j.user.Value) : null;
this.UserId = j.userId.Value;
}
public string AppId { set; get; }
public DateTime? CreatedAt { set; get; }
public int? Cursor { private set; get; }
public string DisplayCreatedAt { set; get; }
public int FavoritesCount { set; get; }
public string Id { set; get; }
public List<Uri> ImageUrls { set; get; }
public string InReplyToStatusId { set; get; }
public bool IsImageAttached { set; get; }
public bool IsReply { set; get; }
public bool IsRepostToStatus { set; get; }
/// <summary>
/// そのステータスへの返信ID
/// </summary>
public List<string> Replies { set; get; }
public int RepliesCount { set; get; }
public string RepostFromStatusId { set; get; }
public int RepostsCount { set; get; }
public List<string> Tags { set; get; }
public string Text { private set; get; }
public User User { set; get; }
public string UserId { private set; get; }
}
}
|
mit
|
C#
|
5efa635c31cb468136765e2a9ed768a7cc7dea94
|
Bump version to 0.0.2
|
queueRAM/BlastCorpsEditor
|
BlastCorpsEditor/Properties/AssemblyInfo.cs
|
BlastCorpsEditor/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Blast Corps Editor")]
[assembly: AssemblyDescription("Blast Corps Level Editor")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("queueRAM")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("Copyright ©queueRAM 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("ce279bd5-c8bb-4e2a-bfbe-8b7afe57cc33")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.2.0")]
[assembly: AssemblyFileVersion("0.0.2.0")]
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Blast Corps Editor")]
[assembly: AssemblyDescription("Blast Corps Level Editor")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("queueRAM")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("Copyright ©queueRAM 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("ce279bd5-c8bb-4e2a-bfbe-8b7afe57cc33")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.1.0")]
[assembly: AssemblyFileVersion("0.0.1.0")]
|
mit
|
C#
|
76bd0da2015cd943dfec4cc399f055cab3ad71ed
|
Add code to calculate NTLM hashes
|
fredatgithub/UsefulFunctions
|
ConsoleAppNTLM/Program.cs
|
ConsoleAppNTLM/Program.cs
|
using FonctionsUtiles.Fred.Csharp;
using System;
using System.Collections.Generic;
namespace ConsoleAppNTLM
{
class Program
{
static void Main()
{
Action<string> display = Console.WriteLine;
ulong count = 0;
bool addToListe = false;
List<string> liste = new List<string>();
string alphabet = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ&é'(-è_çà)=$£*%âêîôûù,;:!?./\\§%µä+°€@<>";
for (int i = 0; i < alphabet.Length; i++)
{
count++;
display($"{alphabet[i]} = {FunctionsCrypto.Ntlm(alphabet[i].ToString())}");
if (addToListe)
{
liste.Add($"{alphabet[i]};{FunctionsCrypto.Ntlm(alphabet[i].ToString())}");
}
}
// 101 NTLM calculated so far with 1 character
for (int i = 0; i < alphabet.Length; i++)
{
for (int j = 0; j < alphabet.Length; j++)
{
count++;
display($"{alphabet[i]}{alphabet[j]} = {FunctionsCrypto.Ntlm(alphabet[i].ToString() + alphabet[j].ToString())}");
if (addToListe)
{
liste.Add($"{alphabet[i]}{alphabet[j]};{FunctionsCrypto.Ntlm(alphabet[i].ToString() + alphabet[j].ToString())}");
}
}
}
//// 10 302 NTLM calculated so far with 2 characters
for (int i = 0; i < alphabet.Length; i++)
{
for (int j = 0; j < alphabet.Length; j++)
{
for (int k = 0; k < alphabet.Length; k++)
{
count++;
display($"{alphabet[i]}{alphabet[j]}{alphabet[k]} = {FunctionsCrypto.Ntlm(alphabet[i].ToString() + alphabet[j].ToString() + alphabet[k].ToString())}");
if (addToListe)
{
liste.Add($"{alphabet[i]}{alphabet[j]}{alphabet[k]};{FunctionsCrypto.Ntlm(alphabet[i].ToString() + alphabet[j].ToString() + alphabet[k].ToString())}");
}
}
}
}
//// 1 040 603 NTLM calculated so far with 3 characters
for (int i = 0; i < alphabet.Length; i++)
{
for (int j = 0; j < alphabet.Length; j++)
{
for (int k = 0; k < alphabet.Length; k++)
{
for (int l = 0; l < alphabet.Length; l++)
{
count++;
display($"{alphabet[i]}{alphabet[j]}{alphabet[k]}{alphabet[l]} = {FunctionsCrypto.Ntlm(alphabet[i].ToString() + alphabet[j].ToString() + alphabet[k].ToString() + alphabet[l].ToString())}");
if (addToListe)
{
liste.Add($"{alphabet[i]}{alphabet[j]}{alphabet[k]}{alphabet[l]} = {FunctionsCrypto.Ntlm(alphabet[i].ToString() + alphabet[j].ToString() + alphabet[k].ToString() + alphabet[l].ToString())}");
}
}
}
}
}
// 105 101 004 NTLM calculated so far with 4 characters //out of memory error at 3.6 GB console app if addToListe = true
display(string.Empty);
display($"There are {count} NTLM hash calculated.");
display(string.Empty);
display("Press any key to exit:");
Console.ReadKey();
}
}
}
|
using FonctionsUtiles.Fred.Csharp;
using System;
namespace ConsoleAppNTLM
{
class Program
{
static void Main(string[] args)
{
Action<string> display = Console.WriteLine;
string alphabet = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ&é'(-è_çà)=$£*%â";
for (int i = 0; i < alphabet.Length; i++)
{
display($"{alphabet[i]} = {FunctionsCrypto.Ntlm(alphabet[i].ToString())}");
}
display("Press any key to exit:");
Console.ReadKey();
}
}
}
|
mit
|
C#
|
6d406181780948b5ab68da3f5c9ef8bd4e53713a
|
Bump to version 0.6
|
cameronism/ConsoleDump
|
ConsoleDump/Properties/AssemblyInfo.cs
|
ConsoleDump/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ConsoleDump")]
[assembly: AssemblyDescription(".Dump() extension method to visualize your collections and objects in color at the console.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("cameronism")]
[assembly: AssemblyProduct("ConsoleDump")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("b3301164-424b-4f08-8c3b-2ec01334b870")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.6.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ConsoleDump")]
[assembly: AssemblyDescription(".Dump() extension method to visualize your collections and objects in color at the console.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("cameronism")]
[assembly: AssemblyProduct("ConsoleDump")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("b3301164-424b-4f08-8c3b-2ec01334b870")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.5.*")]
[assembly: AssemblyFileVersion("1.0.0.0")]
|
apache-2.0
|
C#
|
2e44bd076d3b325ba477a680c2929672740d40b8
|
Add graduate flag as additional property
|
seekasia-oss/jobstreet-ad-posting-api-client
|
src/SEEK.AdPostingApi.Client/Models/AdditionalPropertyType.cs
|
src/SEEK.AdPostingApi.Client/Models/AdditionalPropertyType.cs
|
namespace SEEK.AdPostingApi.Client.Models
{
public enum AdditionalPropertyType
{
ResidentsOnly = 1,
Graduate
}
}
|
namespace SEEK.AdPostingApi.Client.Models
{
public enum AdditionalPropertyType
{
ResidentsOnly = 1
}
}
|
mit
|
C#
|
b94397376c135ffc33bb3c9ae2c059c8b9c3eb2b
|
Bump version to 0.33.1
|
github-for-unity/Unity,github-for-unity/Unity,github-for-unity/Unity
|
common/SolutionInfo.cs
|
common/SolutionInfo.cs
|
#pragma warning disable 436
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyProduct("GitHub for Unity")]
[assembly: AssemblyVersion(System.AssemblyVersionInformation.Version)]
[assembly: AssemblyFileVersion(System.AssemblyVersionInformation.Version)]
[assembly: AssemblyInformationalVersion(System.AssemblyVersionInformation.Version)]
[assembly: ComVisible(false)]
[assembly: AssemblyCompany("GitHub, Inc.")]
[assembly: AssemblyCopyright("Copyright GitHub, Inc. 2017-2018")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: InternalsVisibleTo("TestUtils", AllInternalsVisible = true)]
[assembly: InternalsVisibleTo("UnitTests", AllInternalsVisible = true)]
[assembly: InternalsVisibleTo("IntegrationTests", AllInternalsVisible = true)]
[assembly: InternalsVisibleTo("TaskSystemIntegrationTests", AllInternalsVisible = true)]
//Required for NSubstitute
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2", AllInternalsVisible = true)]
//Required for Unity compilation
[assembly: InternalsVisibleTo("Assembly-CSharp-Editor", AllInternalsVisible = true)]
namespace System
{
internal static class AssemblyVersionInformation {
internal const string Version = "0.33.1";
}
}
|
#pragma warning disable 436
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyProduct("GitHub for Unity")]
[assembly: AssemblyVersion(System.AssemblyVersionInformation.Version)]
[assembly: AssemblyFileVersion(System.AssemblyVersionInformation.Version)]
[assembly: AssemblyInformationalVersion(System.AssemblyVersionInformation.Version)]
[assembly: ComVisible(false)]
[assembly: AssemblyCompany("GitHub, Inc.")]
[assembly: AssemblyCopyright("Copyright GitHub, Inc. 2017-2018")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: InternalsVisibleTo("TestUtils", AllInternalsVisible = true)]
[assembly: InternalsVisibleTo("UnitTests", AllInternalsVisible = true)]
[assembly: InternalsVisibleTo("IntegrationTests", AllInternalsVisible = true)]
[assembly: InternalsVisibleTo("TaskSystemIntegrationTests", AllInternalsVisible = true)]
//Required for NSubstitute
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2", AllInternalsVisible = true)]
//Required for Unity compilation
[assembly: InternalsVisibleTo("Assembly-CSharp-Editor", AllInternalsVisible = true)]
namespace System
{
internal static class AssemblyVersionInformation {
internal const string Version = "0.33.0";
}
}
|
mit
|
C#
|
3a7e20db561d26b009925b4a343965c8754589fa
|
Test Scan being lazy
|
mzahor/morelinq,guygervais/morelinq,kenwilcox/morelinq,amithegde/morelinq,meh-uk/morelinq,RandallFlagg/morelinq,evilz/morelinq,anders9ustafsson/morelinq-portable,swcook1310/morelinq,hardborn/morelinq,Prince2690/morelinq,atknatk/morelinq,s1495k043/morelinq,xingh/morelinq,dee-donny/morelinq,whut/morelinq,amithegde/morelinq,dee-donny/morelinq,realzhaorong/morelinq,kenwilcox/morelinq,xingh/morelinq,ddonny/morelinq,anders9ustafsson/morelinq-portable,subzer0092/morelinq,amyhickman/morelinq,tsjDEV/morelinq,sochdj/morelinq,pavelhodek/morelinq,ShengboZhang/morelinq,scriptnull/morelinq,MeiChunLo/morelinq,montoyaaguirre/morelinq,ventis07/morelinq,ApocalypticOctopus/morelinq,gayancc/morelinq,ventis07/morelinq,bitbonk/morelinq,DuZorn/morelinq,soraismus/morelinq,smurfpandey/morelinq,swcook1310/morelinq,meh-uk/morelinq,usmanm77/morelinq,guygervais/morelinq,jello-chen/morelinq,ApocalypticOctopus/morelinq,ruanzx/morelinq,evilz/morelinq,cliftonm/morelinq,bitbonk/morelinq,CADbloke/morelinq,smurfpandey/morelinq,CADbloke/morelinq,DuZorn/morelinq,jma2400/morelinq,arumata/morelinq,ayseff/morelinq,gayancc/morelinq,csuffyy/morelinq,evilz/morelinq,s1495k043/morelinq,ruanzx/morelinq,hardborn/morelinq,xalid77/morelinq,scriptnull/morelinq,anders9ustafsson/morelinq-portable,usmanm77/morelinq,Jeff-Lewis/morelinq,atknatk/morelinq,florinbrasov/morelinq,RandallFlagg/morelinq,KalebDark/morelinq,joeeisel/morelinq,tsjDEV/morelinq,amyhickman/morelinq,pinakimukherjee/morelinq,montoyaaguirre/morelinq,joeeisel/morelinq,jello-chen/morelinq,jma2400/morelinq,csuffyy/morelinq,ayseff/morelinq,xingh/morelinq,blyzer/morelinq,faithword/morelinq,KalebDark/morelinq,ShengboZhang/morelinq,zalid/morelinq,ApocalypticOctopus/morelinq,florinbrasov/morelinq,cliftonm/morelinq,arumata/morelinq,amithegde/morelinq,pinakimukherjee/morelinq,whut/morelinq,ddonny/morelinq,zalid/morelinq,soraismus/morelinq,dee-donny/morelinq,MeiChunLo/morelinq,pavelhodek/morelinq,Prince2690/morelinq,realzhaorong/morelinq,smurfpandey/morelinq,sochdj/morelinq,blyzer/morelinq,mzahor/morelinq,faithword/morelinq,xalid77/morelinq,Jeff-Lewis/morelinq,subzer0092/morelinq,ddonny/morelinq,sochdj/morelinq
|
MoreLinq.Test/ScanTest.cs
|
MoreLinq.Test/ScanTest.cs
|
#region License and Terms
// MoreLINQ - Extensions to LINQ to Objects
// Copyright (c) 2008 Jonathan Skeet. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#endregion
using System;
using System.Linq;
using NUnit.Framework;
namespace MoreLinq.Test
{
[TestFixture]
public class ScanTest
{
[Test]
[ExpectedException(typeof(InvalidOperationException))]
public void ScanEmpty()
{
(new int[] { }).Scan(SampleData.Plus).Count();
}
[Test]
public void ScanSum()
{
var result = SampleData.Values.Scan(SampleData.Plus);
var gold = SampleData.Values.PreScan(SampleData.Plus, 0).ZipShortest(SampleData.Values, SampleData.Plus);
result.AssertSequenceEqual(gold);
}
[Test]
public void ScanIsLazy()
{
new BreakingSequence<object>().Scan<object>(delegate { throw new NotImplementedException(); });
}
}
}
|
#region License and Terms
// MoreLINQ - Extensions to LINQ to Objects
// Copyright (c) 2008 Jonathan Skeet. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#endregion
using System;
using System.Linq;
using NUnit.Framework;
namespace MoreLinq.Test
{
[TestFixture]
public class ScanTest
{
[Test]
[ExpectedException(typeof(InvalidOperationException))]
public void ScanEmpty()
{
(new int[] { }).Scan(SampleData.Plus).Count();
}
[Test]
public void ScanSum()
{
var result = SampleData.Values.Scan(SampleData.Plus);
var gold = SampleData.Values.PreScan(SampleData.Plus, 0).ZipShortest(SampleData.Values, SampleData.Plus);
result.AssertSequenceEqual(gold);
}
}
}
|
apache-2.0
|
C#
|
457d52c3b9ac11971ff6311874d5404488d893f5
|
Make sure that base path is an entire segment of the URL
|
codevlabs/QuartzNetWebConsole
|
SampleApp.Owin/Program.cs
|
SampleApp.Owin/Program.cs
|
using System;
using Microsoft.Owin.Hosting;
using Owin;
using Quartz;
using Quartz.Impl;
namespace SampleApp.Owin {
class Program {
static void Start(IAppBuilder app) {
// First, initialize Quartz.NET as usual. In this sample app I'll configure Quartz.NET by code.
var schedulerFactory = new StdSchedulerFactory();
var scheduler = schedulerFactory.GetScheduler();
scheduler.Start();
// I'll add some global listeners
//scheduler.ListenerManager.AddJobListener(new GlobalJobListener());
//scheduler.ListenerManager.AddTriggerListener(new GlobalTriggerListener());
// A sample trigger and job
var trigger = TriggerBuilder.Create()
.WithIdentity("myTrigger")
.WithSchedule(DailyTimeIntervalScheduleBuilder.Create()
.WithIntervalInSeconds(6))
.StartNow()
.Build();
var job = new JobDetailImpl("myJob", null, typeof(HelloJob));
scheduler.ScheduleJob(job, trigger);
// A cron trigger and job
var cron = TriggerBuilder.Create()
.WithIdentity("myCronTrigger")
.ForJob(job.Key)
.WithCronSchedule("0/10 * * * * ?") // every 10 seconds
.Build();
scheduler.ScheduleJob(cron);
// A dummy calendar
//scheduler.AddCalendar("myCalendar", new DummyCalendar { Description = "dummy calendar" }, false, false);
app.Use(QuartzNetWebConsole.Setup.Owin("/quartz/", () => scheduler));
}
private static void Main(string[] args) {
using (WebApp.Start("http://localhost:12345", Start))
Console.ReadLine();
}
}
}
|
using System;
using Microsoft.Owin.Hosting;
using Owin;
using Quartz;
using Quartz.Impl;
namespace SampleApp.Owin {
class Program {
static void Start(IAppBuilder app) {
// First, initialize Quartz.NET as usual. In this sample app I'll configure Quartz.NET by code.
var schedulerFactory = new StdSchedulerFactory();
var scheduler = schedulerFactory.GetScheduler();
scheduler.Start();
// I'll add some global listeners
//scheduler.ListenerManager.AddJobListener(new GlobalJobListener());
//scheduler.ListenerManager.AddTriggerListener(new GlobalTriggerListener());
// A sample trigger and job
var trigger = TriggerBuilder.Create()
.WithIdentity("myTrigger")
.WithSchedule(DailyTimeIntervalScheduleBuilder.Create()
.WithIntervalInSeconds(6))
.StartNow()
.Build();
var job = new JobDetailImpl("myJob", null, typeof(HelloJob));
scheduler.ScheduleJob(job, trigger);
// A cron trigger and job
var cron = TriggerBuilder.Create()
.WithIdentity("myCronTrigger")
.ForJob(job.Key)
.WithCronSchedule("0/10 * * * * ?") // every 10 seconds
.Build();
scheduler.ScheduleJob(cron);
// A dummy calendar
//scheduler.AddCalendar("myCalendar", new DummyCalendar { Description = "dummy calendar" }, false, false);
app.Use(QuartzNetWebConsole.Setup.Owin("/quartz", () => scheduler));
}
private static void Main(string[] args) {
using (WebApp.Start("http://localhost:12345", Start))
Console.ReadLine();
}
}
}
|
apache-2.0
|
C#
|
e6f947f5f7499cb44aa7d2dd2dd350a6a70c32ec
|
Allow zip+4 lacking dashes.
|
ctl-global/ctl-core
|
Ctl.Core/Validation/ZipCodeAttribute.cs
|
Ctl.Core/Validation/ZipCodeAttribute.cs
|
/*
Copyright (c) 2014, CTL Global, Inc.
Copyright (c) 2014, iD Commerce + Logistics
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted
provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions
and the following disclaimer. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the documentation and/or other
materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace Ctl.Validation
{
/// <summary>
/// Validates that a string is a US ZIP code, formatted as either XXXXX or XXXXX-XXXX.
/// </summary>
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Parameter, AllowMultiple = false)]
public class ZipCodeAttribute : ValidationAttribute
{
public ZipCodeAttribute()
: base("Field {0} must be a zip code in format XXXXX or XXXXX-XXXX.")
{
}
public override bool IsValid(object value)
{
if (value == null)
{
return true;
}
string s = value as string;
if (s == null)
{
return false;
}
return re.IsMatch(s);
}
static readonly Regex re = new Regex(@"^\d{5}(?:(?:-|‒)?\d{4})?$", RegexOptions.Compiled);
}
}
|
/*
Copyright (c) 2014, CTL Global, Inc.
Copyright (c) 2014, iD Commerce + Logistics
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted
provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions
and the following disclaimer. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the documentation and/or other
materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace Ctl.Validation
{
/// <summary>
/// Validates that a string is a US ZIP code, formatted as either XXXXX or XXXXX-XXXX.
/// </summary>
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Parameter, AllowMultiple = false)]
public class ZipCodeAttribute : ValidationAttribute
{
public ZipCodeAttribute()
: base("Field {0} must be a zip code in format XXXXX or XXXXX-XXXX.")
{
}
public override bool IsValid(object value)
{
if (value == null)
{
return true;
}
string s = value as string;
if (s == null)
{
return false;
}
return re.IsMatch(s);
}
static readonly Regex re = new Regex(@"^\d{5}(?:(?:-|‒)\d{4})?$", RegexOptions.Compiled);
}
}
|
bsd-2-clause
|
C#
|
d632e6730f75818a267beed64051518028b3e270
|
fix catch mechanism
|
nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet
|
WalletWasabi.Gui/Utils.cs
|
WalletWasabi.Gui/Utils.cs
|
using Avalonia.Threading;
using System;
using System.IO;
using System.Threading.Tasks;
namespace WalletWasabi.Gui
{
public static class Utils
{
public static string GetNextWalletName()
{
for (int i = 0; i < int.MaxValue; i++)
{
if (!File.Exists(Path.Combine(Global.WalletsDir, $"Wallet{i}.json")))
{
return $"Wallet{i}";
}
}
throw new NotSupportedException("This is impossible.");
}
public static void PostLogException(this Dispatcher dispatcher, Func<Task> action, DispatcherPriority priority = DispatcherPriority.Normal)
{
dispatcher.Post(async () =>
{
try
{
await action();
}
catch (Exception ex)
{
Logging.Logger.LogDebug<Dispatcher>(ex);
}
}, priority);
}
public static void PostLogException(this Dispatcher dispatcher, Action action, DispatcherPriority priority = DispatcherPriority.Normal)
{
dispatcher.Post(() =>
{
try
{
action();
}
catch (Exception ex)
{
Logging.Logger.LogDebug<Dispatcher>(ex);
}
}, priority);
}
}
}
|
using Avalonia.Threading;
using System;
using System.IO;
namespace WalletWasabi.Gui
{
public static class Utils
{
public static string GetNextWalletName()
{
for (int i = 0; i < int.MaxValue; i++)
{
if (!File.Exists(Path.Combine(Global.WalletsDir, $"Wallet{i}.json")))
{
return $"Wallet{i}";
}
}
throw new NotSupportedException("This is impossible.");
}
public static void PostLogException(this Dispatcher dispatcher, Action action, DispatcherPriority priority = DispatcherPriority.Normal)
{
try
{
dispatcher.Post(action, priority);
}
catch (Exception ex)
{
Logging.Logger.LogDebug<Dispatcher>(ex);
}
}
}
}
|
mit
|
C#
|
dcd27a5f7a547ca454428260dd26af996b156cba
|
Add more NonNull check
|
Wox-launcher/Wox,qianlifeng/Wox,lances101/Wox,qianlifeng/Wox,Wox-launcher/Wox,qianlifeng/Wox,lances101/Wox
|
Wox.Infrastructure/Wox.cs
|
Wox.Infrastructure/Wox.cs
|
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
namespace Wox.Infrastructure
{
public static class Constant
{
public const string Wox = "Wox";
public const string Plugins = "Plugins";
private static readonly Assembly Assembly = Assembly.GetExecutingAssembly();
public static readonly string ProgramDirectory = Directory.GetParent(Assembly.Location.NonNull()).ToString();
public static readonly string ExecutablePath = Path.Combine(ProgramDirectory, Wox + ".exe");
public static readonly string DataDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), Wox);
public static readonly string PluginsDirectory = Path.Combine(DataDirectory, Plugins);
public static readonly string PreinstalledDirectory = Path.Combine(ProgramDirectory, Plugins);
public const string Repository = "https://github.com/Wox-launcher/Wox";
public const string Issue = "https://github.com/Wox-launcher/Wox/issues/new";
public static readonly string Version = FileVersionInfo.GetVersionInfo(Assembly.Location.NonNull()).ProductVersion;
public static readonly string DefaultIcon = Path.Combine(ProgramDirectory, "Images", "app.png");
public static readonly string ErrorIcon = Path.Combine(ProgramDirectory, "Images", "app_error.png");
public static string PythonPath;
public static string EverythingSDKPath;
}
}
|
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
namespace Wox.Infrastructure
{
public static class Constant
{
public const string Wox = "Wox";
public const string Plugins = "Plugins";
private static readonly Assembly Assembly = Assembly.GetExecutingAssembly();
public static readonly string ProgramDirectory = Directory.GetParent(Assembly.Location).ToString();
public static readonly string ExecutablePath = Path.Combine(ProgramDirectory, Wox + ".exe");
public static readonly string DataDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), Wox);
public static readonly string PluginsDirectory = Path.Combine(DataDirectory, Plugins);
public static readonly string PreinstalledDirectory = Path.Combine(ProgramDirectory, Plugins);
public const string Repository = "https://github.com/Wox-launcher/Wox";
public const string Issue = "https://github.com/Wox-launcher/Wox/issues/new";
public static readonly string Version = FileVersionInfo.GetVersionInfo(Assembly.Location).ProductVersion;
public static readonly string DefaultIcon = Path.Combine(ProgramDirectory, "Images", "app.png");
public static readonly string ErrorIcon = Path.Combine(ProgramDirectory, "Images", "app_error.png");
public static string PythonPath;
public static string EverythingSDKPath;
}
}
|
mit
|
C#
|
6122dc6385dec2c67cb3d44a7d06099b98e8769b
|
Make Score.cs immutable.
|
Sankra/NDC2015,Hammerstad/NDC2015
|
NDC2015/Score.cs
|
NDC2015/Score.cs
|
using System;
namespace NDC2015
{
[Serializable]
public struct Score
{
public Score(TimeSpan elapsedTime, string contestantName, string phone)
{
ElapsedTime = elapsedTime;
ContestantName = contestantName;
Phone = phone;
}
public readonly TimeSpan ElapsedTime;
public readonly string ContestantName;
public readonly string Phone;
public string FriendlyElapsedTime
{
get { return ElapsedTime.ToString(Leaderboard.ElapsedFormatString); }
}
}
}
|
using System;
namespace NDC2015
{
[Serializable]
public struct Score
{
public Score(TimeSpan elapsedTime, string contestantName, string phone) : this()
{
ElapsedTime = elapsedTime;
ContestantName = contestantName;
Phone = phone;
}
public TimeSpan ElapsedTime { get; set; }
public string ContestantName { get; set; }
public string Phone;
public string FriendlyElapsedTime
{
get { return ElapsedTime.ToString(Leaderboard.ElapsedFormatString); }
}
}
}
|
mit
|
C#
|
b784a1106902063152a19f9ba751983b03efcc8b
|
Update src/Features/CSharp/Portable/CodeFixes/AddExplicitCast/InheritanceDistanceComparer.cs
|
bartdesmet/roslyn,genlu/roslyn,davkean/roslyn,dotnet/roslyn,physhi/roslyn,tannergooding/roslyn,weltkante/roslyn,aelij/roslyn,brettfo/roslyn,shyamnamboodiripad/roslyn,wvdd007/roslyn,reaction1989/roslyn,stephentoub/roslyn,KirillOsenkov/roslyn,AmadeusW/roslyn,brettfo/roslyn,dotnet/roslyn,heejaechang/roslyn,jasonmalinowski/roslyn,davkean/roslyn,mavasani/roslyn,jmarolf/roslyn,mgoertz-msft/roslyn,stephentoub/roslyn,KirillOsenkov/roslyn,mgoertz-msft/roslyn,AmadeusW/roslyn,AlekseyTs/roslyn,aelij/roslyn,reaction1989/roslyn,genlu/roslyn,panopticoncentral/roslyn,KevinRansom/roslyn,KirillOsenkov/roslyn,weltkante/roslyn,mgoertz-msft/roslyn,gafter/roslyn,ErikSchierboom/roslyn,panopticoncentral/roslyn,brettfo/roslyn,mavasani/roslyn,ErikSchierboom/roslyn,tmat/roslyn,eriawan/roslyn,jasonmalinowski/roslyn,reaction1989/roslyn,wvdd007/roslyn,diryboy/roslyn,jmarolf/roslyn,jasonmalinowski/roslyn,sharwell/roslyn,davkean/roslyn,stephentoub/roslyn,jmarolf/roslyn,gafter/roslyn,heejaechang/roslyn,AlekseyTs/roslyn,bartdesmet/roslyn,weltkante/roslyn,diryboy/roslyn,shyamnamboodiripad/roslyn,physhi/roslyn,tmat/roslyn,sharwell/roslyn,aelij/roslyn,eriawan/roslyn,KevinRansom/roslyn,panopticoncentral/roslyn,diryboy/roslyn,tannergooding/roslyn,tannergooding/roslyn,mavasani/roslyn,CyrusNajmabadi/roslyn,wvdd007/roslyn,AlekseyTs/roslyn,KevinRansom/roslyn,sharwell/roslyn,eriawan/roslyn,genlu/roslyn,CyrusNajmabadi/roslyn,heejaechang/roslyn,bartdesmet/roslyn,AmadeusW/roslyn,CyrusNajmabadi/roslyn,dotnet/roslyn,tmat/roslyn,shyamnamboodiripad/roslyn,gafter/roslyn,ErikSchierboom/roslyn,physhi/roslyn
|
src/Features/CSharp/Portable/CodeFixes/AddExplicitCast/InheritanceDistanceComparer.cs
|
src/Features/CSharp/Portable/CodeFixes/AddExplicitCast/InheritanceDistanceComparer.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#nullable enable
using System;
using System.Collections.Generic;
namespace Microsoft.CodeAnalysis.CSharp.CodeFixes.AddExplicitCast
{
internal sealed class InheritanceDistanceComparer : IComparer<ITypeSymbol>
{
private readonly ITypeSymbol _baseType;
private readonly SemanticModel _semanticModel;
public InheritanceDistanceComparer(SemanticModel semanticModel, ITypeSymbol baseType)
{
_semanticModel = semanticModel;
_baseType = baseType;
}
/// <summary>
/// Calculate the inheritance distance between _baseType and derivedType.
/// </summary>
private int GetInheritanceDistance(ITypeSymbol? derivedType)
{
if (derivedType == null)
return int.MaxValue;
if (derivedType.Equals(_baseType))
return 0;
var distance = GetInheritanceDistance(derivedType.BaseType);
if (derivedType.Interfaces.Length != 0)
{
foreach (var interfaceType in derivedType.Interfaces)
{
distance = Math.Min(GetInheritanceDistance(interfaceType), distance);
}
}
return distance == int.MaxValue ? distance : distance + 1;
}
/// <summary>
/// Wrapper funtion of [GetInheritanceDistance], also consider the class with explicit conversion operator
/// has the highest priority.
/// </summary>
private int GetInheritanceDistanceWrapper(ITypeSymbol type)
{
var conversion = _semanticModel.Compilation.ClassifyCommonConversion(_baseType, type);
// If the node has the explicit conversion operator, then it has the shortest distance,
// since explicit conversion operator is defined by users and has the highest priority
var distance = conversion.IsUserDefined ? 0 : GetInheritanceDistance(type);
return distance;
}
public int Compare(ITypeSymbol x, ITypeSymbol y)
{
var xDist = GetInheritanceDistanceWrapper(x);
var yDist = GetInheritanceDistanceWrapper(y);
return xDist.CompareTo(yDist);
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#nullable enable
using System;
using System.Collections.Generic;
namespace Microsoft.CodeAnalysis.CSharp.CodeFixes.AddExplicitCast
{
sealed class InheritanceDistanceComparer : IComparer<ITypeSymbol>
{
private readonly ITypeSymbol _baseType;
private readonly SemanticModel _semanticModel;
public InheritanceDistanceComparer(SemanticModel semanticModel, ITypeSymbol baseType)
{
_semanticModel = semanticModel;
_baseType = baseType;
}
/// <summary>
/// Calculate the inheritance distance between _baseType and derivedType.
/// </summary>
private int GetInheritanceDistance(ITypeSymbol? derivedType)
{
if (derivedType == null)
return int.MaxValue;
if (derivedType.Equals(_baseType))
return 0;
var distance = GetInheritanceDistance(derivedType.BaseType);
if (derivedType.Interfaces.Length != 0)
{
foreach (var interfaceType in derivedType.Interfaces)
{
distance = Math.Min(GetInheritanceDistance(interfaceType), distance);
}
}
return distance == int.MaxValue ? distance : distance + 1;
}
/// <summary>
/// Wrapper funtion of [GetInheritanceDistance], also consider the class with explicit conversion operator
/// has the highest priority.
/// </summary>
private int GetInheritanceDistanceWrapper(ITypeSymbol type)
{
var conversion = _semanticModel.Compilation.ClassifyCommonConversion(_baseType, type);
// If the node has the explicit conversion operator, then it has the shortest distance,
// since explicit conversion operator is defined by users and has the highest priority
var distance = conversion.IsUserDefined ? 0 : GetInheritanceDistance(type);
return distance;
}
public int Compare(ITypeSymbol x, ITypeSymbol y)
{
var xDist = GetInheritanceDistanceWrapper(x);
var yDist = GetInheritanceDistanceWrapper(y);
return xDist.CompareTo(yDist);
}
}
}
|
mit
|
C#
|
aaa9acd42808649f78347b65bbb7a18bad01e494
|
Fix comment typo
|
simpleinjector/SimpleInjector
|
src/SimpleInjector.Integration.Web.Mvc/SimpleInjectorFilterAttributeFilterProvider.cs
|
src/SimpleInjector.Integration.Web.Mvc/SimpleInjectorFilterAttributeFilterProvider.cs
|
// Copyright (c) Simple Injector Contributors. All rights reserved.
// Licensed under the MIT License. See LICENSE file in the project root for license information.
namespace SimpleInjector.Integration.Web.Mvc
{
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
internal sealed class SimpleInjectorFilterAttributeFilterProvider : FilterAttributeFilterProvider
{
private readonly ConcurrentDictionary<Type, Registration> registrations =
new ConcurrentDictionary<Type, Registration>();
private readonly Func<Type, Registration> registrationFactory;
// Supply false for cacheAttributeInstances, because otherwise attributes become singletons and this
// can cause all sorts of concurrency bugs, because attributes will become singletons.
internal SimpleInjectorFilterAttributeFilterProvider(Container container)
: base(cacheAttributeInstances: false)
{
this.Container = container;
this.registrationFactory =
concreteType => Lifestyle.Transient.CreateRegistration(concreteType, container);
}
internal Container Container { get; }
public override IEnumerable<Filter> GetFilters(
ControllerContext controllerContext, ActionDescriptor actionDescriptor)
{
Filter[] filters = this.GetBaseFilters(controllerContext, actionDescriptor);
foreach (var filter in filters)
{
this.InitializeInstance(filter.Instance);
}
return filters;
}
private Filter[] GetBaseFilters(
ControllerContext controllerContext, ActionDescriptor actionDescriptor)
{
IEnumerable<Filter> filters = base.GetFilters(controllerContext, actionDescriptor);
return (filters as Filter[]) ?? filters.ToArray();
}
private void InitializeInstance(object instance)
{
Registration registration =
this.registrations.GetOrAdd(instance.GetType(), this.registrationFactory);
registration.InitializeInstance(instance);
}
}
}
|
// Copyright (c) Simple Injector Contributors. All rights reserved.
// Licensed under the MIT License. See LICENSE file in the project root for license information.
namespace SimpleInjector.Integration.Web.Mvc
{
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
internal sealed class SimpleInjectorFilterAttributeFilterProvider : FilterAttributeFilterProvider
{
private readonly ConcurrentDictionary<Type, Registration> registrations =
new ConcurrentDictionary<Type, Registration>();
private readonly Func<Type, Registration> registrationFactory;
// Supply false for cacheAttributeInstances, because otherwise attributes become singletons and this
// has can cause all sorts of concurrency bugs, because attributes will becomes singletons.
internal SimpleInjectorFilterAttributeFilterProvider(Container container)
: base(cacheAttributeInstances: false)
{
this.Container = container;
this.registrationFactory =
concreteType => Lifestyle.Transient.CreateRegistration(concreteType, container);
}
internal Container Container { get; }
public override IEnumerable<Filter> GetFilters(
ControllerContext controllerContext, ActionDescriptor actionDescriptor)
{
Filter[] filters = this.GetBaseFilters(controllerContext, actionDescriptor);
foreach (var filter in filters)
{
this.InitializeInstance(filter.Instance);
}
return filters;
}
private Filter[] GetBaseFilters(
ControllerContext controllerContext, ActionDescriptor actionDescriptor)
{
IEnumerable<Filter> filters = base.GetFilters(controllerContext, actionDescriptor);
return (filters as Filter[]) ?? filters.ToArray();
}
private void InitializeInstance(object instance)
{
Registration registration =
this.registrations.GetOrAdd(instance.GetType(), this.registrationFactory);
registration.InitializeInstance(instance);
}
}
}
|
mit
|
C#
|
4cb50c07172966b0abedea1b6d2f65a4299e286d
|
Fix failing style check
|
goo32/saule
|
Saule/Serialization/ResourceDeserializer.cs
|
Saule/Serialization/ResourceDeserializer.cs
|
using System;
using Newtonsoft.Json.Linq;
namespace Saule.Serialization
{
internal class ResourceDeserializer
{
private readonly JToken _object;
private readonly Type _target;
public ResourceDeserializer(JToken @object, Type target)
{
_object = @object;
_target = target;
}
public object Deserialize()
{
return ToFlatStructure(_object).ToObject(_target);
}
private JToken ToFlatStructure(JToken json)
{
var array = json["data"] as JArray;
if (array == null)
{
var obj = json["data"] as JObject;
if (obj == null) {
return null;
}
return SingleToFlatStructure(json["data"] as JObject);
}
var result = new JArray();
foreach (var child in array)
{
result.Add(SingleToFlatStructure(child as JObject));
}
return result;
}
private JToken SingleToFlatStructure(JObject child)
{
var result = new JObject();
if (child["id"] != null)
{
result["id"] = child["id"];
}
foreach (var attr in child["attributes"] ?? new JArray())
{
var prop = attr as JProperty;
result.Add(prop?.Name.ToPascalCase(), prop?.Value);
}
foreach (var rel in child["relationships"] ?? new JArray())
{
var prop = rel as JProperty;
result.Add(prop?.Name.ToPascalCase(), ToFlatStructure(prop?.Value));
}
return result;
}
}
}
|
using System;
using Newtonsoft.Json.Linq;
namespace Saule.Serialization
{
internal class ResourceDeserializer
{
private readonly JToken _object;
private readonly Type _target;
public ResourceDeserializer(JToken @object, Type target)
{
_object = @object;
_target = target;
}
public object Deserialize()
{
return ToFlatStructure(_object).ToObject(_target);
}
private JToken ToFlatStructure(JToken json)
{
var array = json["data"] as JArray;
if (array == null)
{
var obj = json["data"] as JObject;
if (obj == null) { return null; }
return SingleToFlatStructure(json["data"] as JObject);
}
var result = new JArray();
foreach (var child in array)
{
result.Add(SingleToFlatStructure(child as JObject));
}
return result;
}
private JToken SingleToFlatStructure(JObject child)
{
var result = new JObject();
if (child["id"] != null)
{
result["id"] = child["id"];
}
foreach (var attr in child["attributes"] ?? new JArray())
{
var prop = attr as JProperty;
result.Add(prop?.Name.ToPascalCase(), prop?.Value);
}
foreach (var rel in child["relationships"] ?? new JArray())
{
var prop = rel as JProperty;
result.Add(prop?.Name.ToPascalCase(), ToFlatStructure(prop?.Value));
}
return result;
}
}
}
|
mit
|
C#
|
4c2b5722c8688d8def67bce9fc23993994ce463f
|
Bump version
|
nixxquality/WebMConverter,o11c/WebMConverter,Yuisbean/WebMConverter
|
Properties/AssemblyInfo.cs
|
Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("WebM for Retards")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("WebM for Retards")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("88d1c5f0-e3e0-445a-8e11-a02441ab6ca8")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.14.0")]
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("WebM for Retards")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("WebM for Retards")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("88d1c5f0-e3e0-445a-8e11-a02441ab6ca8")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.13.0")]
|
mit
|
C#
|
f4baa3ae7eb4f4ce052608c09726174b2da3e6e1
|
fix issue where assembly did not show the correct version number
|
sachatrauwaen/openform,sachatrauwaen/openform,sachatrauwaen/openform
|
Properties/AssemblyInfo.cs
|
Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("OpenForm")]
[assembly: AssemblyDescription("OpenForm Module for DNN")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Satrabel")]
[assembly: AssemblyProduct("OpenForm")]
[assembly: AssemblyCopyright("Copyright © 2015-2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("5ef01dd5-84a1-49f3-9232-067440288455")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("03.03.00.00")]
[assembly: AssemblyFileVersion("03.03.00.00")]
|
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("OpenForm")]
[assembly: AssemblyDescription("OpenForm Module for DNN")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Satrabel")]
[assembly: AssemblyProduct("OpenForm")]
[assembly: AssemblyCopyright("Copyright © 2015-2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("5ef01dd5-84a1-49f3-9232-067440288455")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("03.02.00.00")]
[assembly: AssemblyFileVersion("03.02.00.00")]
|
mit
|
C#
|
bb10fee53b33fa713653801d307b179690ad5a1e
|
Update AssemblyCopyright in "AssemblyInfo.cs"
|
miunet0123/FileDropBehavior
|
Properties/AssemblyInfo.cs
|
Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。
// アセンブリに関連付けられている情報を変更するには、
// これらの属性値を変更してください。
[assembly: AssemblyTitle( "miunet.Windows.FileDrop" )]
[assembly: AssemblyDescription( "Behavior and Command for file drop on WPF." )]
[assembly: AssemblyConfiguration( "" )]
[assembly: AssemblyCompany( "miunet.jp" )]
[assembly: AssemblyProduct( "miunet.Windows.FileDrop" )]
[assembly: AssemblyCopyright( "This is free and unencumbered software released into the public domain." )]
[assembly: AssemblyTrademark( "" )]
[assembly: AssemblyCulture( "" )]
// ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから
// 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、
// その型の ComVisible 属性を true に設定してください。
[assembly: ComVisible( false )]
// 次の GUID は、このプロジェクトが COM に公開される場合の、typelib の ID です
[assembly: Guid( "1e5ff919-5ebb-4b76-a199-205260de4b26" )]
// アセンブリのバージョン情報は、以下の 4 つの値で構成されています:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を
// 既定値にすることができます:
[assembly: AssemblyVersion( "1.0.*" )]
//[assembly: AssemblyVersion("1.0.0.0")]
//[assembly: AssemblyFileVersion("1.0.0.0")]
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。
// アセンブリに関連付けられている情報を変更するには、
// これらの属性値を変更してください。
[assembly: AssemblyTitle("miunet.Windows.FileDrop")]
[assembly: AssemblyDescription( "Behavior and Command for file drop on WPF." )]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany( "miunet.jp" )]
[assembly: AssemblyProduct("miunet.Windows.FileDrop")]
[assembly: AssemblyCopyright("Copyright © miunet.jp 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから
// 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、
// その型の ComVisible 属性を true に設定してください。
[assembly: ComVisible(false)]
// 次の GUID は、このプロジェクトが COM に公開される場合の、typelib の ID です
[assembly: Guid("1e5ff919-5ebb-4b76-a199-205260de4b26")]
// アセンブリのバージョン情報は、以下の 4 つの値で構成されています:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を
// 既定値にすることができます:
[assembly: AssemblyVersion( "1.0.*" )]
//[assembly: AssemblyVersion("1.0.0.0")]
//[assembly: AssemblyFileVersion("1.0.0.0")]
|
unlicense
|
C#
|
c8aac76aaea92bb7d4c41053611ab4b62a1c8e11
|
Build script now writes the package name and version into the AssemblyDescription attibute. This allows the package information to be seen in Visual Studio avoiding confusion with the assembly version that remains at the major.
|
autofac/Autofac.Mef
|
Properties/AssemblyInfo.cs
|
Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Autofac.Integration.Mef")]
[assembly: InternalsVisibleTo("Autofac.Tests.Integration.Mef, PublicKey=00240000048000009400000006020000002400005253413100040000010001008728425885ef385e049261b18878327dfaaf0d666dea3bd2b0e4f18b33929ad4e5fbc9087e7eda3c1291d2de579206d9b4292456abffbe8be6c7060b36da0c33b883e3878eaf7c89fddf29e6e27d24588e81e86f3a22dd7b1a296b5f06fbfb500bbd7410faa7213ef4e2ce7622aefc03169b0324bcd30ccfe9ac8204e4960be6")]
[assembly: ComVisible(false)]
|
using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Autofac.Integration.Mef")]
[assembly: AssemblyDescription("Autofac MEF Integration")]
[assembly: InternalsVisibleTo("Autofac.Tests.Integration.Mef, PublicKey=00240000048000009400000006020000002400005253413100040000010001008728425885ef385e049261b18878327dfaaf0d666dea3bd2b0e4f18b33929ad4e5fbc9087e7eda3c1291d2de579206d9b4292456abffbe8be6c7060b36da0c33b883e3878eaf7c89fddf29e6e27d24588e81e86f3a22dd7b1a296b5f06fbfb500bbd7410faa7213ef4e2ce7622aefc03169b0324bcd30ccfe9ac8204e4960be6")]
[assembly: ComVisible(false)]
|
mit
|
C#
|
c84bcdfdaba6a796b3bf611660f325e8112156b7
|
Update version to 1.3.5
|
anonymousthing/ListenMoeClient
|
Properties/AssemblyInfo.cs
|
Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Listen.moe Client")]
[assembly: AssemblyProduct("Listen.moe Client")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyCopyright("Copyright 2017 Listen.moe. All rights reserved.")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("88b02799-425e-4622-a849-202adb19601b")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.3.5.0")]
[assembly: AssemblyFileVersion("1.3.5.0")]
|
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Listen.moe Client")]
[assembly: AssemblyProduct("Listen.moe Client")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyCopyright("Copyright 2017 Listen.moe. All rights reserved.")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("88b02799-425e-4622-a849-202adb19601b")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.3.4.0")]
[assembly: AssemblyFileVersion("1.3.4.0")]
|
mit
|
C#
|
9184ad4112cf9bdd070469e289428828ae27e1a7
|
Store settings as plain strings, without SettingsHelper
|
arthurrump/Zermelo.App.UWP
|
Zermelo.App.UWP/Services/SettingsService.cs
|
Zermelo.App.UWP/Services/SettingsService.cs
|
using Template10.Mvvm;
using Template10.Services.SettingsService;
using Windows.Storage;
namespace Zermelo.App.UWP.Services
{
public class SettingsService : BindableBase, ISettingsService
{
ApplicationDataContainer _settings;
public SettingsService()
{
_settings = ApplicationData.Current.RoamingSettings;
}
private T Read<T>(string key)
=> (T)_settings.Values[key];
private void Write<T>(string key, T value)
=> _settings.Values[key] = value;
//Account
public string School
{
get => Read<string>("Host");
set
{
Write("Host", value);
RaisePropertyChanged();
}
}
public string Token
{
get => Read<string>("Token");
set
{
Write("Token", value);
RaisePropertyChanged();
}
}
}
}
|
using Template10.Mvvm;
using Template10.Services.SettingsService;
namespace Zermelo.App.UWP.Services
{
public class SettingsService : BindableBase, ISettingsService
{
ISettingsHelper _helper;
public SettingsService(ISettingsHelper settingsHelper)
{
_helper = settingsHelper;
}
private T Read<T>(string key, T otherwise = default(T))
=> _helper.Read<T>(key, otherwise, SettingsStrategies.Roam);
private void Write<T>(string key, T value) => _helper.Write(key, value, SettingsStrategies.Roam);
//Account
public string School
{
get => Read<string>("Host");
set
{
Write("Host", value);
RaisePropertyChanged();
}
}
public string Token
{
get => Read<string>("Token");
set
{
Write("Token", value);
RaisePropertyChanged();
}
}
}
}
|
mit
|
C#
|
e805ef258b170e73a6b593dec8b1fec476c09a51
|
Update AccountTests.cs
|
Workshop2/Put.io.Wp
|
Put.io.Tests/Tests/Rest/AccountTests.cs
|
Put.io.Tests/Tests/Rest/AccountTests.cs
|
using Microsoft.Phone.Testing;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Put.io.Tests.Tests.Rest
{
[TestClass]
public class AccountTests : WorkItemTest
{
[Asynchronous]
[TestMethod]
public void GetAccountInfo()
{
var rester = new Api.Rest.Account("**Put.io API Key**");
rester.GetAccountInfo(response =>
{
Assert.IsNotNull(response);
Assert.IsNotNull(response.Data);
Assert.IsNotNull(response.Data.Info);
Assert.IsTrue(response.Data.SafeToContinue());
EnqueueTestComplete();
});
}
}
}
|
using Microsoft.Phone.Testing;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Put.io.Tests.Tests.Rest
{
[TestClass]
public class AccountTests : WorkItemTest
{
[Asynchronous]
[TestMethod]
public void GetAccountInfo()
{
var rester = new Api.Rest.Account("PUTIO_KEY");
rester.GetAccountInfo(response =>
{
Assert.IsNotNull(response);
Assert.IsNotNull(response.Data);
Assert.IsNotNull(response.Data.Info);
Assert.IsTrue(response.Data.SafeToContinue());
EnqueueTestComplete();
});
}
}
}
|
mit
|
C#
|
4dc00f371891978f59d2ece54d061901fef9e99b
|
add coma replace
|
ChizhovYuI/tasks
|
Eval/EvalProgram.cs
|
Eval/EvalProgram.cs
|
using System;
using System.Linq;
namespace EvalTask
{
class EvalProgram
{
static void Main(string[] args)
{
string input = Console.In.ReadToEnd();
var lines = input.Split(new[] {'\r', '\n'}, StringSplitOptions.RemoveEmptyEntries);
var expr = lines[0].Replace(",", ".");
var json = string.Join("", lines.Skip(1));
try
{
string output = new ExpressionEvaluator().Evaluate(expr, json);
Console.WriteLine(output);
}
catch (Exception)
{
Console.WriteLine("error");
}
}
}
}
|
using System;
using System.Linq;
using Newtonsoft.Json.Linq;
namespace EvalTask
{
class EvalProgram
{
static void Main(string[] args)
{
string input = Console.In.ReadToEnd();
var lines = input.Split(new[] {'\r', '\n'}, StringSplitOptions.RemoveEmptyEntries);
var expr = lines[0];
var json = string.Join("", lines.Skip(1));
try
{
string output = new ExpressionEvaluator().Evaluate(expr, json);
Console.WriteLine(output);
}
catch (Exception)
{
Console.WriteLine("error");
}
}
}
}
|
mit
|
C#
|
92039b735d3d1508931959d6d04a4a15542b1adc
|
Add DomainException constructor overloads
|
biarne-a/Zebus,Abc-Arbitrage/Zebus
|
src/Abc.Zebus/DomainException.cs
|
src/Abc.Zebus/DomainException.cs
|
using System;
using System.ComponentModel;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using Abc.Zebus.Util.Extensions;
namespace Abc.Zebus
{
public class DomainException : Exception
{
public int ErrorCode { get; private set; }
public DomainException(Exception innerException, int errorCode, string message)
: base(message, innerException)
{
ErrorCode = errorCode;
}
public DomainException(string message)
: this(null, ErrorStatus.UnknownError.Code, message)
{
}
public DomainException(string message, Exception innerException)
: this(innerException, ErrorStatus.UnknownError.Code, message)
{
}
public DomainException(int errorCode, string message)
: this(null, errorCode, message)
{
}
public DomainException(int errorCode, string message, params object[] values)
: this(errorCode, string.Format(message, values))
{
}
public DomainException(Enum enumVal, params object[] values)
: this(Convert.ToInt32(enumVal), enumVal.GetAttributeDescription(), values)
{
}
public DomainException(Expression<Func<int>> errorCodeExpression, params object[] values)
: this(errorCodeExpression.Compile()(), ReadDescriptionFromAttribute(errorCodeExpression), values)
{
}
private static string ReadDescriptionFromAttribute(Expression<Func<int>> errorCodeExpression)
{
var memberExpr = errorCodeExpression.Body as MemberExpression;
if (memberExpr == null)
return string.Empty;
var attr = (DescriptionAttribute)memberExpr.Member.GetCustomAttributes(typeof(DescriptionAttribute)).FirstOrDefault();
return attr != null ? attr.Description : string.Empty;
}
}
}
|
using System;
using System.ComponentModel;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using Abc.Zebus.Util.Extensions;
namespace Abc.Zebus
{
public class DomainException : Exception
{
public int ErrorCode { get; private set; }
public DomainException(Exception innerException, int errorCode, string message)
: base(message, innerException)
{
ErrorCode = errorCode;
}
public DomainException(int errorCode, string message)
: this(null, errorCode, message)
{
}
public DomainException(int errorCode, string message, params object[] values)
: this(errorCode, string.Format(message, values))
{
}
public DomainException(Enum enumVal, params object[] values)
: this(Convert.ToInt32(enumVal), enumVal.GetAttributeDescription(), values)
{
}
public DomainException(Expression<Func<int>> errorCodeExpression, params object[] values)
: this(errorCodeExpression.Compile()(), ReadDescriptionFromAttribute(errorCodeExpression), values)
{
}
private static string ReadDescriptionFromAttribute(Expression<Func<int>> errorCodeExpression)
{
var memberExpr = errorCodeExpression.Body as MemberExpression;
if (memberExpr == null)
return string.Empty;
var attr = (DescriptionAttribute)memberExpr.Member.GetCustomAttributes(typeof(DescriptionAttribute)).FirstOrDefault();
return attr != null ? attr.Description : string.Empty;
}
}
}
|
mit
|
C#
|
3a2063feeb5bd6b6cdd1fa8df11d9eb51139e804
|
build 0.0.3
|
rachmann/qboAccess,rachmann/qboAccess,rachmann/qboAccess
|
src/Global/GlobalAssemblyInfo.cs
|
src/Global/GlobalAssemblyInfo.cs
|
using System;
using System.Reflection;
using System.Runtime.InteropServices;
[ assembly : ComVisible( false ) ]
[ assembly : AssemblyProduct( "QuickBooksOnlineAccess" ) ]
[ assembly : AssemblyCompany( "Agile Harbor, LLC" ) ]
[ assembly : AssemblyCopyright( "Copyright (C) 2014 Agile Harbor, LLC" ) ]
[ assembly : AssemblyDescription( "QuickBooksOnline webservices API wrapper." ) ]
[ assembly : AssemblyTrademark( "" ) ]
[ assembly : AssemblyCulture( "" ) ]
[ assembly : CLSCompliant( false ) ]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
// Keep in track with CA API version
[ assembly : AssemblyVersion( "0.0.3.0" ) ]
|
using System;
using System.Reflection;
using System.Runtime.InteropServices;
[ assembly : ComVisible( false ) ]
[ assembly : AssemblyProduct( "QuickBooksOnlineAccess" ) ]
[ assembly : AssemblyCompany( "Agile Harbor, LLC" ) ]
[ assembly : AssemblyCopyright( "Copyright (C) 2014 Agile Harbor, LLC" ) ]
[ assembly : AssemblyDescription( "QuickBooksOnline webservices API wrapper." ) ]
[ assembly : AssemblyTrademark( "" ) ]
[ assembly : AssemblyCulture( "" ) ]
[ assembly : CLSCompliant( false ) ]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
// Keep in track with CA API version
[ assembly : AssemblyVersion( "0.0.2.0" ) ]
|
bsd-3-clause
|
C#
|
3cc7182155241c973db96a3e9ccdad2e5d52b8a4
|
Change to DI HttpClient in HttpService
|
schwamster/HttpService,schwamster/HttpService
|
src/HttpService/HttpService.cs
|
src/HttpService/HttpService.cs
|
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using System.Net.Http;
using Microsoft.AspNetCore.Authentication;
namespace HttpService
{
public class HttpService : IHttpService
{
private readonly IContextReader _tokenExtractor;
private HttpClient _client;
public HttpService(IHttpContextAccessor accessor, HttpClient client = null) : this(new HttpContextReader(accessor), client)
{
}
public HttpService(IContextReader tokenExtractor, HttpClient client = null)
{
_tokenExtractor = tokenExtractor;
_client = client ?? new HttpClient();
}
public async Task<HttpResponseMessage> GetAsync(string requestUri, bool passToken) =>
await SendAsync(HttpMethod.Get, requestUri, passToken);
public async Task<HttpResponseMessage> PostAsync(string requestUri, HttpContent content, bool passToken) =>
await SendAsync(HttpMethod.Post, requestUri, passToken, content);
public async Task<HttpResponseMessage> PutAsync(string requestUri, HttpContent content, bool passToken) =>
await SendAsync(HttpMethod.Put, requestUri, passToken, content);
public async Task<HttpResponseMessage> DeleteAsync(string requestUri, bool passToken) =>
await SendAsync(HttpMethod.Delete, requestUri, passToken);
private async Task<HttpResponseMessage> SendAsync(HttpMethod method, string requestUri, bool passToken, HttpContent content = null)
{
var msg = new HttpRequestMessage(method, requestUri);
msg.Headers.TryAddWithoutValidation("X-Correlation-Id", this._tokenExtractor.GetCorrelationId());
if (passToken)
{
var token = await _tokenExtractor.GetTokenAsync();
if (!string.IsNullOrEmpty(token))
{
msg.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
}
}
if (content != null)
{
msg.Content = content;
}
return await _client.SendAsync(msg);
}
}
public interface IContextReader
{
Task<string> GetTokenAsync();
string GetCorrelationId();
}
public class HttpContextReader : IContextReader
{
private readonly IHttpContextAccessor _accessor;
public HttpContextReader(IHttpContextAccessor accessor)
{
this._accessor = accessor;
}
public string GetCorrelationId()
{
return this._accessor.HttpContext.TraceIdentifier;
}
public async Task<string> GetTokenAsync()
{
var token = await this._accessor.HttpContext.GetTokenAsync("access_token");
return token;
}
}
}
|
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using System.Net.Http;
using Microsoft.AspNetCore.Authentication;
namespace HttpService
{
public class HttpService : IHttpService
{
private readonly IContextReader _tokenExtractor;
private HttpClient _client;
public HttpService(IHttpContextAccessor accessor, HttpMessageHandler handler = null) : this(new HttpContextReader(accessor), handler)
{
}
public HttpService(IContextReader tokenExtractor, HttpMessageHandler handler = null)
{
_tokenExtractor = tokenExtractor;
_client = handler == null ? new HttpClient() : new HttpClient(handler);
}
public async Task<HttpResponseMessage> GetAsync(string requestUri, bool passToken) =>
await SendAsync(HttpMethod.Get, requestUri, passToken);
public async Task<HttpResponseMessage> PostAsync(string requestUri, HttpContent content, bool passToken) =>
await SendAsync(HttpMethod.Post, requestUri, passToken, content);
public async Task<HttpResponseMessage> PutAsync(string requestUri, HttpContent content, bool passToken) =>
await SendAsync(HttpMethod.Put, requestUri, passToken, content);
public async Task<HttpResponseMessage> DeleteAsync(string requestUri, bool passToken) =>
await SendAsync(HttpMethod.Delete, requestUri, passToken);
private async Task<HttpResponseMessage> SendAsync(HttpMethod method, string requestUri, bool passToken, HttpContent content = null)
{
var msg = new HttpRequestMessage(method, requestUri);
msg.Headers.TryAddWithoutValidation("X-Correlation-Id", this._tokenExtractor.GetCorrelationId());
if (passToken)
{
var token = await _tokenExtractor.GetTokenAsync();
if (!string.IsNullOrEmpty(token))
{
msg.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
}
}
if (content != null)
{
msg.Content = content;
}
return await _client.SendAsync(msg);
}
}
public interface IContextReader
{
Task<string> GetTokenAsync();
string GetCorrelationId();
}
public class HttpContextReader : IContextReader
{
private readonly IHttpContextAccessor _accessor;
public HttpContextReader(IHttpContextAccessor accessor)
{
this._accessor = accessor;
}
public string GetCorrelationId()
{
return this._accessor.HttpContext.TraceIdentifier;
}
public async Task<string> GetTokenAsync()
{
var token = await this._accessor.HttpContext.GetTokenAsync("access_token");
return token;
}
}
}
|
mit
|
C#
|
b6b1ee25a53a4bbf8870f583d42f21432c4e4335
|
Build Release
|
JakeGinnivan/VSTOContrib,JakeGinnivan/VSTOContrib
|
src/Information/VersionInfo.cs
|
src/Information/VersionInfo.cs
|
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.431
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyVersion("0.9.0.52")]
[assembly: AssemblyFileVersion("0.9.0.52")]
|
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.431
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyVersion("0.9.0.51")]
[assembly: AssemblyFileVersion("0.9.0.51")]
|
mit
|
C#
|
c5b7a404f464996427a07037e20c61ec0a309220
|
Align node index display in ToString
|
lionpeloux/Ivy
|
src/IvyCore/Parametric/Node.cs
|
src/IvyCore/Parametric/Node.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IvyCore.Parametric
{
public class Node : Point, ISortedGridElement<Node>
{
/// <summary>
/// The index in the Grid list of nodes.
/// </summary>
public int Index { get; protected set; }
/// <summary>
/// The tuple representing the position of the node in the Grid.
/// </summary>
public Tuple Tuple { get; protected set; }
/// <summary>
/// Create a new Node instance.
/// </summary>
/// <param name="grid">The Grid that node belongs to.</param>
/// <param name="coordinates">Node coordinates</param>
public Node(Grid grid, IList<int> tuple, double[] coordinates)
:base(grid, coordinates)
{
this.Tuple = Tuple.CreateNodeTuple(grid, tuple);
this.Index = this.Tuple.Index;
}
public Node(Grid grid, IList<int> tuple)
: this(grid, tuple, new double[grid.Dim]) { }
public IList<Node> List
{
get
{
return Grid.Nodes;
}
}
public override string ToString()
{
var s = "(" + String.Format("{0:F2}", coordinates[0]);
for (int i = 1; i < coordinates.Length; i++)
{
s += ", " + String.Format("{0:F2}", coordinates[i]);
}
return s += ")";
}
public override string Info()
{
return String.Format("NODE[{0,3}|{1}] = {2}", this.Index, this.Tuple, this.ToString());
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IvyCore.Parametric
{
public class Node : Point, ISortedGridElement<Node>
{
/// <summary>
/// The index in the Grid list of nodes.
/// </summary>
public int Index { get; protected set; }
/// <summary>
/// The tuple representing the position of the node in the Grid.
/// </summary>
public Tuple Tuple { get; protected set; }
/// <summary>
/// Create a new Node instance.
/// </summary>
/// <param name="grid">The Grid that node belongs to.</param>
/// <param name="coordinates">Node coordinates</param>
public Node(Grid grid, IList<int> tuple, double[] coordinates)
:base(grid, coordinates)
{
this.Tuple = Tuple.CreateNodeTuple(grid, tuple);
this.Index = this.Tuple.Index;
}
public Node(Grid grid, IList<int> tuple)
: this(grid, tuple, new double[grid.Dim]) { }
public IList<Node> List
{
get
{
return Grid.Nodes;
}
}
public override string ToString()
{
var s = "(" + String.Format("{0:F2}", coordinates[0]);
for (int i = 1; i < coordinates.Length; i++)
{
s += ", " + String.Format("{0:F2}", coordinates[i]);
}
return s += ")";
}
public override string Info()
{
return "NODE[" + this.Index + "|" + this.Tuple + "] = " + this.ToString();
}
}
}
|
mit
|
C#
|
54f1a3d0d755a2355c05003793c5e9021c8ba167
|
Update BandBlock.cs
|
LANDIS-II-Foundation/Landis-Spatial-Modeling-Library
|
src/RasterIO.Gdal/BandBlock.cs
|
src/RasterIO.Gdal/BandBlock.cs
|
// Contributors:
// James Domingo, Green Code LLC
using Landis.SpatialModeling;
using System;
namespace Landis.RasterIO.Gdal
{
/// <summary>
/// A block of data for a raster band.
/// </summary>
public class BandBlock<T>
where T : struct
{
public T[] Buffer { get; private set; }
public BlockDimensions Size { get; private set; }
public int XOffset { get; set; }
public int YOffset { get; set; }
public int UsedPortionXSize { get; set; }
public int UsedPortionYSize { get; set; }
public int PixelSpace { get; private set; }
public int LineSpace { get; private set; }
public BandBlock(BlockDimensions blockDimensions)
{
int bufferLength = blockDimensions.XSize * blockDimensions.YSize;
Buffer = new T[bufferLength];
Size = blockDimensions;
PixelSpace = Band<T>.ComputeSize();
LineSpace = PixelSpace * blockDimensions.XSize;
}
}
}
|
// Copyright 2010 Green Code LLC
// All rights reserved.
//
// The copyright holders license this file under the New (3-clause) BSD
// License (the "License"). You may not use this file except in
// compliance with the License. A copy of the License is available at
//
// http://www.opensource.org/licenses/BSD-3-Clause
//
// and is included in the NOTICE.txt file distributed with this work.
//
// Contributors:
// James Domingo, Green Code LLC
using Landis.SpatialModeling;
using System;
namespace Landis.RasterIO.Gdal
{
/// <summary>
/// A block of data for a raster band.
/// </summary>
public class BandBlock<T>
where T : struct
{
public T[] Buffer { get; private set; }
public BlockDimensions Size { get; private set; }
public int XOffset { get; set; }
public int YOffset { get; set; }
public int UsedPortionXSize { get; set; }
public int UsedPortionYSize { get; set; }
public int PixelSpace { get; private set; }
public int LineSpace { get; private set; }
public BandBlock(BlockDimensions blockDimensions)
{
int bufferLength = blockDimensions.XSize * blockDimensions.YSize;
Buffer = new T[bufferLength];
Size = blockDimensions;
PixelSpace = Band<T>.ComputeSize();
LineSpace = PixelSpace * blockDimensions.XSize;
}
}
}
|
apache-2.0
|
C#
|
ca64dd74d510be29a5ec5b08a3c2eb44e9debca2
|
Update XML documentation comment of `LimitPrice` (#6381)
|
AlexCatarino/Lean,QuantConnect/Lean,QuantConnect/Lean,AlexCatarino/Lean,AlexCatarino/Lean,QuantConnect/Lean,QuantConnect/Lean,AlexCatarino/Lean
|
Common/Orders/OrderField.cs
|
Common/Orders/OrderField.cs
|
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace QuantConnect.Orders
{
/// <summary>
/// Specifies an order field that does not apply to all order types
/// </summary>
public enum OrderField
{
/// <summary>
/// The limit price for a <see cref="LimitOrder"/>, <see cref="StopLimitOrder"/> or <see cref="LimitIfTouchedOrder"/>
/// </summary>
LimitPrice,
/// <summary>
/// The stop price for a <see cref="StopMarketOrder"/> or a <see cref="StopLimitOrder"/>
/// </summary>
StopPrice,
/// <summary>
/// The trigger price for a <see cref="LimitIfTouchedOrder"/>
/// </summary>
TriggerPrice
}
}
|
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace QuantConnect.Orders
{
/// <summary>
/// Specifies an order field that does not apply to all order types
/// </summary>
public enum OrderField
{
/// <summary>
/// The limit price for a <see cref="LimitOrder"/> or <see cref="StopLimitOrder"/>
/// </summary>
LimitPrice,
/// <summary>
/// The stop price for a <see cref="StopMarketOrder"/> or a <see cref="StopLimitOrder"/>
/// </summary>
StopPrice,
/// <summary>
/// The trigger price for a <see cref="LimitIfTouchedOrder"/>
/// </summary>
TriggerPrice
}
}
|
apache-2.0
|
C#
|
e92488624c4bd3dad377d0dc68327d126b491997
|
Update Viktor.cs
|
FireBuddy/adevade
|
AdEvade/AdEvade/Data/Spells/SpecialSpells/Viktor.cs
|
AdEvade/AdEvade/Data/Spells/SpecialSpells/Viktor.cs
|
using System;
using EloBuddy;
using EloBuddy.SDK;
namespace AdEvade.Data.Spells.SpecialSpells
{
class Viktor : IChampionPlugin
{
static Viktor()
{
}
public const string ChampionName = "Viktor";
public string GetChampionName()
{
return ChampionName;
}
public void LoadSpecialSpell(SpellData spellData)
{
if (spellData.SpellName == "ViktorDeathRay")
{
Obj_AI_Base.OnProcessSpellCast += Obj_AI_Base_OnProcessSpellCast3;
}
}
private static void Obj_AI_Base_OnProcessSpellCast3(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
{
if (sender != null && sender.Team != ObjectManager.Player.Team &&
args.SData.Name != null && args.SData.Name == "ViktorDeathRay")
{
var endpoint = sender.Path;
// var missileDist = End.To2D().Distance(args.Start.To2D());
// var delay = missileDist / 1.5f + 600;
// spellData.SpellDelay = delay;
// SpellDetector.CreateSpellData(sender, args.Start, End, spellData);
}
}
}
}
|
using System;
using EloBuddy;
using EloBuddy.SDK;
namespace AdEvade.Data.Spells.SpecialSpells
{
class Viktor : IChampionPlugin
{
static Viktor()
{
}
public const string ChampionName = "Viktor";
public string GetChampionName()
{
return ChampionName;
}
public void LoadSpecialSpell(SpellData spellData)
{
if (spellData.SpellName == "ViktorDeathRay")
{
Obj_AI_Base.OnProcessSpellCast += Obj_AI_Base_OnProcessSpellCast3;
}
}
private static void Obj_AI_Base_OnProcessSpellCast3(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
{
if (sender != null && sender.Team != ObjectManager.Player.Team &&
args.SData.Name != null && args.SData.Name == "ViktorDeathRay")
{
var endpoint = sender.Path.Last();
// var missileDist = End.To2D().Distance(args.Start.To2D());
// var delay = missileDist / 1.5f + 600;
// spellData.SpellDelay = delay;
// SpellDetector.CreateSpellData(sender, args.Start, End, spellData);
}
}
}
}
|
mit
|
C#
|
11b6274dc6ccb0c99fa0deb454ffaa31e13a5957
|
make ProductId writeable
|
mrklintscher/libfintx
|
src/libfintx/Helper/Program.cs
|
src/libfintx/Helper/Program.cs
|
/*
*
* This file is part of libfintx.
*
* Copyright (c) 2016 - 2018 Torsten Klinger
* E-Mail: torsten.klinger@googlemail.com
*
* libfintx is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* libfintx is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with libfintx; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
namespace libfintx
{
public static class Program
{
public static string Buildname { get; set; } = "libfintx";
public static string Version { get; set; } = "0.1";
/// <summary>
/// Produktregistrierungsnummer. Replace it with you own id if available.
/// </summary>
public static string ProductId = "9FA6681DEC0CF3046BFC2F8A6";
}
}
|
/*
*
* This file is part of libfintx.
*
* Copyright (c) 2016 - 2018 Torsten Klinger
* E-Mail: torsten.klinger@googlemail.com
*
* libfintx is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* libfintx is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with libfintx; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
namespace libfintx
{
public static class Program
{
public static string Buildname { get; set; } = "libfintx";
public static string Version { get; set; } = "0.1";
public const string ProductId = "9FA6681DEC0CF3046BFC2F8A6";
}
}
|
lgpl-2.1
|
C#
|
be9a3f37945383147dd21398df9149e9488c3773
|
Add initialization of additional providers
|
Seddryck/NBi,Seddryck/NBi
|
NBi.Core/Query/Connection/OleDbConnectionFactory.cs
|
NBi.Core/Query/Connection/OleDbConnectionFactory.cs
|
using NBi.Core.Configuration;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Data.Common;
using System.Data.OleDb;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NBi.Core.Query.Connection
{
class OleDbConnectionFactory : DbConnectionFactory
{
private readonly IReadOnlyDictionary<string, string> providers;
public OleDbConnectionFactory()
: base()
{
providers = ConfigurationManager.GetConfiguration().Providers;
}
public OleDbConnectionFactory(IDictionary<string, string> providers)
: base()
{
this.providers = new ReadOnlyDictionary<string, string>(providers);
}
protected override DbProviderFactory ParseConnectionString(string connectionString)
{
var csb = GetConnectionStringBuilder(connectionString);
if (csb == null)
return null;
var providerName = ExtractProviderName(csb, connectionString);
if (string.IsNullOrEmpty(providerName))
return null;
providerName = TranslateProviderName(providerName);
if (string.IsNullOrEmpty(providerName))
return null;
var factory = GetDbProviderFactory(providerName);
return factory;
}
private string ExtractProviderName(DbConnectionStringBuilder connectionStringBuilder, string connectionString)
{
if (connectionStringBuilder.ContainsKey("Provider"))
return (connectionStringBuilder["Provider"].ToString());
return string.Empty;
}
private string TranslateProviderName(string providerName)
{
if (providerName.ToLowerInvariant().StartsWith("sqlncli")) return "System.Data.OleDb"; //Indeed OleDb it's not a mistake! SQL Server Native Client
if (providerName.ToLowerInvariant().StartsWith("oledb")) return "System.Data.OleDb";
if (providerName.ToLowerInvariant().StartsWith("sqloledb")) return "System.Data.OleDb"; // SQL Server OLE DB driver
foreach (var provider in providers)
if (provider.Key.ToLowerInvariant() == providerName.ToLowerInvariant())
return provider.Value;
return null;
}
}
}
|
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Data.Common;
using System.Data.OleDb;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NBi.Core.Query.Connection
{
class OleDbConnectionFactory : DbConnectionFactory
{
private readonly IReadOnlyDictionary<string, string> providers;
public OleDbConnectionFactory()
: base()
{
providers = new ReadOnlyDictionary<string, string>(new Dictionary<string, string>());
}
public OleDbConnectionFactory(IDictionary<string, string> providers)
: base()
{
this.providers = new ReadOnlyDictionary<string, string>(providers);
}
protected override DbProviderFactory ParseConnectionString(string connectionString)
{
var csb = GetConnectionStringBuilder(connectionString);
if (csb == null)
return null;
var providerName = ExtractProviderName(csb, connectionString);
if (string.IsNullOrEmpty(providerName))
return null;
providerName = TranslateProviderName(providerName);
if (string.IsNullOrEmpty(providerName))
return null;
var factory = GetDbProviderFactory(providerName);
return factory;
}
private string ExtractProviderName(DbConnectionStringBuilder connectionStringBuilder, string connectionString)
{
if (connectionStringBuilder.ContainsKey("Provider"))
return (connectionStringBuilder["Provider"].ToString());
return string.Empty;
}
private string TranslateProviderName(string providerName)
{
if (providerName.ToLowerInvariant().StartsWith("sqlncli")) return "System.Data.OleDb"; //Indeed OleDb it's not a mistake! SQL Server Native Client
if (providerName.ToLowerInvariant().StartsWith("oledb")) return "System.Data.OleDb";
if (providerName.ToLowerInvariant().StartsWith("sqloledb")) return "System.Data.OleDb"; // SQL Server OLE DB driver
foreach (var provider in providers)
if (provider.Key.ToLowerInvariant() == providerName.ToLowerInvariant())
return provider.Value;
return null;
}
}
}
|
apache-2.0
|
C#
|
22af3cd923a9e16e5a4643a511086b9d0b925fa5
|
Handle possible null reference;
|
2yangk23/osu,ZLima12/osu,smoogipoo/osu,johnneijzen/osu,peppy/osu,EVAST9919/osu,peppy/osu,peppy/osu,NeoAdonis/osu,ZLima12/osu,ppy/osu,EVAST9919/osu,ppy/osu,2yangk23/osu,johnneijzen/osu,NeoAdonis/osu,UselessToucan/osu,UselessToucan/osu,ppy/osu,smoogipoo/osu,UselessToucan/osu,NeoAdonis/osu,smoogipoo/osu,smoogipooo/osu,peppy/osu-new
|
osu.Game/Graphics/StreamColour.cs
|
osu.Game/Graphics/StreamColour.cs
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK.Graphics;
using osu.Framework.Graphics.Colour;
using System.Collections.Generic;
namespace osu.Game.Graphics
{
public class StreamColour
{
public static readonly Color4 STABLE = new Color4(102, 204, 255, 255);
public static readonly Color4 STABLEFALLBACK = new Color4(34, 153, 187, 255);
public static readonly Color4 BETA = new Color4(255, 221, 85, 255);
public static readonly Color4 CUTTINGEDGE = new Color4(238, 170, 0, 255);
public static readonly Color4 LAZER = new Color4(237, 18, 33, 255);
public static readonly Color4 WEB = new Color4(136, 102, 238, 255);
private static readonly Dictionary<string, ColourInfo> colours = new Dictionary<string, ColourInfo>
{
{ "stable40", STABLE },
{ "stable", STABLEFALLBACK },
{ "beta40", BETA },
{ "cuttingedge", CUTTINGEDGE },
{ "lazer", LAZER },
{ "web", WEB },
};
public static ColourInfo FromStreamName(string name)
{
if (!string.IsNullOrEmpty(name))
if (colours.TryGetValue(name, out ColourInfo colour))
return colour;
return new Color4(255, 255, 255, 255);
}
}
}
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK.Graphics;
using osu.Framework.Graphics.Colour;
using System.Collections.Generic;
namespace osu.Game.Graphics
{
public class StreamColour
{
public static readonly Color4 STABLE = new Color4(102, 204, 255, 255);
public static readonly Color4 STABLEFALLBACK = new Color4(34, 153, 187, 255);
public static readonly Color4 BETA = new Color4(255, 221, 85, 255);
public static readonly Color4 CUTTINGEDGE = new Color4(238, 170, 0, 255);
public static readonly Color4 LAZER = new Color4(237, 18, 33, 255);
public static readonly Color4 WEB = new Color4(136, 102, 238, 255);
private static readonly Dictionary<string, ColourInfo> colours = new Dictionary<string, ColourInfo>
{
{ "stable40", STABLE },
{ "stable", STABLEFALLBACK },
{ "beta40", BETA },
{ "cuttingedge", CUTTINGEDGE },
{ "lazer", LAZER },
{ "web", WEB },
};
public static ColourInfo FromStreamName(string name)
{
if (colours.TryGetValue(name, out ColourInfo colour))
return colour;
else return new Color4(255, 255, 255, 255);
}
}
}
|
mit
|
C#
|
d174e1d40fc54f2239d6c75cafb21d7448f24a2b
|
Fix to handle relative file names correctly (#27)
|
vers-one/EpubReader,versfx/EpubReader
|
Source/VersOne.Epub/Utils/ZipPathUtils.cs
|
Source/VersOne.Epub/Utils/ZipPathUtils.cs
|
using System;
namespace VersOne.Epub.Internal
{
internal static class ZipPathUtils
{
public static string GetDirectoryPath(string filePath)
{
int lastSlashIndex = filePath.LastIndexOf('/');
if (lastSlashIndex == -1)
{
return String.Empty;
}
else
{
return filePath.Substring(0, lastSlashIndex);
}
}
public static string Combine(string directory, string fileName)
{
if (String.IsNullOrEmpty(directory))
{
return fileName;
}
else
{
while (fileName.StartsWith("../"))
{
var idx = directory.LastIndexOf("/");
directory = idx > 0 ? directory.Substring(0, idx) : string.Empty;
fileName = fileName.Substring(3);
}
return string.IsNullOrEmpty(directory) ? fileName : String.Concat(directory, "/", fileName);
}
}
}
}
|
using System;
namespace VersOne.Epub.Internal
{
internal static class ZipPathUtils
{
public static string GetDirectoryPath(string filePath)
{
int lastSlashIndex = filePath.LastIndexOf('/');
if (lastSlashIndex == -1)
{
return String.Empty;
}
else
{
return filePath.Substring(0, lastSlashIndex);
}
}
public static string Combine(string directory, string fileName)
{
if (String.IsNullOrEmpty(directory))
{
return fileName;
}
else
{
return String.Concat(directory, "/", fileName);
}
}
}
}
|
unlicense
|
C#
|
c246ebdef7aad7bc6ddb75c9c69c203617543cea
|
handle big messages
|
unclebob/nslim,neilthompson19/nslim
|
source/fitnesse/slim/Messenger.cs
|
source/fitnesse/slim/Messenger.cs
|
// Copyright © Syterra Software Inc. All rights reserved.
// The use and distribution terms for this software are covered by the Common Public License 1.0 (http://opensource.org/licenses/cpl.php)
// which can be found in the file license.txt at the root of this distribution. By using this software in any fashion, you are agreeing
// to be bound by the terms of this license. You must not remove this notice, or any other, from this software.
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Text;
using fitnesse.mtee.model;
namespace fitnesse.slim {
class Messenger {
private static readonly IdentifierName EndIdentifier = new IdentifierName("bye");
private readonly StreamReader reader;
private readonly StreamWriter writer;
public bool IsEnd { get; private set; }
public static Messenger Make(int port) {
var listener = new TcpListener(IPAddress.Any, port);
listener.Start();
Socket socket = listener.AcceptSocket();
listener.Stop();
return new Messenger(new NetworkStream(socket));
}
public Messenger(Stream stream) {
reader = new StreamReader(stream);
writer = new StreamWriter(stream);
writer.Write("Slim -- V0.0\n");
writer.Flush();
}
public string Read() {
int messageLength = int.Parse(Read(6));
Read(1); // skip the colon
string message = Read(messageLength);
IsEnd = EndIdentifier.Matches(message);
return IsEnd ? null : message;
}
public void Write(string message) {
writer.Write(string.Format("{0:000000}:", message.Length));
writer.Write(message);
writer.Flush();
}
private string Read(int characterLength) {
var message = new StringBuilder(characterLength);
int charactersRemaining = characterLength;
while (charactersRemaining > 0) {
var messageCharacters = new char[charactersRemaining];
int charactersUsed = reader.Read(messageCharacters, 0, charactersRemaining);
message.Append(messageCharacters, 0, charactersUsed);
charactersRemaining -= charactersUsed;
}
return message.ToString();
}
}
}
|
// Copyright © Syterra Software Inc. All rights reserved.
// The use and distribution terms for this software are covered by the Common Public License 1.0 (http://opensource.org/licenses/cpl.php)
// which can be found in the file license.txt at the root of this distribution. By using this software in any fashion, you are agreeing
// to be bound by the terms of this license. You must not remove this notice, or any other, from this software.
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Text;
using fitnesse.mtee.model;
namespace fitnesse.slim {
class Messenger {
private static readonly IdentifierName EndIdentifier = new IdentifierName("bye");
private readonly StreamReader reader;
private readonly StreamWriter writer;
public bool IsEnd { get; private set; }
public static Messenger Make(int port) {
var listener = new TcpListener(IPAddress.Any, port);
listener.Start();
Socket socket = listener.AcceptSocket();
listener.Stop();
return new Messenger(new NetworkStream(socket));
}
public Messenger(Stream stream) {
reader = new StreamReader(stream);
writer = new StreamWriter(stream);
writer.Write("Slim -- V0.0\n");
writer.Flush();
}
public string Read() {
int messageLength = int.Parse(Read(6));
Read(1); // skip the colon
string message = Read(messageLength);
IsEnd = EndIdentifier.Matches(message);
return IsEnd ? null : message;
}
public void Write(string message) {
writer.Write(string.Format("{0:000000}:", message.Length));
writer.Write(message);
writer.Flush();
}
private string Read(int characterLength) {
var messageCharacters = new char[characterLength];
int charactersUsed = reader.Read(messageCharacters, 0, characterLength);
var message = new StringBuilder(charactersUsed);
message.Append(messageCharacters, 0, charactersUsed);
return message.ToString();
}
}
}
|
epl-1.0
|
C#
|
8e3cb5dceb86d9671f9bf07e2b2d2856ccb34868
|
Handle null/missing category and tags
|
MacLeanElectrical/servicestack-introspec
|
src/ServiceStack.IntroSpec/ServiceStack.IntroSpec/Services/ApiSpecMetadataService.cs
|
src/ServiceStack.IntroSpec/ServiceStack.IntroSpec/Services/ApiSpecMetadataService.cs
|
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
namespace ServiceStack.IntroSpec.Services
{
using System.Linq;
using DTO;
public class ApiSpecMetadataService : IService
{
private readonly IApiDocumentationProvider documentationProvider;
public ApiSpecMetadataService(IApiDocumentationProvider documentationProvider)
{
documentationProvider.ThrowIfNull(nameof(documentationProvider));
this.documentationProvider = documentationProvider;
}
public object Get(SpecMetadataRequest request)
{
var documentation = documentationProvider.GetApiDocumentation();
return SpecMetadataResponse.Create(
documentation.Resources.Select(r => r.TypeName).Distinct().ToArray(),
documentation.Resources.Select(r => r.Category).Where(c => !string.IsNullOrEmpty(c)).Distinct().ToArray(),
documentation.Resources.SelectMany(r => r.Tags ?? new string[0]).Distinct().ToArray()
);
}
}
}
|
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
namespace ServiceStack.IntroSpec.Services
{
using System.Linq;
using DTO;
public class ApiSpecMetadataService : IService
{
private readonly IApiDocumentationProvider documentationProvider;
public ApiSpecMetadataService(IApiDocumentationProvider documentationProvider)
{
documentationProvider.ThrowIfNull(nameof(documentationProvider));
this.documentationProvider = documentationProvider;
}
public object Get(SpecMetadataRequest request)
{
var documentation = documentationProvider.GetApiDocumentation();
return SpecMetadataResponse.Create(
documentation.Resources.Select(r => r.TypeName).Distinct().ToArray(),
documentation.Resources.Select(r => r.Category).Distinct().ToArray(),
documentation.Resources.SelectMany(r => r.Tags).Distinct().ToArray()
);
}
}
}
|
mpl-2.0
|
C#
|
70abf69f467a8ae6697ddf16af7e5292d9fa9d97
|
Add TabPage documentation (closes #38)
|
felipebz/ndapi
|
Ndapi/TabPage.cs
|
Ndapi/TabPage.cs
|
using Ndapi.Core.Handles;
using Ndapi.Enums;
using System.Collections.Generic;
namespace Ndapi
{
/// <summary>
/// Represents a tab page.
/// </summary>
public class TabPage : NdapiObject
{
/// <summary>
/// Creates a tab page.
/// </summary>
/// <param name="canvas">Canvas object.</param>
/// <param name="name">Tab page name.</param>
public TabPage(Canvas canvas, string name)
{
Create(name, ObjectType.TabPage, canvas);
}
internal TabPage(ObjectSafeHandle handle) : base(handle)
{
}
/// <summary>
/// Gets or sets the comment.
/// </summary>
public string Comment
{
get { return GetStringProperty(NdapiConstants.D2FP_COMMENT); }
set { SetStringProperty(NdapiConstants.D2FP_COMMENT, value); }
}
/// <summary>
/// Gets or sets whether the tab is enabled.
/// </summary>
public bool Enabled
{
get { return GetBooleanProperty(NdapiConstants.D2FP_ENABLED); }
set { SetBooleanProperty(NdapiConstants.D2FP_ENABLED, value); }
}
/// <summary>
/// Gets or sets the label.
/// </summary>
public string Label
{
get { return GetStringProperty(NdapiConstants.D2FP_LABEL); }
set { SetStringProperty(NdapiConstants.D2FP_LABEL, value); }
}
/// <summary>
/// Gets or sets whether the tab is visible.
/// </summary>
public bool Visible
{
get { return GetBooleanProperty(NdapiConstants.D2FP_VISIBLE); }
set { SetBooleanProperty(NdapiConstants.D2FP_VISIBLE, value); }
}
/// <summary>
/// Gets all the graphic objects attached to the canvas.
/// </summary>
public IEnumerable<Graphic> Graphics => GetObjectList<Graphic>(NdapiConstants.D2FP_GRAPHIC);
}
}
|
using Ndapi.Core.Handles;
using Ndapi.Enums;
using System.Collections.Generic;
namespace Ndapi
{
public class TabPage : NdapiObject
{
public TabPage(Canvas module, string name)
{
Create(name, ObjectType.TabPage, module);
}
internal TabPage(ObjectSafeHandle handle) : base(handle)
{
}
public string Comment
{
get { return GetStringProperty(NdapiConstants.D2FP_COMMENT); }
set { SetStringProperty(NdapiConstants.D2FP_COMMENT, value); }
}
public bool Enabled
{
get { return GetBooleanProperty(NdapiConstants.D2FP_ENABLED); }
set { SetBooleanProperty(NdapiConstants.D2FP_ENABLED, value); }
}
public string Label
{
get { return GetStringProperty(NdapiConstants.D2FP_LABEL); }
set { SetStringProperty(NdapiConstants.D2FP_LABEL, value); }
}
public bool Visible
{
get { return GetBooleanProperty(NdapiConstants.D2FP_VISIBLE); }
set { SetBooleanProperty(NdapiConstants.D2FP_VISIBLE, value); }
}
public IEnumerable<Graphic> Graphics => GetObjectList<Graphic>(NdapiConstants.D2FP_GRAPHIC);
}
}
|
mit
|
C#
|
cda5fdf4c2944b8555aac516fe9166429635e3a4
|
Update asset version number
|
PhannGor/unity3d-rainbow-folders
|
Assets/Plugins/RainbowFolders/Editor/Scripts/Info/AssetInfo.cs
|
Assets/Plugins/RainbowFolders/Editor/Scripts/Info/AssetInfo.cs
|
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Borodar.RainbowFolders.Editor
{
public class AssetInfo
{
public const string NAME = "Rainbow Folders";
public const string STORE_ID = "50668";
public const string VERSION = "0.7";
}
}
|
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Borodar.RainbowFolders.Editor
{
public class AssetInfo
{
public const string NAME = "Rainbow Folders";
public const string STORE_ID = "50668";
public const string VERSION = "0.5.0";
}
}
|
apache-2.0
|
C#
|
63729b3a47f977f6ab4b5c6346c8c9c7d8a0d564
|
Update CompactBinaryBondDeserializer.cs
|
tiksn/TIKSN-Framework
|
TIKSN.Core/Serialization/Bond/CompactBinaryBondDeserializer.cs
|
TIKSN.Core/Serialization/Bond/CompactBinaryBondDeserializer.cs
|
using Bond.IO.Safe;
using Bond.Protocols;
namespace TIKSN.Serialization.Bond
{
public class CompactBinaryBondDeserializer : DeserializerBase<byte[]>
{
protected override T DeserializeInternal<T>(byte[] serial)
{
var input = new InputBuffer(serial);
var reader = new CompactBinaryReader<InputBuffer>(input);
return global::Bond.Deserialize<T>.From(reader);
}
}
}
|
using Bond.IO.Safe;
using Bond.Protocols;
using TIKSN.Analytics.Telemetry;
namespace TIKSN.Serialization.Bond
{
public class CompactBinaryBondDeserializer : DeserializerBase<byte[]>
{
public CompactBinaryBondDeserializer(IExceptionTelemeter exceptionTelemeter) : base(exceptionTelemeter)
{
}
protected override T DeserializeInternal<T>(byte[] serial)
{
var input = new InputBuffer(serial);
var reader = new CompactBinaryReader<InputBuffer>(input);
return global::Bond.Deserialize<T>.From(reader);
}
}
}
|
mit
|
C#
|
0b1ea53058990199ddd8a526bdbe83b9cccc02f3
|
Update equality test
|
StanJav/language-ext,StefanBertels/language-ext,louthy/language-ext
|
Samples/Records/Program.cs
|
Samples/Records/Program.cs
|
using LanguageExt;
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Text;
namespace Records
{
class Program
{
static void Main(string[] args)
{
var opt1 = Maybe.Just(100);
var opt2 = Maybe.Just(100);
var optN = Maybe.Nothing<int>();
var res1 = opt1.Match(
Just: x => x * 2,
Nothing: () => 0);
var res2 = optN.Match(
Just: x => x * 2,
Nothing: () => 0);
var eqA = opt1.Equals(optN);
var eqB = opt1.Equals(opt2);
Console.WriteLine($"opt1: {opt1}");
Console.WriteLine($"optN: {optN}");
Console.WriteLine($"res1: {res1}");
Console.WriteLine($"res2: {res2}");
Console.ReadKey();
}
}
}
|
using LanguageExt;
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Text;
namespace Records
{
class Program
{
static void Main(string[] args)
{
var opt1 = Maybe.Just(100);
var opt2 = Maybe.Nothing<int>();
var res1 = opt1.Match(
Just: x => x * 2,
Nothing: () => 0);
var res2 = opt2.Match(
Just: x => x * 2,
Nothing: () => 0);
var eqA = opt1 == opt2;
var eqB = opt1 != opt2;
Console.WriteLine($"opt1: {opt1}");
Console.WriteLine($"opt2: {opt2}");
Console.WriteLine($"res1: {res1}");
Console.WriteLine($"res2: {res2}");
Console.ReadKey();
}
}
}
|
mit
|
C#
|
666a7ae692dbfdb93c7ac50878c95289ffbade5e
|
fix a test
|
IdentityModel/IdentityModel,IdentityModel/IdentityModel2,IdentityModel/IdentityModelv2,IdentityModel/IdentityModel,IdentityModel/IdentityModel2,IdentityModel/IdentityModelv2
|
test/UnitTests/RequestUrlTests.cs
|
test/UnitTests/RequestUrlTests.cs
|
// Copyright (c) Brock Allen & Dominick Baier. All rights reserved.
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
using FluentAssertions;
using IdentityModel.Client;
using System.Collections.Generic;
using Xunit;
namespace IdentityModel.UnitTests
{
public class RequestUrlTests
{
[Fact]
public void null_value_should_return_base()
{
var request = new RequestUrl("http://server/authorize");
var url = request.Create(null);
url.Should().Be("http://server/authorize");
}
[Fact]
public void empty_value_should_return_base()
{
var request = new RequestUrl("http://server/authorize");
var values = new Dictionary<string, string>();
var url = request.Create(values);
url.Should().Be("http://server/authorize");
}
[Fact]
public void Create_absolute_url_should_behave_as_expected()
{
var request = new RequestUrl("http://server/authorize");
var parmeters = new
{
foo = "foo",
bar = "bar"
};
var url = request.Create(parmeters);
url.Should().Be("http://server/authorize?foo=foo&bar=bar");
}
[Fact]
public void Create_relative_url_should_behave_as_expected()
{
var request = new RequestUrl("/authorize");
var parmeters = new
{
foo = "foo",
bar = "bar"
};
var url = request.Create(parmeters);
url.Should().Be("/authorize?foo=foo&bar=bar");
}
}
}
|
// Copyright (c) Brock Allen & Dominick Baier. All rights reserved.
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
using FluentAssertions;
using IdentityModel.Client;
using System.Collections.Generic;
using Xunit;
namespace IdentityModel.UnitTests
{
public class RequestUrlTests
{
[Fact]
public void null_value_should_return_base()
{
var request = new RequestUrl("http://server/authorize");
var url = request.Create(null);
url.Should().Be("http://server/authorize");
}
[Fact]
public void empty_value_should_return_base()
{
var request = new RequestUrl("http://server/authorize");
var values = new Dictionary<string, string>();
var url = request.Create(null);
url.Should().Be("http://server/authorize");
}
[Fact]
public void Create_absolute_url_should_behave_as_expected()
{
var request = new RequestUrl("http://server/authorize");
var parmeters = new
{
foo = "foo",
bar = "bar"
};
var url = request.Create(parmeters);
url.Should().Be("http://server/authorize?foo=foo&bar=bar");
}
[Fact]
public void Create_relative_url_should_behave_as_expected()
{
var request = new RequestUrl("/authorize");
var parmeters = new
{
foo = "foo",
bar = "bar"
};
var url = request.Create(parmeters);
url.Should().Be("/authorize?foo=foo&bar=bar");
}
}
}
|
apache-2.0
|
C#
|
715e115f9e7123e44eb47f4e4a8619b47215f86e
|
Fix - Corretto disaccoppiamento schede contatto
|
vvfosprojects/sovvf,vvfosprojects/sovvf,vvfosprojects/sovvf,vvfosprojects/sovvf,vvfosprojects/sovvf
|
src/backend/SO115App.Persistence.MongoDB/GestioneSchedeContatto/UpDateSchedeContatto.cs
|
src/backend/SO115App.Persistence.MongoDB/GestioneSchedeContatto/UpDateSchedeContatto.cs
|
//-----------------------------------------------------------------------
// <copyright file="UpDateRichiesta.cs" company="CNVVF">
// Copyright (C) 2017 - CNVVF
//
// This file is part of SOVVF.
// SOVVF is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// SOVVF is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see http://www.gnu.org/licenses/.
// </copyright>
//-----------------------------------------------------------------------
using MongoDB.Driver;
using Persistence.MongoDB;
using SO115App.Models.Classi.NUE;
using SO115App.Models.Servizi.Infrastruttura.SistemiEsterni.Nue;
namespace SO115App.Persistence.MongoDB
{
public class UpDateSchedeContatto : IMergeSchedeContatto
{
private readonly DbContext _dbContext;
public UpDateSchedeContatto(DbContext dbContext)
{
_dbContext = dbContext;
}
public void Merge(SchedaContatto scheda, string codiceSede)
{
var filter = Builders<SchedaContatto>.Filter.Eq(s => s.CodiceScheda, scheda.CodiceScheda);
var replaceOption = new ReplaceOptions();
replaceOption.IsUpsert = true;
_dbContext.SchedeContattoCollection.InsertOne(scheda);
foreach (var schedaMergiata in scheda.Collegate)
{
var filterMerged = Builders<SchedaContatto>.Filter.Eq(s => s.CodiceScheda, schedaMergiata.CodiceScheda);
_dbContext.SchedeContattoCollection.InsertOne(schedaMergiata);
}
}
}
}
|
//-----------------------------------------------------------------------
// <copyright file="UpDateRichiesta.cs" company="CNVVF">
// Copyright (C) 2017 - CNVVF
//
// This file is part of SOVVF.
// SOVVF is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// SOVVF is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see http://www.gnu.org/licenses/.
// </copyright>
//-----------------------------------------------------------------------
using MongoDB.Driver;
using Persistence.MongoDB;
using SO115App.Models.Classi.NUE;
using SO115App.Models.Servizi.Infrastruttura.SistemiEsterni.Nue;
namespace SO115App.Persistence.MongoDB
{
public class UpDateSchedeContatto : IMergeSchedeContatto
{
private readonly DbContext _dbContext;
public UpDateSchedeContatto(DbContext dbContext)
{
_dbContext = dbContext;
}
public void Merge(SchedaContatto scheda, string codiceSede)
{
var filter = Builders<SchedaContatto>.Filter.Eq(s => s.CodiceScheda, scheda.CodiceScheda);
var replaceOption = new ReplaceOptions();
replaceOption.IsUpsert = true;
_dbContext.SchedeContattoCollection.ReplaceOne(filter, scheda, replaceOption);
foreach (var schedaMergiata in scheda.Collegate)
{
var filterMerged = Builders<SchedaContatto>.Filter.Eq(s => s.CodiceScheda, schedaMergiata.CodiceScheda);
_dbContext.SchedeContattoCollection.ReplaceOne(filterMerged, schedaMergiata, replaceOption);
}
}
}
}
|
agpl-3.0
|
C#
|
b7207d2639aab624c273ed73a030e88c5270ba3b
|
Use GTK for OSX
|
nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet
|
WalletWasabi.Gui/Program.cs
|
WalletWasabi.Gui/Program.cs
|
using Avalonia;
using AvalonStudio.Shell;
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using WalletWasabi.Gui.ViewModels;
using WalletWasabi.Logging;
namespace WalletWasabi.Gui
{
internal class Program
{
#pragma warning disable IDE1006 // Naming Styles
private static async Task Main(string[] args)
#pragma warning restore IDE1006 // Naming Styles
{
StatusBarViewModel statusBar = null;
try
{
Logger.SetFilePath(Path.Combine(Global.DataDir, "Logs.txt"));
#if RELEASE
Logger.SetMinimumLevel(LogLevel.Info);
Logger.SetModes(LogMode.File);
#else
Logger.SetMinimumLevel(LogLevel.Debug);
Logger.SetModes(LogMode.Debug, LogMode.Console, LogMode.File);
#endif
var configFilePath = Path.Combine(Global.DataDir, "Config.json");
var config = new Config(configFilePath);
await config.LoadOrCreateDefaultFileAsync();
Logger.LogInfo<Config>("Config is successfully initialized.");
Global.Initialize(config);
statusBar = new StatusBarViewModel(Global.Nodes.ConnectedNodes, Global.MemPoolService, Global.IndexDownloader);
MainWindowViewModel.Instance = new MainWindowViewModel(statusBar);
BuildAvaloniaApp()
.StartShellApp<AppBuilder, MainWindow>("Wasabi Wallet", new DefaultLayoutFactory(), () => MainWindowViewModel.Instance);
}
catch (Exception ex)
{
Logger.LogCritical<Program>(ex);
}
finally
{
statusBar?.Dispose();
await Global.DisposeAsync();
}
}
private static AppBuilder BuildAvaloniaApp()
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
return AppBuilder.Configure<App>().UseGtk3().UseSkia().UseReactiveUI();
}
return AppBuilder.Configure<App>().UsePlatformDetect().UseReactiveUI();
}
}
}
|
using Avalonia;
using AvalonStudio.Shell;
using System;
using System.IO;
using System.Threading.Tasks;
using WalletWasabi.Gui.ViewModels;
using WalletWasabi.Logging;
namespace WalletWasabi.Gui
{
internal class Program
{
#pragma warning disable IDE1006 // Naming Styles
private static async Task Main(string[] args)
#pragma warning restore IDE1006 // Naming Styles
{
StatusBarViewModel statusBar = null;
try
{
Logger.SetFilePath(Path.Combine(Global.DataDir, "Logs.txt"));
#if RELEASE
Logger.SetMinimumLevel(LogLevel.Info);
Logger.SetModes(LogMode.File);
#else
Logger.SetMinimumLevel(LogLevel.Debug);
Logger.SetModes(LogMode.Debug, LogMode.Console, LogMode.File);
#endif
var configFilePath = Path.Combine(Global.DataDir, "Config.json");
var config = new Config(configFilePath);
await config.LoadOrCreateDefaultFileAsync();
Logger.LogInfo<Config>("Config is successfully initialized.");
Global.Initialize(config);
statusBar = new StatusBarViewModel(Global.Nodes.ConnectedNodes, Global.MemPoolService, Global.IndexDownloader);
MainWindowViewModel.Instance = new MainWindowViewModel(statusBar);
BuildAvaloniaApp()
.StartShellApp<AppBuilder, MainWindow>("Wasabi Wallet", new DefaultLayoutFactory(), () => MainWindowViewModel.Instance);
}
catch (Exception ex)
{
Logger.LogCritical<Program>(ex);
}
finally
{
statusBar?.Dispose();
await Global.DisposeAsync();
}
}
private static AppBuilder BuildAvaloniaApp() => AppBuilder.Configure<App>().UsePlatformDetect().UseReactiveUI();
}
}
|
mit
|
C#
|
0ef62429123e33044b57e93d214c4f7691fbbd7a
|
Fix merge
|
mavasani/roslyn,AmadeusW/roslyn,eriawan/roslyn,weltkante/roslyn,shyamnamboodiripad/roslyn,heejaechang/roslyn,KevinRansom/roslyn,mgoertz-msft/roslyn,dotnet/roslyn,AmadeusW/roslyn,mgoertz-msft/roslyn,physhi/roslyn,jasonmalinowski/roslyn,heejaechang/roslyn,CyrusNajmabadi/roslyn,wvdd007/roslyn,panopticoncentral/roslyn,stephentoub/roslyn,genlu/roslyn,aelij/roslyn,genlu/roslyn,panopticoncentral/roslyn,tmat/roslyn,AlekseyTs/roslyn,eriawan/roslyn,diryboy/roslyn,reaction1989/roslyn,ErikSchierboom/roslyn,tmat/roslyn,aelij/roslyn,heejaechang/roslyn,davkean/roslyn,physhi/roslyn,davkean/roslyn,panopticoncentral/roslyn,mavasani/roslyn,ErikSchierboom/roslyn,jasonmalinowski/roslyn,AmadeusW/roslyn,KirillOsenkov/roslyn,gafter/roslyn,bartdesmet/roslyn,aelij/roslyn,dotnet/roslyn,jmarolf/roslyn,sharwell/roslyn,tannergooding/roslyn,stephentoub/roslyn,brettfo/roslyn,AlekseyTs/roslyn,shyamnamboodiripad/roslyn,reaction1989/roslyn,brettfo/roslyn,KirillOsenkov/roslyn,reaction1989/roslyn,diryboy/roslyn,dotnet/roslyn,jasonmalinowski/roslyn,mavasani/roslyn,sharwell/roslyn,physhi/roslyn,davkean/roslyn,ErikSchierboom/roslyn,tmat/roslyn,bartdesmet/roslyn,eriawan/roslyn,KirillOsenkov/roslyn,jmarolf/roslyn,KevinRansom/roslyn,weltkante/roslyn,weltkante/roslyn,shyamnamboodiripad/roslyn,sharwell/roslyn,AlekseyTs/roslyn,bartdesmet/roslyn,CyrusNajmabadi/roslyn,tannergooding/roslyn,mgoertz-msft/roslyn,wvdd007/roslyn,diryboy/roslyn,genlu/roslyn,gafter/roslyn,tannergooding/roslyn,jmarolf/roslyn,wvdd007/roslyn,CyrusNajmabadi/roslyn,KevinRansom/roslyn,stephentoub/roslyn,gafter/roslyn,brettfo/roslyn
|
src/VisualStudio/Core/Def/Implementation/LanguageClient/LiveShareLanguageServerClient.cs
|
src/VisualStudio/Core/Def/Implementation/LanguageClient/LiveShareLanguageServerClient.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#nullable enable
using System;
using System.ComponentModel.Composition;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.Editor;
using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.CodeAnalysis.LanguageServer;
using Microsoft.VisualStudio.LanguageServer.Client;
using Microsoft.VisualStudio.Utilities;
namespace Microsoft.VisualStudio.LanguageServices.Implementation.LanguageService
{
[ContentType(ContentTypeNames.CSharpLspContentTypeName)]
[ContentType(ContentTypeNames.VBLspContentTypeName)]
[Export(typeof(ILanguageClient))]
internal class LiveShareLanguageServerClient : AbstractLiveShareLanguageServerClient
{
[ImportingConstructor]
[Obsolete(MefConstruction.ImportingConstructorMessage, true)]
public LiveShareLanguageServerClient(LanguageServerProtocol languageServerProtocol, VisualStudioWorkspace workspace, IDiagnosticService diagnosticService)
: base(languageServerProtocol, workspace, diagnosticService, diagnosticsClientName: null)
{
}
}
public override string Name => ServicesVSResources.Live_Share_CSharp_Visual_Basic_Language_Server_Client;
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#nullable enable
using System;
using System.ComponentModel.Composition;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.Editor;
using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.CodeAnalysis.LanguageServer;
using Microsoft.VisualStudio.LanguageServer.Client;
using Microsoft.VisualStudio.Utilities;
namespace Microsoft.VisualStudio.LanguageServices.Implementation.LanguageService
{
[ContentType(ContentTypeNames.CSharpLspContentTypeName)]
[ContentType(ContentTypeNames.VBLspContentTypeName)]
[Export(typeof(ILanguageClient))]
internal class LiveShareLanguageServerClient : AbstractLiveShareLanguageServerClient
{
[ImportingConstructor]
[Obsolete(MefConstruction.ImportingConstructorMessage, true)]
public LiveShareLanguageServerClient(LanguageServerProtocol languageServerProtocol, VisualStudioWorkspace workspace, IDiagnosticService diagnosticService)
: base(languageServerProtocol, workspace, diagnosticService, diagnosticsClientName: null)
{
}
}
}
|
mit
|
C#
|
7c5dd74dbedb850fda6c647d30c80affaa4b10c8
|
Add GravatarEmail in UserProfile
|
surrealist/git-newhand,surrealist/git-newhand
|
git-newhand.Web/Models/AccountModels.cs
|
git-newhand.Web/Models/AccountModels.cs
|
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity;
using System.Globalization;
using System.Web.Security;
namespace git_newhand.Web.Models {
public class UsersContext : DbContext {
public UsersContext()
: base("DefaultConnection") {
}
public DbSet<UserProfile> UserProfiles { get; set; }
}
[Table("UserProfile")]
public class UserProfile {
[Key]
[DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
public int UserId { get; set; }
public string UserName { get; set; }
public string GravatarEmail { get; set; }
public string DisplayName { get; set; }
}
public class RegisterExternalLoginModel {
[Required]
[Display(Name = "User name")]
public string UserName { get; set; }
public string ExternalLoginData { get; set; }
}
public class LocalPasswordModel {
[Required]
[DataType(DataType.Password)]
[Display(Name = "Current password")]
public string OldPassword { get; set; }
[Required]
[StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
[DataType(DataType.Password)]
[Display(Name = "New password")]
public string NewPassword { get; set; }
[DataType(DataType.Password)]
[Display(Name = "Confirm new password")]
[Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
public string ConfirmPassword { get; set; }
}
public class LoginModel {
[Required]
[Display(Name = "User name")]
public string UserName { get; set; }
[Required]
[DataType(DataType.Password)]
[Display(Name = "Password")]
public string Password { get; set; }
[Display(Name = "Remember me?")]
public bool RememberMe { get; set; }
}
public class RegisterModel {
[Required]
[Display(Name = "User name")]
public string UserName { get; set; }
[Required]
[StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
[DataType(DataType.Password)]
[Display(Name = "Password")]
public string Password { get; set; }
[DataType(DataType.Password)]
[Display(Name = "Confirm password")]
[Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
public string ConfirmPassword { get; set; }
}
public class ExternalLogin {
public string Provider { get; set; }
public string ProviderDisplayName { get; set; }
public string ProviderUserId { get; set; }
}
}
|
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity;
using System.Globalization;
using System.Web.Security;
namespace git_newhand.Web.Models {
public class UsersContext : DbContext {
public UsersContext()
: base("DefaultConnection") {
}
public DbSet<UserProfile> UserProfiles { get; set; }
}
[Table("UserProfile")]
public class UserProfile {
[Key]
[DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
public int UserId { get; set; }
public string UserName { get; set; }
}
public class RegisterExternalLoginModel {
[Required]
[Display(Name = "User name")]
public string UserName { get; set; }
public string ExternalLoginData { get; set; }
}
public class LocalPasswordModel {
[Required]
[DataType(DataType.Password)]
[Display(Name = "Current password")]
public string OldPassword { get; set; }
[Required]
[StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
[DataType(DataType.Password)]
[Display(Name = "New password")]
public string NewPassword { get; set; }
[DataType(DataType.Password)]
[Display(Name = "Confirm new password")]
[Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
public string ConfirmPassword { get; set; }
}
public class LoginModel {
[Required]
[Display(Name = "User name")]
public string UserName { get; set; }
[Required]
[DataType(DataType.Password)]
[Display(Name = "Password")]
public string Password { get; set; }
[Display(Name = "Remember me?")]
public bool RememberMe { get; set; }
}
public class RegisterModel {
[Required]
[Display(Name = "User name")]
public string UserName { get; set; }
[Required]
[StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
[DataType(DataType.Password)]
[Display(Name = "Password")]
public string Password { get; set; }
[DataType(DataType.Password)]
[Display(Name = "Confirm password")]
[Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
public string ConfirmPassword { get; set; }
}
public class ExternalLogin {
public string Provider { get; set; }
public string ProviderDisplayName { get; set; }
public string ProviderUserId { get; set; }
}
}
|
mit
|
C#
|
bb1aacb360758c2c5e21e172bcb9f1985933a2b9
|
Fix SkinnableSprite initialising a drawable even when the texture is not available
|
peppy/osu,NeoAdonis/osu,UselessToucan/osu,peppy/osu,smoogipoo/osu,peppy/osu-new,UselessToucan/osu,ppy/osu,ppy/osu,UselessToucan/osu,smoogipoo/osu,ppy/osu,smoogipoo/osu,peppy/osu,NeoAdonis/osu,NeoAdonis/osu,smoogipooo/osu
|
osu.Game/Skinning/SkinnableSprite.cs
|
osu.Game/Skinning/SkinnableSprite.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
namespace osu.Game.Skinning
{
/// <summary>
/// A skinnable element which uses a stable sprite and can therefore share implementation logic.
/// </summary>
public class SkinnableSprite : SkinnableDrawable
{
protected override bool ApplySizeRestrictionsToDefault => true;
[Resolved]
private TextureStore textures { get; set; }
public SkinnableSprite(string textureName, Func<ISkinSource, bool> allowFallback = null, ConfineMode confineMode = ConfineMode.NoScaling)
: base(new SpriteComponent(textureName), allowFallback, confineMode)
{
}
protected override Drawable CreateDefault(ISkinComponent component)
{
var texture = textures.Get(component.LookupName);
if (texture == null)
return null;
return new Sprite { Texture = texture };
}
private class SpriteComponent : ISkinComponent
{
public SpriteComponent(string textureName)
{
LookupName = textureName;
}
public string LookupName { get; }
}
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
namespace osu.Game.Skinning
{
/// <summary>
/// A skinnable element which uses a stable sprite and can therefore share implementation logic.
/// </summary>
public class SkinnableSprite : SkinnableDrawable
{
protected override bool ApplySizeRestrictionsToDefault => true;
[Resolved]
private TextureStore textures { get; set; }
public SkinnableSprite(string textureName, Func<ISkinSource, bool> allowFallback = null, ConfineMode confineMode = ConfineMode.NoScaling)
: base(new SpriteComponent(textureName), allowFallback, confineMode)
{
}
protected override Drawable CreateDefault(ISkinComponent component) => new Sprite { Texture = textures.Get(component.LookupName) };
private class SpriteComponent : ISkinComponent
{
public SpriteComponent(string textureName)
{
LookupName = textureName;
}
public string LookupName { get; }
}
}
}
|
mit
|
C#
|
5326f504cc2dbcd5485fc27fd106bd17452c1103
|
Make CLI work with paths containing spaces.
|
activescott/lessmsi,activescott/lessmsi,activescott/lessmsi
|
src/LessMsi.Cli/OpenGuiCommand.cs
|
src/LessMsi.Cli/OpenGuiCommand.cs
|
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using NDesk.Options;
namespace LessMsi.Cli
{
internal class OpenGuiCommand : LessMsiCommand
{
public override void Run(List<string> args)
{
if (args.Count < 2)
throw new OptionException("You must specify the name of the msi file to open when using the o command.", "o");
ShowGui(args);
}
public static void ShowGui(List<string> args)
{
var guiExe = Path.Combine(AppPath, "lessmsi-gui.exe");
if (File.Exists(guiExe))
{
var p = new Process();
p.StartInfo.FileName = guiExe;
if (args.Count > 0)
{
// We add double quotes to support paths with spaces, for ex: "E:\Downloads and Sofware\potato.msi".
p.StartInfo.Arguments = string.Format("\"{0}\"", args[1]);
p.Start();
}
else
p.Start();
}
}
private static string AppPath
{
get
{
var codeBase = new Uri(typeof(OpenGuiCommand).Assembly.CodeBase);
var local = Path.GetDirectoryName(codeBase.LocalPath);
return local;
}
}
}
}
|
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using NDesk.Options;
namespace LessMsi.Cli
{
internal class OpenGuiCommand : LessMsiCommand
{
public override void Run(List<string> args)
{
if (args.Count < 2)
throw new OptionException("You must specify the name of the msi file to open when using the o command.", "o");
ShowGui(args);
}
public static void ShowGui(List<string> args)
{
var guiExe = Path.Combine(AppPath, "lessmsi-gui.exe");
if (File.Exists(guiExe))
{
//should we wait for exit?
if (args.Count > 0)
Process.Start(guiExe, args[1]);
else
Process.Start(guiExe);
}
}
private static string AppPath
{
get
{
var codeBase = new Uri(typeof(OpenGuiCommand).Assembly.CodeBase);
var local = Path.GetDirectoryName(codeBase.LocalPath);
return local;
}
}
}
}
|
mit
|
C#
|
ea23b4a831a9b5886ce781f8cc45870377083fad
|
Fix shell-completion.yml to exclude unlisted targets for invocation
|
nuke-build/nuke,nuke-build/nuke,nuke-build/nuke,nuke-build/nuke
|
source/Nuke.Common/Execution/HandleShellCompletionAttribute.cs
|
source/Nuke.Common/Execution/HandleShellCompletionAttribute.cs
|
// Copyright 2019 Maintainers of NUKE.
// Distributed under the MIT License.
// https://github.com/nuke-build/nuke/blob/master/LICENSE
using System;
using System.Collections.Generic;
using System.Linq;
using Nuke.Common.IO;
using static Nuke.Common.Constants;
namespace Nuke.Common.Execution
{
[AttributeUsage(AttributeTargets.Class)]
internal class HandleShellCompletionAttribute : Attribute, IOnBeforeLogo
{
public void OnBeforeLogo(
NukeBuild build,
IReadOnlyCollection<ExecutableTarget> executableTargets)
{
var completionItems = new SortedDictionary<string, string[]>();
var targets = build.ExecutableTargets.OrderBy(x => x.Name).ToList();
completionItems[InvokedTargetsParameterName] = targets.Where(x => x.Listed).Select(x => x.Name).ToArray();
completionItems[SkippedTargetsParameterName] = targets.Select(x => x.Name).ToArray();
var parameters = InjectionUtility.GetParameterMembers(build.GetType(), includeUnlisted: false);
foreach (var parameter in parameters)
{
var parameterName = ParameterService.GetParameterMemberName(parameter);
if (completionItems.ContainsKey(parameterName))
continue;
var subItems = ParameterService.GetParameterValueSet(parameter, build)?.Select(x => x.Text);
completionItems[parameterName] = subItems?.ToArray();
}
SerializationTasks.YamlSerializeToFile(completionItems, GetCompletionFile(NukeBuild.RootDirectory));
if (EnvironmentInfo.GetParameter<bool>(CompletionParameterName))
Environment.Exit(exitCode: 0);
}
}
}
|
// Copyright 2019 Maintainers of NUKE.
// Distributed under the MIT License.
// https://github.com/nuke-build/nuke/blob/master/LICENSE
using System;
using System.Collections.Generic;
using System.Linq;
using Nuke.Common.IO;
namespace Nuke.Common.Execution
{
[AttributeUsage(AttributeTargets.Class)]
internal class HandleShellCompletionAttribute : Attribute, IOnBeforeLogo
{
public void OnBeforeLogo(
NukeBuild build,
IReadOnlyCollection<ExecutableTarget> executableTargets)
{
var completionItems = new SortedDictionary<string, string[]>();
var targetNames = build.ExecutableTargets.Select(x => x.Name).OrderBy(x => x).ToList();
completionItems[Constants.InvokedTargetsParameterName] = targetNames.ToArray();
completionItems[Constants.SkippedTargetsParameterName] = targetNames.ToArray();
var parameters = InjectionUtility.GetParameterMembers(build.GetType(), includeUnlisted: false);
foreach (var parameter in parameters)
{
var parameterName = ParameterService.GetParameterMemberName(parameter);
if (completionItems.ContainsKey(parameterName))
continue;
var subItems = ParameterService.GetParameterValueSet(parameter, build)?.Select(x => x.Text);
completionItems[parameterName] = subItems?.ToArray();
}
SerializationTasks.YamlSerializeToFile(completionItems, Constants.GetCompletionFile(NukeBuild.RootDirectory));
if (EnvironmentInfo.GetParameter<bool>(Constants.CompletionParameterName))
Environment.Exit(exitCode: 0);
}
}
}
|
mit
|
C#
|
f4520c7532764dbb6be32be4a5cdb3aa8667c5b4
|
Update PixelBandAccessor.cs
|
LANDIS-II-Foundation/Landis-Spatial-Modeling-Library
|
src/RasterIO/PixelBandAccessor.cs
|
src/RasterIO/PixelBandAccessor.cs
|
// Contributors:
// James Domingo, Green Code LLC
using Landis.SpatialModeling;
namespace Landis.RasterIO
{
/// <summary>
/// Accessor for getting or seting a particular pixel band.
/// </summary>
public abstract class PixelBandAccessor<T>
where T : struct
{
protected Band<T> pixelBand;
protected PixelBandAccessor(PixelBand pixelBand)
{
this.pixelBand = pixelBand as Band<T>;
if (this.pixelBand == null)
throw new System.ArgumentException("pixelBand is not a Band<T>");
}
}
}
|
// Copyright 2010 Green Code LLC
// All rights reserved.
//
// The copyright holders license this file under the New (3-clause) BSD
// License (the "License"). You may not use this file except in
// compliance with the License. A copy of the License is available at
//
// http://www.opensource.org/licenses/BSD-3-Clause
//
// and is included in the NOTICE.txt file distributed with this work.
//
// Contributors:
// James Domingo, Green Code LLC
using Landis.SpatialModeling;
namespace Landis.RasterIO
{
/// <summary>
/// Accessor for getting or seting a particular pixel band.
/// </summary>
public abstract class PixelBandAccessor<T>
where T : struct
{
protected Band<T> pixelBand;
protected PixelBandAccessor(PixelBand pixelBand)
{
this.pixelBand = pixelBand as Band<T>;
if (this.pixelBand == null)
throw new System.ArgumentException("pixelBand is not a Band<T>");
}
}
}
|
apache-2.0
|
C#
|
27b6565b4c1c4a0e26ad52118cf517988834f6ba
|
Update comments
|
cshung/clrmd,cshung/clrmd,Microsoft/clrmd,Microsoft/clrmd
|
src/Microsoft.Diagnostics.Runtime/src/Common/ClrStaticField.cs
|
src/Microsoft.Diagnostics.Runtime/src/Common/ClrStaticField.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
namespace Microsoft.Diagnostics.Runtime
{
/// <summary>
/// Represents a static field in the target process.
/// </summary>
public abstract class ClrStaticField : ClrField
{
/// <summary>
/// Returns whether this static field has been initialized in a particular AppDomain
/// or not. If a static variable has not been initialized, then its class constructor
/// may have not been run yet. Calling any of the Read* methods on an uninitialized static
/// will result in returning either NULL or a value of 0.
/// </summary>
/// <param name="appDomain">The AppDomain to see if the variable has been initialized.</param>
/// <returns>
/// True if the field has been initialized (even if initialized to NULL or a default
/// value), false if the runtime has not initialized this variable.
/// </returns>
public abstract bool IsInitialized(ClrAppDomain appDomain);
/// <summary>
/// Gets the address of the static field's value in memory.
/// </summary>
/// <returns>The address of the field's value.</returns>
public abstract ulong GetAddress(ClrAppDomain appDomain);
/// <summary>
/// Reads the value of the field as an unmanaged struct or primitive type.
/// </summary>
/// <typeparam name="T">An unmanaged struct or primitive type.</typeparam>
/// <returns>The value read.</returns>
public abstract T Read<T>(ClrAppDomain appDomain) where T : unmanaged;
/// <summary>
/// Reads the value of an object field.
/// </summary>
/// <returns>The value read.</returns>
public abstract ClrObject ReadObject(ClrAppDomain appDomain);
/// <summary>
/// Reads a ValueType struct from the instance field.
/// </summary>
/// <returns>The value read.</returns>
public abstract ClrValueType ReadStruct(ClrAppDomain appDomain);
/// <summary>
/// Reads a string from the instance field.
/// </summary>
/// <returns>The value read.</returns>
public abstract string? ReadString(ClrAppDomain appDomain);
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
namespace Microsoft.Diagnostics.Runtime
{
/// <summary>
/// Represents a static field in the target process.
/// </summary>
public abstract class ClrStaticField : ClrField
{
/// <summary>
/// Returns whether this static field has been initialized in a particular AppDomain
/// or not. If a static variable has not been initialized, then its class constructor
/// may have not been run yet. Calling GetFieldValue on an uninitialized static
/// will result in returning either NULL or a value of 0.
/// </summary>
/// <param name="appDomain">The AppDomain to see if the variable has been initialized.</param>
/// <returns>
/// True if the field has been initialized (even if initialized to NULL or a default
/// value), false if the runtime has not initialized this variable.
/// </returns>
public abstract bool IsInitialized(ClrAppDomain appDomain);
/// <summary>
/// Gets the address of the static field's value in memory.
/// </summary>
/// <returns>The address of the field's value.</returns>
public abstract ulong GetAddress(ClrAppDomain appDomain);
/// <summary>
/// Reads the value of the field as an unmanaged struct or primitive type.
/// </summary>
/// <typeparam name="T">An unmanaged struct or primitive type.</typeparam>
/// <returns>The value read.</returns>
public abstract T Read<T>(ClrAppDomain appDomain) where T : unmanaged;
/// <summary>
/// Reads the value of an object field.
/// </summary>
/// <returns>The value read.</returns>
public abstract ClrObject ReadObject(ClrAppDomain appDomain);
/// <summary>
/// Reads a ValueType struct from the instance field.
/// </summary>
/// <returns>The value read.</returns>
public abstract ClrValueType ReadStruct(ClrAppDomain appDomain);
/// <summary>
/// Reads a string from the instance field.
/// </summary>
/// <returns>The value read.</returns>
public abstract string? ReadString(ClrAppDomain appDomain);
}
}
|
mit
|
C#
|
90eb88c56755717609f38ca3cea5897a3b7e8f72
|
Fix conditional in interface
|
ginach/onedrive-sdk-csharp,gitasaurus/onedrive-sdk-csharp,OneDrive/onedrive-sdk-csharp
|
src/OneDriveSdk.Common/Authentication/IAuthenticationResult.cs
|
src/OneDriveSdk.Common/Authentication/IAuthenticationResult.cs
|
// ------------------------------------------------------------------------------
// Copyright (c) 2015 Microsoft Corporation
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
// ------------------------------------------------------------------------------
namespace Microsoft.OneDrive.Sdk
{
using System;
using Microsoft.IdentityModel.Clients.ActiveDirectory;
public interface IAuthenticationResult
{
string AccessToken { get; }
string AccessTokenType { get; }
DateTimeOffset ExpiresOn { get; }
string IdToken { get; }
bool IsMultipleResourceRefreshToken { get; }
string RefreshToken { get; }
string TenantId { get; }
UserInfo UserInfo { get; }
#if WINRT
string Error { get; }
string ErrorDescription { get; }
AuthenticationStatus Status { get; }
int StatusCode { get; set; }
#endif
string CreateAuthorizationHeader();
string Serialize();
}
}
|
// ------------------------------------------------------------------------------
// Copyright (c) 2015 Microsoft Corporation
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
// ------------------------------------------------------------------------------
namespace Microsoft.OneDrive.Sdk
{
using System;
using Microsoft.IdentityModel.Clients.ActiveDirectory;
public interface IAuthenticationResult
{
string AccessToken { get; }
string AccessTokenType { get; }
DateTimeOffset ExpiresOn { get; }
string IdToken { get; }
bool IsMultipleResourceRefreshToken { get; }
string RefreshToken { get; }
string TenantId { get; }
UserInfo UserInfo { get; }
#if !WINFORMS
string Error { get; }
string ErrorDescription { get; }
AuthenticationStatus Status { get; }
int StatusCode { get; set; }
#endif
string CreateAuthorizationHeader();
string Serialize();
}
}
|
mit
|
C#
|
9d7715a0ec042f7220663fb49286e6e7e19f4626
|
Add some comments to DataMigration (#8623)
|
xkproject/Orchard2,xkproject/Orchard2,stevetayloruk/Orchard2,stevetayloruk/Orchard2,stevetayloruk/Orchard2,xkproject/Orchard2,stevetayloruk/Orchard2,xkproject/Orchard2,stevetayloruk/Orchard2,xkproject/Orchard2
|
src/OrchardCore/OrchardCore.Data.Abstractions/DataMigration.cs
|
src/OrchardCore/OrchardCore.Data.Abstractions/DataMigration.cs
|
using YesSql.Sql;
namespace OrchardCore.Data.Migration
{
/// <summary>
/// A <see cref="DataMigration"/> is discovered through method reflection
/// and runs sequentially from the Create() method through UpdateFromX().
/// </summary>
/// <example>
/// Usage of method implementations:
/// <code>
/// public class Migrations : DataMigration
/// {
/// public void Create() { return 1; } // or
/// public Task CreateAsync() { return 1; }
/// public void UpdateFrom1() { return 2; } // or
/// public Task UpdateFrom1Async() { return 2; }
/// public void Uninstall() { } // or
/// public Task UninstallAsync() { }
/// }
/// </code>
/// </example>
public abstract class DataMigration : IDataMigration
{
/// <inheritdocs />
public ISchemaBuilder SchemaBuilder { get; set; }
}
}
|
using YesSql.Sql;
namespace OrchardCore.Data.Migration
{
/// <summary>
/// Represents a database migration.
/// </summary>
public abstract class DataMigration : IDataMigration
{
/// <inheritdocs />
public ISchemaBuilder SchemaBuilder { get; set; }
}
}
|
bsd-3-clause
|
C#
|
ac11de7efb5d71125d07eb0efc9ce230e88e841a
|
Correct order of params in diff highlighter tests
|
chaitanyagurrapu/shouldly,JoeMighty/shouldly,AmadeusW/shouldly,ankurMalhotra/shouldly
|
src/Shouldly.Tests/InternalTests/StringDiffHighlighterTests.cs
|
src/Shouldly.Tests/InternalTests/StringDiffHighlighterTests.cs
|
using NUnit.Framework;
using Shouldly.DifferenceHighlighting2;
using System;
namespace Shouldly.Tests.InternalTests
{
[TestFixture]
public static class StringDiffHighlighterTests
{
private static IStringDifferenceHighlighter _sut;
[SetUp]
public static void Setup()
{
_sut = new StringDifferenceHighlighter(null, 0);
}
[Test]
[ExpectedException(typeof(ArgumentNullException))]
public static void Should_throw_exception_when_expected_arg_is_null()
{
_sut.HighlightDifferences(null, "not null");
}
[Test]
[ExpectedException(typeof(ArgumentNullException))]
public static void Should_throw_exception_when_actual_arg_is_null()
{
_sut.HighlightDifferences("not null", null);
}
}
}
|
using NUnit.Framework;
using Shouldly.DifferenceHighlighting2;
using System;
namespace Shouldly.Tests.InternalTests
{
[TestFixture]
public static class StringDiffHighlighterTests
{
private static IStringDifferenceHighlighter _sut;
[SetUp]
public static void Setup()
{
_sut = new StringDifferenceHighlighter(null, 0);
}
[Test]
[ExpectedException(typeof(ArgumentNullException))]
public static void Should_throw_exception_when_expected_arg_is_null()
{
_sut.HighlightDifferences("not null", null);
}
[Test]
[ExpectedException(typeof(ArgumentNullException))]
public static void Should_throw_exception_when_actual_arg_is_null()
{
_sut.HighlightDifferences(null, "not null");
}
}
}
|
bsd-3-clause
|
C#
|
363af72a5a3d15d5b4f7914b054009d61b13ee48
|
Add equality checks to Link annotation
|
skonves/Konves.TextGraph
|
src/Konves.TextGraph/Annotations/Link.cs
|
src/Konves.TextGraph/Annotations/Link.cs
|
using Konves.TextGraph.Models;
namespace Konves.TextGraph.Annotations
{
public sealed class Link : Annotation
{
public Link(int offset, int length, string uri) : base(offset, length)
{
Uri = uri;
}
public string Uri { get; }
public override string Subtype { get { return "link"; } }
public override string Type { get { return "navigation"; } }
public override bool Equals(object obj)
{
return base.Equals(obj) && (obj as Link).Uri == Uri;
}
public override int GetHashCode()
{
return GetHashCode(GetHashCode(), Uri);
}
}
}
|
using Konves.TextGraph.Models;
namespace Konves.TextGraph.Annotations
{
public sealed class Link : Annotation
{
public Link(int offset, int length, string uri) : base(offset, length)
{
Uri = uri;
}
public string Uri { get; }
public override string Subtype { get { return "link"; } }
public override string Type { get { return "navigation"; } }
}
}
|
apache-2.0
|
C#
|
edb057d115e3590418d35d8db4b7e162bcf44f21
|
Update Tester class implementation due to the recent changes in Tester implementation
|
JonesTwink/MPP.Tracer
|
Tracer/Tester/SingleThreadTest.cs
|
Tracer/Tester/SingleThreadTest.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tracer;
using System.Threading;
namespace Tester
{
class SingleThreadTest : ITest
{
private ITracer tracer = new Tracer.Tracer();
public void Run()
{
tracer.StartTrace();
Thread.Sleep(500);
RunCycle(500);
tracer.StopTrace();
PrintTestResults();
}
private void RunCycle(int sleepTime)
{
tracer.StartTrace();
Thread.Sleep(sleepTime);
tracer.StopTrace();
}
private void PrintTestResults()
{
var traceResult = tracer.GetTraceResult();
foreach (TraceResultItem analyzedItem in traceResult)
{
analyzedItem.PrintToConsole();
}
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tracer;
namespace Tester
{
class SingleThreadTest : ITest
{
private ITracer tracer = new Tracer.Tracer();
public void Run()
{
tracer.StartTrace();
RunCycle(204800000);
tracer.StopTrace();
TraceResult result = tracer.GetTraceResult();
result.PrintToConsole();
}
private void RunCycle(int repeatAmount)
{
ITracer tracer = new Tracer.Tracer();
tracer.StartTrace();
for (int i = 0; i < repeatAmount; i++)
{
int a = 1;
a += i;
}
tracer.StopTrace();
TraceResult result = tracer.GetTraceResult();
result.PrintToConsole();
}
}
}
|
mit
|
C#
|
3bc3406b359fee7125cda693c373d3977049a588
|
Add configuration getting/setting
|
Zyrio/ictus,Zyrio/ictus
|
src/Yio/Startup.cs
|
src/Yio/Startup.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Yio.Data.Constants;
namespace Yio
{
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
AppSettingsConstant.FileEndpoint = Configuration.GetSection("AppSettings").GetSection("FileEndpoint").Value;
AppSettingsConstant.FileStorage = Configuration.GetSection("AppSettings").GetSection("FileStorage").Value;
}
public IConfiguration Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container.
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc();
services.AddOptions();
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.Run(async (context) =>
{
await context.Response.WriteAsync("Hello World!");
});
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
namespace Yio
{
public class Startup
{
// This method gets called by the runtime. Use this method to add services to the container.
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
public void ConfigureServices(IServiceCollection services)
{
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.Run(async (context) =>
{
await context.Response.WriteAsync("Hello World!");
});
}
}
}
|
mit
|
C#
|
3d845abdb7fecead1a0506f3a50f57108a05f86a
|
Test on null input string
|
maxkoryukov/MK.WebLib,maxkoryukov/MK.Lib
|
src/MK.Lib.T/Ext/StringExt__AppendRandom_Test.cs
|
src/MK.Lib.T/Ext/StringExt__AppendRandom_Test.cs
|
using System;
using NUnit.Framework;
namespace MK.Ext
{
[TestFixture]
public class StringExt__AppendRandom_Test
{
[Test]
public void NotTheSameOnSimilarTests()
{
const string dict = "ab1";
foreach (var init in new string[] { "12", "", "a", "-", "12", "%" })
{
for (int len = 2; len < 50; len++)
{
string s1 = null;
string s2 = null;
int i = 0;
do
{
var l = len + init.Length;
s1 = StringExt.AppendRandom(init, l, dict);
s2 = StringExt.AppendRandom(init, l, dict);
i++;
}
while (i < 5 && s1 == s2);
Assert.AreNotEqual(s1, s2);
}
}
}
[Test]
public void ThrowsOnEmptyDomain()
{
var e = Assert.Throws<ArgumentException>(() =>
{
"123".AppendRandom(4, "");
}
);
Assert.AreEqual("char_domain", e.ParamName);
}
[Test]
[TestCase(null, 8)]
[TestCase("", 40)]
public void WorksOnNullAndEmptyStrings(string s, int len)
{
var e = StringExt.AppendRandom(s, len);
Assert.That(e, Is.Not.Null);
Assert.That(e, Has.Length.EqualTo(len));
}
[Test]
public void NotThrowOnNullDomain()
{
Assert.DoesNotThrow(() =>
{
"a".AppendRandom(5, null);
}
);
}
}
}
|
using System;
using NUnit.Framework;
namespace MK.Ext
{
[TestFixture]
public class StringExt__AppendRandom_Test
{
[Test]
public void NotTheSameOnSimilarTests()
{
const string dict = "ab1";
foreach (var init in new string[] { "12", "", "a", "-", "12", "%" })
{
for (int len = 2; len < 50; len++)
{
string s1 = null;
string s2 = null;
int i = 0;
do
{
var l = len + init.Length;
s1 = StringExt.AppendRandom(init, l, dict);
s2 = StringExt.AppendRandom(init, l, dict);
i++;
}
while (i < 5 && s1 == s2);
Assert.AreNotEqual(s1, s2);
}
}
}
[Test]
public void ThrowsOnEmptyDomain()
{
var e = Assert.Throws<ArgumentException>(() =>
{
"123".AppendRandom(4, "");
}
);
Assert.AreEqual("char_domain", e.ParamName);
}
[Test]
public void NotThrowOnNullDomain()
{
Assert.DoesNotThrow(() =>
{
"a".AppendRandom(5, null);
}
);
}
}
}
|
mit
|
C#
|
a51f7fb112194ca43697c04c5fc9724aea7d11cd
|
Comment IsoYearOfEraDateTimeField a little (it's horrible!) but fix a bug at the same time. (It's a bug which couldn't be shown via the public API.)
|
zaccharles/nodatime,BenJenkinson/nodatime,malcolmr/nodatime,jskeet/nodatime,malcolmr/nodatime,nodatime/nodatime,BenJenkinson/nodatime,zaccharles/nodatime,nodatime/nodatime,jskeet/nodatime,zaccharles/nodatime,zaccharles/nodatime,malcolmr/nodatime,zaccharles/nodatime,zaccharles/nodatime,malcolmr/nodatime
|
src/NodaTime/Fields/IsoYearOfEraDateTimeField.cs
|
src/NodaTime/Fields/IsoYearOfEraDateTimeField.cs
|
// Copyright 2009 The Noda Time Authors. All rights reserved.
// Use of this source code is governed by the Apache License 2.0,
// as found in the LICENSE.txt file.
using System;
using NodaTime.Calendars;
using NodaTime.Utility;
namespace NodaTime.Fields
{
/// <summary>
/// Field which is never used directly, but only as the basis for the "year of century" and
/// "century of era" fields in the ISO calendar.
/// </summary>
internal sealed class IsoYearOfEraDateTimeField : DecoratedDateTimeField
{
internal static readonly DateTimeField Instance = new IsoYearOfEraDateTimeField();
private IsoYearOfEraDateTimeField() : base(GregorianCalendarSystem.GetInstance(4).Fields.Year, DateTimeFieldType.YearOfEra)
{
}
internal override int GetValue(LocalInstant localInstant)
{
return Math.Abs(WrappedField.GetValue(localInstant));
}
internal override long GetInt64Value(LocalInstant localInstant)
{
return Math.Abs(WrappedField.GetValue(localInstant));
}
internal override LocalInstant SetValue(LocalInstant localInstant, long value)
{
Preconditions.CheckArgumentRange("value", value, 0, GetMaximumValue());
if (WrappedField.GetValue(localInstant) < 0)
{
value = -value;
}
return base.SetValue(localInstant, value);
}
internal override long GetMinimumValue()
{
return 0;
}
internal override long GetMaximumValue()
{
return WrappedField.GetMaximumValue();
}
internal override LocalInstant RoundFloor(LocalInstant localInstant)
{
return WrappedField.RoundFloor(localInstant);
}
internal override LocalInstant RoundCeiling(LocalInstant localInstant)
{
return WrappedField.RoundCeiling(localInstant);
}
}
}
|
// Copyright 2009 The Noda Time Authors. All rights reserved.
// Use of this source code is governed by the Apache License 2.0,
// as found in the LICENSE.txt file.
using System;
using NodaTime.Calendars;
using NodaTime.Utility;
namespace NodaTime.Fields
{
internal sealed class IsoYearOfEraDateTimeField : DecoratedDateTimeField
{
internal static readonly DateTimeField Instance = new IsoYearOfEraDateTimeField();
private IsoYearOfEraDateTimeField() : base(GregorianCalendarSystem.GetInstance(4).Fields.Year, DateTimeFieldType.YearOfEra)
{
}
internal override int GetValue(LocalInstant localInstant)
{
return Math.Abs(WrappedField.GetValue(localInstant));
}
internal override long GetInt64Value(LocalInstant localInstant)
{
return Math.Abs(WrappedField.GetValue(localInstant));
}
internal override LocalInstant SetValue(LocalInstant localInstant, long value)
{
Preconditions.CheckArgumentRange("value", value, 0, GetMaximumValue());
if (WrappedField.GetValue(localInstant) < 0)
{
value = -value;
}
return base.SetValue(localInstant, value);
}
internal override long GetMinimumValue()
{
return 0;
}
internal override long GetMaximumValue()
{
return WrappedField.GetMaximumValue();
}
internal override LocalInstant RoundFloor(LocalInstant localInstant)
{
return WrappedField.RoundCeiling(localInstant);
}
internal override LocalInstant RoundCeiling(LocalInstant localInstant)
{
return WrappedField.RoundCeiling(localInstant);
}
}
}
|
apache-2.0
|
C#
|
32068e2dba00bb63f78d28c8c932d14004c3a8e7
|
Update fixture path for specs
|
taxjar/taxjar.net
|
src/Taxjar.Tests/Infrastructure/TaxjarFixture.cs
|
src/Taxjar.Tests/Infrastructure/TaxjarFixture.cs
|
using System.IO;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace Taxjar.Tests
{
public class TaxjarFixture
{
public static string GetJSON(string fixturePath)
{
using (StreamReader file = File.OpenText(Path.Combine("../../../", "Fixtures", fixturePath)))
using (JsonTextReader reader = new JsonTextReader(file))
{
JObject response = (JObject)JToken.ReadFrom(reader);
var resString = response.ToString(Formatting.None).Replace(@"\", "");
return response.ToString(Formatting.None).Replace(@"\", "");
}
}
}
}
|
using System.IO;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace Taxjar.Tests
{
public class TaxjarFixture
{
public static string GetJSON(string fixturePath)
{
using (StreamReader file = File.OpenText(Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "../../../", "Fixtures", fixturePath)))
using (JsonTextReader reader = new JsonTextReader(file))
{
JObject response = (JObject)JToken.ReadFrom(reader);
var resString = response.ToString(Formatting.None).Replace(@"\", "");
return response.ToString(Formatting.None).Replace(@"\", "");
}
}
}
}
|
mit
|
C#
|
69e87ab98910d99f7568e7aa5270c70f794c971c
|
update version
|
Appleseed/base,Appleseed/base
|
Applications/Appleseed.Base.Alerts.Console/Appleseed.Base.Alerts/Properties/AssemblyInfo.cs
|
Applications/Appleseed.Base.Alerts.Console/Appleseed.Base.Alerts/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Appleseed.Base.Alerts")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("ANANT Corporation")]
[assembly: AssemblyProduct("Appleseed.Base.Alerts")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("77854e82-6943-4ea4-a26e-3253d6e68de9")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.3.0")]
[assembly: AssemblyFileVersion("1.0.3.0")]
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Appleseed.Base.Alerts")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("ANANT Corporation")]
[assembly: AssemblyProduct("Appleseed.Base.Alerts")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("77854e82-6943-4ea4-a26e-3253d6e68de9")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
|
apache-2.0
|
C#
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.