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 |
---|---|---|---|---|---|---|---|---|
2098a2e866014be772fccd879ef89095a4de99d6 | Add missing xmldoc. | Washi1337/AsmResolver,Washi1337/AsmResolver,Washi1337/AsmResolver,Washi1337/AsmResolver | src/AsmResolver.DotNet/MetadataMember.cs | src/AsmResolver.DotNet/MetadataMember.cs | using AsmResolver.PE.DotNet.Metadata.Tables;
namespace AsmResolver.DotNet
{
/// <summary>
/// Represents a single member in a .NET image.
/// </summary>
public abstract class MetadataMember : IMetadataMember
{
/// <summary>
/// Initializes the metadata member with a metadata token.
/// </summary>
/// <param name="token">The token.</param>
protected MetadataMember(MetadataToken token)
{
MetadataToken = token;
}
/// <inheritdoc />
public MetadataToken MetadataToken
{
get;
internal set;
}
}
} | using AsmResolver.PE.DotNet.Metadata.Tables;
namespace AsmResolver.DotNet
{
public abstract class MetadataMember : IMetadataMember
{
protected MetadataMember(MetadataToken token)
{
MetadataToken = token;
}
/// <inheritdoc />
public MetadataToken MetadataToken
{
get;
internal set;
}
}
} | mit | C# |
1c14bf8a40b759ed6dd386e139680059f34e9900 | bump 1.1.2 | GangZhuo/kcptun-gui-windows | kcptun-gui/Controller/MainController.cs | kcptun-gui/Controller/MainController.cs | using System;
using kcptun_gui.Model;
namespace kcptun_gui.Controller
{
public class MainController
{
public const string Version = "1.1.2";
public ConfigurationController ConfigController { get; private set; }
public KCPTunnelController KCPTunnelController { get; private set; }
public bool IsKcptunRunning
{
get { return KCPTunnelController.IsRunning; }
}
public MainController()
{
ConfigController = new ConfigurationController(this);
ConfigController.ConfigChanged += OnConfigChanged;
KCPTunnelController = new KCPTunnelController(this);
}
public void Start()
{
Reload();
}
public void Stop()
{
try
{
KCPTunnelController.Stop();
}
catch(Exception e)
{
Logging.LogUsefulException(e);
}
}
public void Reload()
{
try
{
if (KCPTunnelController.IsRunning)
KCPTunnelController.Stop();
Configuration config = ConfigController.GetCurrentConfiguration();
if (config.enabled)
{
KCPTunnelController.Server = config.GetCurrentServer();
KCPTunnelController.Start();
}
}
catch (Exception e)
{
Logging.LogUsefulException(e);
}
}
private void OnConfigChanged(object sender, EventArgs e)
{
Reload();
}
}
}
| using System;
using kcptun_gui.Model;
namespace kcptun_gui.Controller
{
public class MainController
{
public const string Version = "1.1.1";
public ConfigurationController ConfigController { get; private set; }
public KCPTunnelController KCPTunnelController { get; private set; }
public bool IsKcptunRunning
{
get { return KCPTunnelController.IsRunning; }
}
public MainController()
{
ConfigController = new ConfigurationController(this);
ConfigController.ConfigChanged += OnConfigChanged;
KCPTunnelController = new KCPTunnelController(this);
}
public void Start()
{
Reload();
}
public void Stop()
{
try
{
KCPTunnelController.Stop();
}
catch(Exception e)
{
Logging.LogUsefulException(e);
}
}
public void Reload()
{
try
{
if (KCPTunnelController.IsRunning)
KCPTunnelController.Stop();
Configuration config = ConfigController.GetCurrentConfiguration();
if (config.enabled)
{
KCPTunnelController.Server = config.GetCurrentServer();
KCPTunnelController.Start();
}
}
catch (Exception e)
{
Logging.LogUsefulException(e);
}
}
private void OnConfigChanged(object sender, EventArgs e)
{
Reload();
}
}
}
| mit | C# |
eee58224dfb27060b9dee9cab3fe5d3d10f18f43 | Introduce EndOffset to Analyze token | adam-mccoy/elasticsearch-net,adam-mccoy/elasticsearch-net,elastic/elasticsearch-net,CSGOpenSource/elasticsearch-net,elastic/elasticsearch-net,adam-mccoy/elasticsearch-net,CSGOpenSource/elasticsearch-net,CSGOpenSource/elasticsearch-net | src/Nest/Indices/Analyze/AnalyzeToken.cs | src/Nest/Indices/Analyze/AnalyzeToken.cs | using System;
using Newtonsoft.Json;
namespace Nest
{
[JsonObject]
public class AnalyzeToken
{
[JsonProperty("token")]
public string Token { get; internal set; }
[JsonProperty("type")]
public string Type { get; internal set; }
//TODO change to long in 6.0... RC: (this is int in Elasticsearch codebase)
[JsonProperty("start_offset")]
public int StartOffset { get; internal set; }
[JsonProperty("end_offset")]
public int EndOffset { get; internal set; }
[JsonProperty("position")]
public int Position { get; internal set; }
[JsonProperty("position_length")]
public long? PositionLength { get; internal set; }
}
}
| using Newtonsoft.Json;
namespace Nest
{
[JsonObject]
public class AnalyzeToken
{
[JsonProperty(PropertyName = "token")]
public string Token { get; internal set; }
[JsonProperty(PropertyName = "type")]
public string Type { get; internal set; }
//TODO change to long in 6.0
[JsonProperty(PropertyName = "start_offset")]
public int StartOffset { get; internal set; }
[JsonProperty(PropertyName = "end_offset")]
public int EndPostion { get; internal set; }
[JsonProperty(PropertyName = "position")]
public int Position { get; internal set; }
[JsonProperty(PropertyName = "position_length")]
public long? PositionLength { get; internal set; }
}
}
| apache-2.0 | C# |
630f2a0b96d43cdb253aff706cd4c1433d6c4e2a | Remove Restrictions on search endpoint | SkillsFundingAgency/das-commitments,SkillsFundingAgency/das-commitments,SkillsFundingAgency/das-commitments | src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Queries/GetApprenticeships/GetApprenticeshipsQueryValidator.cs | src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Queries/GetApprenticeships/GetApprenticeshipsQueryValidator.cs | using System;
using System.Linq;
using FluentValidation;
using SFA.DAS.CommitmentsV2.Models;
namespace SFA.DAS.CommitmentsV2.Application.Queries.GetApprenticeships
{
public class GetApprenticeshipsQueryValidator : AbstractValidator<GetApprenticeshipsQuery>
{
public GetApprenticeshipsQueryValidator()
{
RuleFor(request => request.SortField)
.Must(field => string.IsNullOrEmpty(field) ||
typeof(Apprenticeship).GetProperties().Select(c => c.Name).Contains(field) ||
typeof(Cohort).GetProperties().Select(c => c.Name).Contains(field) ||
typeof(AccountLegalEntity).GetProperties().Select(c => c.Name).Contains(field) ||
field.Equals("ProviderName", StringComparison.CurrentCultureIgnoreCase))
.WithMessage("Sort field must be empty or property on Apprenticeship ");
}
}
}
| using System;
using System.Linq;
using FluentValidation;
using SFA.DAS.CommitmentsV2.Models;
namespace SFA.DAS.CommitmentsV2.Application.Queries.GetApprenticeships
{
public class GetApprenticeshipsQueryValidator : AbstractValidator<GetApprenticeshipsQuery>
{
public GetApprenticeshipsQueryValidator()
{
Unless(request => request.EmployerAccountId.HasValue && request.EmployerAccountId.Value > 0, () =>
{
RuleFor(request => request.ProviderId)
.Must(id => id.HasValue && id.Value > 0)
.WithMessage("The provider id must be set");
});
Unless(request => request.ProviderId.HasValue && request.ProviderId.Value > 0, () =>
{
RuleFor(request => request.EmployerAccountId)
.Must(id => id.HasValue && id.Value > 0)
.WithMessage("The employer account id must be set");
});
When(request => request.ProviderId.HasValue && request.EmployerAccountId.HasValue, () =>
{
Unless(request => request.EmployerAccountId.Value == 0, () =>
{
RuleFor(request => request.ProviderId)
.Must(id => id.Value == 0)
.WithMessage("The provider id must be zero if employer account id is set");
});
Unless(request => request.ProviderId.Value == 0, () =>
{
RuleFor(request => request.EmployerAccountId)
.Must(id => id.Value == 0)
.WithMessage("The employer account id must be zero if provider id is set");
});
});
RuleFor(request => request.SortField)
.Must(field => string.IsNullOrEmpty(field) ||
typeof(Apprenticeship).GetProperties().Select(c => c.Name).Contains(field) ||
typeof(Cohort).GetProperties().Select(c => c.Name).Contains(field) ||
typeof(AccountLegalEntity).GetProperties().Select(c => c.Name).Contains(field) ||
field.Equals("ProviderName", StringComparison.CurrentCultureIgnoreCase))
.WithMessage("Sort field must be empty or property on Apprenticeship ");
}
}
}
| mit | C# |
827e352bf1a9359f373381b1a76bb515d6930c63 | Update AdminModeEvent.cs | Yonom/BotBits | BotBits/Packages/MessageHandler/Events/AdminModeEvent.cs | BotBits/Packages/MessageHandler/Events/AdminModeEvent.cs | using PlayerIOClient;
namespace BotBits.Events
{
/// <summary>
/// Occurs when an administrator toggles administrator mode.
/// </summary>
/// <seealso cref="PlayerEvent{T}" />
[ReceiveEvent("admin")]
public sealed class AdminModeEvent : PlayerEvent<AdminModeEvent>
{
/// <summary>
/// Initializes a new instance of the <see cref="AdminModeEvent" /> class.
/// </summary>
/// <param name="message">The message.</param>
/// <param name="client"></param>
internal AdminModeEvent(BotBitsClient client, Message message)
: base(client, message)
{
this.AdminMode = message.GetBoolean(1);
}
/// <summary>
/// Gets or sets a value indicating whether this player is in administrator mode.
/// </summary>
/// <value><c>true</c> if this player is in administrator mode; otherwise, <c>false</c>.</value>
public bool AdminMode { get; set; }
}
}
| using PlayerIOClient;
namespace BotBits.Events
{
/// <summary>
/// Occurs when an administrator toggles administrator mode.
/// </summary>
/// <seealso cref="PlayerEvent{T}" />
[ReceiveEvent("admin")]
public sealed class AdminModeEvent : PlayerEvent<AdminModeEvent>
{
/// <summary>
/// Initializes a new instance of the <see cref="AdminModeEvent" /> class.
/// </summary>
/// <param name="message">The message.</param>
/// <param name="client"></param>
internal AdminModeEvent(BotBitsClient client, Message message)
: base(client, message)
{
this.AdminMode = message.GetBoolean(1);
this.StaffAura = (StaffAura)message.GetInt(2);
}
public StaffAura StaffAura { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this player is in administrator mode.
/// </summary>
/// <value><c>true</c> if this player is in administrator mode; otherwise, <c>false</c>.</value>
public bool AdminMode { get; set; }
}
} | mit | C# |
ef20906bc4d5a7bf78e1100881871141397adb6b | Fix ContainserServiceListResult | samtoubia/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,djyou/azure-sdk-for-net,Yahnoosh/azure-sdk-for-net,samtoubia/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,shutchings/azure-sdk-for-net,nathannfan/azure-sdk-for-net,peshen/azure-sdk-for-net,yaakoviyun/azure-sdk-for-net,atpham256/azure-sdk-for-net,JasonYang-MSFT/azure-sdk-for-net,yaakoviyun/azure-sdk-for-net,nathannfan/azure-sdk-for-net,yoavrubin/azure-sdk-for-net,shutchings/azure-sdk-for-net,pankajsn/azure-sdk-for-net,samtoubia/azure-sdk-for-net,r22016/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,ahosnyms/azure-sdk-for-net,djyou/azure-sdk-for-net,jhendrixMSFT/azure-sdk-for-net,djyou/azure-sdk-for-net,btasdoven/azure-sdk-for-net,r22016/azure-sdk-for-net,ahosnyms/azure-sdk-for-net,smithab/azure-sdk-for-net,shutchings/azure-sdk-for-net,begoldsm/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,pilor/azure-sdk-for-net,hyonholee/azure-sdk-for-net,hyonholee/azure-sdk-for-net,yugangw-msft/azure-sdk-for-net,atpham256/azure-sdk-for-net,AzCiS/azure-sdk-for-net,btasdoven/azure-sdk-for-net,jamestao/azure-sdk-for-net,markcowl/azure-sdk-for-net,hyonholee/azure-sdk-for-net,AzCiS/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,hyonholee/azure-sdk-for-net,yoavrubin/azure-sdk-for-net,olydis/azure-sdk-for-net,shahabhijeet/azure-sdk-for-net,pilor/azure-sdk-for-net,jhendrixMSFT/azure-sdk-for-net,AzureAutomationTeam/azure-sdk-for-net,stankovski/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,yoavrubin/azure-sdk-for-net,nathannfan/azure-sdk-for-net,SiddharthChatrolaMs/azure-sdk-for-net,olydis/azure-sdk-for-net,AzCiS/azure-sdk-for-net,mihymel/azure-sdk-for-net,jamestao/azure-sdk-for-net,shahabhijeet/azure-sdk-for-net,ScottHolden/azure-sdk-for-net,SiddharthChatrolaMs/azure-sdk-for-net,yaakoviyun/azure-sdk-for-net,jamestao/azure-sdk-for-net,peshen/azure-sdk-for-net,SiddharthChatrolaMs/azure-sdk-for-net,Yahnoosh/azure-sdk-for-net,stankovski/azure-sdk-for-net,btasdoven/azure-sdk-for-net,MichaelCommo/azure-sdk-for-net,olydis/azure-sdk-for-net,DheerendraRathor/azure-sdk-for-net,DheerendraRathor/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,AzureAutomationTeam/azure-sdk-for-net,ScottHolden/azure-sdk-for-net,Yahnoosh/azure-sdk-for-net,JasonYang-MSFT/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,JasonYang-MSFT/azure-sdk-for-net,smithab/azure-sdk-for-net,begoldsm/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,MichaelCommo/azure-sdk-for-net,mihymel/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,shahabhijeet/azure-sdk-for-net,atpham256/azure-sdk-for-net,jamestao/azure-sdk-for-net,begoldsm/azure-sdk-for-net,samtoubia/azure-sdk-for-net,yugangw-msft/azure-sdk-for-net,AzureAutomationTeam/azure-sdk-for-net,jhendrixMSFT/azure-sdk-for-net,hyonholee/azure-sdk-for-net,pankajsn/azure-sdk-for-net,ScottHolden/azure-sdk-for-net,shahabhijeet/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,mihymel/azure-sdk-for-net,MichaelCommo/azure-sdk-for-net,DheerendraRathor/azure-sdk-for-net,peshen/azure-sdk-for-net,smithab/azure-sdk-for-net,pankajsn/azure-sdk-for-net,r22016/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,yugangw-msft/azure-sdk-for-net,pilor/azure-sdk-for-net,ahosnyms/azure-sdk-for-net | src/ResourceManagement/Compute/Microsoft.Azure.Management.Compute/Generated/Models/ContainerServiceListResult.cs | src/ResourceManagement/Compute/Microsoft.Azure.Management.Compute/Generated/Models/ContainerServiceListResult.cs | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
namespace Microsoft.Azure.Management.Compute.Models
{
using System;
using System.Linq;
using System.Collections.Generic;
using Newtonsoft.Json;
using Microsoft.Rest;
using Microsoft.Rest.Serialization;
using Microsoft.Rest.Azure;
/// <summary>
/// The List Container Service operation response
/// </summary>
public partial class ContainerServiceListResult
{
/// <summary>
/// Initializes a new instance of the ContainerServiceListResult class.
/// </summary>
public ContainerServiceListResult() { }
/// <summary>
/// Initializes a new instance of the ContainerServiceListResult class.
/// </summary>
public ContainerServiceListResult(IList<ContainerService> value = default(IList<ContainerService>))
{
Value = value;
}
/// <summary>
/// Gets or sets the list of container services.
/// </summary>
[JsonProperty(PropertyName = "value")]
public IList<ContainerService> Value { get; set; }
}
}
| // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
namespace Microsoft.Azure.Management.Compute.Models
{
using System;
using System.Linq;
using System.Collections.Generic;
using Newtonsoft.Json;
using Microsoft.Rest;
using Microsoft.Rest.Serialization;
using Microsoft.Rest.Azure;
/// <summary>
/// The List Container Service operation response
/// </summary>
public partial class ContainerServiceListResult
{
/// <summary>
/// Initializes a new instance of the ContainerServiceListResult class.
/// </summary>
public ContainerServiceListResult() { }
/// <summary>
/// Initializes a new instance of the ContainerServiceListResult class.
/// </summary>
public ContainerServiceListResult(object properties = default(object))
{
Properties = properties;
}
/// <summary>
/// Gets or sets the list of container services.
/// </summary>
[JsonProperty(PropertyName = "properties")]
public object Properties { get; set; }
}
}
| mit | C# |
0e64d1063af84f7fcc700eca315e70a9a786b5b3 | Add "Year" property to "DateInfoFrame" class | elp87/TagReader | elp87.TagReader/id3v2/Frames/DateInfoFrame.cs | elp87.TagReader/id3v2/Frames/DateInfoFrame.cs | using elp87.TagReader.id3v2.Frames;
using System;
using System.Globalization;
namespace elp87.TagReader.id3v2.Frames
{
public class DateInfoFrame
: TextInfoFrame
{
#region Fields
private DateTime _date;
#endregion
#region Constructors
protected DateInfoFrame()
{ }
public DateInfoFrame(FrameFlagSet flags, byte[] frameData)
: base(flags, frameData)
{
_date = this.ParseDate();
}
#endregion
#region Properties
public DateTime Date { get { return this._date; } }
public int Year { get { return this._date.Year; } }
#endregion
#region Methods
private DateTime ParseDate()
{
return this.ParseDate(this.ToString());
}
private DateTime ParseDate(string dateString)
{
string dateFormat;
switch (dateString.Length)
{
case 4:
dateFormat = "yyyy"; break;
case 7:
dateFormat = @"yyyy-MM"; break;
case 10:
dateFormat = @"yyyy-MM-dd"; break;
case 13:
dateFormat = @"yyyy-MM-ddTHH"; break;
case 16:
dateFormat = @"yyyy-MM-ddTHH:mm"; break;
case 19:
dateFormat = @"yyyy-MM-ddTHH:mm:ss"; break;
default:
throw new FormatException();
}
return DateTime.ParseExact(dateString, dateFormat, CultureInfo.InvariantCulture);
}
#endregion
}
}
| using elp87.TagReader.id3v2.Frames;
using System;
using System.Globalization;
namespace elp87.TagReader.id3v2.Frames
{
public class DateInfoFrame
: TextInfoFrame
{
#region Fields
private DateTime _date;
#endregion
#region Constructors
protected DateInfoFrame()
{ }
public DateInfoFrame(FrameFlagSet flags, byte[] frameData)
: base(flags, frameData)
{
_date = this.ParseDate();
}
#endregion
#region Properties
public DateTime Date { get { return this._date; } }
#endregion
#region Methods
private DateTime ParseDate()
{
return this.ParseDate(this.ToString());
}
private DateTime ParseDate(string dateString)
{
string dateFormat;
switch (dateString.Length)
{
case 4:
dateFormat = "yyyy"; break;
case 7:
dateFormat = @"yyyy-MM"; break;
case 10:
dateFormat = @"yyyy-MM-dd"; break;
case 13:
dateFormat = @"yyyy-MM-ddTHH"; break;
case 16:
dateFormat = @"yyyy-MM-ddTHH:mm"; break;
case 19:
dateFormat = @"yyyy-MM-ddTHH:mm:ss"; break;
default:
throw new FormatException();
}
return DateTime.ParseExact(dateString, dateFormat, CultureInfo.InvariantCulture);
}
#endregion
}
}
| lgpl-2.1 | C# |
cd7ca4f29cdb7b25f5fd9d2311cbdd510ec0e46c | enhance english natural language utilities. | signumsoftware/framework,AlejandroCano/framework,avifatal/framework,avifatal/framework,AlejandroCano/framework,signumsoftware/framework | Signum.Utilities/NaturalLanguage/English.cs | Signum.Utilities/NaturalLanguage/English.cs | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Signum.Utilities.NaturalLanguage
{
public class EnglishPluralizer : IPluralizer
{
//http://www.csse.monash.edu.au/~damian/papers/HTML/Plurals.html
Dictionary<string, string> exceptions = new Dictionary<string, string>
{
{"an", "en"}, // woman -> women
{"ch", "ches"}, // church -> churches
{"eau", "eaus"}, //chateau -> chateaus
{"en", "ens"}, //foramen -> foramens
{"ex", "exes"}, //index -> indexes
{"f", "ves"}, //wolf -> wolves
{"fe", "ves"}, //wolf -> wolves
{"ieu", "ieus"}, //milieu-> mileus
{"is", "is"}, //basis -> basis
{"ix", "ixes"}, //matrix -> matrixes
{"nx", "nxes"}, //phalanx -> phalanxes
{"s", "s"}, //series -> series
{"sh", "shes"}, //wish -> wishes
{"us", "us"},// genus -> us
{"x", "xes"},// box -> boxes
{"ey", "eys" }, // key -> keys
{"ay", "ays" }, // play -> plays
{"oy", "oys" }, // boy -> boys
{"uy", "uys" }, // guy -> guys
{"y", "ies"}, //ferry -> ferries
};
public string MakePlural(string singularName)
{
if (string.IsNullOrEmpty(singularName))
return singularName;
int index = singularName.LastIndexOf(' ');
if (index != -1)
return singularName.Substring(0, index + 1) + MakePlural(singularName.Substring(index + 1));
var result = exceptions.FirstOrDefault(r => singularName.EndsWith(r.Key));
if (result.Value != null)
return singularName.Substring(0, singularName.Length - result.Key.Length) + result.Value;
return singularName + "s";
}
}
}
| using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Signum.Utilities.NaturalLanguage
{
public class EnglishPluralizer : IPluralizer
{
//http://www.csse.monash.edu.au/~damian/papers/HTML/Plurals.html
Dictionary<string, string> exceptions = new Dictionary<string, string>
{
{"an", "en"}, // woman -> women
{"ch", "ches"}, // church -> churches
{"eau", "eaus"}, //chateau -> chateaus
{"en", "ens"}, //foramen -> foramens
{"ex", "exes"}, //index -> indexes
{"f", "ves"}, //wolf -> wolves
{"fe", "ves"}, //wolf -> wolves
{"ieu", "ieus milieu"}, //milieu-> mileus
{"is", "is"}, //basis -> basis
{"ix", "ixes"}, //matrix -> matrixes
{"nx", "nxes"}, //phalanx -> phalanxes
{"s", "s"}, //series -> series
{"sh", "shes"}, //wish -> wishes
{"us", "us"},// genus -> us
{"x", "xes"},// box -> boxes
{"y", "ies"}, //ferry -> ferries
};
public string MakePlural(string singularName)
{
if (string.IsNullOrEmpty(singularName))
return singularName;
int index = singularName.LastIndexOf(' ');
if (index != -1)
return singularName.Substring(0, index + 1) + MakePlural(singularName.Substring(index + 1));
var result = exceptions.FirstOrDefault(r => singularName.EndsWith(r.Key));
if (result.Value != null)
return singularName.Substring(0, singularName.Length - result.Key.Length) + result.Value;
return singularName + "s";
}
}
}
| mit | C# |
679e24c5f0d8c05a17d2b806c96d87d3e17ebcfa | Update AdUnitFactoryBase.cs | tiksn/TIKSN-Framework | TIKSN.Core/Advertising/AdUnitFactoryBase.cs | TIKSN.Core/Advertising/AdUnitFactoryBase.cs | using System.Collections.Generic;
namespace TIKSN.Advertising
{
public abstract class AdUnitFactoryBase : IAdUnitFactory
{
protected readonly Dictionary<string, AdUnitBundle> _adUnitBundles;
private readonly IAdUnitSelector _adUnitSelector;
protected AdUnitFactoryBase(IAdUnitSelector adUnitSelector)
{
this._adUnitSelector = adUnitSelector;
this._adUnitBundles = new Dictionary<string, AdUnitBundle>();
this.Register();
}
public AdUnit Create(string key)
{
var adUnitBundle = this._adUnitBundles[key];
return this._adUnitSelector.Select(adUnitBundle);
}
protected abstract void Register();
}
}
| using System.Collections.Generic;
namespace TIKSN.Advertising
{
public abstract class AdUnitFactoryBase : IAdUnitFactory
{
protected readonly Dictionary<string, AdUnitBundle> _adUnitBundles;
private readonly IAdUnitSelector _adUnitSelector;
protected AdUnitFactoryBase(IAdUnitSelector adUnitSelector)
{
_adUnitSelector = adUnitSelector;
_adUnitBundles = new Dictionary<string, AdUnitBundle>();
Register();
}
public AdUnit Create(string key)
{
var adUnitBundle = _adUnitBundles[key];
return _adUnitSelector.Select(adUnitBundle);
}
protected abstract void Register();
}
} | mit | C# |
e80d18bbd090791e75c081252e479b088ab3db51 | add logged fields | ojraqueno/vstemplates,ojraqueno/vstemplates,ojraqueno/vstemplates | MVC5_R/MVC5_R.WebApp/Infrastructure/Logging/MVCLogger.cs | MVC5_R/MVC5_R.WebApp/Infrastructure/Logging/MVCLogger.cs | using Microsoft.AspNet.Identity;
using MVC5_R.Infrastructure.Data;
using MVC5_R.Infrastructure.Logging;
using MVC5_R.Models;
using System;
using System.Web.Mvc;
namespace MVC5_R.WebApp.Infrastructure.Logging
{
public class MVCLogger : IMVCLogger
{
public void Log(ExceptionContext filterContext)
{
var logEntry = new LogEntry
{
Action = Convert.ToString(filterContext.RouteData.Values["action"]),
Controller = Convert.ToString(filterContext.RouteData.Values["controller"]),
LoggedOn = DateTime.UtcNow,
Level = LogLevel.Error,
Message = filterContext.Exception.Message,
Request = GetRequest(filterContext),
StackTrace = filterContext.Exception.StackTrace,
UserId = filterContext.HttpContext.User.Identity.GetUserId()
};
Logger.Log(logEntry);
}
private static string GetRequest(ExceptionContext filterContext)
{
var headers = filterContext.HttpContext.Request.ServerVariables["ALL_RAW"].Replace("\r\n", Environment.NewLine);
var form = filterContext.HttpContext.Request.Form.ToString();
return headers + Environment.NewLine + form;
}
}
} | using Microsoft.AspNet.Identity;
using MVC5_R.Infrastructure.Data;
using MVC5_R.Models;
using System;
using System.Web.Mvc;
namespace MVC5_R.WebApp.Infrastructure.Logging
{
public class MVCLogger : IMVCLogger
{
public void Log(ExceptionContext filterContext)
{
var logEntry = new LogEntry
{
Action = Convert.ToString(filterContext.RouteData.Values["action"]),
Controller = Convert.ToString(filterContext.RouteData.Values["controller"]),
LoggedOn = DateTime.UtcNow,
Message = filterContext.Exception.Message,
StackTrace = filterContext.Exception.StackTrace,
UserId = filterContext.HttpContext.User.Identity.GetUserId()
};
using (var db = new ApplicationDbContext())
{
db.LogEntries.Add(logEntry);
db.SaveChanges();
}
}
}
} | mit | C# |
cb0acc4727bf392ec6a8b6053c67c750c754accc | test resourceId | sebastus/AzureFunctionForSplunk | shared/addStandardProperties.csx | shared/addStandardProperties.csx | #r "Newtonsoft.Json"
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
static string addStandardProperties(string message, TraceWriter log)
{
var converter = new ExpandoObjectConverter();
dynamic obj = JsonConvert.DeserializeObject<ExpandoObject>(message, converter);
object resourceId;
((IDictionary<string, object>)obj).TryGetValue("resourceId", out resourceId);
log.Info(String.Format("ResourceId in the incoming message: {0}", resourceId));
var standardProperties = getStandardProperties(((string)resourceId).ToUpper());
obj.am_subscriptionId = standardProperties["subscriptionId"];
obj.am_resourceGroup = standardProperties["resourceGroup"];
obj.am_resourceType = standardProperties["resourceType"];
obj.am_resourceName = standardProperties["resourceName"];
string json = Newtonsoft.Json.JsonConvert.SerializeObject(obj);
return json;
}
public static System.Collections.Generic.Dictionary<string, string> getStandardProperties(string resourceId)
{
var patternSubscriptionId = "SUBSCRIPTIONS\\/(.*?)\\/";
var patternResourceGroup = "SUBSCRIPTIONS\\/(?:.*?)\\/RESOURCEGROUPS\\/(.*?)\\/";
var patternResourceType = "PROVIDERS\\/(.*?\\/.*?)(?:\\/)";
var patternResourceName = "PROVIDERS\\/(?:.*?\\/.*?\\/)(.*?)(?:\\/|$)";
System.Collections.Generic.Dictionary<string, string> values = new System.Collections.Generic.Dictionary<string, string>();
Match m = Regex.Match(resourceId, patternSubscriptionId);
var subscriptionID = m.Groups[1].Value;
values.Add("subscriptionId", subscriptionID);
m = Regex.Match(resourceId, patternResourceGroup);
var resourceGroup = m.Groups[1].Value;
values.Add("resourceGroup", resourceGroup);
m = Regex.Match(resourceId, patternResourceType);
var resourceType = m.Groups[1].Value;
values.Add("resourceType", resourceType);
m = Regex.Match(resourceId, patternResourceName);
var resourceName = m.Groups[1].Value;
values.Add("resourceName", resourceName);
return values;
} | #r "Newtonsoft.Json"
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
static string addStandardProperties(string message, TraceWriter log)
{
var converter = new ExpandoObjectConverter();
dynamic obj = JsonConvert.DeserializeObject<ExpandoObject>(message, converter);
object resourceId;
((IDictionary<string, object>)obj).TryGetValue("resourceId", out resourceId);
var standardProperties = getStandardProperties(((string)resourceId).ToUpper());
obj.am_subscriptionId = standardProperties["subscriptionId"];
obj.am_resourceGroup = standardProperties["resourceGroup"];
obj.am_resourceType = standardProperties["resourceType"];
obj.am_resourceName = standardProperties["resourceName"];
string json = Newtonsoft.Json.JsonConvert.SerializeObject(obj);
return json;
}
public static System.Collections.Generic.Dictionary<string, string> getStandardProperties(string resourceId)
{
var patternSubscriptionId = "SUBSCRIPTIONS\\/(.*?)\\/";
var patternResourceGroup = "SUBSCRIPTIONS\\/(?:.*?)\\/RESOURCEGROUPS\\/(.*?)\\/";
var patternResourceType = "PROVIDERS\\/(.*?\\/.*?)(?:\\/)";
var patternResourceName = "PROVIDERS\\/(?:.*?\\/.*?\\/)(.*?)(?:\\/|$)";
System.Collections.Generic.Dictionary<string, string> values = new System.Collections.Generic.Dictionary<string, string>();
Match m = Regex.Match(resourceId, patternSubscriptionId);
var subscriptionID = m.Groups[1].Value;
values.Add("subscriptionId", subscriptionID);
m = Regex.Match(resourceId, patternResourceGroup);
var resourceGroup = m.Groups[1].Value;
values.Add("resourceGroup", resourceGroup);
m = Regex.Match(resourceId, patternResourceType);
var resourceType = m.Groups[1].Value;
values.Add("resourceType", resourceType);
m = Regex.Match(resourceId, patternResourceName);
var resourceName = m.Groups[1].Value;
values.Add("resourceName", resourceName);
return values;
} | mit | C# |
e08a6f8c2f88da32abf9731e74195030c247d849 | Update KnownFolderVersionConsideration.cs | tiksn/TIKSN-Framework | TIKSN.Core/FileSystem/KnownFolderVersionConsideration.cs | TIKSN.Core/FileSystem/KnownFolderVersionConsideration.cs | namespace TIKSN.FileSystem
{
public enum KnownFolderVersionConsideration
{
None,
Major,
MajorMinor,
MajorMinorBuild,
MajorMinorBuildRevision
}
}
| namespace TIKSN.FileSystem
{
public enum KnownFolderVersionConsideration
{
None,
Major,
MajorMinor,
MajorMinorBuild,
MajorMinorBuildRevision
}
} | mit | C# |
2d4b1596d4fe3b805b7848abf9948f8317402566 | Fix windows x64 using WOW64 | wangkanai/Detection | src/Services/PlatformService.cs | src/Services/PlatformService.cs | // Copyright (c) 2014-2020 Sarin Na Wangkanai, All Rights Reserved.
// The Apache v2. See License.txt in the project root for license information.
using Wangkanai.Detection.Extensions;
using Wangkanai.Detection.Models;
namespace Wangkanai.Detection.Services
{
public class PlatformService : IPlatformService
{
public Processor Processor { get; }
public OperatingSystem OperatingSystem { get; }
public PlatformService(IUserAgentService userAgentService)
{
var userAgent = userAgentService.UserAgent;
OperatingSystem = ParseOperatingSystem(userAgent);
Processor = ParseProcessor(userAgent, OperatingSystem);
}
private static OperatingSystem ParseOperatingSystem(UserAgent agent)
{
if (agent.Contains(OperatingSystem.Android))
return OperatingSystem.Android;
if (agent.Contains(OperatingSystem.Windows))
return OperatingSystem.Windows;
if (agent.Contains(OperatingSystem.Mac))
return OperatingSystem.Mac;
if (agent.Contains(OperatingSystem.iOS))
return OperatingSystem.iOS;
if (agent.Contains(OperatingSystem.Linux))
return OperatingSystem.Linux;
return OperatingSystem.Others;
}
private static Processor ParseProcessor(UserAgent agent, OperatingSystem os)
{
if (agent.Contains(Processor.ARM) || agent.Contains(OperatingSystem.Android))
return Processor.ARM;
if (agent.Contains(Processor.x64) || agent.Contains("x86_64") || agent.Contains("wow64"))
return Processor.x64;
var x86 = new[] {"i86", "i686"};
if (agent.Contains(Processor.x86) || agent.Contains(x86))
return Processor.x86;
if (os == OperatingSystem.Mac && !agent.Contains("PPC"))
return Processor.x64;
return Processor.Others;
}
}
}
| // Copyright (c) 2014-2020 Sarin Na Wangkanai, All Rights Reserved.
// The Apache v2. See License.txt in the project root for license information.
using Wangkanai.Detection.Extensions;
using Wangkanai.Detection.Models;
namespace Wangkanai.Detection.Services
{
public class PlatformService : IPlatformService
{
public Processor Processor { get; }
public OperatingSystem OperatingSystem { get; }
public PlatformService(IUserAgentService userAgentService)
{
var userAgent = userAgentService.UserAgent;
OperatingSystem = ParseOperatingSystem(userAgent);
Processor = ParseProcessor(userAgent, OperatingSystem);
}
private static OperatingSystem ParseOperatingSystem(UserAgent agent)
{
if (agent.Contains(OperatingSystem.Android))
return OperatingSystem.Android;
if (agent.Contains(OperatingSystem.Windows))
return OperatingSystem.Windows;
if (agent.Contains(OperatingSystem.Mac))
return OperatingSystem.Mac;
if (agent.Contains(OperatingSystem.iOS))
return OperatingSystem.iOS;
if (agent.Contains(OperatingSystem.Linux))
return OperatingSystem.Linux;
return OperatingSystem.Others;
}
private static Processor ParseProcessor(UserAgent agent, OperatingSystem os)
{
if (agent.Contains(Processor.ARM) || agent.Contains(OperatingSystem.Android))
return Processor.ARM;
if (agent.Contains(Processor.x64) || agent.Contains("x86_64"))
return Processor.x64;
var x86 = new[] {"i86", "i686"};
if (agent.Contains(Processor.x86) || agent.Contains(x86))
return Processor.x86;
if (os == OperatingSystem.Mac && !agent.Contains("PPC"))
return Processor.x64;
return Processor.Others;
}
}
}
| apache-2.0 | C# |
1e4acf76053ea259344b15422ce7ab8136cfb25a | bump version | Fody/Validar | CommonAssemblyInfo.cs | CommonAssemblyInfo.cs | using System.Reflection;
[assembly: AssemblyTitle("Validar")]
[assembly: AssemblyProduct("Validar")]
[assembly: AssemblyVersion("0.10.0.0")]
[assembly: AssemblyFileVersion("0.10.0.0")]
| using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Validar")]
[assembly: AssemblyProduct("Validar")]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("0.9.0.0")]
[assembly: AssemblyFileVersion("0.9.0.0")]
| mit | C# |
07fbf3c915e74085d66220cd8d2037c70b3fbd43 | Fix for #1041. UIKit methods cannot be invoked off main thread. We need to wrap those when called in an async context. | martijn00/MvvmCross-Plugins,lothrop/MvvmCross-Plugins,Didux/MvvmCross-Plugins,MatthewSannes/MvvmCross-Plugins | Cirrious/DownloadCache/Cirrious.MvvmCross.Plugins.DownloadCache.Touch/MvxTouchLocalFileImageLoader.cs | Cirrious/DownloadCache/Cirrious.MvvmCross.Plugins.DownloadCache.Touch/MvxTouchLocalFileImageLoader.cs | // MvxTouchLocalFileImageLoader.cs
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
// Project Lead - Stuart Lodge, @slodge, [email protected]
using System.Threading.Tasks;
using Cirrious.CrossCore;
using Cirrious.CrossCore.Core;
using Cirrious.MvvmCross.Plugins.File;
using UIKit;
namespace Cirrious.MvvmCross.Plugins.DownloadCache.Touch
{
public class MvxTouchLocalFileImageLoader
: MvxAllThreadDispatchingObject
, IMvxLocalFileImageLoader<UIImage>
{
private const string ResourcePrefix = "res:";
public Task<MvxImage<UIImage>> Load(string localPath, bool shouldCache, int width, int height)
{
UIImage uiImage = null;
InvokeOnMainThread(() => {
if (localPath.StartsWith(ResourcePrefix))
uiImage = LoadResourceImage(localPath.Substring(ResourcePrefix.Length));
else
uiImage = LoadUiImage(localPath);
});
var result = (MvxImage<UIImage>)new MvxTouchImage(uiImage);
return Task.FromResult(result);
}
private static UIImage LoadUiImage(string localPath)
{
var file = Mvx.Resolve<IMvxFileStore>();
var nativePath = file.NativePath(localPath);
return UIImage.FromFile(nativePath);
}
private static UIImage LoadResourceImage(string resourcePath)
{
return UIImage.FromBundle(resourcePath);
}
}
} | // MvxTouchLocalFileImageLoader.cs
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
// Project Lead - Stuart Lodge, @slodge, [email protected]
using System.Threading.Tasks;
using Cirrious.CrossCore;
using Cirrious.MvvmCross.Plugins.File;
using Foundation;
using UIKit;
namespace Cirrious.MvvmCross.Plugins.DownloadCache.Touch
{
public class MvxTouchLocalFileImageLoader
: IMvxLocalFileImageLoader<UIImage>
{
private const string ResourcePrefix = "res:";
public Task<MvxImage<UIImage>> Load(string localPath, bool shouldCache, int width, int height)
{
return Task.Run(() =>
{
UIImage uiImage;
if (localPath.StartsWith(ResourcePrefix))
{
var resourcePath = localPath.Substring(ResourcePrefix.Length);
uiImage = LoadResourceImage(resourcePath, shouldCache);
}
else
{
uiImage = LoadUIImage(localPath);
}
return (MvxImage<UIImage>)new MvxTouchImage(uiImage);
});
}
private UIImage LoadUIImage(string localPath)
{
var file = Mvx.Resolve<IMvxFileStore>();
var nativePath = file.NativePath(localPath);
return UIImage.FromFile(nativePath);
}
private UIImage LoadResourceImage(string resourcePath, bool shouldCache)
{
return UIImage.FromBundle(resourcePath);
}
}
} | mit | C# |
f70b4839bd80834720e2d205f097d014ec30bfb8 | Remove a few unnecessary attributes in OsuTestCase. | ZLima12/osu,Drezi126/osu,peppy/osu-new,NeoAdonis/osu,peppy/osu,EVAST9919/osu,Damnae/osu,NeoAdonis/osu,smoogipoo/osu,naoey/osu,johnneijzen/osu,DrabWeb/osu,UselessToucan/osu,naoey/osu,UselessToucan/osu,NeoAdonis/osu,Frontear/osuKyzer,DrabWeb/osu,naoey/osu,2yangk23/osu,ppy/osu,ppy/osu,peppy/osu,smoogipoo/osu,Nabile-Rahmani/osu,ZLima12/osu,UselessToucan/osu,smoogipooo/osu,2yangk23/osu,peppy/osu,EVAST9919/osu,johnneijzen/osu,DrabWeb/osu,ppy/osu,smoogipoo/osu | osu.Desktop.Tests/Visual/OsuTestCase.cs | osu.Desktop.Tests/Visual/OsuTestCase.cs | // Copyright (c) 2007-2017 ppy Pty Ltd <[email protected]>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Desktop.Platform;
using osu.Framework.Testing;
using osu.Game;
namespace osu.Desktop.Tests.Visual
{
public abstract class OsuTestCase : TestCase
{
public override void RunTest()
{
using (var host = new HeadlessGameHost(realtime: false))
host.Run(new OsuTestCaseTestRunner(this));
}
public class OsuTestCaseTestRunner : OsuGameBase
{
private readonly OsuTestCase testCase;
public OsuTestCaseTestRunner(OsuTestCase testCase)
{
this.testCase = testCase;
}
protected override void LoadComplete()
{
base.LoadComplete();
Add(new TestCaseTestRunner.TestRunner(testCase));
}
}
}
}
| // Copyright (c) 2007-2017 ppy Pty Ltd <[email protected]>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using NUnit.Framework;
using osu.Framework.Desktop.Platform;
using osu.Framework.Testing;
using osu.Game;
namespace osu.Desktop.Tests.Visual
{
[TestFixture]
public abstract class OsuTestCase : TestCase
{
[Test]
public override void RunTest()
{
using (var host = new HeadlessGameHost(realtime: false))
host.Run(new OsuTestCaseTestRunner(this));
}
public class OsuTestCaseTestRunner : OsuGameBase
{
private readonly OsuTestCase testCase;
public OsuTestCaseTestRunner(OsuTestCase testCase)
{
this.testCase = testCase;
}
protected override void LoadComplete()
{
base.LoadComplete();
Add(new TestCaseTestRunner.TestRunner(testCase));
}
}
}
}
| mit | C# |
cb4a53b33b005eb30ba426d54fee08e35416b46f | INcrease timeout | SanSYS/MassTransit,MassTransit/MassTransit,jacobpovar/MassTransit,phatboyg/MassTransit,MassTransit/MassTransit,phatboyg/MassTransit,SanSYS/MassTransit,jacobpovar/MassTransit | src/Containers/MassTransit.Containers.Tests/Scenarios/When_registering_a_consumer.cs | src/Containers/MassTransit.Containers.Tests/Scenarios/When_registering_a_consumer.cs | // Copyright 2007-2012 Chris Patterson, Dru Sellers, Travis Smith, et. al.
//
// 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 MassTransit.Containers.Tests.Scenarios
{
using System.Linq;
using System.Threading;
using Magnum.Extensions;
using Magnum.TestFramework;
using Testing;
[Scenario]
public abstract class When_registering_a_consumer :
Given_a_service_bus_instance
{
[When]
public void Registering_a_consumer()
{
}
[Then]
public void Should_have_a_subscription_for_the_consumer_message_type()
{
LocalBus.HasSubscription<SimpleMessageInterface>().Count()
.ShouldEqual(1, "No subscription for the SimpleMessageInterface was found.");
}
[Then]
public void Should_have_a_subscription_for_the_nested_consumer_type()
{
LocalBus.HasSubscription<AnotherMessageInterface>().Count()
.ShouldEqual(1, "Only one subscription should be registered for another consumer");
}
[Then]
public void Should_receive_using_the_first_consumer()
{
const string name = "Joe";
var complete = new ManualResetEvent(false);
LocalBus.SubscribeHandler<SimpleMessageClass>(x => complete.Set());
LocalBus.Publish(new SimpleMessageClass(name));
complete.WaitOne(8.Seconds());
GetSimpleConsumer()
.Last.Name.ShouldEqual(name);
}
protected abstract SimpleConsumer GetSimpleConsumer();
}
} | // Copyright 2007-2011 Chris Patterson, Dru Sellers, Travis Smith, et. al.
//
// 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 MassTransit.Containers.Tests.Scenarios
{
using System.Linq;
using Magnum.TestFramework;
using Testing;
[Scenario]
public abstract class When_registering_a_consumer :
Given_a_service_bus_instance
{
[When]
public void Registering_a_consumer()
{
}
[Then]
public void Should_have_a_subscription_for_the_consumer_message_type()
{
LocalBus.HasSubscription<SimpleMessageInterface>().Count()
.ShouldEqual(1, "No subscription for the SimpleMessageInterface was found.");
}
[Then]
public void Should_have_a_subscription_for_the_nested_consumer_type()
{
LocalBus.HasSubscription<AnotherMessageInterface>().Count()
.ShouldEqual(1, "Only one subscription should be registered for another consumer");
}
[Then]
public void Should_receive_using_the_first_consumer()
{
const string name = "Joe";
LocalBus.Publish(new SimpleMessageClass(name));
GetSimpleConsumer()
.Last.Name.ShouldEqual(name);
}
protected abstract SimpleConsumer GetSimpleConsumer();
}
} | apache-2.0 | C# |
d6a98c3f63c2acc76e01477829691ecf3d47b724 | Add a null check | sta/websocket-sharp,sta/websocket-sharp,sta/websocket-sharp,sta/websocket-sharp | Example3/Chat.cs | Example3/Chat.cs | using System;
using System.Threading;
using WebSocketSharp;
using WebSocketSharp.Server;
namespace Example3
{
public class Chat : WebSocketBehavior
{
private string _name;
private static int _number = 0;
private string _prefix;
public Chat ()
{
_prefix = "anon#";
}
public string Prefix {
get {
return _prefix;
}
set {
_prefix = !value.IsNullOrEmpty () ? value : "anon#";
}
}
private string getName ()
{
var name = QueryString["name"];
return !name.IsNullOrEmpty () ? name : _prefix + getNumber ();
}
private static int getNumber ()
{
return Interlocked.Increment (ref _number);
}
protected override void OnClose (CloseEventArgs e)
{
if (_name == null)
return;
var fmt = "{0} got logged off...";
var msg = String.Format (fmt, _name);
Sessions.Broadcast (msg);
}
protected override void OnMessage (MessageEventArgs e)
{
Sessions.Broadcast (String.Format ("{0}: {1}", _name, e.Data));
}
protected override void OnOpen ()
{
_name = getName ();
}
}
}
| using System;
using System.Threading;
using WebSocketSharp;
using WebSocketSharp.Server;
namespace Example3
{
public class Chat : WebSocketBehavior
{
private string _name;
private static int _number = 0;
private string _prefix;
public Chat ()
{
_prefix = "anon#";
}
public string Prefix {
get {
return _prefix;
}
set {
_prefix = !value.IsNullOrEmpty () ? value : "anon#";
}
}
private string getName ()
{
var name = QueryString["name"];
return !name.IsNullOrEmpty () ? name : _prefix + getNumber ();
}
private static int getNumber ()
{
return Interlocked.Increment (ref _number);
}
protected override void OnClose (CloseEventArgs e)
{
var fmt = "{0} got logged off...";
var msg = String.Format (fmt, _name);
Sessions.Broadcast (msg);
}
protected override void OnMessage (MessageEventArgs e)
{
Sessions.Broadcast (String.Format ("{0}: {1}", _name, e.Data));
}
protected override void OnOpen ()
{
_name = getName ();
}
}
}
| mit | C# |
0a1d117d92bb71452ff7c4763a7ca042fe46062f | Remove form Fields from Container Edit | tommcclean/PortalCMS,tommcclean/PortalCMS,tommcclean/PortalCMS | Portal.CMS.Web/Areas/Builder/Views/Container/_Edit.cshtml | Portal.CMS.Web/Areas/Builder/Views/Container/_Edit.cshtml | @model Portal.CMS.Web.Areas.Builder.ViewModels.Container.EditViewModel
@{
Layout = "";
}
<script type="text/javascript">
function Delete()
{
$('#@Model.ContainerElementId').remove();
var dataParams = { "pageSectionId": @Model.PageSectionId , "componentId": "@Model.ContainerElementId", "__RequestVerificationToken": $('input[name=__RequestVerificationToken]').val() };
$('#container-editor-' + @Model.PageSectionId).fadeOut();
$.ajax({
data: dataParams,
type: 'POST',
cache: false,
url: '@Url.Action("Delete", "Component", new { area = "Builder" })',
success: function (data) {
if (data.State === false)
{
alert("Error: The document has lost synchronisation. Reloading document...");
location.reload();
}
},
});
}
</script>
<br />
<div class="footer">
<a onclick="Delete()" data-dismiss="modal" class="btn delete">Delete</a>
<button class="btn" data-dismiss="modal">Cancel</button>
</div> | @model Portal.CMS.Web.Areas.Builder.ViewModels.Container.EditViewModel
@{
Layout = "";
}
<script type="text/javascript">
function Delete()
{
$('#@Model.ContainerElementId').remove();
var dataParams = { "pageSectionId": @Model.PageSectionId , "componentId": "@Model.ContainerElementId", "__RequestVerificationToken": $('input[name=__RequestVerificationToken]').val() };
$('#container-editor-' + @Model.PageSectionId).fadeOut();
$.ajax({
data: dataParams,
type: 'POST',
cache: false,
url: '@Url.Action("Delete", "Component", new { area = "Builder" })',
success: function (data) {
if (data.State === false)
{
alert("Error: The document has lost synchronisation. Reloading document...");
location.reload();
}
},
});
}
</script>
@using (Html.BeginForm("Edit", "Container", FormMethod.Post))
{
@Html.AntiForgeryToken()
@Html.HiddenFor(x => x.PageSectionId)
@Html.HiddenFor(x => x.ContainerElementId)
<br />
<div class="footer">
<button class="btn primary">Save</button>
<a onclick="Delete()" data-dismiss="modal" class="btn delete">Delete</a>
<button class="btn" data-dismiss="modal">Cancel</button>
</div>
} | mit | C# |
71dd2f49f7e7ceb73ba7539bb804bff9a8d3c74c | Increase tracing for ProfileOptimization_CheckFileExists (#32317) | mmitche/corefx,ptoonen/corefx,Jiayili1/corefx,ViktorHofer/corefx,Jiayili1/corefx,ViktorHofer/corefx,mmitche/corefx,ptoonen/corefx,mmitche/corefx,wtgodbe/corefx,ericstj/corefx,shimingsg/corefx,wtgodbe/corefx,ptoonen/corefx,shimingsg/corefx,BrennanConroy/corefx,Jiayili1/corefx,ViktorHofer/corefx,wtgodbe/corefx,ericstj/corefx,ViktorHofer/corefx,ViktorHofer/corefx,ptoonen/corefx,ericstj/corefx,mmitche/corefx,Jiayili1/corefx,shimingsg/corefx,ericstj/corefx,Jiayili1/corefx,ericstj/corefx,BrennanConroy/corefx,ericstj/corefx,mmitche/corefx,shimingsg/corefx,wtgodbe/corefx,shimingsg/corefx,wtgodbe/corefx,mmitche/corefx,ptoonen/corefx,wtgodbe/corefx,wtgodbe/corefx,ericstj/corefx,ptoonen/corefx,BrennanConroy/corefx,shimingsg/corefx,mmitche/corefx,ViktorHofer/corefx,ptoonen/corefx,shimingsg/corefx,ViktorHofer/corefx,Jiayili1/corefx,Jiayili1/corefx | src/System.Runtime.Extensions/tests/System/Runtime/ProfileOptimization.netcoreapp.cs | src/System.Runtime.Extensions/tests/System/Runtime/ProfileOptimization.netcoreapp.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.Diagnostics;
using System.IO;
using System.Threading;
using Xunit;
using Xunit.Abstractions;
namespace System.Runtime.Tests
{
public class ProfileOptimizationTest : RemoteExecutorTestBase
{
[Fact]
public void ProfileOptimization_CheckFileExists()
{
string profileFile = GetTestFileName();
RemoteInvoke((_profileFile) =>
{
// tracking down why test sporadically fails on RedHat69
// write to the file first to check permissions
// See https://github.com/dotnet/corefx/issues/31792
File.WriteAllText(_profileFile, "42");
// Verify this write succeeded
Assert.True(File.Exists(_profileFile), $"'{_profileFile}' does not exist");
Assert.True(new FileInfo(_profileFile).Length > 0, $"'{_profileFile}' is empty");
// Delete the file and verify the delete
File.Delete(_profileFile);
Assert.True(!File.Exists(_profileFile), $"'{_profileFile} ought to not exist now");
// Perform the test work
ProfileOptimization.SetProfileRoot(Path.GetDirectoryName(_profileFile));
ProfileOptimization.StartProfile(Path.GetFileName(_profileFile));
}, profileFile).Dispose();
// profileFile should deterministically exist now -- if not, wait 5 seconds
bool existed = File.Exists(profileFile);
if (!existed)
{
Thread.Sleep(5000);
}
Assert.True(File.Exists(profileFile), $"'{profileFile}' does not exist");
Assert.True(new FileInfo(profileFile).Length > 0, $"'{profileFile}' is empty");
Assert.True(existed, $"'{profileFile}' did not immediately exist, but did exist 5 seconds later");
}
}
}
| // 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.Diagnostics;
using System.IO;
using Xunit;
using Xunit.Abstractions;
namespace System.Runtime.Tests
{
public class ProfileOptimizationTest : RemoteExecutorTestBase
{
private readonly ITestOutputHelper _output;
public ProfileOptimizationTest(ITestOutputHelper output) => _output = output;
[Fact]
public void ProfileOptimization_CheckFileExists()
{
string tmpProfileFilePath = GetTestFileName();
string tmpTestFileName = Path.Combine(Path.GetDirectoryName(tmpProfileFilePath), Path.GetRandomFileName());
_output.WriteLine($"We'll test write permission on path '{tmpTestFileName}'");
RemoteInvoke((profileFilePath, testFileName) =>
{
// after test fail tracked by https://github.com/dotnet/corefx/issues/31792
// we suspect that the reason is something related to write permission to the location
// to prove that we added a simple write to file in same location of profile file directory path
// ProfileOptimization/Multi-Core JIT could fail silently
File.WriteAllText(testFileName, "42");
ProfileOptimization.SetProfileRoot(Path.GetDirectoryName(profileFilePath));
ProfileOptimization.StartProfile(Path.GetFileName(profileFilePath));
}, tmpProfileFilePath, tmpTestFileName).Dispose();
FileInfo fileInfo = new FileInfo(tmpProfileFilePath);
Assert.True(fileInfo.Exists);
Assert.True(fileInfo.Length > 0);
}
}
}
| mit | C# |
5864dc0f815655f573523d90178f3e7c093c544e | Test for accelerating whilst falling now passes | Pyroka/TddPlatformer,Pyroka/TddPlatformer | Assets/Scripts/Player/PlayerMovement.cs | Assets/Scripts/Player/PlayerMovement.cs | using UnityEngine;
using System.Collections.Generic;
public class PlayerMovement
{
private const float Gravity = -1.0f;
public bool IsOnGround { get; set; }
private Vector3 currentVelocity;
public Vector3 Update()
{
if (IsOnGround)
{
return Vector2.zero;
}
currentVelocity += new Vector3(0.0f, Gravity);
return currentVelocity;
}
} | using UnityEngine;
using System.Collections.Generic;
public class PlayerMovement
{
private const float Gravity = -1.0f;
public bool IsOnGround { get; set; }
public Vector3 Update()
{
if (IsOnGround)
{
return Vector2.zero;
}
return new Vector3(0.0f, Gravity);
}
} | mit | C# |
923917f6693697a5ba4cd4ee749282626f6ca3f9 | Add script disabling to PauseManager | Barleytree/NitoriWare,NitorInc/NitoriWare,NitorInc/NitoriWare,uulltt/NitoriWare,plrusek/NitoriWare,Barleytree/NitoriWare | Assets/Scripts/Scenario/PauseManager.cs | Assets/Scripts/Scenario/PauseManager.cs | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PauseManager : MonoBehaviour
{
private bool paused;
private float timeScale;
private List<AudioSource> pausedAudioSources;
private List<MonoBehaviour> disabledScripts;
void Start ()
{
paused = false;
}
void Update ()
{
if (Input.GetKeyDown(KeyCode.Escape))
if (!paused)
pause();
else
unPause();
}
void pause()
{
timeScale = Time.timeScale;
Time.timeScale = 0f;
AudioSource[] audioSources = FindObjectsOfType(typeof(AudioSource)) as AudioSource[];
pausedAudioSources = new List<AudioSource>();
foreach (AudioSource source in audioSources)
{
if (source.isPlaying)
{
source.Pause();
pausedAudioSources.Add(source);
}
}
MonoBehaviour[] scripts = FindObjectsOfType(typeof(MonoBehaviour)) as MonoBehaviour[];
disabledScripts = new List<MonoBehaviour>();
foreach( MonoBehaviour script in scripts)
{
if (script.enabled && script != this)
{
script.enabled = false;
disabledScripts.Add(script);
}
}
paused = true;
}
void unPause()
{
Time.timeScale = timeScale;
foreach (AudioSource source in pausedAudioSources)
{
source.UnPause();
}
foreach (MonoBehaviour script in disabledScripts)
{
script.enabled = true;
}
paused = false;
}
}
| using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PauseManager : MonoBehaviour
{
private bool paused;
private float timeScale;
private AudioSource[] audioSources;
void Start ()
{
paused = false;
}
void Update ()
{
if (Input.GetKeyDown(KeyCode.Escape))
if (!paused)
pause();
else
unPause();
}
void pause()
{
timeScale = Time.timeScale;
Time.timeScale = 0f;
audioSources = FindObjectsOfType(typeof(AudioSource)) as AudioSource[];
for (int i = 0; i < audioSources.Length; i++)
{
audioSources[i].Pause();
}
paused = true;
}
void unPause()
{
Time.timeScale = timeScale;
for (int i = 0; i < audioSources.Length; i++)
{
audioSources[i].UnPause();
}
paused = false;
}
}
| mit | C# |
7a0edd5f6955446965eaeb95575b618db5807165 | Update PageController.cs | Code-Inside/Samples,Code-Inside/Samples,Code-Inside/Samples,Code-Inside/Samples | 2015/SelfHostWithBetterRoutingForEmbeddedResources/SelfHostWithBetterRouting/Controller/PageController.cs | 2015/SelfHostWithBetterRoutingForEmbeddedResources/SelfHostWithBetterRouting/Controller/PageController.cs | using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;
namespace SelfHostWithBetterRouting.Controller
{
public class PageController : ApiController
{
private const string ResourcePath = "SelfHostWithBetterRouting.Pages{0}";
public static Stream GetStream(string folderAndFileInProjectPath)
{
var asm = Assembly.GetExecutingAssembly();
var resource = string.Format(ResourcePath, folderAndFileInProjectPath);
return asm.GetManifestResourceStream(resource);
}
public HttpResponseMessage Get()
{
var virtualPathRoot = this.Request.GetRequestContext().VirtualPathRoot;
string filename = this.Request.RequestUri.PathAndQuery;
// happens if it is hosted in IIS
if (virtualPathRoot != "/")
{
filename = filename.Replace(virtualPathRoot, string.Empty);
}
// input as /page-assets/js/scripts.js
if (filename == "/")
{
filename = ".index.html";
}
// folders will be seen as "namespaces" - so replace / with the .
filename = filename.Replace("/", ".");
// resources can't be named with -, so it will be replaced with a _
filename = filename.Replace("-", "_");
var mimeType = System.Web.MimeMapping.GetMimeMapping(filename);
var fileStream = GetStream(filename);
if (fileStream != null)
{
var response = new HttpResponseMessage();
response.Content = new StreamContent(fileStream);
response.Content.Headers.ContentType = new MediaTypeHeaderValue(mimeType);
return response;
}
return new HttpResponseMessage(System.Net.HttpStatusCode.NotFound);
}
}
}
| using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;
namespace SelfHostWithBetterRouting.Controller
{
public class PageController : ApiController
{
private const string ResourcePath = "SelfHostWithBetterRouting.Pages{0}";
public static Stream GetStream(string folderAndFileInProjectPath)
{
var asm = Assembly.GetExecutingAssembly();
var resource = string.Format(ResourcePath, folderAndFileInProjectPath);
return asm.GetManifestResourceStream(resource);
}
public HttpResponseMessage Get()
{
var virtualPathRoot = this.Request.GetRequestContext().VirtualPathRoot;
string filename = this.Request.RequestUri.PathAndQuery;
filename = filename.Replace(virtualPathRoot, string.Empty);
// input as /page-assets/js/scripts.js
if (filename == "/" || string.IsNullOrWhiteSpace(filename))
{
filename = ".index.html";
}
// folders will be seen as "namespaces" - so replace / with the .
filename = filename.Replace("/", ".");
// resources can't be named with -, so it will be replaced with a _
filename = filename.Replace("-", "_");
var mimeType = System.Web.MimeMapping.GetMimeMapping(filename);
var fileStream = GetStream(filename);
if (fileStream != null)
{
var response = new HttpResponseMessage();
response.Content = new StreamContent(fileStream);
response.Content.Headers.ContentType = new MediaTypeHeaderValue(mimeType);
return response;
}
return new HttpResponseMessage(System.Net.HttpStatusCode.NotFound);
}
}
}
| mit | C# |
95733ad1023a9a86368ebd507c13c369bb151573 | fix null exception for webhook pings | EslaMx7/sparkpost-csharp-webhooks-sample | SparkPostWebhooksSample/Controllers/WebhooksController.cs | SparkPostWebhooksSample/Controllers/WebhooksController.cs | using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json.Linq;
namespace SparkPostWebhooksSample.Controllers
{
[Route("api/webhook")]
public class WebhooksController : Controller
{
[HttpPost]
public IActionResult ReceiveEvents([FromBody] JArray payload)
{
var unsubscribe_events = new string[] { "bounce", "list_unsubscribe", "spam_complaint", "out_of_band", "link_unsubscribe" };
var extracted_emails = new HashSet<string>();
foreach (var obj in payload)
{
var msys = obj["msys"] as JObject;
var evt_prop = msys.Properties().FirstOrDefault();
if (evt_prop != null)
{
var message_paylod = msys[evt_prop.Name] as JObject;
var message_type = message_paylod.Property("type")?.Value.ToString();
if (unsubscribe_events.Contains(message_type))
{
var recipient_address = message_paylod.Property("rcpt_to")?.Value.ToString();
extracted_emails.Add(recipient_address);
}
}
}
// TODO: unsubscribe
return Ok(extracted_emails);
}
}
} | using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json.Linq;
namespace SparkPostWebhooksSample.Controllers
{
[Route("api/webhook")]
public class WebhooksController : Controller
{
[HttpPost]
public IActionResult ReceiveEvents([FromBody] JArray payload)
{
var unsubscribe_events = new string[] { "bounce", "list_unsubscribe", "spam_complaint", "out_of_band", "link_unsubscribe" };
var extracted_emails = new HashSet<string>();
foreach (var obj in payload)
{
var msys = obj["msys"] as JObject;
var evt_prop = msys.Properties().FirstOrDefault();
var message_paylod = msys[evt_prop?.Name] as JObject;
var message_type = message_paylod.Property("type")?.Value.ToString();
if (unsubscribe_events.Contains(message_type))
{
var recipient_address = message_paylod.Property("rcpt_to")?.Value.ToString();
extracted_emails.Add(recipient_address);
}
}
// TODO: unsubscribe
return Ok(extracted_emails);
}
}
} | apache-2.0 | C# |
0e941ab4a10153f5f8fe085d21b19f85e0eebf57 | Add AvFoundationLibrary to preloaded libraries | PlayScriptRedux/monomac,dlech/monomac | src/Foundation/NSObjectMac.cs | src/Foundation/NSObjectMac.cs | //
// Copyright 2010, Novell, Inc.
//
// 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.
//
//
// Used to preload the Foundation and AppKit libraries as our runtime
// requires this. This will be replaced later with a dynamic system
//
using System;
using MonoMac.ObjCRuntime;
namespace MonoMac.Foundation {
public partial class NSObject {
// Used to force the loading of AppKit and Foundation
static IntPtr fl = Dlfcn.dlopen (Constants.FoundationLibrary, 1);
static IntPtr al = Dlfcn.dlopen (Constants.AppKitLibrary, 1);
static IntPtr ab = Dlfcn.dlopen (Constants.AddressBookLibrary, 1);
static IntPtr ct = Dlfcn.dlopen (Constants.CoreTextLibrary, 1);
static IntPtr wl = Dlfcn.dlopen (Constants.WebKitLibrary, 1);
static IntPtr zl = Dlfcn.dlopen (Constants.QuartzLibrary, 1);
static IntPtr ql = Dlfcn.dlopen (Constants.QTKitLibrary, 1);
static IntPtr cl = Dlfcn.dlopen (Constants.CoreLocationLibrary, 1);
static IntPtr ll = Dlfcn.dlopen (Constants.SecurityLibrary, 1);
static IntPtr zc = Dlfcn.dlopen (Constants.QuartzComposerLibrary, 1);
static IntPtr cw = Dlfcn.dlopen (Constants.CoreWlanLibrary, 1);
static IntPtr pk = Dlfcn.dlopen (Constants.PdfKitLibrary, 1);
static IntPtr ik = Dlfcn.dlopen (Constants.ImageKitLibrary, 1);
static IntPtr sb = Dlfcn.dlopen (Constants.ScriptingBridgeLibrary, 1);
static IntPtr av = Dlfcn.dlopen (Constants.AVFoundationLibrary, 1);
}
}
| //
// Copyright 2010, Novell, Inc.
//
// 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.
//
//
// Used to preload the Foundation and AppKit libraries as our runtime
// requires this. This will be replaced later with a dynamic system
//
using System;
using MonoMac.ObjCRuntime;
namespace MonoMac.Foundation {
public partial class NSObject {
// Used to force the loading of AppKit and Foundation
static IntPtr fl = Dlfcn.dlopen (Constants.FoundationLibrary, 1);
static IntPtr al = Dlfcn.dlopen (Constants.AppKitLibrary, 1);
static IntPtr ab = Dlfcn.dlopen (Constants.AddressBookLibrary, 1);
static IntPtr ct = Dlfcn.dlopen (Constants.CoreTextLibrary, 1);
static IntPtr wl = Dlfcn.dlopen (Constants.WebKitLibrary, 1);
static IntPtr zl = Dlfcn.dlopen (Constants.QuartzLibrary, 1);
static IntPtr ql = Dlfcn.dlopen (Constants.QTKitLibrary, 1);
static IntPtr cl = Dlfcn.dlopen (Constants.CoreLocationLibrary, 1);
static IntPtr ll = Dlfcn.dlopen (Constants.SecurityLibrary, 1);
static IntPtr zc = Dlfcn.dlopen (Constants.QuartzComposerLibrary, 1);
static IntPtr cw = Dlfcn.dlopen (Constants.CoreWlanLibrary, 1);
static IntPtr pk = Dlfcn.dlopen (Constants.PdfKitLibrary, 1);
static IntPtr ik = Dlfcn.dlopen (Constants.ImageKitLibrary, 1);
static IntPtr sb = Dlfcn.dlopen (Constants.ScriptingBridgeLibrary, 1);
}
}
| apache-2.0 | C# |
71ef4f85d82c7f305ad88948cf3d7c3e41d345fc | Fix broken test | SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice | src/SFA.DAS.EmployerApprenticeshipsService.Domain.UnitTests/Extensions/WhenIGetAnEmploymentStatusAgreementDescription.cs | src/SFA.DAS.EmployerApprenticeshipsService.Domain.UnitTests/Extensions/WhenIGetAnEmploymentStatusAgreementDescription.cs | using NUnit.Framework;
using SFA.DAS.EAS.Domain;
using SFA.DAS.EAS.Domain.Extensions;
using SFA.DAS.EAS.Domain.Models.EmployerAgreement;
namespace SFA.DAS.EmployerApprenticeshipsService.Domain.UnitTests.Extensions
{
class WhenIGetAnEmploymentStatusAgreementDescription
{
[Test]
public void ThenIShouldGetTheCorrectDescription()
{
Assert.AreEqual("Not signed", EmployerAgreementStatus.Pending.GetDescription());
Assert.AreEqual("Signed", EmployerAgreementStatus.Signed.GetDescription());
Assert.AreEqual("Expired", EmployerAgreementStatus.Expired.GetDescription());
Assert.AreEqual("Superseded", EmployerAgreementStatus.Superseded.GetDescription());
}
}
}
| using NUnit.Framework;
using SFA.DAS.EAS.Domain;
using SFA.DAS.EAS.Domain.Extensions;
using SFA.DAS.EAS.Domain.Models.EmployerAgreement;
namespace SFA.DAS.EmployerApprenticeshipsService.Domain.UnitTests.Extensions
{
class WhenIGetAnEmploymentStatusAgreementDescription
{
[Test]
public void ThenIShouldGetTheCorrectDescription()
{
Assert.AreEqual("Not signed", EmployerAgreementStatus.Pending.GetDescription());
Assert.AreEqual("Signed", EmployerAgreementStatus.Signed.GetDescription());
Assert.AreEqual("Expired", EmployerAgreementStatus.Expired.GetDescription());
Assert.AreEqual("Superceded", EmployerAgreementStatus.Superseded.GetDescription());
}
}
}
| mit | C# |
74eb6d7e402e654c27e63cee7205f75c5b4d88ec | Update Constants.cs | darkestspirit/IdentityServer3.Contrib.Localization,totpero/IdentityServer3.Contrib.Localization,IdentityServer/IdentityServer3.Contrib.Localization,Utdanningsdirektoratet/IdentityServer3.Contrib.Localization,johnkors/IdentityServer3.Contrib.Localization | source/IdentityServer3.Localization/Constants.cs | source/IdentityServer3.Localization/Constants.cs | namespace Thinktecture.IdentityServer.Core.Services.Contrib
{
public class Constants
{
public const string Default = "Default";
public const string Pirate = "pirate";
public const string deDE = "de-DE";
public const string esAR = "es-AR";
public const string frFR = "fr-FR";
public const string nbNO = "nb-NO";
public const string svSE = "sv-SE";
public const string trTR = "tr-TR";
public const string roRO = "ro-RO";
public const string nlNL = "nl-NL";
public const string zhCN = "zh-CN";
}
}
| namespace Thinktecture.IdentityServer.Core.Services.Contrib
{
public class Constants
{
public const string Default = "Default";
public const string Pirate = "pirate";
public const string deDE = "de-DE";
public const string esAR = "es-AR";
public const string frFR = "fr-FR";
public const string nbNO = "nb-NO";
public const string svSE = "sv-SE";
public const string trTR = "tr-TR";
public const string roRO = "ro-RO";
public const string nlNL = "nl-NL";
}
} | mit | C# |
f5421b60f1f077dbbb8313baaca99b132e2a0a30 | Update Run.cs | grzesiek-galezowski/component-based-test-tool | ComponentBasedTestTool/Components/AzurePipelines/Dto/Run.cs | ComponentBasedTestTool/Components/AzurePipelines/Dto/Run.cs | using System;
namespace Components.AzurePipelines.Dto;
public record Run
(
ReferenceLinks Links,
Pipeline Pipeline,
string State,
string Result,
DateTime CreatedDate,
string Url,
Resources Resources,
string FinalYaml,
int Id,
object Name
); | using System;
namespace Components.AzurePipelines.Dto;
public record Run
(
ReferenceLinks Links,
Pipeline Pipeline,
string State,
DateTime CreatedDate,
string Url,
Resources Resources,
string FinalYaml,
int Id,
object Name
); | mit | C# |
26be51c8efcdc407bd2f5e0e125991c0dc113e01 | Reduce code size by using `Repeated<T>` as the value of `EmptyList<T>.Value`. | qwertie/Loyc,qwertie/Loyc | Core/Loyc.Essentials/Collections/HelperClasses/EmptyList.cs | Core/Loyc.Essentials/Collections/HelperClasses/EmptyList.cs | // This file is part of the Loyc project. Licence: LGPL
using System;
using System.Collections.Generic;
using System.Text;
namespace Loyc.Collections
{
/// <summary>Helper class: <see cref="EmptyList{T}.Value"/> is a read-only empty list.</summary>
/// <remarks>It is a boxed copy of <c>ListExt.Repeat(default(T), 0)</c>.</remarks>
[Serializable]
public static class EmptyList<T>
{
public static readonly IListAndListSource<T> Value = new Repeated<T>(default(T), 0);
}
}
| // This file is part of the Loyc project. Licence: LGPL
using System;
using System.Collections.Generic;
using System.Text;
namespace Loyc.Collections
{
/// <summary>Helper class: <see cref="EmptyList{T}.Value"/> is a read-only empty list.</summary>
[Serializable]
public class EmptyList<T> : IList<T>, IRange<T>, IIsEmpty
{
public static readonly EmptyList<T> Value = new EmptyList<T>();
public int IndexOf(T item)
{
return -1;
}
public void Insert(int index, T item)
{
ReadOnly();
}
private void ReadOnly()
{
throw new InvalidOperationException("Collection is read-only");
}
public void RemoveAt(int index)
{
ReadOnly();
}
public T this[int index]
{
get {
throw new IndexOutOfRangeException();
}
set {
throw new IndexOutOfRangeException();
}
}
public T TryGet(int index, out bool fail)
{
fail = true;
return default(T);
}
public void Add(T item)
{
ReadOnly();
}
public void Clear()
{
}
public bool Contains(T item)
{
return false;
}
public void CopyTo(T[] array, int arrayIndex)
{
}
public int Count
{
get { return 0; }
}
public bool IsReadOnly
{
get { return true; }
}
public bool Remove(T item)
{
return false;
}
public IEnumerator<T> GetEnumerator()
{
return EmptyEnumerator<T>.Value;
}
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
return EmptyEnumerator<T>.Value;
}
public IRange<T> Slice(int start, int count)
{
return this;
}
#region IRange<T> members
public bool IsEmpty
{
get { return true; }
}
public T First
{
get { throw new EmptySequenceException(); }
}
public T Last
{
get { throw new EmptySequenceException(); }
}
public T PopLast(out bool fail)
{
fail = true; return default(T);
}
public T PopFirst(out bool fail)
{
fail = true; return default(T);
}
IFRange<T> ICloneable<IFRange<T>>.Clone() { return this; }
IBRange<T> ICloneable<IBRange<T>>.Clone() { return this; }
IRange<T> ICloneable<IRange<T>>.Clone() { return this; }
#endregion
}
}
| lgpl-2.1 | C# |
d63aa2983312a11144ad6e0a806c72e38e8455e5 | Resolve RefBox TODOs | madelson/DistributedLock | DistributedLock.Core/Internal/RefBox.cs | DistributedLock.Core/Internal/RefBox.cs | using System;
using System.Threading;
namespace Medallion.Threading.Internal
{
/// <summary>
/// Wraps a value tuple to be a read/write reference
/// </summary>
#if DEBUG
public
#else
internal
#endif
sealed class RefBox<T> where T : struct
{
private readonly T _value;
internal RefBox(T value)
{
this._value = value;
}
public ref readonly T Value => ref this._value;
}
/// <summary>
/// Simplifies storing state in certain <see cref="IDisposable"/>s.
/// </summary>
#if DEBUG
public
#else
internal
#endif
sealed class RefBox
{
public static RefBox<T> Create<T>(T value) where T : struct => new RefBox<T>(value);
/// <summary>
/// Thread-safely checks if <paramref name="boxRef"/> is non-null and if so sets it to null and outputs
/// the value as <paramref name="value"/>.
/// </summary>
public static bool TryConsume<T>(ref RefBox<T>? boxRef, out T value)
where T : struct
{
var box = Interlocked.Exchange(ref boxRef, null);
if (box != null)
{
value = box.Value;
return true;
}
value = default;
return false;
}
}
}
| using System.Threading;
namespace Medallion.Threading.Internal
{
// todo use in more places or get rid of
#if DEBUG
public
#else
internal
#endif
sealed class RefBox<T> where T : struct
{
private readonly T _value;
internal RefBox(T value)
{
this._value = value;
}
public ref readonly T Value => ref this._value;
}
#if DEBUG
public
#else
internal
#endif
sealed class RefBox
{
public static RefBox<T> Create<T>(T value) where T : struct => new RefBox<T>(value);
public static bool TryConsume<T>(ref RefBox<T>? boxRef, out T value)
where T : struct
{
var box = Interlocked.Exchange(ref boxRef, null);
if (box != null)
{
value = box.Value;
return true;
}
value = default;
return false;
}
}
}
| mit | C# |
53a6932e924c3a9d202eaaadc934692c91f9257e | Align .NET4 assembly version with main project | nicolaiarocci/Eve.NET | Eve.NET.Net4/Properties/AssemblyInfo.cs | Eve.NET.Net4/Properties/AssemblyInfo.cs | using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle ("Eve.NET.Net4")]
[assembly: AssemblyDescription ("")]
[assembly: AssemblyConfiguration ("")]
[assembly: AssemblyCompany ("CIR 2000")]
[assembly: AssemblyProduct ("")]
[assembly: AssemblyCopyright ("nicola")]
[assembly: AssemblyTrademark ("")]
[assembly: AssemblyCulture ("")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion("0.1.0.1")]
[assembly: AssemblyFileVersion("0.1.0.1")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]
| using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle ("Eve.NET.Net4")]
[assembly: AssemblyDescription ("")]
[assembly: AssemblyConfiguration ("")]
[assembly: AssemblyCompany ("CIR 2000")]
[assembly: AssemblyProduct ("")]
[assembly: AssemblyCopyright ("nicola")]
[assembly: AssemblyTrademark ("")]
[assembly: AssemblyCulture ("")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion ("1.0.*")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]
| bsd-3-clause | C# |
ecb3d16372219b711d9cf4a4013ca7cb2950feba | Remove unused usings | hey-red/Markdown | MarkdownSharp/Extensions/Mal/Profile.cs | MarkdownSharp/Extensions/Mal/Profile.cs | /**
* This file is part of the MarkdownSharp package
* For the full copyright and license information,
* view the LICENSE file that was distributed with this source code.
*/
using System;
using System.Text.RegularExpressions;
namespace MarkdownSharp.Extensions.Mal
{
/// <summary>
/// Create short link for http://myanimelist.net
/// ex: http://myanimelist.net/profile/ritsufag => mal://ritsufag
/// </summary>
public class Profile : IExtensionInterface
{
private static Regex _malArticles = new Regex(@"
(?:http\:\/\/)
(?:www\.)?
myanimelist\.net\/profile\/
([\w-]{2,16})", RegexOptions.Multiline | RegexOptions.IgnorePatternWhitespace);
public string Transform(string text)
{
return _malArticles.Replace(text, new MatchEvaluator(ProfileEvaluator));
}
private string ProfileEvaluator(Match match)
{
string userName = match.Groups[1].Value;
return String.Format(
"[mal://{0}](http://myanimelist.net/profile/{1})",
userName, userName
);
}
}
}
| /**
* This file is part of the MarkdownSharp package
* For the full copyright and license information,
* view the LICENSE file that was distributed with this source code.
*/
using System;
using System.Net;
using System.Text.RegularExpressions;
namespace MarkdownSharp.Extensions.Mal
{
/// <summary>
/// Create short link for http://myanimelist.net
/// ex: http://myanimelist.net/profile/ritsufag => mal://ritsufag
/// </summary>
public class Profile : IExtensionInterface
{
private static Regex _malArticles = new Regex(@"
(?:http\:\/\/)
(?:www\.)?
myanimelist\.net\/profile\/
([\w-]{2,16})", RegexOptions.Multiline | RegexOptions.IgnorePatternWhitespace);
public string Transform(string text)
{
return _malArticles.Replace(text, new MatchEvaluator(ProfileEvaluator));
}
private string ProfileEvaluator(Match match)
{
string userName = match.Groups[1].Value;
return String.Format(
"[mal://{0}](http://myanimelist.net/profile/{1})",
userName, userName
);
}
}
}
| mit | C# |
5e5fe1f2218462b060f6a7fd220d1f47f8b4353f | Add additional Fields overload (#2550) | adam-mccoy/elasticsearch-net,elastic/elasticsearch-net,elastic/elasticsearch-net,CSGOpenSource/elasticsearch-net,CSGOpenSource/elasticsearch-net,adam-mccoy/elasticsearch-net,CSGOpenSource/elasticsearch-net,adam-mccoy/elasticsearch-net | src/Nest/CommonAbstractions/Infer/Fields/FieldsDescriptor.cs | src/Nest/CommonAbstractions/Infer/Fields/FieldsDescriptor.cs | using System;
using System.Collections.Generic;
using System.Linq.Expressions;
namespace Nest
{
public class FieldsDescriptor<T> : DescriptorPromiseBase<FieldsDescriptor<T>, Fields>
where T : class
{
public FieldsDescriptor() : base(new Fields()) { }
public FieldsDescriptor<T> Fields(params Expression<Func<T, object>>[] fields) => Assign(f => f.And(fields));
public FieldsDescriptor<T> Fields(params string[] fields) => Assign(f => f.And(fields));
public FieldsDescriptor<T> Fields(IEnumerable<Field> fields) => Assign(f => f.ListOfFields.AddRange(fields));
public FieldsDescriptor<T> Field(Expression<Func<T, object>> field, double? boost = null) => Assign(f => f.And(field, boost));
public FieldsDescriptor<T> Field(string field, double? boost = null) => Assign(f => f.And(field, boost));
public FieldsDescriptor<T> Field(Field field) => Assign(f => f.And(field));
}
}
| using System;
using System.Collections.Generic;
using System.Linq.Expressions;
namespace Nest
{
public class FieldsDescriptor<T> : DescriptorPromiseBase<FieldsDescriptor<T>, Fields>
where T : class
{
public FieldsDescriptor() : base(new Fields()) { }
public FieldsDescriptor<T> Fields(params Expression<Func<T, object>>[] fields) => Assign(f => f.And(fields));
public FieldsDescriptor<T> Fields(params string[] fields) => Assign(f => f.And(fields));
public FieldsDescriptor<T> Fields(IEnumerable<Field> fields) => Assign(f => f.ListOfFields.AddRange(fields));
public FieldsDescriptor<T> Field(Expression<Func<T, object>> field, double? boost = null) => Assign(f => f.And(field, boost));
public FieldsDescriptor<T> Field(string field, double? boost = null) => Assign(f => f.And(field, boost));
}
} | apache-2.0 | C# |
eb0171e2acfe8220b9f5c8993b82fc86da41be9d | Fix in NodaTime.Benchmarks.BclTests.Comparison_Operators | BenJenkinson/nodatime,malcolmr/nodatime,nodatime/nodatime,malcolmr/nodatime,jskeet/nodatime,BenJenkinson/nodatime,malcolmr/nodatime,jskeet/nodatime,malcolmr/nodatime,nodatime/nodatime | src/NodaTime.Benchmarks/BclTests/DateTimeOffsetBenchmarks.cs | src/NodaTime.Benchmarks/BclTests/DateTimeOffsetBenchmarks.cs | // Copyright 2013 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 System.Collections.Generic;
using System.ComponentModel;
using System.Globalization;
using BenchmarkDotNet;
using BenchmarkDotNet.Tasks;
namespace NodaTime.Benchmarks.BclTests
{
[BenchmarkTask(platform: BenchmarkPlatform.X86, jitVersion: BenchmarkJitVersion.LegacyJit)]
[BenchmarkTask(platform: BenchmarkPlatform.X64, jitVersion: BenchmarkJitVersion.LegacyJit)]
[BenchmarkTask(platform: BenchmarkPlatform.X64, jitVersion: BenchmarkJitVersion.RyuJit)]
[Category("BCL")]
public class DateTimeOffsetBenchmarks
{
private static readonly DateTimeOffset sample = new DateTimeOffset(2009, 12, 26, 10, 8, 30, 234, TimeSpan.Zero);
private static readonly DateTimeOffset earlier = new DateTimeOffset(2009, 12, 26, 10, 8, 30, 234, TimeSpan.FromHours(1));
private static readonly DateTimeOffset later = new DateTimeOffset(2009, 12, 26, 10, 8, 30, 234, TimeSpan.FromHours(-1));
private static readonly IComparer<DateTimeOffset> defaultComparer = Comparer<DateTimeOffset>.Default;
[Benchmark]
public void CompareTo()
{
sample.CompareTo(earlier);
sample.CompareTo(sample);
sample.CompareTo(later);
}
[Benchmark]
public void Comparer_Compare()
{
defaultComparer.Compare(sample, earlier);
defaultComparer.Compare(sample, sample);
defaultComparer.Compare(sample, later);
}
[Benchmark]
public bool Comparison_Operators()
{
#pragma warning disable 1718
return (sample < earlier) | (sample < sample) | (sample < later);
#pragma warning restore 1718
}
[Benchmark]
[Category("Text")]
public string Format()
{
return sample.ToString("dd/MM/yyyy HH:mm:ss", CultureInfo.InvariantCulture);
}
}
}
| // Copyright 2013 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 System.Collections.Generic;
using System.ComponentModel;
using System.Globalization;
using BenchmarkDotNet;
using BenchmarkDotNet.Tasks;
namespace NodaTime.Benchmarks.BclTests
{
[BenchmarkTask(platform: BenchmarkPlatform.X86, jitVersion: BenchmarkJitVersion.LegacyJit)]
[BenchmarkTask(platform: BenchmarkPlatform.X64, jitVersion: BenchmarkJitVersion.LegacyJit)]
[BenchmarkTask(platform: BenchmarkPlatform.X64, jitVersion: BenchmarkJitVersion.RyuJit)]
[Category("BCL")]
public class DateTimeOffsetBenchmarks
{
private static readonly DateTimeOffset sample = new DateTimeOffset(2009, 12, 26, 10, 8, 30, 234, TimeSpan.Zero);
private static readonly DateTimeOffset earlier = new DateTimeOffset(2009, 12, 26, 10, 8, 30, 234, TimeSpan.FromHours(1));
private static readonly DateTimeOffset later = new DateTimeOffset(2009, 12, 26, 10, 8, 30, 234, TimeSpan.FromHours(-1));
private static readonly IComparer<DateTimeOffset> defaultComparer = Comparer<DateTimeOffset>.Default;
[Benchmark]
public void CompareTo()
{
sample.CompareTo(earlier);
sample.CompareTo(sample);
sample.CompareTo(later);
}
[Benchmark]
public void Comparer_Compare()
{
defaultComparer.Compare(sample, earlier);
defaultComparer.Compare(sample, sample);
defaultComparer.Compare(sample, later);
}
[Benchmark]
public bool Comparison_Operators()
{
return (sample < earlier);
#pragma warning disable 1718
return (sample < sample);
#pragma warning restore 1718
return (sample < later);
}
[Benchmark]
[Category("Text")]
public string Format()
{
return sample.ToString("dd/MM/yyyy HH:mm:ss", CultureInfo.InvariantCulture);
}
}
}
| apache-2.0 | C# |
bed0973c65b3dd53df9b6c675f74e5f20973724a | Use path.combine | JohanLarsson/Gu.Wpf.UiAutomation | Gu.Wpf.UiAutomation.UITests/ImageAssertTests.cs | Gu.Wpf.UiAutomation.UITests/ImageAssertTests.cs | namespace Gu.Wpf.UiAutomation.UITests
{
using System.IO;
using NUnit.Framework;
public class ImageAssertTests
{
private static readonly string ExeFileName = Path.Combine(
TestContext.CurrentContext.TestDirectory,
@"..\..\TestApplications\WpfApplication\bin\WpfApplication.exe");
private static readonly string ImageFileName = Path.Combine(
TestContext.CurrentContext.TestDirectory,
@"Images\button.png");
[Test]
public void WhenEqual()
{
using (var app = Application.Launch(ExeFileName, "SizeWindow"))
{
var window = app.MainWindow;
var button = window.FindButton("SizeButton");
try
{
ImageAssert.AreEqual(ImageFileName, button);
}
catch
{
ScreenCapture.CaptureToFile(button, Path.Combine(Path.GetTempPath(), "button.png"));
throw;
}
}
}
[Test]
public void WhenNotEqual()
{
using (var app = Application.Launch(ExeFileName, "SizeWindow"))
{
var window = app.MainWindow;
Assert.Throws<NUnit.Framework.AssertionException>(() => ImageAssert.AreEqual(ImageFileName, window));
}
}
}
} | namespace Gu.Wpf.UiAutomation.UITests
{
using System.IO;
using NUnit.Framework;
public class ImageAssertTests
{
private static readonly string ExeFileName = Path.Combine(
TestContext.CurrentContext.TestDirectory,
@"..\..\TestApplications\WpfApplication\bin\WpfApplication.exe");
private static readonly string ImageFileName = Path.Combine(
TestContext.CurrentContext.TestDirectory,
@"Images\button.png");
[Test]
public void WhenEqual()
{
using (var app = Application.Launch(ExeFileName, "SizeWindow"))
{
var window = app.MainWindow;
var button = window.FindButton("SizeButton");
try
{
ImageAssert.AreEqual(ImageFileName, button);
}
catch
{
ScreenCapture.CaptureToFile(button, @"%Temp%\button.png");
throw;
}
}
}
[Test]
public void WhenNotEqual()
{
using (var app = Application.Launch(ExeFileName, "SizeWindow"))
{
var window = app.MainWindow;
Assert.Throws<NUnit.Framework.AssertionException>(() => ImageAssert.AreEqual(ImageFileName, window));
}
}
}
} | mit | C# |
9aef0a5370119508b55640efa93c4104a2a91ebc | Fix constructor selection bug | RockFramework/RockLib.Configuration | RockLib.Configuration.ObjectFactory/ConstructorOrderInfo.cs | RockLib.Configuration.ObjectFactory/ConstructorOrderInfo.cs | using Microsoft.Extensions.Configuration;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace RockLib.Configuration.ObjectFactory
{
internal class ConstructorOrderInfo : IComparable<ConstructorOrderInfo>
{
public ConstructorOrderInfo(ConstructorInfo constructor, Dictionary<string, IConfigurationSection> availableMembers)
{
Constructor = constructor;
var parameters = constructor.GetParameters();
TotalParameters = parameters.Length;
if (TotalParameters == 0)
{
IsInvokableWithoutDefaultParameters = true;
IsInvokableWithDefaultParameters = true;
MissingParameterNames = Enumerable.Empty<string>();
MatchedParameters = 0;
}
else
{
IsInvokableWithoutDefaultParameters = parameters.Count(p => availableMembers.ContainsKey(p.Name)) == TotalParameters;
IsInvokableWithDefaultParameters = parameters.Count(p => availableMembers.ContainsKey(p.Name) || p.HasDefaultValue) == TotalParameters;
MissingParameterNames = parameters.Where(p => !availableMembers.ContainsKey(p.Name) && !p.HasDefaultValue).Select(p => p.Name);
MatchedParameters = parameters.Count(p => availableMembers.ContainsKey(p.Name));
}
}
public ConstructorInfo Constructor { get; }
public bool IsInvokableWithoutDefaultParameters { get; }
public bool IsInvokableWithDefaultParameters { get; }
public int MatchedParameters { get; }
public int TotalParameters { get; }
public IEnumerable<string> MissingParameterNames { get; }
public int CompareTo(ConstructorOrderInfo other)
{
if (IsInvokableWithoutDefaultParameters && !other.IsInvokableWithoutDefaultParameters) return -1;
if (!IsInvokableWithoutDefaultParameters && other.IsInvokableWithoutDefaultParameters) return 1;
if (IsInvokableWithDefaultParameters && !other.IsInvokableWithDefaultParameters) return -1;
if (!IsInvokableWithDefaultParameters && other.IsInvokableWithDefaultParameters) return 1;
if (MatchedParameters > other.MatchedParameters) return -1;
if (MatchedParameters < other.MatchedParameters) return 1;
if (TotalParameters > other.TotalParameters) return -1;
if (TotalParameters < other.TotalParameters) return 1;
return 0;
}
}
}
| using Microsoft.Extensions.Configuration;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace RockLib.Configuration.ObjectFactory
{
internal class ConstructorOrderInfo : IComparable<ConstructorOrderInfo>
{
public ConstructorOrderInfo(ConstructorInfo constructor, Dictionary<string, IConfigurationSection> availableMembers)
{
Constructor = constructor;
var parameters = constructor.GetParameters();
TotalParameters = parameters.Length;
if (TotalParameters == 0)
{
IsInvokableWithoutDefaultParameters = true;
IsInvokableWithDefaultParameters = true;
MissingParameterNames = Enumerable.Empty<string>();
}
else
{
IsInvokableWithoutDefaultParameters = parameters.Count(p => availableMembers.ContainsKey(p.Name)) == TotalParameters;
IsInvokableWithDefaultParameters = parameters.Count(p => availableMembers.ContainsKey(p.Name) || p.HasDefaultValue) == TotalParameters;
MissingParameterNames = parameters.Where(p => !availableMembers.ContainsKey(p.Name) && !p.HasDefaultValue).Select(p => p.Name);
}
}
public ConstructorInfo Constructor { get; }
public bool IsInvokableWithoutDefaultParameters { get; }
public bool IsInvokableWithDefaultParameters { get; }
public int TotalParameters { get; }
public IEnumerable<string> MissingParameterNames { get; }
public int CompareTo(ConstructorOrderInfo other)
{
if (IsInvokableWithoutDefaultParameters && !other.IsInvokableWithoutDefaultParameters) return -1;
if (!IsInvokableWithoutDefaultParameters && other.IsInvokableWithoutDefaultParameters) return 1;
if (IsInvokableWithDefaultParameters && !other.IsInvokableWithDefaultParameters) return -1;
if (!IsInvokableWithDefaultParameters && other.IsInvokableWithDefaultParameters) return 1;
if (TotalParameters > other.TotalParameters) return -1;
if (TotalParameters < other.TotalParameters) return 1;
return 0;
}
}
}
| mit | C# |
f988dec5cbb9f867b111490485cc933f8898f9ad | Use .NET Core 3.1. | FacilityApi/FacilityJavaScript,FacilityApi/FacilityJavaScript,FacilityApi/FacilityCSharp,FacilityApi/Facility,FacilityApi/FacilityJavaScript | tools/Build/Build.cs | tools/Build/Build.cs | using System;
using System.Linq;
using Faithlife.Build;
using static Faithlife.Build.BuildUtility;
using static Faithlife.Build.DotNetRunner;
internal static class Build
{
public static int Main(string[] args) => BuildRunner.Execute(args, build =>
{
var codegen = "fsdgen___";
var dotNetBuildSettings = new DotNetBuildSettings
{
NuGetApiKey = Environment.GetEnvironmentVariable("NUGET_API_KEY"),
DocsSettings = new DotNetDocsSettings
{
GitLogin = new GitLoginInfo("FacilityApiBot", Environment.GetEnvironmentVariable("BUILD_BOT_PASSWORD") ?? ""),
GitAuthor = new GitAuthorInfo("FacilityApiBot", "[email protected]"),
SourceCodeUrl = "https://github.com/FacilityApi/RepoTemplate/tree/master/src",
ProjectHasDocs = name => !name.StartsWith("fsdgen", StringComparison.Ordinal),
},
};
build.AddDotNetTargets(dotNetBuildSettings);
build.Target("codegen")
.DependsOn("build")
.Describe("Generates code from the FSD")
.Does(() => CodeGen(verify: false));
build.Target("verify-codegen")
.DependsOn("build")
.Describe("Ensures the generated code is up-to-date")
.Does(() => CodeGen(verify: true));
build.Target("test")
.DependsOn("verify-codegen");
void CodeGen(bool verify)
{
var configuration = dotNetBuildSettings!.BuildOptions!.ConfigurationOption!.Value;
var toolPath = FindFiles($"src/{codegen}/bin/{configuration}/netcoreapp3.1/{codegen}.dll").FirstOrDefault();
var verifyOption = verify ? "--verify" : null;
RunDotNet(toolPath, "___", "___", "--newline", "lf", verifyOption);
}
});
}
| using System;
using System.Linq;
using Faithlife.Build;
using static Faithlife.Build.BuildUtility;
using static Faithlife.Build.DotNetRunner;
internal static class Build
{
public static int Main(string[] args) => BuildRunner.Execute(args, build =>
{
var codegen = "fsdgen___";
var dotNetBuildSettings = new DotNetBuildSettings
{
NuGetApiKey = Environment.GetEnvironmentVariable("NUGET_API_KEY"),
DocsSettings = new DotNetDocsSettings
{
GitLogin = new GitLoginInfo("FacilityApiBot", Environment.GetEnvironmentVariable("BUILD_BOT_PASSWORD") ?? ""),
GitAuthor = new GitAuthorInfo("FacilityApiBot", "[email protected]"),
SourceCodeUrl = "https://github.com/FacilityApi/RepoTemplate/tree/master/src",
ProjectHasDocs = name => !name.StartsWith("fsdgen", StringComparison.Ordinal),
},
};
build.AddDotNetTargets(dotNetBuildSettings);
build.Target("codegen")
.DependsOn("build")
.Describe("Generates code from the FSD")
.Does(() => CodeGen(verify: false));
build.Target("verify-codegen")
.DependsOn("build")
.Describe("Ensures the generated code is up-to-date")
.Does(() => CodeGen(verify: true));
build.Target("test")
.DependsOn("verify-codegen");
void CodeGen(bool verify)
{
var configuration = dotNetBuildSettings!.BuildOptions!.ConfigurationOption!.Value;
var toolPath = FindFiles($"src/{codegen}/bin/{configuration}/netcoreapp*/{codegen}.dll").FirstOrDefault();
var verifyOption = verify ? "--verify" : null;
RunDotNet(toolPath, "___", "___", "--newline", "lf", verifyOption);
}
});
}
| mit | C# |
06350ae0d3ba2c35fbe74038edba3c3577aa4bd2 | Update Assembly version | gatepoet/Deicon.TilesDavis | src/TilesDavis.Wpf/TilesDavis.Wpf/Properties/AssemblyInfo.cs | src/TilesDavis.Wpf/TilesDavis.Wpf/Properties/AssemblyInfo.cs | using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// 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("TilesDavis")]
[assembly: AssemblyDescription("A windows 10 custom tile manager")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("DeiCon")]
[assembly: AssemblyProduct("TilesDavis.Wpf")]
[assembly: AssemblyCopyright("Copyright © 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)]
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
// 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;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// 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("TilesDavis")]
[assembly: AssemblyDescription("A windows 10 custom tile manager")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("DeiCon")]
[assembly: AssemblyProduct("TilesDavis.Wpf")]
[assembly: AssemblyCopyright("Copyright © 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)]
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
// 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")]
| unlicense | C# |
756ca9c741a44c84f2da8a4992d2402e44ba267c | Fix PortfolioTarget percent test name | AlexCatarino/Lean,Jay-Jay-D/LeanSTP,AnshulYADAV007/Lean,redmeros/Lean,redmeros/Lean,QuantConnect/Lean,AnshulYADAV007/Lean,QuantConnect/Lean,JKarathiya/Lean,Jay-Jay-D/LeanSTP,redmeros/Lean,kaffeebrauer/Lean,JKarathiya/Lean,AnshulYADAV007/Lean,StefanoRaggi/Lean,AlexCatarino/Lean,AnshulYADAV007/Lean,JKarathiya/Lean,Jay-Jay-D/LeanSTP,QuantConnect/Lean,StefanoRaggi/Lean,AlexCatarino/Lean,kaffeebrauer/Lean,QuantConnect/Lean,AlexCatarino/Lean,jameschch/Lean,jameschch/Lean,kaffeebrauer/Lean,Jay-Jay-D/LeanSTP,jameschch/Lean,JKarathiya/Lean,StefanoRaggi/Lean,kaffeebrauer/Lean,jameschch/Lean,redmeros/Lean,StefanoRaggi/Lean,jameschch/Lean,StefanoRaggi/Lean,kaffeebrauer/Lean,Jay-Jay-D/LeanSTP,AnshulYADAV007/Lean | Tests/Algorithm/Framework/Portfolio/PortfolioTargetTests.cs | Tests/Algorithm/Framework/Portfolio/PortfolioTargetTests.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.
*/
using System.Linq;
using Moq;
using NUnit.Framework;
using QuantConnect.Algorithm.Framework.Portfolio;
using QuantConnect.Data.Market;
using QuantConnect.Securities;
using QuantConnect.Tests.Engine;
namespace QuantConnect.Tests.Algorithm.Framework.Portfolio
{
[TestFixture]
public class PortfolioTargetTests
{
[Test]
public void PercentInvokesBuyingPowerModelAndAddsInExistingHoldings()
{
const decimal bpmQuantity = 100;
const decimal holdings = 50;
const decimal targetPercent = 0.5m;
var algorithm = PerformanceBenchmarkAlgorithms.SingleSecurity_Second;
algorithm.Initialize();
algorithm.PostInitialize();
var security = algorithm.Securities.Single().Value;
security.SetMarketPrice(new Tick{Value = 1m});
security.Holdings.SetHoldings(1m, holdings);
var tpv = algorithm.Portfolio.TotalPortfolioValue;
var buyingPowerMock = new Mock<IBuyingPowerModel>();
buyingPowerMock.Setup(bpm => bpm.GetMaximumOrderQuantityForTargetValue(algorithm.Portfolio, security, targetPercent * tpv))
.Returns(new GetMaximumOrderQuantityForTargetValueResult(bpmQuantity, null, false));
security.BuyingPowerModel = buyingPowerMock.Object;
var target = PortfolioTarget.Percent(algorithm, security.Symbol, targetPercent);
Assert.AreEqual(security.Symbol, target.Symbol);
Assert.AreEqual(bpmQuantity + holdings, target.Quantity);
}
}
}
| /*
* 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.
*/
using System.Linq;
using Moq;
using NUnit.Framework;
using QuantConnect.Algorithm.Framework.Portfolio;
using QuantConnect.Data.Market;
using QuantConnect.Securities;
using QuantConnect.Tests.Engine;
namespace QuantConnect.Tests.Algorithm.Framework.Portfolio
{
[TestFixture]
public class PortfolioTargetTests
{
[Test]
public void PercentInvokesBuyingPowerModelAndSubtractsOutExistingHoldings()
{
const decimal bpmQuantity = 100;
const decimal holdings = 50;
const decimal targetPercent = 0.5m;
var algorithm = PerformanceBenchmarkAlgorithms.SingleSecurity_Second;
algorithm.Initialize();
algorithm.PostInitialize();
var security = algorithm.Securities.Single().Value;
security.SetMarketPrice(new Tick{Value = 1m});
security.Holdings.SetHoldings(1m, holdings);
var tpv = algorithm.Portfolio.TotalPortfolioValue;
var buyingPowerMock = new Mock<IBuyingPowerModel>();
buyingPowerMock.Setup(bpm => bpm.GetMaximumOrderQuantityForTargetValue(algorithm.Portfolio, security, targetPercent * tpv))
.Returns(new GetMaximumOrderQuantityForTargetValueResult(bpmQuantity, null, false));
security.BuyingPowerModel = buyingPowerMock.Object;
var target = PortfolioTarget.Percent(algorithm, security.Symbol, targetPercent);
Assert.AreEqual(security.Symbol, target.Symbol);
Assert.AreEqual(bpmQuantity + holdings, target.Quantity);
}
}
}
| apache-2.0 | C# |
e870ac6456c334577f4cc57fff54305179cae041 | Fix code quality for CI | peppy/osu,ppy/osu,ppy/osu,peppy/osu,ppy/osu,peppy/osu | osu.Game/Screens/Edit/Setup/ColoursSection.cs | osu.Game/Screens/Edit/Setup/ColoursSection.cs | // Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable disable
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Localisation;
using osu.Game.Graphics.UserInterfaceV2;
using osu.Game.Localisation;
namespace osu.Game.Screens.Edit.Setup
{
internal class ColoursSection : SetupSection
{
public override LocalisableString Title => EditorSetupStrings.ColoursHeader;
private LabelledColourPalette comboColours;
[BackgroundDependencyLoader]
private void load()
{
Children = new Drawable[]
{
comboColours = new LabelledColourPalette
{
Label = EditorSetupStrings.HitcircleSliderCombos,
FixedLabelWidth = LABEL_WIDTH,
ColourNamePrefix = EditorSetupStrings.ComboColourPrefix
}
};
if (Beatmap.BeatmapSkin != null)
comboColours.Colours.BindTo(Beatmap.BeatmapSkin.ComboColours);
}
}
}
| // Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable disable
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Localisation;
using osu.Game.Graphics.UserInterfaceV2;
using osu.Game.Localisation;
namespace osu.Game.Screens.Edit.Setup
{
internal class ColoursSection : SetupSection
{
public override LocalisableString Title => EditorSetupStrings.ColoursHeader;
private LabelledColourPalette comboColours;
[BackgroundDependencyLoader]
private void load()
{
Children = new Drawable[]
{
comboColours = new LabelledColourPalette
{
Label = EditorSetupStrings.HitcircleSliderCombos,
FixedLabelWidth = LABEL_WIDTH,
ColourNamePrefix = EditorSetupStrings.ComboColourPrefix }
};
if (Beatmap.BeatmapSkin != null)
comboColours.Colours.BindTo(Beatmap.BeatmapSkin.ComboColours);
}
}
}
| mit | C# |
dce279f0028c053291f5d3a89744017c18d029c2 | Add log level to Logger. | eternnoir/NLogging | src/NLogging/Logger.cs | src/NLogging/Logger.cs | namespace NLogging
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
public class Logger
{
private string loggerName;
private LogLevel logLevel;
public string LoggerName
{
get
{
return this.loggerName;
}
}
/// <summary>
/// Log level property
/// </summary>
public LogLevel Level
{
get
{
return this.logLevel;
}
set
{
this.logLevel = value;
}
}
public Logger(string loggerName)
{
this.loggerName = loggerName;
this.logLevel = LogLevel.NOTSET;
}
public Logger(string loggerName, LogLevel logLevel)
{
this.loggerName = loggerName;
this.logLevel = logLevel;
}
}
}
| namespace NLogging
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
public class Logger
{
private string loggerName;
public string LoggerName
{
get
{
return this.loggerName;
}
}
public Logger(string loggerName)
{
this.loggerName = loggerName;
}
}
}
| mit | C# |
fec1b85832223a2ff9276d82fad80b0de08dd06c | Fix style issues in X509ExtensionEnumerator | seanshpark/corefx,manu-silicon/corefx,mokchhya/corefx,jeremymeng/corefx,lggomez/corefx,cartermp/corefx,khdang/corefx,wtgodbe/corefx,khdang/corefx,benjamin-bader/corefx,richlander/corefx,twsouthwick/corefx,richlander/corefx,mellinoe/corefx,shimingsg/corefx,Petermarcu/corefx,ptoonen/corefx,khdang/corefx,SGuyGe/corefx,lggomez/corefx,ravimeda/corefx,mmitche/corefx,mazong1123/corefx,dhoehna/corefx,vidhya-bv/corefx-sorting,richlander/corefx,nbarbettini/corefx,DnlHarvey/corefx,JosephTremoulet/corefx,tstringer/corefx,iamjasonp/corefx,fgreinacher/corefx,rahku/corefx,krytarowski/corefx,mokchhya/corefx,benjamin-bader/corefx,benjamin-bader/corefx,elijah6/corefx,jhendrixMSFT/corefx,shmao/corefx,ptoonen/corefx,bitcrazed/corefx,marksmeltzer/corefx,weltkante/corefx,krk/corefx,dotnet-bot/corefx,dhoehna/corefx,seanshpark/corefx,elijah6/corefx,nchikanov/corefx,ravimeda/corefx,ericstj/corefx,weltkante/corefx,mellinoe/corefx,axelheer/corefx,twsouthwick/corefx,ellismg/corefx,iamjasonp/corefx,benpye/corefx,weltkante/corefx,jcme/corefx,rubo/corefx,yizhang82/corefx,marksmeltzer/corefx,ptoonen/corefx,SGuyGe/corefx,nchikanov/corefx,dhoehna/corefx,nbarbettini/corefx,YoupHulsebos/corefx,n1ghtmare/corefx,cartermp/corefx,MaggieTsang/corefx,DnlHarvey/corefx,kkurni/corefx,billwert/corefx,wtgodbe/corefx,stone-li/corefx,krytarowski/corefx,Priya91/corefx-1,twsouthwick/corefx,mazong1123/corefx,billwert/corefx,mafiya69/corefx,benpye/corefx,krk/corefx,ravimeda/corefx,akivafr123/corefx,Ermiar/corefx,jeremymeng/corefx,SGuyGe/corefx,BrennanConroy/corefx,seanshpark/corefx,the-dwyer/corefx,DnlHarvey/corefx,krk/corefx,janhenke/corefx,shmao/corefx,parjong/corefx,kkurni/corefx,adamralph/corefx,alphonsekurian/corefx,billwert/corefx,vidhya-bv/corefx-sorting,the-dwyer/corefx,alexperovich/corefx,MaggieTsang/corefx,Jiayili1/corefx,kkurni/corefx,tijoytom/corefx,dotnet-bot/corefx,jcme/corefx,akivafr123/corefx,gkhanna79/corefx,nchikanov/corefx,josguil/corefx,mafiya69/corefx,Chrisboh/corefx,mellinoe/corefx,krytarowski/corefx,iamjasonp/corefx,rjxby/corefx,alexperovich/corefx,mmitche/corefx,weltkante/corefx,MaggieTsang/corefx,BrennanConroy/corefx,ellismg/corefx,Yanjing123/corefx,gkhanna79/corefx,nbarbettini/corefx,lggomez/corefx,stephenmichaelf/corefx,690486439/corefx,benjamin-bader/corefx,janhenke/corefx,rjxby/corefx,ellismg/corefx,shimingsg/corefx,the-dwyer/corefx,stone-li/corefx,seanshpark/corefx,krk/corefx,kkurni/corefx,axelheer/corefx,the-dwyer/corefx,yizhang82/corefx,cydhaselton/corefx,lggomez/corefx,Jiayili1/corefx,alexandrnikitin/corefx,billwert/corefx,Chrisboh/corefx,parjong/corefx,marksmeltzer/corefx,bitcrazed/corefx,Petermarcu/corefx,shahid-pk/corefx,parjong/corefx,bitcrazed/corefx,benpye/corefx,khdang/corefx,zhenlan/corefx,zhenlan/corefx,zhenlan/corefx,690486439/corefx,yizhang82/corefx,shahid-pk/corefx,YoupHulsebos/corefx,cydhaselton/corefx,krytarowski/corefx,SGuyGe/corefx,ptoonen/corefx,ellismg/corefx,JosephTremoulet/corefx,krytarowski/corefx,n1ghtmare/corefx,dsplaisted/corefx,jhendrixMSFT/corefx,akivafr123/corefx,ellismg/corefx,josguil/corefx,rjxby/corefx,manu-silicon/corefx,mmitche/corefx,seanshpark/corefx,vidhya-bv/corefx-sorting,krk/corefx,yizhang82/corefx,richlander/corefx,khdang/corefx,Jiayili1/corefx,jcme/corefx,pallavit/corefx,alexandrnikitin/corefx,weltkante/corefx,ericstj/corefx,stephenmichaelf/corefx,zhenlan/corefx,alexperovich/corefx,khdang/corefx,cartermp/corefx,stone-li/corefx,Jiayili1/corefx,Yanjing123/corefx,mmitche/corefx,tijoytom/corefx,dhoehna/corefx,alphonsekurian/corefx,cydhaselton/corefx,SGuyGe/corefx,krk/corefx,iamjasonp/corefx,ericstj/corefx,nbarbettini/corefx,alexandrnikitin/corefx,jlin177/corefx,billwert/corefx,alphonsekurian/corefx,alphonsekurian/corefx,rahku/corefx,ericstj/corefx,yizhang82/corefx,iamjasonp/corefx,parjong/corefx,jeremymeng/corefx,tstringer/corefx,rahku/corefx,axelheer/corefx,gkhanna79/corefx,tijoytom/corefx,tstringer/corefx,stone-li/corefx,YoupHulsebos/corefx,elijah6/corefx,krk/corefx,gkhanna79/corefx,JosephTremoulet/corefx,Ermiar/corefx,nbarbettini/corefx,alexperovich/corefx,ericstj/corefx,Ermiar/corefx,manu-silicon/corefx,adamralph/corefx,mafiya69/corefx,Ermiar/corefx,Priya91/corefx-1,the-dwyer/corefx,gkhanna79/corefx,rahku/corefx,pallavit/corefx,690486439/corefx,alphonsekurian/corefx,cydhaselton/corefx,cartermp/corefx,jlin177/corefx,rubo/corefx,krytarowski/corefx,mellinoe/corefx,elijah6/corefx,tijoytom/corefx,ravimeda/corefx,marksmeltzer/corefx,shahid-pk/corefx,mazong1123/corefx,alexandrnikitin/corefx,rubo/corefx,MaggieTsang/corefx,mmitche/corefx,MaggieTsang/corefx,jhendrixMSFT/corefx,wtgodbe/corefx,mokchhya/corefx,janhenke/corefx,shimingsg/corefx,Petermarcu/corefx,dsplaisted/corefx,rahku/corefx,rahku/corefx,shimingsg/corefx,tstringer/corefx,shahid-pk/corefx,jhendrixMSFT/corefx,stephenmichaelf/corefx,seanshpark/corefx,shimingsg/corefx,Ermiar/corefx,seanshpark/corefx,stephenmichaelf/corefx,shmao/corefx,lggomez/corefx,mellinoe/corefx,mafiya69/corefx,ViktorHofer/corefx,DnlHarvey/corefx,jhendrixMSFT/corefx,jhendrixMSFT/corefx,tstringer/corefx,axelheer/corefx,zhenlan/corefx,jlin177/corefx,pallavit/corefx,rjxby/corefx,stone-li/corefx,jeremymeng/corefx,shahid-pk/corefx,billwert/corefx,JosephTremoulet/corefx,mmitche/corefx,Jiayili1/corefx,marksmeltzer/corefx,zhenlan/corefx,parjong/corefx,mokchhya/corefx,richlander/corefx,kkurni/corefx,josguil/corefx,dhoehna/corefx,jhendrixMSFT/corefx,manu-silicon/corefx,josguil/corefx,ravimeda/corefx,pallavit/corefx,mokchhya/corefx,dotnet-bot/corefx,Chrisboh/corefx,Ermiar/corefx,dotnet-bot/corefx,bitcrazed/corefx,ViktorHofer/corefx,the-dwyer/corefx,dotnet-bot/corefx,690486439/corefx,JosephTremoulet/corefx,rjxby/corefx,mmitche/corefx,jcme/corefx,lggomez/corefx,jcme/corefx,marksmeltzer/corefx,axelheer/corefx,elijah6/corefx,alphonsekurian/corefx,cydhaselton/corefx,shmao/corefx,ptoonen/corefx,benpye/corefx,marksmeltzer/corefx,rahku/corefx,shimingsg/corefx,nchikanov/corefx,DnlHarvey/corefx,jlin177/corefx,rubo/corefx,stephenmichaelf/corefx,alexperovich/corefx,Priya91/corefx-1,jcme/corefx,Chrisboh/corefx,stephenmichaelf/corefx,jeremymeng/corefx,shmao/corefx,jlin177/corefx,adamralph/corefx,josguil/corefx,YoupHulsebos/corefx,vidhya-bv/corefx-sorting,gkhanna79/corefx,akivafr123/corefx,ViktorHofer/corefx,Petermarcu/corefx,gkhanna79/corefx,Priya91/corefx-1,cartermp/corefx,yizhang82/corefx,mazong1123/corefx,shmao/corefx,wtgodbe/corefx,jlin177/corefx,Priya91/corefx-1,elijah6/corefx,Yanjing123/corefx,Petermarcu/corefx,ViktorHofer/corefx,rjxby/corefx,ravimeda/corefx,janhenke/corefx,alexperovich/corefx,DnlHarvey/corefx,YoupHulsebos/corefx,weltkante/corefx,mellinoe/corefx,stone-li/corefx,benpye/corefx,jlin177/corefx,lggomez/corefx,vidhya-bv/corefx-sorting,zhenlan/corefx,twsouthwick/corefx,rubo/corefx,the-dwyer/corefx,mazong1123/corefx,stone-li/corefx,benjamin-bader/corefx,mafiya69/corefx,nbarbettini/corefx,benjamin-bader/corefx,alexandrnikitin/corefx,wtgodbe/corefx,manu-silicon/corefx,Chrisboh/corefx,mazong1123/corefx,shmao/corefx,Jiayili1/corefx,twsouthwick/corefx,twsouthwick/corefx,akivafr123/corefx,dhoehna/corefx,Jiayili1/corefx,tijoytom/corefx,dhoehna/corefx,josguil/corefx,parjong/corefx,janhenke/corefx,ericstj/corefx,mazong1123/corefx,stephenmichaelf/corefx,manu-silicon/corefx,mafiya69/corefx,dsplaisted/corefx,rjxby/corefx,fgreinacher/corefx,BrennanConroy/corefx,Priya91/corefx-1,ViktorHofer/corefx,cydhaselton/corefx,alexperovich/corefx,shimingsg/corefx,ViktorHofer/corefx,cartermp/corefx,JosephTremoulet/corefx,elijah6/corefx,Petermarcu/corefx,parjong/corefx,kkurni/corefx,nchikanov/corefx,nbarbettini/corefx,MaggieTsang/corefx,billwert/corefx,n1ghtmare/corefx,cydhaselton/corefx,ptoonen/corefx,MaggieTsang/corefx,dotnet-bot/corefx,JosephTremoulet/corefx,benpye/corefx,shahid-pk/corefx,pallavit/corefx,dotnet-bot/corefx,ravimeda/corefx,richlander/corefx,pallavit/corefx,weltkante/corefx,twsouthwick/corefx,alphonsekurian/corefx,Ermiar/corefx,yizhang82/corefx,Petermarcu/corefx,ptoonen/corefx,nchikanov/corefx,bitcrazed/corefx,tstringer/corefx,janhenke/corefx,ellismg/corefx,krytarowski/corefx,Yanjing123/corefx,Chrisboh/corefx,mokchhya/corefx,wtgodbe/corefx,fgreinacher/corefx,wtgodbe/corefx,Yanjing123/corefx,SGuyGe/corefx,fgreinacher/corefx,iamjasonp/corefx,YoupHulsebos/corefx,YoupHulsebos/corefx,nchikanov/corefx,iamjasonp/corefx,ericstj/corefx,n1ghtmare/corefx,manu-silicon/corefx,tijoytom/corefx,tijoytom/corefx,axelheer/corefx,richlander/corefx,690486439/corefx,ViktorHofer/corefx,DnlHarvey/corefx,n1ghtmare/corefx | src/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/X509ExtensionEnumerator.cs | src/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/X509ExtensionEnumerator.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.Collections;
namespace System.Security.Cryptography.X509Certificates
{
public sealed class X509ExtensionEnumerator : IEnumerator
{
internal X509ExtensionEnumerator(X509ExtensionCollection extensions)
{
_extensions = extensions;
_current = -1;
}
public X509Extension Current
{
get { return _extensions[_current]; }
}
object IEnumerator.Current
{
get { return Current; }
}
public bool MoveNext()
{
if (_current == _extensions.Count - 1)
return false;
_current++;
return true;
}
public void Reset()
{
_current = -1;
}
private X509ExtensionCollection _extensions;
private int _current;
}
}
| // 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.IO;
using System.Text;
using System.Collections;
using System.Diagnostics;
using System.Globalization;
using System.Runtime.InteropServices;
using Internal.Cryptography;
namespace System.Security.Cryptography.X509Certificates
{
public sealed class X509ExtensionEnumerator : IEnumerator
{
internal X509ExtensionEnumerator(X509ExtensionCollection extensions)
{
_extensions = extensions;
_current = -1;
}
public X509Extension Current
{
get
{
return _extensions[_current];
}
}
object IEnumerator.Current
{
get
{
return _extensions[_current];
}
}
public bool MoveNext()
{
if (_current == _extensions.Count - 1)
return false;
_current++;
return true;
}
public void Reset()
{
_current = -1;
}
private X509ExtensionCollection _extensions;
private int _current;
}
}
| mit | C# |
dc99950831f014fd0aa9fd0417000f60dbe24d7f | Bump version to 0.11.0 | quisquous/cactbot,quisquous/cactbot,quisquous/cactbot,quisquous/cactbot,quisquous/cactbot,quisquous/cactbot | CactbotOverlay/Properties/AssemblyInfo.cs | CactbotOverlay/Properties/AssemblyInfo.cs | using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("CactbotOverlay")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CactbotOverlay")]
[assembly: AssemblyCopyright("Copyright 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("a7324717-0785-49ac-95e9-dc01bd7fbe7c")]
// Version:
// - Major Version
// - Minor Version
// - Build Number
// - Revision
// GitHub has only 3 version components, so Revision should always be 0.
[assembly: AssemblyVersion("0.11.0.0")]
[assembly: AssemblyFileVersion("0.11.0.0")] | using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("CactbotOverlay")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CactbotOverlay")]
[assembly: AssemblyCopyright("Copyright 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("a7324717-0785-49ac-95e9-dc01bd7fbe7c")]
// Version:
// - Major Version
// - Minor Version
// - Build Number
// - Revision
// GitHub has only 3 version components, so Revision should always be 0.
[assembly: AssemblyVersion("0.10.10.0")]
[assembly: AssemblyFileVersion("0.10.10.0")] | apache-2.0 | C# |
b7cd4a85e05ffea30640d4242ac489bae3b296ec | Fix missing label for team members when creating team | crowar/Bonobo-Git-Server,snoopydo/Bonobo-Git-Server,crowar/Bonobo-Git-Server,darioajr/Bonobo-Git-Server,willdean/Bonobo-Git-Server,gencer/Bonobo-Git-Server,Monepi/Bonobo-Git-Server,Webmine/Bonobo-Git-Server,yonglehou/Bonobo-Git-Server,YelaSeamless/Bonobo-Git-Server,gencer/Bonobo-Git-Server,anyeloamt1/Bonobo-Git-Server,Acute-sales-ltd/Bonobo-Git-Server,kfarnung/Bonobo-Git-Server,jiangzm/Bonobo-Git-Server,Webmine/Bonobo-Git-Server,RedX2501/Bonobo-Git-Server,padremortius/Bonobo-Git-Server,Ollienator/Bonobo-Git-Server,snoopydo/Bonobo-Git-Server,jiangzm/Bonobo-Git-Server,darioajr/Bonobo-Git-Server,Webmine/Bonobo-Git-Server,NipponSysits/IIS.Git-Connector,PGM-NipponSysits/IIS.Git-Connector,lkho/Bonobo-Git-Server,Webmine/Bonobo-Git-Server,dunderburken/Bonobo-Git-Server,forgetz/Bonobo-Git-Server,crowar/Bonobo-Git-Server,larrynung/Bonobo-Git-Server,braegelno5/Bonobo-Git-Server,padremortius/Bonobo-Git-Server,kfarnung/Bonobo-Git-Server,forgetz/Bonobo-Git-Server,jiangzm/Bonobo-Git-Server,crowar/Bonobo-Git-Server,padremortius/Bonobo-Git-Server,braegelno5/Bonobo-Git-Server,yonglehou/Bonobo-Git-Server,dunderburken/Bonobo-Git-Server,snoopydo/Bonobo-Git-Server,KiritoStudio/Bonobo-Git-Server,Webmine/Bonobo-Git-Server,RedX2501/Bonobo-Git-Server,larrynung/Bonobo-Git-Server,braegelno5/Bonobo-Git-Server,PGM-NipponSysits/IIS.Git-Connector,padremortius/Bonobo-Git-Server,larshg/Bonobo-Git-Server,willdean/Bonobo-Git-Server,yonglehou/Bonobo-Git-Server,larshg/Bonobo-Git-Server,Monepi/Bonobo-Git-Server,Ollienator/Bonobo-Git-Server,dunderburken/Bonobo-Git-Server,Webmine/Bonobo-Git-Server,crowar/Bonobo-Git-Server,Ollienator/Bonobo-Git-Server,Acute-sales-ltd/Bonobo-Git-Server,gencer/Bonobo-Git-Server,NipponSysits/IIS.Git-Connector,snoopydo/Bonobo-Git-Server,KiritoStudio/Bonobo-Git-Server,snoopydo/Bonobo-Git-Server,kfarnung/Bonobo-Git-Server,braegelno5/Bonobo-Git-Server,hakim89/Bonobo-Git-Server,RedX2501/Bonobo-Git-Server,dunderburken/Bonobo-Git-Server,KiritoStudio/Bonobo-Git-Server,hakim89/Bonobo-Git-Server,YelaSeamless/Bonobo-Git-Server,Acute-sales-ltd/Bonobo-Git-Server,willdean/Bonobo-Git-Server,anyeloamt1/Bonobo-Git-Server,Ollienator/Bonobo-Git-Server,Monepi/Bonobo-Git-Server,crowar/Bonobo-Git-Server,dunderburken/Bonobo-Git-Server,igoryok-zp/Bonobo-Git-Server,YelaSeamless/Bonobo-Git-Server,kfarnung/Bonobo-Git-Server,YelaSeamless/Bonobo-Git-Server,NipponSysits/IIS.Git-Connector,jiangzm/Bonobo-Git-Server,Acute-sales-ltd/Bonobo-Git-Server,Acute-sales-ltd/Bonobo-Git-Server,NipponSysits/IIS.Git-Connector,darioajr/Bonobo-Git-Server,RedX2501/Bonobo-Git-Server,forgetz/Bonobo-Git-Server,igoryok-zp/Bonobo-Git-Server,dunderburken/Bonobo-Git-Server,larrynung/Bonobo-Git-Server,darioajr/Bonobo-Git-Server,larrynung/Bonobo-Git-Server,PGM-NipponSysits/IIS.Git-Connector,willdean/Bonobo-Git-Server,Monepi/Bonobo-Git-Server,darioajr/Bonobo-Git-Server,YelaSeamless/Bonobo-Git-Server,yonglehou/Bonobo-Git-Server,hakim89/Bonobo-Git-Server,hakim89/Bonobo-Git-Server,jiangzm/Bonobo-Git-Server,igoryok-zp/Bonobo-Git-Server,PGM-NipponSysits/IIS.Git-Connector,Ollienator/Bonobo-Git-Server,padremortius/Bonobo-Git-Server,darioajr/Bonobo-Git-Server,Monepi/Bonobo-Git-Server,lkho/Bonobo-Git-Server,gencer/Bonobo-Git-Server,igoryok-zp/Bonobo-Git-Server,hakim89/Bonobo-Git-Server,forgetz/Bonobo-Git-Server,jiangzm/Bonobo-Git-Server,YelaSeamless/Bonobo-Git-Server,snoopydo/Bonobo-Git-Server,padremortius/Bonobo-Git-Server,Ollienator/Bonobo-Git-Server,larrynung/Bonobo-Git-Server,KiritoStudio/Bonobo-Git-Server,hakim89/Bonobo-Git-Server,NipponSysits/IIS.Git-Connector,larshg/Bonobo-Git-Server,PGM-NipponSysits/IIS.Git-Connector,yonglehou/Bonobo-Git-Server,anyeloamt1/Bonobo-Git-Server,willdean/Bonobo-Git-Server,larshg/Bonobo-Git-Server,larrynung/Bonobo-Git-Server,anyeloamt1/Bonobo-Git-Server,lkho/Bonobo-Git-Server,Monepi/Bonobo-Git-Server,KiritoStudio/Bonobo-Git-Server,lkho/Bonobo-Git-Server,PGM-NipponSysits/IIS.Git-Connector,yonglehou/Bonobo-Git-Server,Acute-sales-ltd/Bonobo-Git-Server,NipponSysits/IIS.Git-Connector,KiritoStudio/Bonobo-Git-Server,Acute-sales-ltd/Bonobo-Git-Server | Bonobo.Git.Server/Views/Team/Create.cshtml | Bonobo.Git.Server/Views/Team/Create.cshtml | @model Bonobo.Git.Server.Models.TeamDetailModel
@{
ViewBag.Title = Resources.Team_Create_Title;
}
<h2>@Resources.Team_Create_Title</h2>
@using (Html.BeginForm("Create", "Team", FormMethod.Post, new { @class = "uniForm" }))
{
@Html.ValidationSummary(false, Resources.Team_Create_Fail, new { @id = "errorMsg" })
<fieldset>
<h3>@Resources.Team_Create_TeamInformations</h3>
<div class="ctrlHolder">
@Html.LabelFor(m => m.Name)
@Html.TextBoxFor(m => m.Name, new { @class = "textInput small" })<em>*</em>
<p class="formHint">
@Html.ValidationMessageFor(m => m.Name)
</p>
</div>
<div class="ctrlHolder">
@Html.LabelFor(m => m.Description)
@Html.TextAreaFor(m => m.Description, new { @class = "textInput medium" })
<p class="formHint">
</p>
</div>
<div class="ctrlHolder">
@{
var users = (from u in ViewData["AvailableUsers"] as string[] orderby u
select new SelectListItem() { Value = u, Text = u }).ToArray();
}
@Html.LabelFor(m => m.Members)
@Html.CheckboxListFor(m => m.Members, users, new { @class = "checkboxList medium" })
<p class="formHint">
</p>
</div>
<div class="buttonHolder">
@Html.ActionLink("← " + Resources.Team_Create_Back, "Index", null, new { @class = "secondaryAction" })
<button type="reset" class="secondaryAction">← @Resources.Reset</button>
<input type="submit" value="@Resources.Team_Create_Submit" class="primaryAction" />
</div>
</fieldset>
}
| @model Bonobo.Git.Server.Models.TeamDetailModel
@{
ViewBag.Title = Resources.Team_Create_Title;
}
<h2>@Resources.Team_Create_Title</h2>
@using (Html.BeginForm("Create", "Team", FormMethod.Post, new { @class = "uniForm" }))
{
@Html.ValidationSummary(false, Resources.Team_Create_Fail, new { @id = "errorMsg" })
<fieldset>
<h3>@Resources.Team_Create_TeamInformations</h3>
<div class="ctrlHolder">
@Html.LabelFor(m => m.Name)
@Html.TextBoxFor(m => m.Name, new { @class = "textInput small" })<em>*</em>
<p class="formHint">
@Html.ValidationMessageFor(m => m.Name)
</p>
</div>
<div class="ctrlHolder">
@Html.LabelFor(m => m.Description)
@Html.TextAreaFor(m => m.Description, new { @class = "textInput medium" })
<p class="formHint">
</p>
</div>
<div class="ctrlHolder">
@{
var users = (from u in ViewData["AvailableUsers"] as string[] orderby u
select new SelectListItem() { Value = u, Text = u }).ToArray();
}
@Html.CheckboxListFor(m => m.Members, users, new { @class = "checkboxList medium" })
<p class="formHint">
</p>
</div>
<div class="buttonHolder">
@Html.ActionLink("← " + Resources.Team_Create_Back, "Index", null, new { @class = "secondaryAction" })
<button type="reset" class="secondaryAction">← @Resources.Reset</button>
<input type="submit" value="@Resources.Team_Create_Submit" class="primaryAction" />
</div>
</fieldset>
}
| mit | C# |
29d414c32a5f3f9f19f0a741676457b7ddf68276 | make Profilers visible to Grpc.IntegrationTesting | kumaralokgithub/grpc,ppietrasa/grpc,yugui/grpc,dgquintas/grpc,PeterFaiman/ruby-grpc-minimal,MakMukhi/grpc,donnadionne/grpc,soltanmm/grpc,tengyifei/grpc,leifurhauks/grpc,a-veitch/grpc,grpc/grpc,pszemus/grpc,andrewpollock/grpc,chrisdunelm/grpc,pmarks-net/grpc,dklempner/grpc,muxi/grpc,jcanizales/grpc,rjshade/grpc,ncteisen/grpc,LuminateWireless/grpc,7anner/grpc,leifurhauks/grpc,fuchsia-mirror/third_party-grpc,makdharma/grpc,baylabs/grpc,baylabs/grpc,zhimingxie/grpc,dgquintas/grpc,arkmaxim/grpc,matt-kwong/grpc,yongni/grpc,thinkerou/grpc,muxi/grpc,kpayson64/grpc,baylabs/grpc,pszemus/grpc,dklempner/grpc,murgatroid99/grpc,jtattermusch/grpc,firebase/grpc,baylabs/grpc,zhimingxie/grpc,leifurhauks/grpc,podsvirov/grpc,carl-mastrangelo/grpc,stanley-cheung/grpc,apolcyn/grpc,kriswuollett/grpc,royalharsh/grpc,perumaalgoog/grpc,simonkuang/grpc,vjpai/grpc,grani/grpc,infinit/grpc,jcanizales/grpc,ncteisen/grpc,grani/grpc,ejona86/grpc,msmania/grpc,perumaalgoog/grpc,muxi/grpc,LuminateWireless/grpc,royalharsh/grpc,mehrdada/grpc,vjpai/grpc,jboeuf/grpc,stanley-cheung/grpc,firebase/grpc,sreecha/grpc,grani/grpc,donnadionne/grpc,pszemus/grpc,tengyifei/grpc,MakMukhi/grpc,mehrdada/grpc,fuchsia-mirror/third_party-grpc,ppietrasa/grpc,makdharma/grpc,7anner/grpc,chrisdunelm/grpc,royalharsh/grpc,deepaklukose/grpc,deepaklukose/grpc,baylabs/grpc,matt-kwong/grpc,yongni/grpc,malexzx/grpc,chrisdunelm/grpc,daniel-j-born/grpc,kriswuollett/grpc,mehrdada/grpc,yongni/grpc,hstefan/grpc,LuminateWireless/grpc,kskalski/grpc,chrisdunelm/grpc,soltanmm/grpc,hstefan/grpc,arkmaxim/grpc,rjshade/grpc,rjshade/grpc,Crevil/grpc,chrisdunelm/grpc,y-zeng/grpc,kskalski/grpc,7anner/grpc,nicolasnoble/grpc,ncteisen/grpc,firebase/grpc,MakMukhi/grpc,ctiller/grpc,fuchsia-mirror/third_party-grpc,Vizerai/grpc,jboeuf/grpc,matt-kwong/grpc,grpc/grpc,ppietrasa/grpc,philcleveland/grpc,soltanmm-google/grpc,dgquintas/grpc,greasypizza/grpc,7anner/grpc,ppietrasa/grpc,soltanmm-google/grpc,thunderboltsid/grpc,andrewpollock/grpc,carl-mastrangelo/grpc,philcleveland/grpc,yang-g/grpc,Vizerai/grpc,kriswuollett/grpc,bogdandrutu/grpc,ejona86/grpc,mehrdada/grpc,perumaalgoog/grpc,dgquintas/grpc,infinit/grpc,podsvirov/grpc,kpayson64/grpc,vjpai/grpc,kumaralokgithub/grpc,y-zeng/grpc,thinkerou/grpc,msmania/grpc,pmarks-net/grpc,MakMukhi/grpc,yang-g/grpc,ejona86/grpc,jboeuf/grpc,grani/grpc,donnadionne/grpc,daniel-j-born/grpc,quizlet/grpc,dklempner/grpc,y-zeng/grpc,soltanmm/grpc,pszemus/grpc,donnadionne/grpc,zhimingxie/grpc,arkmaxim/grpc,muxi/grpc,ipylypiv/grpc,jtattermusch/grpc,jboeuf/grpc,msmania/grpc,baylabs/grpc,fuchsia-mirror/third_party-grpc,pmarks-net/grpc,deepaklukose/grpc,kpayson64/grpc,grani/grpc,MakMukhi/grpc,a11r/grpc,simonkuang/grpc,pszemus/grpc,LuminateWireless/grpc,carl-mastrangelo/grpc,yang-g/grpc,leifurhauks/grpc,rjshade/grpc,greasypizza/grpc,tengyifei/grpc,nicolasnoble/grpc,Crevil/grpc,stanley-cheung/grpc,greasypizza/grpc,wcevans/grpc,donnadionne/grpc,philcleveland/grpc,PeterFaiman/ruby-grpc-minimal,deepaklukose/grpc,ctiller/grpc,malexzx/grpc,murgatroid99/grpc,yongni/grpc,tengyifei/grpc,thinkerou/grpc,pszemus/grpc,ncteisen/grpc,vjpai/grpc,ppietrasa/grpc,yugui/grpc,mehrdada/grpc,simonkuang/grpc,geffzhang/grpc,thinkerou/grpc,matt-kwong/grpc,andrewpollock/grpc,wcevans/grpc,a-veitch/grpc,soltanmm/grpc,grpc/grpc,stanley-cheung/grpc,thinkerou/grpc,nicolasnoble/grpc,vsco/grpc,nicolasnoble/grpc,andrewpollock/grpc,carl-mastrangelo/grpc,pszemus/grpc,dklempner/grpc,ctiller/grpc,soltanmm-google/grpc,nicolasnoble/grpc,ppietrasa/grpc,LuminateWireless/grpc,soltanmm/grpc,rjshade/grpc,vsco/grpc,ppietrasa/grpc,andrewpollock/grpc,donnadionne/grpc,ncteisen/grpc,firebase/grpc,wcevans/grpc,y-zeng/grpc,dklempner/grpc,chrisdunelm/grpc,vjpai/grpc,makdharma/grpc,makdharma/grpc,stanley-cheung/grpc,kpayson64/grpc,MakMukhi/grpc,muxi/grpc,grpc/grpc,vsco/grpc,apolcyn/grpc,grpc/grpc,dgquintas/grpc,simonkuang/grpc,a-veitch/grpc,vjpai/grpc,deepaklukose/grpc,quizlet/grpc,perumaalgoog/grpc,daniel-j-born/grpc,vsco/grpc,zhimingxie/grpc,baylabs/grpc,infinit/grpc,podsvirov/grpc,msmania/grpc,mehrdada/grpc,firebase/grpc,PeterFaiman/ruby-grpc-minimal,simonkuang/grpc,adelez/grpc,a11r/grpc,andrewpollock/grpc,jcanizales/grpc,ncteisen/grpc,sreecha/grpc,jboeuf/grpc,soltanmm-google/grpc,jtattermusch/grpc,chrisdunelm/grpc,rjshade/grpc,kumaralokgithub/grpc,ipylypiv/grpc,ncteisen/grpc,apolcyn/grpc,pszemus/grpc,Vizerai/grpc,pszemus/grpc,ejona86/grpc,matt-kwong/grpc,matt-kwong/grpc,makdharma/grpc,wcevans/grpc,kriswuollett/grpc,ctiller/grpc,makdharma/grpc,soltanmm/grpc,donnadionne/grpc,pszemus/grpc,thunderboltsid/grpc,ipylypiv/grpc,kskalski/grpc,muxi/grpc,jtattermusch/grpc,apolcyn/grpc,dgquintas/grpc,bogdandrutu/grpc,carl-mastrangelo/grpc,quizlet/grpc,apolcyn/grpc,msmania/grpc,thinkerou/grpc,perumaalgoog/grpc,yang-g/grpc,zhimingxie/grpc,royalharsh/grpc,adelez/grpc,a-veitch/grpc,perumaalgoog/grpc,infinit/grpc,jcanizales/grpc,ctiller/grpc,a11r/grpc,ejona86/grpc,wcevans/grpc,firebase/grpc,hstefan/grpc,hstefan/grpc,podsvirov/grpc,kpayson64/grpc,podsvirov/grpc,kskalski/grpc,ctiller/grpc,kriswuollett/grpc,PeterFaiman/ruby-grpc-minimal,rjshade/grpc,msmania/grpc,donnadionne/grpc,stanley-cheung/grpc,sreecha/grpc,yugui/grpc,malexzx/grpc,Crevil/grpc,kumaralokgithub/grpc,yongni/grpc,thinkerou/grpc,nicolasnoble/grpc,kriswuollett/grpc,arkmaxim/grpc,vjpai/grpc,jcanizales/grpc,bogdandrutu/grpc,tengyifei/grpc,Crevil/grpc,hstefan/grpc,thunderboltsid/grpc,thinkerou/grpc,donnadionne/grpc,quizlet/grpc,ctiller/grpc,soltanmm-google/grpc,chrisdunelm/grpc,mehrdada/grpc,vsco/grpc,bogdandrutu/grpc,thinkerou/grpc,geffzhang/grpc,PeterFaiman/ruby-grpc-minimal,infinit/grpc,kpayson64/grpc,jtattermusch/grpc,pmarks-net/grpc,grpc/grpc,nicolasnoble/grpc,kskalski/grpc,jboeuf/grpc,zhimingxie/grpc,grani/grpc,hstefan/grpc,ejona86/grpc,stanley-cheung/grpc,ejona86/grpc,LuminateWireless/grpc,jcanizales/grpc,zhimingxie/grpc,philcleveland/grpc,malexzx/grpc,carl-mastrangelo/grpc,murgatroid99/grpc,malexzx/grpc,a-veitch/grpc,grpc/grpc,grani/grpc,Vizerai/grpc,ipylypiv/grpc,ncteisen/grpc,yugui/grpc,stanley-cheung/grpc,dklempner/grpc,arkmaxim/grpc,soltanmm/grpc,arkmaxim/grpc,murgatroid99/grpc,firebase/grpc,greasypizza/grpc,kriswuollett/grpc,greasypizza/grpc,chrisdunelm/grpc,baylabs/grpc,dklempner/grpc,kpayson64/grpc,murgatroid99/grpc,Vizerai/grpc,simonkuang/grpc,a11r/grpc,kumaralokgithub/grpc,quizlet/grpc,ipylypiv/grpc,jboeuf/grpc,carl-mastrangelo/grpc,mehrdada/grpc,firebase/grpc,bogdandrutu/grpc,LuminateWireless/grpc,fuchsia-mirror/third_party-grpc,LuminateWireless/grpc,grpc/grpc,wcevans/grpc,y-zeng/grpc,baylabs/grpc,arkmaxim/grpc,royalharsh/grpc,vjpai/grpc,kpayson64/grpc,adelez/grpc,kskalski/grpc,firebase/grpc,Vizerai/grpc,yugui/grpc,perumaalgoog/grpc,ctiller/grpc,pmarks-net/grpc,adelez/grpc,jboeuf/grpc,mehrdada/grpc,stanley-cheung/grpc,perumaalgoog/grpc,dgquintas/grpc,Vizerai/grpc,y-zeng/grpc,a-veitch/grpc,ejona86/grpc,yang-g/grpc,philcleveland/grpc,donnadionne/grpc,royalharsh/grpc,adelez/grpc,geffzhang/grpc,royalharsh/grpc,podsvirov/grpc,greasypizza/grpc,ipylypiv/grpc,7anner/grpc,kpayson64/grpc,arkmaxim/grpc,yongni/grpc,ctiller/grpc,fuchsia-mirror/third_party-grpc,firebase/grpc,jcanizales/grpc,greasypizza/grpc,infinit/grpc,firebase/grpc,murgatroid99/grpc,stanley-cheung/grpc,ejona86/grpc,sreecha/grpc,ejona86/grpc,Crevil/grpc,muxi/grpc,soltanmm-google/grpc,bogdandrutu/grpc,muxi/grpc,matt-kwong/grpc,rjshade/grpc,nicolasnoble/grpc,kskalski/grpc,adelez/grpc,muxi/grpc,grpc/grpc,leifurhauks/grpc,jcanizales/grpc,vsco/grpc,soltanmm-google/grpc,murgatroid99/grpc,leifurhauks/grpc,dklempner/grpc,nicolasnoble/grpc,geffzhang/grpc,ipylypiv/grpc,msmania/grpc,mehrdada/grpc,kriswuollett/grpc,ejona86/grpc,jtattermusch/grpc,PeterFaiman/ruby-grpc-minimal,apolcyn/grpc,carl-mastrangelo/grpc,geffzhang/grpc,daniel-j-born/grpc,jboeuf/grpc,philcleveland/grpc,apolcyn/grpc,adelez/grpc,Vizerai/grpc,daniel-j-born/grpc,mehrdada/grpc,apolcyn/grpc,thunderboltsid/grpc,ppietrasa/grpc,geffzhang/grpc,apolcyn/grpc,jtattermusch/grpc,kpayson64/grpc,PeterFaiman/ruby-grpc-minimal,wcevans/grpc,grani/grpc,pmarks-net/grpc,yongni/grpc,msmania/grpc,thunderboltsid/grpc,a-veitch/grpc,yugui/grpc,grani/grpc,Crevil/grpc,pmarks-net/grpc,Vizerai/grpc,vsco/grpc,tengyifei/grpc,geffzhang/grpc,dgquintas/grpc,pszemus/grpc,leifurhauks/grpc,ctiller/grpc,matt-kwong/grpc,PeterFaiman/ruby-grpc-minimal,podsvirov/grpc,a-veitch/grpc,fuchsia-mirror/third_party-grpc,pszemus/grpc,malexzx/grpc,bogdandrutu/grpc,makdharma/grpc,donnadionne/grpc,chrisdunelm/grpc,yugui/grpc,sreecha/grpc,quizlet/grpc,kumaralokgithub/grpc,deepaklukose/grpc,daniel-j-born/grpc,kumaralokgithub/grpc,sreecha/grpc,ncteisen/grpc,sreecha/grpc,yang-g/grpc,deepaklukose/grpc,PeterFaiman/ruby-grpc-minimal,thinkerou/grpc,chrisdunelm/grpc,muxi/grpc,vjpai/grpc,zhimingxie/grpc,sreecha/grpc,malexzx/grpc,yang-g/grpc,a11r/grpc,royalharsh/grpc,daniel-j-born/grpc,Crevil/grpc,deepaklukose/grpc,firebase/grpc,philcleveland/grpc,thunderboltsid/grpc,dklempner/grpc,simonkuang/grpc,carl-mastrangelo/grpc,infinit/grpc,ctiller/grpc,wcevans/grpc,ipylypiv/grpc,nicolasnoble/grpc,jboeuf/grpc,andrewpollock/grpc,quizlet/grpc,ncteisen/grpc,geffzhang/grpc,murgatroid99/grpc,sreecha/grpc,philcleveland/grpc,jtattermusch/grpc,fuchsia-mirror/third_party-grpc,vjpai/grpc,infinit/grpc,thunderboltsid/grpc,hstefan/grpc,yongni/grpc,grpc/grpc,7anner/grpc,dgquintas/grpc,kskalski/grpc,thinkerou/grpc,pmarks-net/grpc,Crevil/grpc,dgquintas/grpc,hstefan/grpc,soltanmm/grpc,kskalski/grpc,jtattermusch/grpc,Vizerai/grpc,wcevans/grpc,adelez/grpc,soltanmm/grpc,simonkuang/grpc,ejona86/grpc,zhimingxie/grpc,msmania/grpc,jboeuf/grpc,simonkuang/grpc,ncteisen/grpc,ipylypiv/grpc,greasypizza/grpc,7anner/grpc,bogdandrutu/grpc,stanley-cheung/grpc,ctiller/grpc,deepaklukose/grpc,MakMukhi/grpc,jtattermusch/grpc,fuchsia-mirror/third_party-grpc,a11r/grpc,a11r/grpc,Crevil/grpc,malexzx/grpc,yongni/grpc,murgatroid99/grpc,MakMukhi/grpc,ppietrasa/grpc,quizlet/grpc,vsco/grpc,greasypizza/grpc,murgatroid99/grpc,grpc/grpc,adelez/grpc,7anner/grpc,rjshade/grpc,MakMukhi/grpc,sreecha/grpc,royalharsh/grpc,jtattermusch/grpc,vsco/grpc,yang-g/grpc,vjpai/grpc,tengyifei/grpc,ncteisen/grpc,hstefan/grpc,tengyifei/grpc,makdharma/grpc,carl-mastrangelo/grpc,infinit/grpc,pmarks-net/grpc,kriswuollett/grpc,makdharma/grpc,yang-g/grpc,muxi/grpc,jcanizales/grpc,quizlet/grpc,podsvirov/grpc,daniel-j-born/grpc,7anner/grpc,philcleveland/grpc,arkmaxim/grpc,tengyifei/grpc,yugui/grpc,malexzx/grpc,jtattermusch/grpc,a11r/grpc,andrewpollock/grpc,mehrdada/grpc,soltanmm-google/grpc,nicolasnoble/grpc,Vizerai/grpc,LuminateWireless/grpc,thinkerou/grpc,grpc/grpc,leifurhauks/grpc,daniel-j-born/grpc,carl-mastrangelo/grpc,thunderboltsid/grpc,andrewpollock/grpc,bogdandrutu/grpc,leifurhauks/grpc,kumaralokgithub/grpc,y-zeng/grpc,jboeuf/grpc,stanley-cheung/grpc,y-zeng/grpc,vjpai/grpc,kumaralokgithub/grpc,thunderboltsid/grpc,podsvirov/grpc,nicolasnoble/grpc,geffzhang/grpc,perumaalgoog/grpc,matt-kwong/grpc,yugui/grpc,a11r/grpc,carl-mastrangelo/grpc,donnadionne/grpc,kpayson64/grpc,muxi/grpc,dgquintas/grpc,a-veitch/grpc,sreecha/grpc,fuchsia-mirror/third_party-grpc,PeterFaiman/ruby-grpc-minimal,y-zeng/grpc,sreecha/grpc,soltanmm-google/grpc | src/csharp/Grpc.Core/Properties/AssemblyInfo.cs | src/csharp/Grpc.Core/Properties/AssemblyInfo.cs | using System.Reflection;
using System.Runtime.CompilerServices;
[assembly: AssemblyTitle("Grpc.Core")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("Google Inc. All rights reserved.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
#if SIGNED
[assembly: InternalsVisibleTo("Grpc.Core.Tests,PublicKey=" +
"00240000048000009400000006020000002400005253413100040000010001002f5797a92c6fcde81bd4098f43" +
"0442bb8e12768722de0b0cb1b15e955b32a11352740ee59f2c94c48edc8e177d1052536b8ac651bce11ce5da3a" +
"27fc95aff3dc604a6971417453f9483c7b5e836756d5b271bf8f2403fe186e31956148c03d804487cf642f8cc0" +
"71394ee9672dfe5b55ea0f95dfd5a7f77d22c962ccf51320d3")]
[assembly: InternalsVisibleTo("Grpc.IntegrationTesting,PublicKey=" +
"00240000048000009400000006020000002400005253413100040000010001002f5797a92c6fcde81bd4098f43" +
"0442bb8e12768722de0b0cb1b15e955b32a11352740ee59f2c94c48edc8e177d1052536b8ac651bce11ce5da3a" +
"27fc95aff3dc604a6971417453f9483c7b5e836756d5b271bf8f2403fe186e31956148c03d804487cf642f8cc0" +
"71394ee9672dfe5b55ea0f95dfd5a7f77d22c962ccf51320d3")]
#else
[assembly: InternalsVisibleTo("Grpc.Core.Tests")]
[assembly: InternalsVisibleTo("Grpc.IntegrationTesting")]
#endif
| using System.Reflection;
using System.Runtime.CompilerServices;
[assembly: AssemblyTitle("Grpc.Core")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("Google Inc. All rights reserved.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
#if SIGNED
[assembly: InternalsVisibleTo("Grpc.Core.Tests,PublicKey=" +
"00240000048000009400000006020000002400005253413100040000010001002f5797a92c6fcde81bd4098f43" +
"0442bb8e12768722de0b0cb1b15e955b32a11352740ee59f2c94c48edc8e177d1052536b8ac651bce11ce5da3a" +
"27fc95aff3dc604a6971417453f9483c7b5e836756d5b271bf8f2403fe186e31956148c03d804487cf642f8cc0" +
"71394ee9672dfe5b55ea0f95dfd5a7f77d22c962ccf51320d3")]
#else
[assembly: InternalsVisibleTo("Grpc.Core.Tests")]
#endif
| apache-2.0 | C# |
e72eed6ba57f2c309bf65734b7cb972b7cef2690 | Fix fast forward | Barleytree/NitoriWare,NitorInc/NitoriWare,Barleytree/NitoriWare,NitorInc/NitoriWare | Assets/Microgames/DarkRoom/Scripts/DarkRoomMusicController.cs | Assets/Microgames/DarkRoom/Scripts/DarkRoomMusicController.cs | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Linq;
public class DarkRoomMusicController : MonoBehaviour
{
public static DarkRoomMusicController instance;
[SerializeField]
private float volumeLerpSpeed = 3f;
[SerializeField]
private float volumeMult;
[SerializeField]
private AudioSource baseSource;
public enum Instrument
{
ArpBass,
Toms
}
private const int InstrumentCount = 2;
private AudioSource[] instrumentSources;
private float[] volumeLevels;
private float[] initialVolumes;
void Awake ()
{
instance = this;
instrumentSources = Enumerable.Range(0, InstrumentCount)
.Select(a => transform.Find(((Instrument)a).ToString())
.GetComponent<AudioSource>())
.ToArray();
initialVolumes = instrumentSources.Select(a => a.volume).ToArray();
volumeLevels = instrumentSources.Select(a => 0f).ToArray();
}
void LateUpdate ()
{
for (int i = 0; i < instrumentSources.Length; i++)
{
var source = instrumentSources[i];
source.volume = Mathf.MoveTowards(source.volume, volumeLevels[i], volumeLerpSpeed) * initialVolumes[i] * volumeMult;
if (MicrogameController.instance.isDebugMode() && Input.GetKeyDown(KeyCode.S))
source.pitch *= 4f;
if (MicrogameController.instance.isDebugMode() && Input.GetKeyUp(KeyCode.S))
source.pitch /= 4f;
}
if (MicrogameController.instance.isDebugMode() && Input.GetKeyDown(KeyCode.S))
baseSource.pitch *= 4f;
if (MicrogameController.instance.isDebugMode() && Input.GetKeyUp(KeyCode.S))
baseSource.pitch /= 4f;
volumeLevels = volumeLevels.Select(a => 0f).ToArray();
}
public void SetVolumeLevel(Instrument instrument, float volume)
{
volumeLevels[(int)instrument] = Mathf.Max(volumeLevels[(int)instrument], volume);
}
}
| using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Linq;
public class DarkRoomMusicController : MonoBehaviour
{
public static DarkRoomMusicController instance;
[SerializeField]
private float volumeLerpSpeed = 3f;
[SerializeField]
private float volumeMult;
[SerializeField]
private AudioSource baseSource;
public enum Instrument
{
ArpBass,
Toms
}
private const int InstrumentCount = 2;
private AudioSource[] instrumentSources;
private float[] volumeLevels;
private float[] initialVolumes;
void Awake ()
{
instance = this;
instrumentSources = Enumerable.Range(0, InstrumentCount)
.Select(a => transform.Find(((Instrument)a).ToString())
.GetComponent<AudioSource>())
.ToArray();
initialVolumes = instrumentSources.Select(a => a.volume).ToArray();
volumeLevels = instrumentSources.Select(a => 0f).ToArray();
}
void LateUpdate ()
{
for (int i = 0; i < instrumentSources.Length; i++)
{
var source = instrumentSources[i];
source.volume = Mathf.MoveTowards(source.volume, volumeLevels[i], volumeLerpSpeed) * initialVolumes[i] * volumeMult;
if (MicrogameController.instance.isDebugMode() && Input.GetKeyDown(KeyCode.S))
{
source.pitch *= 4f;
baseSource.pitch *= 4f;
}
if (MicrogameController.instance.isDebugMode() && Input.GetKeyUp(KeyCode.S))
{
source.pitch /= 4f;
baseSource.pitch /= 4f;
}
}
volumeLevels = volumeLevels.Select(a => 0f).ToArray();
}
public void SetVolumeLevel(Instrument instrument, float volume)
{
volumeLevels[(int)instrument] = Mathf.Max(volumeLevels[(int)instrument], volume);
}
}
| mit | C# |
5deb84a8d92164ac36d49905fa4369889ac13221 | add mock for load, getheade, getcolumns | urffin/MetaTagsChecker | MetaTagsChecker/MetaTagsCheckerLib/CSV.cs | MetaTagsChecker/MetaTagsCheckerLib/CSV.cs | using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MetaTagsCheckerLib
{
public class CSV
{
public bool HasHeader { get; private set; }
public char Separator { get; private set; }
private List<string> header { get; set; }
public CSV(char separator = ';', bool hasHeader = false)
{
HasHeader = hasHeader;
Separator = separator;
}
public async Task<IEnumerable<string[]>> Load(Stream stream)
{
using (var reader = new StreamReader(stream))
{
return await Load(reader);
}
}
public async Task<IEnumerable<string[]>> Load(TextReader reader)
{
string line;
if (HasHeader)
{
header = await GetHeader(reader);
}
while ((line = await reader.ReadLineAsync()) != null)
{
}
}
private async Task<List<string>> GetHeader(TextReader reader)
{
var line = await reader.ReadLineAsync();
return GetColumns(line).ToList();
}
private IEnumerable<string> GetColumns(string line)
{
throw new NotImplementedException();
}
}
}
| using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MetaTagsCheckerLib
{
public class CSV
{
public bool HasHeader { get; private set; }
public char Separator { get; private set; }
public CSV(char separator = ';', bool hasHeader = true)
{
HasHeader = hasHeader;
Separator = separator;
}
public IEnumerable<string[]> Load(Stream stream)
{
using (var reader = new StreamReader(stream))
{
return Load(reader);
}
}
public IEnumerable<string[]> Load(TextReader reader)
{
reader.
}
}
}
| mit | C# |
2cf13cc01474099d8a5805cc0c8bf2e52f065303 | Add debug support (.NET). | mntone/UniversityScheduleClient,mntone/UniversityScheduleClient | NET/UniversitySchedule.Core/PeriodInfo.cs | NET/UniversitySchedule.Core/PeriodInfo.cs | using System;
using System.Diagnostics;
using System.Runtime.Serialization;
namespace Mntone.UniversitySchedule.Core
{
/// <summary>
/// PeriodInfo
/// </summary>
[DataContract]
[DebuggerDisplay( "{StringView()}" )]
public sealed class PeriodInfo
{
private const string TIME_FORMAT = "HH':'mmzz";
private PeriodInfo() { }
/// <summary>
/// Constructor
/// </summary>
/// <param name="from">From</param>
/// <param name="to">To</param>
internal PeriodInfo( DateTime from, DateTime to )
{
this.From = from;
this.To = to;
}
/// <summary>
/// From
/// </summary>
public DateTime From { get; private set; }
[DataMember( Name = "from", IsRequired = true )]
[DebuggerBrowsable( DebuggerBrowsableState.Never )]
private String FromImpl
{
get { return this.From.ToString( TIME_FORMAT ); }
set { this.From = DateTime.ParseExact( value, TIME_FORMAT, null ); }
}
/// <summary>
/// To
/// </summary>
public DateTime To { get; private set; }
[DataMember( Name = "to", IsRequired = true )]
[DebuggerBrowsable( DebuggerBrowsableState.Never )]
private String ToImpl
{
get { return this.To.ToString( TIME_FORMAT ); }
set { this.To = DateTime.ParseExact( value, TIME_FORMAT, null ); }
}
private string StringView()
{
return string.Format( "{0}-{1}", this.FromImpl, this.ToImpl );
}
}
} | using System;
using System.Diagnostics;
using System.Runtime.Serialization;
namespace Mntone.UniversitySchedule.Core
{
/// <summary>
/// PeriodInfo
/// </summary>
[DataContract]
public sealed class PeriodInfo
{
private const string TIME_FORMAT = "HH':'mmzz";
private PeriodInfo() { }
/// <summary>
/// Constructor
/// </summary>
/// <param name="from">From</param>
/// <param name="to">To</param>
internal PeriodInfo( DateTime from, DateTime to )
{
this.From = from;
this.To = to;
}
/// <summary>
/// From
/// </summary>
public DateTime From { get; private set; }
[DataMember( Name = "from", IsRequired = true )]
[DebuggerBrowsable( DebuggerBrowsableState.Never )]
private String FromImpl
{
get { return this.From.ToString( TIME_FORMAT ); }
set { this.From = DateTime.ParseExact( value, TIME_FORMAT, null ); }
}
/// <summary>
/// To
/// </summary>
public DateTime To { get; private set; }
[DataMember( Name = "to", IsRequired = true )]
[DebuggerBrowsable( DebuggerBrowsableState.Never )]
private String ToImpl
{
get { return this.To.ToString( TIME_FORMAT ); }
set { this.To = DateTime.ParseExact( value, TIME_FORMAT, null ); }
}
}
} | mit | C# |
4f2d518dbcd4168920a8869dfafe06615695392a | Fix application exit. | tfreitasleal/MvvmFx,MvvmFx/MvvmFx | Samples/CaliburnMicro/AcyncUpdate.WisejWeb/AsyncUpdateView.cs | Samples/CaliburnMicro/AcyncUpdate.WisejWeb/AsyncUpdateView.cs | using System;
#if WISEJ
using Wisej.Web;
#else
using System.Windows.Forms;
#endif
using MvvmFx.CaliburnMicro;
namespace AcyncUpdate.UI
{
public interface IAsyncUpdateView : IHaveDataContext, IHaveBusyIndicator
{
}
public partial class AsyncUpdateView : Form, IAsyncUpdateView
{
private IAsyncUpdateViewModel _viewModel;
public AsyncUpdateView()
{
InitializeComponent();
ActiveControl = customerName;
}
public new void Close()
{
Application.Exit();
}
public BusyIndicator Indicator
{
get { return busyIndicator; }
}
private void Bind()
{
customerName.DataBindings.Add(new Binding("ReadOnly", DataContext, "IsCustomerNameReadOnly", true,
DataSourceUpdateMode.OnPropertyChanged));
}
#region IHaveDataContext implementation
public event EventHandler<DataContextChangedEventArgs> DataContextChanged = delegate { };
public object DataContext
{
get { return _viewModel; }
set
{
if (value != _viewModel)
{
_viewModel = value as IAsyncUpdateViewModel;
Bind();
DataContextChanged(this, new DataContextChangedEventArgs());
}
}
}
#endregion
}
} | using System;
#if WISEJ
using Wisej.Web;
#else
using System.Windows.Forms;
#endif
using MvvmFx.CaliburnMicro;
namespace AcyncUpdate.UI
{
public interface IAsyncUpdateView : IHaveDataContext, IHaveBusyIndicator
{
}
public partial class AsyncUpdateView : Form, IAsyncUpdateView
{
private IAsyncUpdateViewModel _viewModel;
public AsyncUpdateView()
{
InitializeComponent();
ActiveControl = customerName;
}
public BusyIndicator Indicator
{
get { return busyIndicator; }
}
private void Bind()
{
customerName.DataBindings.Add(new Binding("ReadOnly", DataContext, "IsCustomerNameReadOnly", true,
DataSourceUpdateMode.OnPropertyChanged));
}
#region IHaveDataContext implementation
public event EventHandler<DataContextChangedEventArgs> DataContextChanged = delegate { };
public object DataContext
{
get { return _viewModel; }
set
{
if (value != _viewModel)
{
_viewModel = value as IAsyncUpdateViewModel;
Bind();
DataContextChanged(this, new DataContextChangedEventArgs());
}
}
}
#endregion
}
} | mit | C# |
95e0782c8c76feaa3acfec604ddddb56a7909d23 | Update Source/Libraries/openXDA.Model/SystemCenter/RemoteXDAAsset.cs | GridProtectionAlliance/openXDA,GridProtectionAlliance/openXDA,GridProtectionAlliance/openXDA,GridProtectionAlliance/openXDA | Source/Libraries/openXDA.Model/SystemCenter/RemoteXDAAsset.cs | Source/Libraries/openXDA.Model/SystemCenter/RemoteXDAAsset.cs | //******************************************************************************************************
// RemoteXDAAsset.cs - Gbtc
//
// Copyright © 2019, Grid Protection Alliance. All Rights Reserved.
//
// Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See
// the NOTICE file distributed with this work for additional information regarding copyright ownership.
// The GPA licenses this file to you under the MIT License (MIT), the "License"; you may not use this
// file except in compliance with the License. You may obtain a copy of the License at:
//
// http://opensource.org/licenses/MIT
//
// Unless agreed to in writing, the subject software distributed under the License is distributed on an
// "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the
// License for the specific language governing permissions and limitations.
//
// Code Modification History:
// ----------------------------------------------------------------------------------------------------
// 05/16/2022 - Gabriel Santos
// Generated original version of source code.
//
//******************************************************************************************************
using GSF.Data.Model;
namespace openXDA.Model
{
/// <summary>
/// Model of a remote asset.
/// </summary>
[AllowSearch]
[DeleteRoles("Administrator")]
[TableName("AssetsToDataPush"), CustomView(@"
SELECT
AssetsToDataPush.ID,
AssetsToDataPush.RemoteXDAInstanceID,
AssetsToDataPush.LocalXDAAssetID,
AssetsToDataPush.RemoteXDAAssetID,
AssetsToDataPush.RemoteXDAAssetKey,
AssetsToDataPush.Obsfucate,
AssetsToDataPush.Synced,
AssetsToDataPush.RemoteAssetCreatedByDataPusher,
Asset.AssetName as LocalAssetName,
Asset.AssetKey as LocalAssetKey
FROM
AssetsToDataPush LEFT JOIN
Asset ON AssetsToDataPush.LocalXDAAssetID = [Asset].ID")]
public class RemoteXDAAsset : AssetsToDataPush
{
public string LocalAssetName { get; set; }
public string LocalAssetKey { get; set; }
}
} | //******************************************************************************************************
// AdditionalField.cs - Gbtc
//
// Copyright © 2019, Grid Protection Alliance. All Rights Reserved.
//
// Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See
// the NOTICE file distributed with this work for additional information regarding copyright ownership.
// The GPA licenses this file to you under the MIT License (MIT), the "License"; you may not use this
// file except in compliance with the License. You may obtain a copy of the License at:
//
// http://opensource.org/licenses/MIT
//
// Unless agreed to in writing, the subject software distributed under the License is distributed on an
// "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the
// License for the specific language governing permissions and limitations.
//
// Code Modification History:
// ----------------------------------------------------------------------------------------------------
// 05/16/2022 - Gabriel Santos
// Generated original version of source code.
//
//******************************************************************************************************
using GSF.Data.Model;
namespace openXDA.Model
{
/// <summary>
/// Model of a remote asset.
/// </summary>
[AllowSearch]
[DeleteRoles("Administrator")]
[TableName("AssetsToDataPush"), CustomView(@"
SELECT
AssetsToDataPush.ID,
AssetsToDataPush.RemoteXDAInstanceID,
AssetsToDataPush.LocalXDAAssetID,
AssetsToDataPush.RemoteXDAAssetID,
AssetsToDataPush.RemoteXDAAssetKey,
AssetsToDataPush.Obsfucate,
AssetsToDataPush.Synced,
AssetsToDataPush.RemoteAssetCreatedByDataPusher,
Asset.AssetName as LocalAssetName,
Asset.AssetKey as LocalAssetKey
FROM
AssetsToDataPush LEFT JOIN
Asset ON AssetsToDataPush.LocalXDAAssetID = [Asset].ID")]
public class RemoteXDAAsset : AssetsToDataPush
{
public string LocalAssetName { get; set; }
public string LocalAssetKey { get; set; }
}
} | mit | C# |
0ddb5eba11c6d1cc94596f20029e3157cf4a8ad6 | Define 'RecordingLog.Contains(Severity)' | jonathanvdc/Pixie,jonathanvdc/Pixie | Pixie/RecordingLog.cs | Pixie/RecordingLog.cs | using System.Collections.Generic;
namespace Pixie
{
/// <summary>
/// A log implementation that records all incoming entries
/// and forwards them to another log.
/// </summary>
public sealed class RecordingLog : ILog
{
/// <summary>
/// Creates a log that simply records all incoming messages.
/// </summary>
public RecordingLog()
: this(NullLog.Instance)
{ }
/// <summary>
/// Creates a log that forwards all of its incoming messages
/// to a particular log and also records them.
/// </summary>
/// <param name="forwardingLog">
/// The log to forward messages to.
/// </param>
public RecordingLog(ILog forwardingLog)
{
this.recorded = new List<LogEntry>();
this.ForwardingLog = forwardingLog;
}
private List<LogEntry> recorded;
/// <summary>
/// Gets the log to which messages are sent by this log
/// after they have been recorded.
/// </summary>
/// <returns>The inner log.</returns>
public ILog ForwardingLog { get; private set; }
/// <summary>
/// Gets a list of all entries that have been recorded
/// by this log.
/// </summary>
/// <returns>A list of all recorded entries.</returns>
public IReadOnlyList<LogEntry> RecordedEntries => recorded;
/// <summary>
/// Tests if this log contains at least one entry of
/// a particular severity.
/// </summary>
/// <param name="severity">The severity to look for.</param>
/// <returns>
/// <c>true</c> if this log contains at least one entry
/// of <paramref name="severity"/>; otherwise, <c>false</c>.
/// </returns>
public bool Contains(Severity severity)
{
int entryCount = recorded.Count;
for (int i = 0; i < entryCount; i++)
{
if (recorded[i].Severity == severity)
{
return true;
}
}
return false;
}
/// <inheritdoc/>
public void Log(LogEntry entry)
{
lock (recorded)
{
recorded.Add(entry);
}
ForwardingLog.Log(entry);
}
}
}
| using System.Collections.Generic;
namespace Pixie
{
/// <summary>
/// A log implementation that records all incoming entries
/// and forwards them to another log.
/// </summary>
public sealed class RecordingLog : ILog
{
/// <summary>
/// Creates a log that simply records all incoming messages.
/// </summary>
public RecordingLog()
: this(NullLog.Instance)
{ }
/// <summary>
/// Creates a log that forwards all of its incoming messages
/// to a particular log and also records them.
/// </summary>
/// <param name="forwardingLog">
/// The log to forward messages to.
/// </param>
public RecordingLog(ILog forwardingLog)
{
this.recorded = new List<LogEntry>();
this.ForwardingLog = forwardingLog;
}
private List<LogEntry> recorded;
/// <summary>
/// Gets the log to which messages are sent by this log
/// after they have been recorded.
/// </summary>
/// <returns>The inner log.</returns>
public ILog ForwardingLog { get; private set; }
/// <summary>
/// Gets a list of all entries that have been recorded
/// by this log.
/// </summary>
/// <returns>A list of all recorded entries.</returns>
public IReadOnlyList<LogEntry> RecordedEntries => recorded;
/// <inheritdoc/>
public void Log(LogEntry entry)
{
lock (recorded)
{
recorded.Add(entry);
}
ForwardingLog.Log(entry);
}
}
}
| mit | C# |
208332b8315fce6750b38bfda4e7957ad8f013a2 | Remove unused 'RunningOnMono' property | aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore | test/ServerComparison.FunctionalTests/Helpers.cs | test/ServerComparison.FunctionalTests/Helpers.cs | // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.IO;
namespace ServerComparison.FunctionalTests
{
public class Helpers
{
public static string GetApplicationPath()
{
return Path.GetFullPath(Path.Combine("..", "ServerComparison.TestSites"));
}
}
} | // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.IO;
namespace ServerComparison.FunctionalTests
{
public class Helpers
{
public static bool RunningOnMono
{
get
{
return Type.GetType("Mono.Runtime") != null;
}
}
public static string GetApplicationPath()
{
return Path.GetFullPath(Path.Combine("..", "ServerComparison.TestSites"));
}
}
} | apache-2.0 | C# |
a2d1c2c096ccfbc56ceff2319164393dd4e2c149 | Fix formatting | smoogipooo/osu,peppy/osu,DrabWeb/osu,smoogipoo/osu,naoey/osu,EVAST9919/osu,DrabWeb/osu,naoey/osu,2yangk23/osu,naoey/osu,NeoAdonis/osu,DrabWeb/osu,ZLima12/osu,ZLima12/osu,ppy/osu,EVAST9919/osu,UselessToucan/osu,UselessToucan/osu,peppy/osu,ppy/osu,smoogipoo/osu,NeoAdonis/osu,2yangk23/osu,peppy/osu-new,johnneijzen/osu,NeoAdonis/osu,UselessToucan/osu,johnneijzen/osu,ppy/osu,smoogipoo/osu,peppy/osu | osu.Game.Rulesets.Taiko/Judgements/TaikoSwellJudgement.cs | osu.Game.Rulesets.Taiko/Judgements/TaikoSwellJudgement.cs | // Copyright (c) 2007-2018 ppy Pty Ltd <[email protected]>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Taiko.Judgements
{
public class TaikoSwellJudgement : TaikoJudgement
{
public override bool AffectsCombo => false;
protected override double HealthIncreaseFor(HitResult result)
{
switch (result)
{
case HitResult.Miss:
return -0.65;
default:
return 0;
}
}
}
}
| // Copyright (c) 2007-2018 ppy Pty Ltd <[email protected]>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Taiko.Judgements
{
public class TaikoSwellJudgement : TaikoJudgement
{
public override bool AffectsCombo => false;
protected override double HealthIncreaseFor(HitResult result)
{
switch(result)
{
case HitResult.Miss:
return -0.65;
default:
return 0;
}
}
}
}
| mit | C# |
11f7174649986e67b8437b322f9ac64cb6531831 | change size | Borayvor/ASP.NET-MVC-CourseProject,Borayvor/ASP.NET-MVC-CourseProject,Borayvor/ASP.NET-MVC-CourseProject | EntertainmentSystem/Web/EntertainmentSystem.Web/Areas/Forum/Views/AllPosts/Index.cshtml | EntertainmentSystem/Web/EntertainmentSystem.Web/Areas/Forum/Views/AllPosts/Index.cshtml | @using EntertainmentSystem.Web.Areas.Forum.Controllers
@using EntertainmentSystem.Web.Areas.Forum.ViewModels
@model PostsPageViewModel
<section id="es-forum-home">
<h1 class="text-left">Forum</h1>
<hr />
<div class="container">
@foreach (var post in Model.Posts)
{
@Html.Partial("_PostHomePartial", post)
}
</div>
<div class="text-center">
<nav>
<ul class="pagination pagination-sm">
@if (Model.CurrentPage != 1)
{
<li>
<a href="@(Url.Action<AllPostsController>(c => c.Index(Model.CurrentPage - 1, Model.Search)))" aria-label="Previous">
<span aria-hidden="true">«</span>
</a>
</li>
}
@for (int i = 1; i <= Model.TotalPages; i++)
{
var className = string.Empty;
if (Model.CurrentPage == i)
{
className = "active";
}
<li class="@className"><a href="@(Url.Action<AllPostsController>(c => c.Index(i, Model.Search)))">@(i)</a></li>
}
@if (Model.CurrentPage != Model.TotalPages)
{
<li>
<a href="@(Url.Action<AllPostsController>(c => c.Index(Model.CurrentPage + 1, Model.Search)))" aria-label="Next">
<span aria-hidden="true">»</span>
</a>
</li>
}
</ul>
</nav>
</div>
</section> | @using EntertainmentSystem.Web.Areas.Forum.Controllers
@using EntertainmentSystem.Web.Areas.Forum.ViewModels
@model PostsPageViewModel
<section id="es-forum-home">
<h1 class="text-left">Forum</h1>
<hr />
<div class="container">
@foreach (var post in Model.Posts)
{
@Html.Partial("_PostHomePartial", post)
}
</div>
<div class="text-center">
<nav>
<ul class="pagination">
@if (Model.CurrentPage != 1)
{
<li>
<a href="@(Url.Action<AllPostsController>(c => c.Index(Model.CurrentPage - 1, Model.Search)))" aria-label="Previous">
<span aria-hidden="true">«</span>
</a>
</li>
}
@for (int i = 1; i <= Model.TotalPages; i++)
{
var className = string.Empty;
if (Model.CurrentPage == i)
{
className = "active";
}
<li class="@className"><a href="@(Url.Action<AllPostsController>(c => c.Index(i, Model.Search)))">@(i)</a></li>
}
@if (Model.CurrentPage != Model.TotalPages)
{
<li>
<a href="@(Url.Action<AllPostsController>(c => c.Index(Model.CurrentPage + 1, Model.Search)))" aria-label="Next">
<span aria-hidden="true">»</span>
</a>
</li>
}
</ul>
</nav>
</div>
</section> | mit | C# |
1b0949438736047544c8c2acc83cea5887490ffb | add revese-proxy support | MCeddy/IoT-core | IoT-Core/Startup.cs | IoT-Core/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.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using IoT_Core.Models;
using IoT_Core.Middelware;
using Microsoft.AspNetCore.HttpOverrides;
namespace IoT_Core
{
public class Startup
{
public Startup(IHostingEnvironment env)
{
var builder = new ConfigurationBuilder()
.SetBasePath(env.ContentRootPath)
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
.AddEnvironmentVariables();
Configuration = builder.Build();
}
public IConfigurationRoot Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddEntityFrameworkSqlite()
.AddDbContext<SensorValueContext>();
services.AddMvc();
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
loggerFactory.AddDebug();
// for reverse-proxy support
app.UseForwardedHeaders(new ForwardedHeadersOptions
{
ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
});
if (env.IsProduction())
{
app.UseSecretAuthentication();
}
app.UseMvc();
// create database
using (var serviceScope = app.ApplicationServices.GetService<IServiceScopeFactory>().CreateScope())
{
var sensorValueContext = serviceScope.ServiceProvider.GetRequiredService<SensorValueContext>();
sensorValueContext.Database.EnsureCreated();
}
}
}
}
| using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using IoT_Core.Models;
using IoT_Core.Middelware;
namespace IoT_Core
{
public class Startup
{
public Startup(IHostingEnvironment env)
{
var builder = new ConfigurationBuilder()
.SetBasePath(env.ContentRootPath)
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
.AddEnvironmentVariables();
Configuration = builder.Build();
}
public IConfigurationRoot Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddEntityFrameworkSqlite()
.AddDbContext<SensorValueContext>();
services.AddMvc();
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
loggerFactory.AddDebug();
if (env.IsProduction())
{
app.UseSecretAuthentication();
}
app.UseMvc();
// create database
using (var serviceScope = app.ApplicationServices.GetService<IServiceScopeFactory>().CreateScope())
{
var sensorValueContext = serviceScope.ServiceProvider.GetRequiredService<SensorValueContext>();
sensorValueContext.Database.EnsureCreated();
}
}
}
}
| mit | C# |
27e2bcbb1c14f866bd755832e1a1a4b5c1cf8d94 | Fix wrong id used in DoNotUseCoroutines test | Kasperki/UnityEngineAnalyzer,Kasperki/UnityEngineAnalyzer | UnityEngineAnalyzer/UnityEngineAnalyzer.Test/Coroutines/DoNotUseCoroutinesAnalyzerTests.cs | UnityEngineAnalyzer/UnityEngineAnalyzer.Test/Coroutines/DoNotUseCoroutinesAnalyzerTests.cs | using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.Text;
using NUnit.Framework;
using RoslynNUnitLight;
using UnityEngineAnalyzer.Coroutines;
namespace UnityEngineAnalyzer.Test.Coroutines
{
[TestFixture]
sealed class DoNotUseCoroutinesAnalyzerTests : AnalyzerTestFixture
{
protected override string LanguageName => LanguageNames.CSharp;
protected override DiagnosticAnalyzer CreateAnalyzer() => new DoNotUseCoroutinesAnalyzer();
[Test]
public void StartCoroutineUsedInMonoBehaviourClass()
{
const string code = @"
using UnityEngine;
class C : MonoBehaviour
{
void M()
{
[|StartCoroutine("")|];
}
}";
Document document;
TextSpan span;
TestHelpers.TryGetDocumentAndSpanFromMarkup(code, LanguageName, MetadataReferenceHelper.UsingUnityEngine, out document, out span);
HasDiagnostic(document, span, DiagnosticIDs.DoNotUseCoroutines);
}
[Test]
public void StartCoroutineUsedByMonoBehaviourClass()
{
const string code = @"
using UnityEngine;
class CC : MonoBehaviour { }
class C : MonoBehaviour
{
private CC cc;
void M()
{
cc.[|StartCoroutine("")|];
}
}";
Document document;
TextSpan span;
TestHelpers.TryGetDocumentAndSpanFromMarkup(code, LanguageName, MetadataReferenceHelper.UsingUnityEngine, out document, out span);
HasDiagnostic(document, span, DiagnosticIDs.DoNotUseCoroutines);
}
}
}
| using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.Text;
using NUnit.Framework;
using RoslynNUnitLight;
using UnityEngineAnalyzer.Coroutines;
namespace UnityEngineAnalyzer.Test.Coroutines
{
[TestFixture]
sealed class DoNotUseCoroutinesAnalyzerTests : AnalyzerTestFixture
{
protected override string LanguageName => LanguageNames.CSharp;
protected override DiagnosticAnalyzer CreateAnalyzer() => new DoNotUseCoroutinesAnalyzer();
[Test]
public void StartCoroutineUsedInMonoBehaviourClass()
{
const string code = @"
using UnityEngine;
class C : MonoBehaviour
{
void M()
{
[|StartCoroutine("")|];
}
}";
Document document;
TextSpan span;
TestHelpers.TryGetDocumentAndSpanFromMarkup(code, LanguageName, MetadataReferenceHelper.UsingUnityEngine, out document, out span);
HasDiagnostic(document, span, DiagnosticIDs.EmptyMonoBehaviourMethod);
}
[Test]
public void StartCoroutineUsedByMonoBehaviourClass()
{
const string code = @"
using UnityEngine;
class CC : MonoBehaviour { }
class C : MonoBehaviour
{
private CC cc;
void M()
{
cc.[|StartCoroutine("")|];
}
}";
Document document;
TextSpan span;
TestHelpers.TryGetDocumentAndSpanFromMarkup(code, LanguageName, MetadataReferenceHelper.UsingUnityEngine, out document, out span);
HasDiagnostic(document, span, DiagnosticIDs.EmptyMonoBehaviourMethod);
}
}
}
| mit | C# |
8c23e4eaa72945abd4d03e66849814f5d9020541 | bump version | Dalet/140-speedrun-timer,Dalet/140-speedrun-timer,Dalet/140-speedrun-timer | SharedAssemblyInfo.cs | SharedAssemblyInfo.cs | using System.Reflection;
[assembly: AssemblyVersion("0.7.3.4")]
[assembly: AssemblyFileVersion("0.7.3.4")]
| using System.Reflection;
[assembly: AssemblyVersion("0.7.3.3")]
[assembly: AssemblyFileVersion("0.7.3.3")]
| unlicense | C# |
bb3335a6dc3b026707aab0f9b9aafeebbab39b95 | Fix Throttle operator | emoacht/Monitorian | Source/Monitorian.Core/Helper/Throttle.cs | Source/Monitorian.Core/Helper/Throttle.cs | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Threading;
namespace Monitorian.Core.Helper
{
/// <summary>
/// Rx Throttle like operator
/// </summary>
public class Throttle
{
protected readonly SemaphoreSlim _semaphore = new SemaphoreSlim(1, 1);
protected readonly DispatcherTimer _timer;
protected readonly Action _action;
public Throttle(TimeSpan dueTime, Action action)
{
if (dueTime <= TimeSpan.Zero)
throw new ArgumentOutOfRangeException(nameof(dueTime));
_timer = new DispatcherTimer { Interval = dueTime };
_timer.Tick += OnTick;
this._action = action;
}
private async void OnTick(object sender, EventArgs e)
{
try
{
await _semaphore.WaitAsync();
if (!_timer.IsEnabled)
return;
_timer.Stop();
_action?.Invoke();
}
finally
{
_semaphore.Release();
}
}
public virtual async Task PushAsync()
{
try
{
await _semaphore.WaitAsync();
_timer.Stop();
_timer.Start();
}
finally
{
_semaphore.Release();
}
}
}
/// <summary>
/// Rx Sample like operator
/// </summary>
public class Sample : Throttle
{
public Sample(TimeSpan dueTime, Action action) : base(dueTime, action)
{ }
public override async Task PushAsync()
{
try
{
await _semaphore.WaitAsync();
if (!_timer.IsEnabled)
_timer.Start();
}
finally
{
_semaphore.Release();
}
}
}
} | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Threading;
namespace Monitorian.Core.Helper
{
/// <summary>
/// Rx Throttle like operator
/// </summary>
public class Throttle
{
protected readonly Action _action;
protected readonly DispatcherTimer _timer;
protected readonly SemaphoreSlim _semaphore = new SemaphoreSlim(1, 1);
public Throttle(TimeSpan dueTime, Action action)
{
if (dueTime <= TimeSpan.Zero)
throw new ArgumentOutOfRangeException(nameof(dueTime));
this._action = action;
_timer = new DispatcherTimer { Interval = dueTime };
_timer.Tick += OnTick;
}
private void OnTick(object sender, EventArgs e)
{
try
{
_semaphore.Wait();
_timer.Stop();
_action?.Invoke();
}
finally
{
_semaphore.Release();
}
}
public virtual async Task PushAsync()
{
try
{
await _semaphore.WaitAsync();
_timer.Stop();
_timer.Start();
}
finally
{
_semaphore.Release();
}
}
}
/// <summary>
/// Rx Sample like operator
/// </summary>
public class Sample : Throttle
{
public Sample(TimeSpan dueTime, Action action) : base(dueTime, action)
{ }
public override async Task PushAsync()
{
try
{
await _semaphore.WaitAsync();
if (!_timer.IsEnabled)
_timer.Start();
}
finally
{
_semaphore.Release();
}
}
}
} | mit | C# |
05a75570b3d69b069b2c3a634bc3d921cf28afed | Remove services from etcd on shutdown (Fixes #15) | LukeTillman/killrvideo-csharp,LukeTillman/killrvideo-csharp,LukeTillman/killrvideo-csharp | src/KillrVideo/Listeners/RegisterWithEtcdListener.cs | src/KillrVideo/Listeners/RegisterWithEtcdListener.cs | using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Threading.Tasks;
using EtcdNet;
using Grpc.Core;
using KillrVideo.Configuration;
using KillrVideo.Host.Config;
using KillrVideo.Protobuf;
using KillrVideo.Protobuf.Services;
namespace KillrVideo.Listeners
{
/// <summary>
/// Registers running services with Etcd for service discovery.
/// </summary>
[Export(typeof(IServerListener))]
public class RegisterWithEtcdListener : IServerListener
{
private readonly EtcdClient _client;
private readonly IHostConfiguration _config;
private readonly Lazy<string> _uniqueId;
public RegisterWithEtcdListener(EtcdClient client, IHostConfiguration config)
{
if (client == null) throw new ArgumentNullException(nameof(client));
if (config == null) throw new ArgumentNullException(nameof(config));
_client = client;
_config = config;
_uniqueId = new Lazy<string>(() => $"{_config.ApplicationName}:{_config.ApplicationInstanceId}");
}
public void OnStart(IEnumerable<ServerPort> serverPorts, IEnumerable<IGrpcServerService> servicesStarted)
{
string ip = _config.GetRequiredConfigurationValue(ConfigConstants.HostIp);
int[] ports = serverPorts.Select(p => p.Port).ToArray();
// Register each service that started with etcd using the host IP setting
var registerTasks = new List<Task>();
foreach (IGrpcServerService service in servicesStarted)
{
foreach (int port in ports)
{
var t = _client.SetNodeAsync(GetServiceKey(service), $"{ip}:{port}");
registerTasks.Add(t);
}
}
Task.WaitAll(registerTasks.ToArray());
}
public void OnStop(IEnumerable<ServerPort> serverPorts, IEnumerable<IGrpcServerService> servicesStopped)
{
// Remove all services from etcd that were registered on startup
var removeTasks = new List<Task>();
foreach (IGrpcServerService service in servicesStopped)
{
var t = _client.DeleteNodeAsync(GetServiceKey(service));
removeTasks.Add(t);
}
Task.WaitAll(removeTasks.ToArray());
}
private string GetServiceKey(IGrpcServerService service)
{
return $"/killrvideo/services/{service.Descriptor.Name}/{_uniqueId.Value}";
}
}
} | using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Threading.Tasks;
using EtcdNet;
using Grpc.Core;
using KillrVideo.Configuration;
using KillrVideo.Host.Config;
using KillrVideo.Protobuf;
using KillrVideo.Protobuf.Services;
namespace KillrVideo.Listeners
{
/// <summary>
/// Registers running services with Etcd for service discovery.
/// </summary>
[Export(typeof(IServerListener))]
public class RegisterWithEtcdListener : IServerListener
{
private readonly EtcdClient _client;
private readonly IHostConfiguration _config;
public RegisterWithEtcdListener(EtcdClient client, IHostConfiguration config)
{
if (client == null) throw new ArgumentNullException(nameof(client));
if (config == null) throw new ArgumentNullException(nameof(config));
_client = client;
_config = config;
}
public void OnStart(IEnumerable<ServerPort> serverPorts, IEnumerable<IGrpcServerService> servicesStarted)
{
string ip = _config.GetRequiredConfigurationValue(ConfigConstants.HostIp);
string uniqueId = $"{_config.ApplicationName}:{_config.ApplicationInstanceId}";
int[] ports = serverPorts.Select(p => p.Port).ToArray();
// Register each service that started with etcd using the host IP setting
var registerTasks = new List<Task>();
foreach (IGrpcServerService service in servicesStarted)
{
foreach (int port in ports)
{
var t = _client.SetNodeAsync($"/killrvideo/services/{service.Descriptor.Name}/{uniqueId}", $"{ip}:{port}");
registerTasks.Add(t);
}
}
Task.WaitAll(registerTasks.ToArray());
}
public void OnStop(IEnumerable<ServerPort> serverPorts, IEnumerable<IGrpcServerService> servicesStopped)
{
}
}
} | apache-2.0 | C# |
c81acb0710e00a104c84495bb0a8378d3dc4d0c8 | update history test | RagtimeWilly/FplClient | src/FplClient.Tests/Clients/FplEntryHistoryClientTests.cs | src/FplClient.Tests/Clients/FplEntryHistoryClientTests.cs | using System.Net.Http;
using FplClient.Clients;
using NUnit.Framework;
namespace FplClient.Tests.Clients
{
[TestFixture]
public class FplEntryHistoryClientTests
{
private TestContext _context;
[SetUp]
public void Setup()
{
_context = new TestContext();
}
[Test]
public void Retrieves_team_history_successfully()
{
var data = _context.Sut.GetHistory(639).Result;
Assert.IsNotNull(data.SeasonHistory);
}
private class TestContext
{
public TestContext()
{
Sut = new FplEntryHistoryClient(new HttpClient());
}
public FplEntryHistoryClient Sut { get; }
}
}
}
| using System.Net.Http;
using FplClient.Clients;
using NUnit.Framework;
namespace FplClient.Tests.Clients
{
[TestFixture]
public class FplEntryHistoryClientTests
{
private TestContext _context;
[SetUp]
public void Setup()
{
_context = new TestContext();
}
[Test]
public void Retrieves_team_history_successfully()
{
var data = _context.Sut.GetHistory(639).Result;
Assert.IsNotNull(data);
}
private class TestContext
{
public TestContext()
{
Sut = new FplEntryHistoryClient(new HttpClient());
}
public FplEntryHistoryClient Sut { get; }
}
}
}
| mit | C# |
194bd21ea1833bf189b4e00b870c0fb1fd944583 | Use Id as plugin name if missed | JetBrains/ReSharperGallery,JetBrains/ReSharperGallery,JetBrains/ReSharperGallery | Website/Controllers/InternalController.cs | Website/Controllers/InternalController.cs | using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using NuGetGallery.Filters;
namespace NuGetGallery.Controllers
{
[GoogleAnalyticsMeasurementProtocol]
public class InternalController : System.Web.Http.ApiController
{
private readonly IPackageService _packageService;
public InternalController(IPackageService packageService)
{
_packageService = packageService;
}
[System.Web.Http.HttpGet]
public IEnumerable<object> Packages(bool includePrerelease = false)
{
return _packageService
.GetPackagesForListing(includePrerelease)
.Select(_ => new
{
_.PackageRegistration.Id,
_.Title,
_.Description,
Owners = _.PackageRegistration.Owners.Select(__ => __.Username),
Authors = _.Authors.Select(__ => __.Name),
Dependencies = _.Dependencies.Select(__ => new { product = __.Id, version = __.VersionSpec }),
_.Tags,
_.LastUpdated,
_.Version,
_.PackageRegistration.DownloadCount,
_.ProjectUrl,
_.LicenseUrl,
_.IconUrl
})
.AsEnumerable()
.Select(_ => new
{
Name = string.IsNullOrEmpty(_.Title) ? _.Id : _.Title,
Description = _.Description,
Owners = _.Owners.Select(__ => new { owner = __, url = Url.Link(null, MVC.Users.Profiles(__).GetRouteValueDictionary()) }),
Authors = _.Authors,
Compatible_versions = _.Dependencies,
Tags = string.IsNullOrEmpty(_.Tags) ? new string[0] : _.Tags.Trim().Split(' '),
Last_update = _.LastUpdated,
Last_version = _.Version,
Downloads = _.DownloadCount,
URLs = new { project = _.ProjectUrl, license = _.LicenseUrl, contact = Url.Link(null, MVC.Packages.ContactOwners(_.Id).GetRouteValueDictionary()) },
Logo = _.IconUrl
});
}
}
} | using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using NuGetGallery.Filters;
namespace NuGetGallery.Controllers
{
[GoogleAnalyticsMeasurementProtocol]
public class InternalController : System.Web.Http.ApiController
{
private readonly IPackageService _packageService;
public InternalController(IPackageService packageService)
{
_packageService = packageService;
}
[System.Web.Http.HttpGet]
public IEnumerable<object> Packages(bool includePrerelease = false)
{
return _packageService
.GetPackagesForListing(includePrerelease)
.Select(_ => new
{
_.PackageRegistration.Id,
_.Title,
_.Description,
Owners = _.PackageRegistration.Owners.Select(__ => __.Username),
Authors = _.Authors.Select(__ => __.Name),
Dependencies = _.Dependencies.Select(__ => new { product = __.Id, version = __.VersionSpec }),
_.Tags,
_.LastUpdated,
_.Version,
_.PackageRegistration.DownloadCount,
_.ProjectUrl,
_.LicenseUrl,
_.IconUrl
})
.AsEnumerable()
.Select(_ => new
{
Name = _.Title,
Description = _.Description,
Owners = _.Owners.Select(__ => new { owner = __, url = Url.Link(null, MVC.Users.Profiles(__).GetRouteValueDictionary()) }),
Authors = _.Authors,
Compatible_versions = _.Dependencies,
Tags = string.IsNullOrEmpty(_.Tags) ? new string[0] : _.Tags.Trim().Split(' '),
Last_update = _.LastUpdated,
Last_version = _.Version,
Downloads = _.DownloadCount,
URLs = new { project = _.ProjectUrl, license = _.LicenseUrl, contact = Url.Link(null, MVC.Packages.ContactOwners(_.Id).GetRouteValueDictionary()) },
Logo = _.IconUrl
});
}
}
} | apache-2.0 | C# |
12d7fea52fd13f830807593e44b3ad2da49fc39a | Update FontStyleTypeConverter.cs | Core2D/Core2D,wieslawsoltes/Core2D,Core2D/Core2D,wieslawsoltes/Core2D,wieslawsoltes/Core2D,wieslawsoltes/Core2D | src/Serializer.Xaml/Converters/FontStyleTypeConverter.cs | src/Serializer.Xaml/Converters/FontStyleTypeConverter.cs | // Copyright (c) Wiesław Šoltés. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Globalization;
#if NETSTANDARD1_3
using System.ComponentModel;
#endif
using Core2D.Style;
using Portable.Xaml.ComponentModel;
namespace Serializer.Xaml.Converters
{
/// <summary>
/// Defines <see cref="FontStyle"/> type converter.
/// </summary>
internal class FontStyleTypeConverter : TypeConverter
{
/// <inheritdoc/>
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
{
return sourceType == typeof(string);
}
/// <inheritdoc/>
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
{
return destinationType == typeof(string);
}
/// <inheritdoc/>
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
{
return FontStyle.Parse((string)value);
}
/// <inheritdoc/>
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
{
var style = value as FontStyle;
if (style != null)
{
return style.ToString();
}
throw new NotSupportedException();
}
}
}
| // Copyright (c) Wiesław Šoltés. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Globalization;
#if NETSTANDARD1_3
using System.ComponentModel;
#else
using Portable.Xaml.ComponentModel;
#endif
using Core2D.Style;
namespace Serializer.Xaml.Converters
{
/// <summary>
/// Defines <see cref="FontStyle"/> type converter.
/// </summary>
internal class FontStyleTypeConverter : TypeConverter
{
/// <inheritdoc/>
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
{
return sourceType == typeof(string);
}
/// <inheritdoc/>
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
{
return destinationType == typeof(string);
}
/// <inheritdoc/>
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
{
return FontStyle.Parse((string)value);
}
/// <inheritdoc/>
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
{
var style = value as FontStyle;
if (style != null)
{
return style.ToString();
}
throw new NotSupportedException();
}
}
}
| mit | C# |
c84b4707e3cf92d3c85b7d07ae36985e25e0fd8d | Add locations to allow scopes to dictionary | dotnet-architecture/eShopOnContainers,albertodall/eShopOnContainers,productinfo/eShopOnContainers,andrelmp/eShopOnContainers,albertodall/eShopOnContainers,skynode/eShopOnContainers,dotnet-architecture/eShopOnContainers,albertodall/eShopOnContainers,skynode/eShopOnContainers,productinfo/eShopOnContainers,andrelmp/eShopOnContainers,productinfo/eShopOnContainers,TypeW/eShopOnContainers,dotnet-architecture/eShopOnContainers,TypeW/eShopOnContainers,productinfo/eShopOnContainers,TypeW/eShopOnContainers,dotnet-architecture/eShopOnContainers,skynode/eShopOnContainers,skynode/eShopOnContainers,andrelmp/eShopOnContainers,TypeW/eShopOnContainers,andrelmp/eShopOnContainers,dotnet-architecture/eShopOnContainers,skynode/eShopOnContainers,productinfo/eShopOnContainers,albertodall/eShopOnContainers,albertodall/eShopOnContainers,andrelmp/eShopOnContainers,andrelmp/eShopOnContainers,TypeW/eShopOnContainers,productinfo/eShopOnContainers | src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Identity/IdentityService.cs | src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Identity/IdentityService.cs | using IdentityModel.Client;
using System;
using System.Collections.Generic;
namespace eShopOnContainers.Core.Services.Identity
{
public class IdentityService : IIdentityService
{
public string CreateAuthorizationRequest()
{
// Create URI to authorization endpoint
var authorizeRequest = new AuthorizeRequest(GlobalSetting.Instance.IdentityEndpoint);
// Dictionary with values for the authorize request
var dic = new Dictionary<string, string>();
dic.Add("client_id", "xamarin");
dic.Add("client_secret", "secret");
dic.Add("response_type", "code id_token token");
dic.Add("scope", "openid profile basket orders locations offline_access");
dic.Add("redirect_uri", GlobalSetting.Instance.IdentityCallback);
dic.Add("nonce", Guid.NewGuid().ToString("N"));
// Add CSRF token to protect against cross-site request forgery attacks.
var currentCSRFToken = Guid.NewGuid().ToString("N");
dic.Add("state", currentCSRFToken);
var authorizeUri = authorizeRequest.Create(dic);
return authorizeUri;
}
public string CreateLogoutRequest(string token)
{
if(string.IsNullOrEmpty(token))
{
return string.Empty;
}
return string.Format("{0}?id_token_hint={1}&post_logout_redirect_uri={2}",
GlobalSetting.Instance.LogoutEndpoint,
token,
GlobalSetting.Instance.LogoutCallback);
}
}
}
| using IdentityModel.Client;
using System;
using System.Collections.Generic;
namespace eShopOnContainers.Core.Services.Identity
{
public class IdentityService : IIdentityService
{
public string CreateAuthorizationRequest()
{
// Create URI to authorization endpoint
var authorizeRequest = new AuthorizeRequest(GlobalSetting.Instance.IdentityEndpoint);
// Dictionary with values for the authorize request
var dic = new Dictionary<string, string>();
dic.Add("client_id", "xamarin");
dic.Add("client_secret", "secret");
dic.Add("response_type", "code id_token token");
dic.Add("scope", "openid profile basket orders offline_access");
dic.Add("redirect_uri", GlobalSetting.Instance.IdentityCallback);
dic.Add("nonce", Guid.NewGuid().ToString("N"));
// Add CSRF token to protect against cross-site request forgery attacks.
var currentCSRFToken = Guid.NewGuid().ToString("N");
dic.Add("state", currentCSRFToken);
var authorizeUri = authorizeRequest.Create(dic);
return authorizeUri;
}
public string CreateLogoutRequest(string token)
{
if(string.IsNullOrEmpty(token))
{
return string.Empty;
}
return string.Format("{0}?id_token_hint={1}&post_logout_redirect_uri={2}",
GlobalSetting.Instance.LogoutEndpoint,
token,
GlobalSetting.Instance.LogoutCallback);
}
}
}
| mit | C# |
d816cb2f57d51b0d8faf14bb215103ff52cb6ac3 | Move GC initialization into a static constructor | jonathanvdc/flame-llvm,jonathanvdc/flame-llvm,jonathanvdc/flame-llvm | runtime/GC.cs | runtime/GC.cs | using System.Runtime.InteropServices;
namespace __compiler_rt
{
/// <summary>
/// Garbage collection functionality that can be used by the compiler.
/// </summary>
public static unsafe class GC
{
/// <summary>
/// Initializes the garbage collector.
/// </summary>
static GC()
{
GC_init();
}
private static extern void* GC_malloc(ulong size);
private static extern void GC_init();
/// <summary>
/// Allocates a region of storage that is the given number of bytes in size.
/// The storage is zero-initialized.
/// </summary>
/// <param name="size">The number of bytes to allocate.</param>
public static void* Allocate(ulong size)
{
return GC_malloc(size);
}
}
}
| using System.Runtime.InteropServices;
namespace __compiler_rt
{
/// <summary>
/// Garbage collection functionality that can be used by the compiler.
/// </summary>
public static unsafe class GC
{
private static extern void* GC_malloc(ulong size);
private static extern void GC_init();
/// <summary>
/// Allocates a region of storage that is the given number of bytes in size.
/// The storage is zero-initialized.
/// </summary>
/// <param name="size">The number of bytes to allocate.</param>
public static void* Allocate(ulong size)
{
return GC_malloc(size);
}
/// <summary>
/// Initializes the garbage collector.
/// </summary>
public static void Initialize()
{
GC_init();
}
}
}
| mit | C# |
b410afa24226454d5342b34ccbf974cc19e7646e | Use var instead. | dlemstra/Magick.NET,dlemstra/Magick.NET | src/Magick.NET/Helpers/UTF8Marshaler.cs | src/Magick.NET/Helpers/UTF8Marshaler.cs | // Copyright Dirk Lemstra https://github.com/dlemstra/Magick.NET.
// Licensed under the Apache License, Version 2.0.
using System;
using System.Runtime.InteropServices;
using System.Text;
namespace ImageMagick
{
internal sealed class UTF8Marshaler : INativeInstance
{
private UTF8Marshaler(string? value)
{
Instance = ManagedToNative(value);
}
public IntPtr Instance { get; private set; }
public void Dispose()
{
if (Instance == IntPtr.Zero)
return;
Marshal.FreeHGlobal(Instance);
Instance = IntPtr.Zero;
}
internal static INativeInstance CreateInstance(string? value)
=> new UTF8Marshaler(value);
internal static IntPtr ManagedToNative(string? value)
{
if (value == null)
return IntPtr.Zero;
// not null terminated
var strbuf = Encoding.UTF8.GetBytes(value);
var buffer = Marshal.AllocHGlobal(strbuf.Length + 1);
Marshal.Copy(strbuf, 0, buffer, strbuf.Length);
// write the terminating null
#if !NETSTANDARD
Marshal.WriteByte(new IntPtr(buffer.ToInt64() + strbuf.Length), 0);
#else
Marshal.WriteByte(buffer + strbuf.Length, 0);
#endif
return buffer;
}
internal static string? NativeToManaged(IntPtr nativeData)
{
var strbuf = ByteConverter.ToArray(nativeData);
if (strbuf == null)
return null;
if (strbuf.Length == 0)
return string.Empty;
return Encoding.UTF8.GetString(strbuf, 0, strbuf.Length);
}
internal static string? NativeToManagedAndRelinquish(IntPtr nativeData)
{
var result = NativeToManaged(nativeData);
MagickMemory.Relinquish(nativeData);
return result;
}
}
}
| // Copyright Dirk Lemstra https://github.com/dlemstra/Magick.NET.
// Licensed under the Apache License, Version 2.0.
using System;
using System.Runtime.InteropServices;
using System.Text;
namespace ImageMagick
{
internal sealed class UTF8Marshaler : INativeInstance
{
private UTF8Marshaler(string? value)
{
Instance = ManagedToNative(value);
}
public IntPtr Instance { get; private set; }
public void Dispose()
{
if (Instance == IntPtr.Zero)
return;
Marshal.FreeHGlobal(Instance);
Instance = IntPtr.Zero;
}
internal static INativeInstance CreateInstance(string? value)
=> new UTF8Marshaler(value);
internal static IntPtr ManagedToNative(string? value)
{
if (value == null)
return IntPtr.Zero;
// not null terminated
byte[] strbuf = Encoding.UTF8.GetBytes(value);
IntPtr buffer = Marshal.AllocHGlobal(strbuf.Length + 1);
Marshal.Copy(strbuf, 0, buffer, strbuf.Length);
// write the terminating null
#if !NETSTANDARD
Marshal.WriteByte(new IntPtr(buffer.ToInt64() + strbuf.Length), 0);
#else
Marshal.WriteByte(buffer + strbuf.Length, 0);
#endif
return buffer;
}
internal static string? NativeToManaged(IntPtr nativeData)
{
var strbuf = ByteConverter.ToArray(nativeData);
if (strbuf == null)
return null;
if (strbuf.Length == 0)
return string.Empty;
return Encoding.UTF8.GetString(strbuf, 0, strbuf.Length);
}
internal static string? NativeToManagedAndRelinquish(IntPtr nativeData)
{
var result = NativeToManaged(nativeData);
MagickMemory.Relinquish(nativeData);
return result;
}
}
}
| apache-2.0 | C# |
bde6db44fb1c81b77b7aad13d061ec17a2fd67db | Clean up the BusClientFactory | pardahlman/RawRabbit,northspb/RawRabbit | src/RawRabbit.vNext/BusClientFactory.cs | src/RawRabbit.vNext/BusClientFactory.cs | using System;
using Microsoft.Framework.Configuration;
using Microsoft.Framework.DependencyInjection;
using RawRabbit.Configuration;
using RawRabbit.Logging;
namespace RawRabbit.vNext
{
public class BusClientFactory
{
public static BusClient CreateDefault(TimeSpan requestTimeout)
{
return CreateDefault(new RawRabbitConfiguration { RequestTimeout = requestTimeout });
}
public static BusClient CreateDefault(RawRabbitConfiguration config)
{
var addCfg = new Action<IServiceCollection>(s => s.AddSingleton(p => config));
var services = new ServiceCollection().AddRawRabbit(null, addCfg);
return CreateDefault(services);
}
public static BusClient CreateDefault(Action<IServiceCollection> custom = null)
{
var services = new ServiceCollection().AddRawRabbit(null, custom);
return CreateDefault(services);
}
public static BusClient CreateDefault(IConfigurationRoot config, Action<IServiceCollection> custom)
{
var services = new ServiceCollection().AddRawRabbit(config, custom);
return CreateDefault(services);
}
public static BusClient CreateDefault(IServiceCollection services)
{
var serviceProvider = services.BuildServiceProvider();
LogManager.CurrentFactory = serviceProvider.GetService<ILoggerFactory>();
return serviceProvider.GetService<BusClient>();
}
}
}
| using System;
using Microsoft.Framework.Configuration;
using Microsoft.Framework.DependencyInjection;
using RawRabbit.Common;
using RawRabbit.Configuration;
using RawRabbit.Context;
using RawRabbit.Logging;
using RawRabbit.Operations.Contracts;
namespace RawRabbit.vNext
{
public class BusClientFactory
{
public static BusClient CreateDefault(RawRabbitConfiguration config)
{
var addCfg = new Action<IServiceCollection>(s => s.AddSingleton<RawRabbitConfiguration>(p => config));
var provider = new ServiceCollection()
.AddRawRabbit(null, addCfg)
.BuildServiceProvider();
return CreateDefault((IServiceProvider) provider);
}
public static BusClient CreateDefault(Action<IServiceCollection> services = null)
{
var provider = new ServiceCollection()
.AddRawRabbit(null, services)
.BuildServiceProvider();
return CreateDefault((IServiceProvider) provider);
}
public static BusClient CreateDefault(IConfigurationRoot config, Action<IServiceCollection> services)
{
var provider = new ServiceCollection().AddRawRabbit(config, services)
.BuildServiceProvider();
return CreateDefault(provider);
}
public static BusClient CreateDefault(IServiceProvider serviceProvider)
{
LogManager.CurrentFactory = serviceProvider.GetService<ILoggerFactory>();
return new BusClient(
serviceProvider.GetService<IConfigurationEvaluator>(),
serviceProvider.GetService<ISubscriber<MessageContext>>(),
serviceProvider.GetService<IPublisher>(),
serviceProvider.GetService<IResponder<MessageContext>>(),
serviceProvider.GetService<IRequester>()
);
}
public static BusClient CreateDefault(TimeSpan requestTimeout)
{
return CreateDefault(new RawRabbitConfiguration { RequestTimeout = requestTimeout });
}
}
}
| mit | C# |
3ed3fcf315ab1ffc5040c8cb39a05548aa7cc731 | Update ai/navmesh agents to stop pursuing during content display state. | drawcode/game-lib-engine | Engine/Game/Actor/NavMeshAgentFollowController.cs | Engine/Game/Actor/NavMeshAgentFollowController.cs | using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Engine.Game.Actor {
public class NavMeshAgentFollowController : MonoBehaviour {
public NavMeshAgent agent;
public Transform targetFollow;
// Use this for initialization
private void Start() {
agent = GetComponent<NavMeshAgent>();
NavigateToDestination();
}
public void NavigateToDestination() {
if (agent != null) {
if (targetFollow != null) {
float distance = Vector3.Distance(agent.destination, targetFollow.position);
if (distance < 5) {
agent.Stop();
}
else {
agent.destination = targetFollow.position;
}
}
}
}
// Update is called once per frame
private void Update() {
if(!GameConfigs.isGameRunning) {
if (agent != null) {
agent.Stop();
}
return;
}
if (agent != null) {
if (agent.remainingDistance == 0 || agent.isPathStale) {
NavigateToDestination();
}
}
}
}
} | using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Engine.Game.Actor {
public class NavMeshAgentFollowController : MonoBehaviour {
public NavMeshAgent agent;
public Transform targetFollow;
// Use this for initialization
private void Start() {
agent = GetComponent<NavMeshAgent>();
NavigateToDestination();
}
public void NavigateToDestination() {
if (agent != null) {
if (targetFollow != null) {
float distance = Vector3.Distance(agent.destination, targetFollow.position);
if (distance < 5) {
agent.Stop();
}
else {
agent.destination = targetFollow.position;
}
}
}
}
// Update is called once per frame
private void Update() {
if (agent != null) {
if (agent.remainingDistance == 0 || agent.isPathStale) {
NavigateToDestination();
}
}
}
}
} | mit | C# |
924398e4bff5fa8f552f61fca1f9e5ce53567adf | add a mock class for tests that should not verify a link | jgraber/ForgetTheMilk,jgraber/ForgetTheMilk,jgraber/ForgetTheMilk | ForgetTheMilk/ConsoleVerification/TaskLinkTest.cs | ForgetTheMilk/ConsoleVerification/TaskLinkTest.cs | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ForgetTheMilk.Controllers;
using NUnit.Framework;
namespace ConsoleVerification
{
public class TaskLinkTest : AssertionHelper
{
class IgnoreLinkValidator : ILinkValidator
{
public void Validate(string link)
{
}
}
[Test]
public void CreateTask_DescriptionWithALink_SetLink()
{
var input = "test http://www.google.com";
var task = new Task(input, default(DateTime), new IgnoreLinkValidator());
Expect(task.Link, Is.EqualTo("http://www.google.com"));
}
[Test]
public void Validate_InvalidUrl_ThrowsException()
{
var input = "http://www.doesnotexistdotcom.com";
Expect(() => new Task(input, default(DateTime), new LinkValidator()),
Throws.Exception.With.Message.EqualTo("Invalid link " + input));
}
}
}
| using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ForgetTheMilk.Controllers;
using NUnit.Framework;
namespace ConsoleVerification
{
public class TaskLinkTest : AssertionHelper
{
[Test]
public void CreateTask_DescriptionWithALink_SetLink()
{
var input = "test http://www.google.com";
var task = new Task(input, default(DateTime));
Expect(task.Link, Is.EqualTo("http://www.google.com"));
}
[Test]
public void Validate_InvalidUrl_ThrowsException()
{
var input = "http://www.doesnotexistdotcom.com";
Expect(() => new Task(input, default(DateTime), new LinkValidator()),
Throws.Exception.With.Message.EqualTo("Invalid link " + input));
}
}
}
| apache-2.0 | C# |
9ddc43f0cfdd40bc833c625f1f9da0f864152bef | Fix unit test | SkillsFundingAgency/das-commitments,SkillsFundingAgency/das-commitments,SkillsFundingAgency/das-commitments | src/CommitmentsV2/SFA.DAS.CommitmentsV2.UnitTests/Application/Queries/GetNewerTrainingProgrammeVersions/GetNewerTrainingProgrammeVersionsTests.cs | src/CommitmentsV2/SFA.DAS.CommitmentsV2.UnitTests/Application/Queries/GetNewerTrainingProgrammeVersions/GetNewerTrainingProgrammeVersionsTests.cs | using AutoFixture;
using FluentAssertions;
using Microsoft.Extensions.Logging;
using Moq;
using NUnit.Framework;
using SFA.DAS.CommitmentsV2.Application.Queries.GetNewerTrainingProgrammeVersions;
using SFA.DAS.CommitmentsV2.Domain.Entities;
using SFA.DAS.CommitmentsV2.Domain.Interfaces;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace SFA.DAS.CommitmentsV2.UnitTests.Application.Queries.GetNewerTrainingProgrammeVersions
{
public class GetNewerTrainingProgrammeVersionsTests
{
private GetNewerTrainingProgrammeVersionsQuery _query;
private GetNewerTrainingProgrammeVersionsQueryHandler _handler;
private IEnumerable<TrainingProgramme> _newVersions;
private Mock<ITrainingProgrammeLookup> _mockTrainingProgrammeService;
[SetUp]
public void Arrange()
{
var fixture = new Fixture();
_query = fixture.Create<GetNewerTrainingProgrammeVersionsQuery>();
_newVersions = fixture.CreateMany<TrainingProgramme>();
_mockTrainingProgrammeService = new Mock<ITrainingProgrammeLookup>();
_handler = new GetNewerTrainingProgrammeVersionsQueryHandler(_mockTrainingProgrammeService.Object, Mock.Of<ILogger<GetNewerTrainingProgrammeVersionsQueryHandler>>());
}
[Test]
public async Task Then_ReturnTrainingProgrammeVersions()
{
_mockTrainingProgrammeService.Setup(x => x.GetNewerTrainingProgrammeVersions(_query.StandardUId))
.ReturnsAsync(_newVersions);
var result = await _handler.Handle(_query, CancellationToken.None);
result.NewerVersions.Should().BeEquivalentTo(_newVersions);
}
[Test]
public async Task And_LookupServiceThrowsException_Then_ReturnEmptyResponse()
{
_mockTrainingProgrammeService.Setup(x => x.GetNewerTrainingProgrammeVersions(_query.StandardUId))
.Throws(new Exception());
var result = await _handler.Handle(_query, CancellationToken.None);
result.NewerVersions.Should().BeNull();
}
}
}
| using AutoFixture;
using FluentAssertions;
using Microsoft.Extensions.Logging;
using Moq;
using NUnit.Framework;
using SFA.DAS.CommitmentsV2.Application.Queries.GetNewerTrainingProgrammeVersions;
using SFA.DAS.CommitmentsV2.Domain.Entities;
using SFA.DAS.CommitmentsV2.Domain.Interfaces;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace SFA.DAS.CommitmentsV2.UnitTests.Application.Queries.GetNewerTrainingProgrammeVersions
{
public class GetNewerTrainingProgrammeVersionsTests
{
private GetNewerTrainingProgrammeVersionsQuery _query;
private GetNewerTrainingProgrammeVersionsQueryHandler _handler;
private IEnumerable<TrainingProgramme> _newVersions;
private Mock<ITrainingProgrammeLookup> _mockTrainingProgrammeService;
[SetUp]
public void Arrange()
{
var fixture = new Fixture();
_query = fixture.Create<GetNewerTrainingProgrammeVersionsQuery>();
_newVersions = fixture.CreateMany<TrainingProgramme>();
_mockTrainingProgrammeService = new Mock<ITrainingProgrammeLookup>();
_handler = new GetNewerTrainingProgrammeVersionsQueryHandler(_mockTrainingProgrammeService.Object, Mock.Of<ILogger<GetNewerTrainingProgrammeVersionsQueryHandler>>());
}
[Test]
public async Task Then_ReturnTrainingProgrammeVersions()
{
_mockTrainingProgrammeService.Setup(x => x.GetTrainingProgrammeVersions(_query.StandardUId))
.ReturnsAsync(_newVersions);
var result = await _handler.Handle(_query, CancellationToken.None);
result.NewerVersions.Should().BeEquivalentTo(_newVersions);
}
[Test]
public async Task And_LookupServiceThrowsException_Then_ReturnEmptyResponse()
{
_mockTrainingProgrammeService.Setup(x => x.GetTrainingProgrammeVersions(_query.StandardUId))
.Throws(new Exception());
var result = await _handler.Handle(_query, CancellationToken.None);
result.NewerVersions.Should().BeNull();
}
}
}
| mit | C# |
e26f2fbb4336e06f91b5dd8b9155b16713773cd7 | Remove unnecessary named param. | eriawan/roslyn,mavasani/roslyn,KevinRansom/roslyn,bartdesmet/roslyn,VSadov/roslyn,stephentoub/roslyn,KevinRansom/roslyn,AmadeusW/roslyn,KirillOsenkov/roslyn,jamesqo/roslyn,cston/roslyn,eriawan/roslyn,OmarTawfik/roslyn,brettfo/roslyn,xasx/roslyn,aelij/roslyn,paulvanbrenk/roslyn,shyamnamboodiripad/roslyn,abock/roslyn,stephentoub/roslyn,sharwell/roslyn,tannergooding/roslyn,aelij/roslyn,sharwell/roslyn,physhi/roslyn,mgoertz-msft/roslyn,gafter/roslyn,bartdesmet/roslyn,diryboy/roslyn,swaroop-sridhar/roslyn,brettfo/roslyn,OmarTawfik/roslyn,diryboy/roslyn,tmeschter/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,dpoeschl/roslyn,genlu/roslyn,dpoeschl/roslyn,mavasani/roslyn,dotnet/roslyn,jmarolf/roslyn,heejaechang/roslyn,reaction1989/roslyn,jasonmalinowski/roslyn,bartdesmet/roslyn,tmat/roslyn,jasonmalinowski/roslyn,mgoertz-msft/roslyn,brettfo/roslyn,jasonmalinowski/roslyn,bkoelman/roslyn,stephentoub/roslyn,wvdd007/roslyn,AlekseyTs/roslyn,diryboy/roslyn,swaroop-sridhar/roslyn,paulvanbrenk/roslyn,CyrusNajmabadi/roslyn,tmat/roslyn,dpoeschl/roslyn,gafter/roslyn,eriawan/roslyn,tmat/roslyn,abock/roslyn,MichalStrehovsky/roslyn,dotnet/roslyn,KirillOsenkov/roslyn,nguerrera/roslyn,tannergooding/roslyn,physhi/roslyn,panopticoncentral/roslyn,agocke/roslyn,xasx/roslyn,sharwell/roslyn,weltkante/roslyn,shyamnamboodiripad/roslyn,jamesqo/roslyn,tmeschter/roslyn,KirillOsenkov/roslyn,ErikSchierboom/roslyn,nguerrera/roslyn,paulvanbrenk/roslyn,cston/roslyn,agocke/roslyn,jamesqo/roslyn,cston/roslyn,VSadov/roslyn,agocke/roslyn,davkean/roslyn,DustinCampbell/roslyn,reaction1989/roslyn,bkoelman/roslyn,AlekseyTs/roslyn,jcouv/roslyn,AmadeusW/roslyn,CyrusNajmabadi/roslyn,bkoelman/roslyn,weltkante/roslyn,heejaechang/roslyn,nguerrera/roslyn,mgoertz-msft/roslyn,MichalStrehovsky/roslyn,tannergooding/roslyn,OmarTawfik/roslyn,gafter/roslyn,AmadeusW/roslyn,jcouv/roslyn,DustinCampbell/roslyn,reaction1989/roslyn,panopticoncentral/roslyn,shyamnamboodiripad/roslyn,wvdd007/roslyn,weltkante/roslyn,davkean/roslyn,jcouv/roslyn,abock/roslyn,AlekseyTs/roslyn,genlu/roslyn,xasx/roslyn,panopticoncentral/roslyn,VSadov/roslyn,genlu/roslyn,davkean/roslyn,CyrusNajmabadi/roslyn,heejaechang/roslyn,ErikSchierboom/roslyn,tmeschter/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,KevinRansom/roslyn,jmarolf/roslyn,aelij/roslyn,MichalStrehovsky/roslyn,physhi/roslyn,mavasani/roslyn,dotnet/roslyn,wvdd007/roslyn,swaroop-sridhar/roslyn,ErikSchierboom/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,jmarolf/roslyn,DustinCampbell/roslyn | src/Features/Core/Portable/RemoveUnnecessaryParentheses/AbstractRemoveUnnecessaryParenthesesCodeFixProvider.cs | src/Features/Core/Portable/RemoveUnnecessaryParentheses/AbstractRemoveUnnecessaryParenthesesCodeFixProvider.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;
using System.Collections.Immutable;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CodeActions;
using Microsoft.CodeAnalysis.CodeFixes;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.Editing;
using Microsoft.CodeAnalysis.LanguageServices;
using Microsoft.CodeAnalysis.Shared.Extensions;
using Roslyn.Utilities;
namespace Microsoft.CodeAnalysis.RemoveUnnecessaryParentheses
{
internal abstract class AbstractRemoveUnnecessaryParenthesesCodeFixProvider<TParenthesizedExpressionSyntax>
: SyntaxEditorBasedCodeFixProvider
where TParenthesizedExpressionSyntax : SyntaxNode
{
public override ImmutableArray<string> FixableDiagnosticIds
=> ImmutableArray.Create(IDEDiagnosticIds.RemoveUnnecessaryParenthesesDiagnosticId);
protected abstract bool CanRemoveParentheses(TParenthesizedExpressionSyntax current, SemanticModel semanticModel);
public override Task RegisterCodeFixesAsync(CodeFixContext context)
{
context.RegisterCodeFix(
new MyCodeAction(
c => FixAsync(context.Document, context.Diagnostics[0], c)),
context.Diagnostics);
return SpecializedTasks.EmptyTask;
}
protected override async Task FixAllAsync(
Document document, ImmutableArray<Diagnostic> diagnostics,
SyntaxEditor editor, CancellationToken cancellationToken)
{
var syntaxFacts = document.GetLanguageService<ISyntaxFactsService>();
var originalNodes = diagnostics.SelectAsArray(
d => (TParenthesizedExpressionSyntax)d.AdditionalLocations[0].FindNode(
findInsideTrivia: true, getInnermostNodeForTie: true, cancellationToken));
await editor.ApplyExpressionLevelSemanticEditsAsync(
document, originalNodes,
(semanticModel, current) => current != null && CanRemoveParentheses(current, semanticModel),
(_, currentRoot, current) => currentRoot.ReplaceNode(current, syntaxFacts.Unparenthesize(current)),
cancellationToken).ConfigureAwait(false);
}
private class MyCodeAction : CodeAction.DocumentChangeAction
{
public MyCodeAction(Func<CancellationToken, Task<Document>> createChangedDocument)
: base(FeaturesResources.Remove_unnecessary_parentheses, createChangedDocument, FeaturesResources.Remove_unnecessary_parentheses)
{
}
}
}
}
| // 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;
using System.Collections.Immutable;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CodeActions;
using Microsoft.CodeAnalysis.CodeFixes;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.Editing;
using Microsoft.CodeAnalysis.LanguageServices;
using Microsoft.CodeAnalysis.Shared.Extensions;
using Roslyn.Utilities;
namespace Microsoft.CodeAnalysis.RemoveUnnecessaryParentheses
{
internal abstract class AbstractRemoveUnnecessaryParenthesesCodeFixProvider<TParenthesizedExpressionSyntax>
: SyntaxEditorBasedCodeFixProvider
where TParenthesizedExpressionSyntax : SyntaxNode
{
public override ImmutableArray<string> FixableDiagnosticIds
=> ImmutableArray.Create(IDEDiagnosticIds.RemoveUnnecessaryParenthesesDiagnosticId);
protected abstract bool CanRemoveParentheses(TParenthesizedExpressionSyntax current, SemanticModel semanticModel);
public override Task RegisterCodeFixesAsync(CodeFixContext context)
{
context.RegisterCodeFix(
new MyCodeAction(
c => FixAsync(context.Document, context.Diagnostics[0], c)),
context.Diagnostics);
return SpecializedTasks.EmptyTask;
}
protected override async Task FixAllAsync(
Document document, ImmutableArray<Diagnostic> diagnostics,
SyntaxEditor editor, CancellationToken cancellationToken)
{
var syntaxFacts = document.GetLanguageService<ISyntaxFactsService>();
var originalNodes = diagnostics.SelectAsArray(
d => (TParenthesizedExpressionSyntax)d.AdditionalLocations[0].FindNode(findInsideTrivia: true, getInnermostNodeForTie: true, cancellationToken: cancellationToken));
await editor.ApplyExpressionLevelSemanticEditsAsync(
document, originalNodes,
(semanticModel, current) => current != null && CanRemoveParentheses(current, semanticModel),
(_, currentRoot, current) => currentRoot.ReplaceNode(current, syntaxFacts.Unparenthesize(current)),
cancellationToken).ConfigureAwait(false);
}
private class MyCodeAction : CodeAction.DocumentChangeAction
{
public MyCodeAction(Func<CancellationToken, Task<Document>> createChangedDocument)
: base(FeaturesResources.Remove_unnecessary_parentheses, createChangedDocument, FeaturesResources.Remove_unnecessary_parentheses)
{
}
}
}
}
| mit | C# |
64c140c7f49dc7e88d220e9546a3181537de1d1e | fix Properties in PredicateSegment. | sdcb/ibatis2sdmap | ibatis2sdmap/src/ibatis2sdmap/SqlSegments/PredicateSegment.cs | ibatis2sdmap/src/ibatis2sdmap/SqlSegments/PredicateSegment.cs | using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Xml.Linq;
namespace ibatis2sdmap.SqlSegments
{
public class PredicateSegment : SqlSegment
{
public string MacroName { get; }
public string Property { get; }
public string[] Properties { get; }
public string Prepend { get; }
public IEnumerable<SqlSegment> Segments { get; }
public PredicateSegment(XElement xe, string macroName)
{
Property = xe.Attribute("property")?.Value;
Properties = xe.Attribute("properties")?.Value.Split(',');
if (Property == null && Properties == null)
throw new ArgumentException(nameof(xe));
Prepend = xe.Attribute("prepend")?.Value ?? "";
Segments = xe.Nodes().Select(Create);
MacroName = macroName;
}
public override string Emit()
{
if (Property != null)
{
return
$"#{MacroName}<{Property}, sql{{" +
$"{Prepend} {string.Concat(Segments.Select(x => x.Emit()))}" +
$"}}>";
}
else
{
return string.Join("\r\n", Properties.Select(prop =>
{
return
$"#{MacroName}<{prop}, sql{{" +
$"{Prepend} {string.Concat(Segments.Select(x => x.Emit()))}" +
$"}}>";
}));
}
}
}
}
| using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Xml.Linq;
namespace ibatis2sdmap.SqlSegments
{
public class PredicateSegment : SqlSegment
{
public string MacroName { get; }
public string Property { get; }
public string Properties { get; }
public string Prepend { get; }
public IEnumerable<SqlSegment> Segments { get; }
public PredicateSegment(XElement xe, string macroName)
{
Property = xe.Attribute("property")?.Value;
Properties = xe.Attribute("properties")?.Value;
if (Property == null && Properties == null)
throw new ArgumentException(nameof(xe));
Prepend = xe.Attribute("prepend")?.Value ?? "";
Segments = xe.Nodes().Select(Create);
MacroName = macroName;
}
public override string Emit()
{
return
$"#{MacroName}<{Property ?? Properties}, sql{{" +
$"{Prepend} {string.Concat(Segments.Select(x => x.Emit()))}" +
$"}}>";
}
}
}
| mit | C# |
33735b15aec08a86b6c9089a6c1fb4d1ee275021 | Update osu!direct beatmap sections sorting | ppy/osu,smoogipoo/osu,DrabWeb/osu,johnneijzen/osu,smoogipooo/osu,ppy/osu,UselessToucan/osu,peppy/osu,peppy/osu-new,2yangk23/osu,peppy/osu,NeoAdonis/osu,ZLima12/osu,NeoAdonis/osu,johnneijzen/osu,peppy/osu,NeoAdonis/osu,2yangk23/osu,ppy/osu,ZLima12/osu,smoogipoo/osu,EVAST9919/osu,DrabWeb/osu,EVAST9919/osu,DrabWeb/osu,smoogipoo/osu,UselessToucan/osu,UselessToucan/osu | osu.Game/Online/API/Requests/SearchBeatmapSetsRequest.cs | osu.Game/Online/API/Requests/SearchBeatmapSetsRequest.cs | // Copyright (c) 2007-2018 ppy Pty Ltd <[email protected]>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.ComponentModel;
using osu.Game.Overlays;
using osu.Game.Overlays.Direct;
using osu.Game.Rulesets;
namespace osu.Game.Online.API.Requests
{
public class SearchBeatmapSetsRequest : APIRequest<SearchBeatmapSetsResponse>
{
private readonly string query;
private readonly RulesetInfo ruleset;
private readonly BeatmapSearchCategory searchCategory;
private readonly DirectSortCriteria sortCriteria;
private readonly SortDirection direction;
private string directionString => direction == SortDirection.Descending ? @"desc" : @"asc";
public SearchBeatmapSetsRequest(string query, RulesetInfo ruleset, BeatmapSearchCategory searchCategory = BeatmapSearchCategory.Any, DirectSortCriteria sortCriteria = DirectSortCriteria.Ranked, SortDirection direction = SortDirection.Descending)
{
this.query = System.Uri.EscapeDataString(query);
this.ruleset = ruleset;
this.searchCategory = searchCategory;
this.sortCriteria = sortCriteria;
this.direction = direction;
}
// ReSharper disable once ImpureMethodCallOnReadonlyValueField
protected override string Target => $@"beatmapsets/search?q={query}&m={ruleset.ID ?? 0}&s={(int)searchCategory}&sort={sortCriteria.ToString().ToLowerInvariant()}_{directionString}";
}
public enum BeatmapSearchCategory
{
Any = 7,
[Description("Ranked & Approved")]
RankedApproved = 0,
Qualified = 3,
Loved = 8,
Favourites = 2,
[Description("Pending & WIP")]
PendingWIP = 4,
Graveyard = 5,
[Description("My Maps")]
MyMaps = 6,
}
}
| // Copyright (c) 2007-2018 ppy Pty Ltd <[email protected]>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.ComponentModel;
using osu.Game.Overlays;
using osu.Game.Overlays.Direct;
using osu.Game.Rulesets;
namespace osu.Game.Online.API.Requests
{
public class SearchBeatmapSetsRequest : APIRequest<SearchBeatmapSetsResponse>
{
private readonly string query;
private readonly RulesetInfo ruleset;
private readonly BeatmapSearchCategory searchCategory;
private readonly DirectSortCriteria sortCriteria;
private readonly SortDirection direction;
private string directionString => direction == SortDirection.Descending ? @"desc" : @"asc";
public SearchBeatmapSetsRequest(string query, RulesetInfo ruleset, BeatmapSearchCategory searchCategory = BeatmapSearchCategory.Any, DirectSortCriteria sortCriteria = DirectSortCriteria.Ranked, SortDirection direction = SortDirection.Descending)
{
this.query = System.Uri.EscapeDataString(query);
this.ruleset = ruleset;
this.searchCategory = searchCategory;
this.sortCriteria = sortCriteria;
this.direction = direction;
}
// ReSharper disable once ImpureMethodCallOnReadonlyValueField
protected override string Target => $@"beatmapsets/search?q={query}&m={ruleset.ID ?? 0}&s={(int)searchCategory}&sort={sortCriteria.ToString().ToLowerInvariant()}_{directionString}";
}
public enum BeatmapSearchCategory
{
Any = 7,
[Description("Ranked & Approved")]
RankedApproved = 0,
Approved = 1,
Loved = 8,
Favourites = 2,
Qualified = 3,
Pending = 4,
Graveyard = 5,
[Description("My Maps")]
MyMaps = 6,
}
}
| mit | C# |
d17d9cecbd20eac22a4dc2187483bb329efea3ed | Increase usable radius, allow configurability | duaiwe/ld36 | src/Assets/GameObjects/UsableObjComponent/UsableObjectCS.cs | src/Assets/GameObjects/UsableObjComponent/UsableObjectCS.cs | using UnityEngine;
using System.Collections;
/**
* Using this component:
*
* 1. Implement the UsableObject interface (Assets/CommonScripts/UsableObject) on a script component of your game object.
* 2. Add the UsableObjectTpl Prefab as a child of your game object.
* 3. Adjust Position of Transform, Radius/Offset of Circile Collider, and Radius of Emission Shape as needed.
*/
[RequireComponent(typeof(BoxCollider2D))]
public class UsableObjectCS : MonoBehaviour
{
public GameObject target;
public float usableRadiusPercent = 1.25f;
private ParticleSystem particles;
void Start ()
{
particles = GetComponent<ParticleSystem> ();
Bounds spriteBounds = GetComponentInParent<SpriteRenderer> ().bounds;
ParticleSystem.ShapeModule shape = particles.shape;
shape.radius = spriteBounds.extents.x * 0.8f;
Vector2 colliderSize = spriteBounds.size;
colliderSize.x *= usableRadiusPercent;
GetComponent<BoxCollider2D> ().size = colliderSize;
}
public void OnTriggerEnter2D (Collider2D other)
{
if (null != particles) {
particles.Play ();
}
if (!UISystem.Instance.CutSceneDisplaying ()) {
if (null != other.GetComponents<PlayerController> ()) {
target.SendMessage ("Nearby", other.gameObject);
}
}
}
public void OnTriggerExit2D (Collider2D other)
{
if (null != particles) {
particles.Stop ();
}
}
public void StopUsing(GameObject user) {
target.SendMessage ("UseEnd", user);
}
public void StartUsing (GameObject user)
{
if (!UISystem.Instance.CutSceneDisplaying ()) {
target.SendMessage ("UseStart", user);
}
}
}
| using UnityEngine;
using System.Collections;
/**
* Using this component:
*
* 1. Implement the UsableObject interface (Assets/CommonScripts/UsableObject) on a script component of your game object.
* 2. Add the UsableObjectTpl Prefab as a child of your game object.
* 3. Adjust Position of Transform, Radius/Offset of Circile Collider, and Radius of Emission Shape as needed.
*/
public class UsableObjectCS : MonoBehaviour
{
public GameObject target;
private ParticleSystem particles;
void Start ()
{
particles = GetComponent<ParticleSystem> ();
Bounds spriteBounds = GetComponentInParent<SpriteRenderer> ().bounds;
ParticleSystem.ShapeModule shape = particles.shape;
shape.radius = spriteBounds.extents.x * 0.8f;
GetComponent<BoxCollider2D> ().size = spriteBounds.size;
GetComponent<BoxCollider2D> ().offset = new Vector2 (spriteBounds.extents.x, 0);
}
public void OnTriggerEnter2D (Collider2D other)
{
if (null != particles) {
particles.Play ();
}
if (!UISystem.Instance.CutSceneDisplaying ()) {
if (null != other.GetComponents<PlayerController> ()) {
target.SendMessage ("Nearby", other.gameObject);
}
}
}
public void OnTriggerExit2D (Collider2D other)
{
if (null != particles) {
particles.Stop ();
}
}
public void StopUsing(GameObject user) {
target.SendMessage ("UseEnd", user);
}
public void StartUsing (GameObject user)
{
if (!UISystem.Instance.CutSceneDisplaying ()) {
target.SendMessage ("UseStart", user);
}
}
}
| mit | C# |
b2a09def08121d507ecf34d9397783637cdca47a | Add the Key field to VoucherifyClientException | voucherifyio/voucherify-dotNET-sdk,voucherifyio/voucherify-dotNET-sdk | src/Voucherify/Core/Exceptions/VoucherifyClientException.cs | src/Voucherify/Core/Exceptions/VoucherifyClientException.cs | using Newtonsoft.Json;
using System;
namespace Voucherify.Core.Exceptions
{
[JsonObject]
public class VoucherifyClientException : Exception
{
[JsonIgnore]
private Exception internalException;
[JsonProperty(PropertyName = "message")]
public new string Message { get; private set; }
[JsonProperty(PropertyName = "code")]
public int Code { get; private set; }
[JsonProperty(PropertyName = "details")]
public string Details { get; private set; }
[JsonProperty(PropertyName = "key")]
public string Key { get; private set; }
public VoucherifyClientException() { }
public VoucherifyClientException(string message, int code, string details)
{
this.Message = message;
this.Code = code;
this.Details = details;
}
public VoucherifyClientException(Exception internalException)
{
this.internalException = internalException;
}
public override string ToString()
{
if (internalException != null)
{
return string.Format("VoucherifyError[inner='{0}']", internalException);
}
return string.Format("VoucherifyError[code={0}, message='{1}', details='{2}']", this.Code, this.Message, this.Details);
}
}
}
| using Newtonsoft.Json;
using System;
namespace Voucherify.Core.Exceptions
{
[JsonObject]
public class VoucherifyClientException : Exception
{
[JsonIgnore]
private Exception internalException;
[JsonProperty(PropertyName = "message")]
public new string Message { get; private set; }
[JsonProperty(PropertyName = "code")]
public int Code { get; private set; }
[JsonProperty(PropertyName = "details")]
public string Details { get; private set; }
public VoucherifyClientException() { }
public VoucherifyClientException(string message, int code, string details)
{
this.Message = message;
this.Code = code;
this.Details = details;
}
public VoucherifyClientException(Exception internalException)
{
this.internalException = internalException;
}
public override string ToString()
{
if (internalException != null)
{
return string.Format("VoucherifyError[inner='{0}']", internalException);
}
return string.Format("VoucherifyError[code={0}, message='{1}', details='{2}']", this.Code, this.Message, this.Details);
}
}
}
| mit | C# |
1c6aef4418da3d441e3ae2e4e8a3e631450fff91 | fix ConsumerCacheService bug | phatboyg/MassTransit,MassTransit/MassTransit,MassTransit/MassTransit,phatboyg/MassTransit | src/Containers/MassTransit.ExtensionsDependencyInjectionIntegration/ConsumerCacheService.cs | src/Containers/MassTransit.ExtensionsDependencyInjectionIntegration/ConsumerCacheService.cs | // Copyright 2007-2017 Chris Patterson, Dru Sellers, Travis Smith, et. al.
//
// 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 MassTransit.ExtensionsDependencyInjectionIntegration
{
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public class ConsumerCacheService :
IConsumerCacheService
{
readonly ConcurrentDictionary<Type, ICachedConfigurator> _configurators = new ConcurrentDictionary<Type, ICachedConfigurator>();
public void Add<T>()
where T : class, IConsumer
{
_configurators.GetOrAdd(typeof(T), _ => new ConsumerCachedConfigurator<T>());
}
public IEnumerable<ICachedConfigurator> GetConfigurators()
{
return _configurators.Values.ToList();
}
public void Add(Type consumerType)
{
_configurators.GetOrAdd(consumerType, _ => (ICachedConfigurator)Activator.CreateInstance(typeof(ConsumerCachedConfigurator<>).MakeGenericType(consumerType)));
}
}
} | // Copyright 2007-2017 Chris Patterson, Dru Sellers, Travis Smith, et. al.
//
// 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 MassTransit.ExtensionsDependencyInjectionIntegration
{
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public class ConsumerCacheService :
IConsumerCacheService
{
readonly ConcurrentDictionary<Type, ICachedConfigurator> _configurators = new ConcurrentDictionary<Type, ICachedConfigurator>();
public void Add<T>()
where T : class, IConsumer
{
_configurators.GetOrAdd(typeof(T), _ => new ConsumerCachedConfigurator<T>());
}
public IEnumerable<ICachedConfigurator> GetConfigurators()
{
return _configurators.Values.ToList();
}
public void Add(Type consumerType)
{
_configurators.GetOrAdd(consumerType, _ => (ICachedConfigurator)Activator.CreateInstance(typeof(ICachedConfigurator).MakeGenericType(consumerType)));
}
}
} | apache-2.0 | C# |
359346c7e8221d3f085c9b32fad8592933c95ecb | Add new Gateway Sku | olydis/azure-sdk-for-net,Yahnoosh/azure-sdk-for-net,btasdoven/azure-sdk-for-net,samtoubia/azure-sdk-for-net,Yahnoosh/azure-sdk-for-net,hyonholee/azure-sdk-for-net,SiddharthChatrolaMs/azure-sdk-for-net,ScottHolden/azure-sdk-for-net,pankajsn/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,begoldsm/azure-sdk-for-net,nathannfan/azure-sdk-for-net,jhendrixMSFT/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,stankovski/azure-sdk-for-net,jamestao/azure-sdk-for-net,djyou/azure-sdk-for-net,djyou/azure-sdk-for-net,jamestao/azure-sdk-for-net,yugangw-msft/azure-sdk-for-net,samtoubia/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,peshen/azure-sdk-for-net,btasdoven/azure-sdk-for-net,jhendrixMSFT/azure-sdk-for-net,pilor/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,smithab/azure-sdk-for-net,DheerendraRathor/azure-sdk-for-net,peshen/azure-sdk-for-net,atpham256/azure-sdk-for-net,MichaelCommo/azure-sdk-for-net,hyonholee/azure-sdk-for-net,JasonYang-MSFT/azure-sdk-for-net,yaakoviyun/azure-sdk-for-net,MichaelCommo/azure-sdk-for-net,mihymel/azure-sdk-for-net,yugangw-msft/azure-sdk-for-net,SiddharthChatrolaMs/azure-sdk-for-net,MichaelCommo/azure-sdk-for-net,shahabhijeet/azure-sdk-for-net,atpham256/azure-sdk-for-net,jamestao/azure-sdk-for-net,JasonYang-MSFT/azure-sdk-for-net,ScottHolden/azure-sdk-for-net,r22016/azure-sdk-for-net,peshen/azure-sdk-for-net,markcowl/azure-sdk-for-net,samtoubia/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,stankovski/azure-sdk-for-net,samtoubia/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,r22016/azure-sdk-for-net,nathannfan/azure-sdk-for-net,djyou/azure-sdk-for-net,pankajsn/azure-sdk-for-net,shahabhijeet/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,ahosnyms/azure-sdk-for-net,shahabhijeet/azure-sdk-for-net,DheerendraRathor/azure-sdk-for-net,SiddharthChatrolaMs/azure-sdk-for-net,pilor/azure-sdk-for-net,smithab/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,ahosnyms/azure-sdk-for-net,shahabhijeet/azure-sdk-for-net,Yahnoosh/azure-sdk-for-net,hyonholee/azure-sdk-for-net,mihymel/azure-sdk-for-net,shutchings/azure-sdk-for-net,atpham256/azure-sdk-for-net,AzureAutomationTeam/azure-sdk-for-net,AzureAutomationTeam/azure-sdk-for-net,begoldsm/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,AzCiS/azure-sdk-for-net,begoldsm/azure-sdk-for-net,shutchings/azure-sdk-for-net,olydis/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,jamestao/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,smithab/azure-sdk-for-net,AzureAutomationTeam/azure-sdk-for-net,mihymel/azure-sdk-for-net,yugangw-msft/azure-sdk-for-net,pankajsn/azure-sdk-for-net,ahosnyms/azure-sdk-for-net,btasdoven/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,nathannfan/azure-sdk-for-net,pilor/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,hyonholee/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,yaakoviyun/azure-sdk-for-net,AzCiS/azure-sdk-for-net,r22016/azure-sdk-for-net,shutchings/azure-sdk-for-net,jhendrixMSFT/azure-sdk-for-net,ScottHolden/azure-sdk-for-net,AzCiS/azure-sdk-for-net,DheerendraRathor/azure-sdk-for-net,olydis/azure-sdk-for-net,hyonholee/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,yaakoviyun/azure-sdk-for-net,JasonYang-MSFT/azure-sdk-for-net | src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewaySkuTier.cs | src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewaySkuTier.cs | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
namespace Microsoft.Azure.Management.Network.Models
{
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.Runtime.Serialization;
/// <summary>
/// Defines values for VirtualNetworkGatewaySkuTier.
/// </summary>
public static class VirtualNetworkGatewaySkuTier
{
public const string Basic = "Basic";
public const string HighPerformance = "HighPerformance";
public const string Standard = "Standard";
public const string UltraPerformance = "UltraPerformance";
}
}
| // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
namespace Microsoft.Azure.Management.Network.Models
{
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.Runtime.Serialization;
/// <summary>
/// Defines values for VirtualNetworkGatewaySkuTier.
/// </summary>
public static class VirtualNetworkGatewaySkuTier
{
public const string Basic = "Basic";
public const string HighPerformance = "HighPerformance";
public const string Standard = "Standard";
}
}
| mit | C# |
44ed399fa6126c61e82ab5cba0e64fdd76ee771d | Put RedMageJobData beside the method that returns it | quisquous/cactbot,sqt/cactbot,sqt/cactbot,quisquous/cactbot,quisquous/cactbot,sqt/cactbot,quisquous/cactbot,sqt/cactbot,sqt/cactbot,quisquous/cactbot,quisquous/cactbot | CactbotOverlay/FFXIVProcess.cs | CactbotOverlay/FFXIVProcess.cs | using System;
using System.Diagnostics;
using System.Linq;
using Tamagawa.EnmityPlugin;
namespace Cactbot {
// Exposes the FFXIV game directly. Call FindProcess() regularly to update
// memory addresses when FFXIV is run or closed.
public class FFXIVProcess {
private Process process_ = null;
private FFXIVMemory enmity_memory_;
// A static variable address for red mage mana. White mana is the first
// byte, and Black mana the second.
private static long kRedMageManaAddr = 0x7FF6D382ADB0;
public bool FindProcess(Tamagawa.EnmityPlugin.Logger logger) {
// Only support the DirectX 11 binary. The DirectX 9 one has different addresses.
Process found_process = (from x in Process.GetProcessesByName("ffxiv_dx11")
where !x.HasExited && x.MainModule != null && x.MainModule.ModuleName == "ffxiv_dx11.exe"
select x).FirstOrDefault<Process>();
if (found_process != null && found_process.HasExited)
found_process = null;
bool changed_existance = (process_ == null) != (found_process == null);
bool changed_pid = process_ != null && found_process != null && process_.Id != found_process.Id;
if (changed_existance || changed_pid) {
if (enmity_memory_ != null) {
enmity_memory_.Dispose();
enmity_memory_ = null;
}
process_ = found_process;
enmity_memory_ = new FFXIVMemory(logger, process_);
if (!enmity_memory_.validateProcess()) {
enmity_memory_.Dispose();
enmity_memory_ = null;
}
}
return enmity_memory_ != null;
}
public Combatant GetSelfCombatant() {
if (enmity_memory_ == null)
return null;
return enmity_memory_.GetSelfCombatant();
}
public class RedMageJobData {
public int white;
public int black;
}
public RedMageJobData GetRedMage() {
if (enmity_memory_ == null)
return null;
int kBufferLen = 2;
byte[] buffer = new byte[kBufferLen];
IntPtr bytes_read = IntPtr.Zero;
bool ok = NativeMethods.ReadProcessMemory(process_.Handle, new IntPtr(kRedMageManaAddr), buffer, new IntPtr(kBufferLen), ref bytes_read);
if (!ok)
return null;
var r = new RedMageJobData();
r.white = buffer.ElementAt(0);
r.black = buffer.ElementAt(1);
return r;
}
}
} | using System;
using System.Diagnostics;
using System.Linq;
using Tamagawa.EnmityPlugin;
namespace Cactbot {
// Exposes the FFXIV game directly. Call FindProcess() regularly to update
// memory addresses when FFXIV is run or closed.
public class FFXIVProcess {
private Process process_ = null;
private FFXIVMemory enmity_memory_;
// A static variable address for red mage mana. White mana is the first
// byte, and Black mana the second.
private static long kRedMageManaAddr = 0x7FF6D382ADB0;
public class RedMageJobData {
public int white;
public int black;
}
public bool FindProcess(Tamagawa.EnmityPlugin.Logger logger) {
// Only support the DirectX 11 binary. The DirectX 9 one has different addresses.
Process found_process = (from x in Process.GetProcessesByName("ffxiv_dx11")
where !x.HasExited && x.MainModule != null && x.MainModule.ModuleName == "ffxiv_dx11.exe"
select x).FirstOrDefault<Process>();
if (found_process != null && found_process.HasExited)
found_process = null;
bool changed_existance = (process_ == null) != (found_process == null);
bool changed_pid = process_ != null && found_process != null && process_.Id != found_process.Id;
if (changed_existance || changed_pid) {
if (enmity_memory_ != null) {
enmity_memory_.Dispose();
enmity_memory_ = null;
}
process_ = found_process;
enmity_memory_ = new FFXIVMemory(logger, process_);
if (!enmity_memory_.validateProcess()) {
enmity_memory_.Dispose();
enmity_memory_ = null;
}
}
return enmity_memory_ != null;
}
public Combatant GetSelfCombatant() {
if (enmity_memory_ == null)
return null;
return enmity_memory_.GetSelfCombatant();
}
public RedMageJobData GetRedMage() {
if (enmity_memory_ == null)
return null;
int kBufferLen = 2;
byte[] buffer = new byte[kBufferLen];
IntPtr bytes_read = IntPtr.Zero;
bool ok = NativeMethods.ReadProcessMemory(process_.Handle, new IntPtr(kRedMageManaAddr), buffer, new IntPtr(kBufferLen), ref bytes_read);
if (!ok)
return null;
var r = new RedMageJobData();
r.white = buffer.ElementAt(0);
r.black = buffer.ElementAt(1);
return r;
}
}
} | apache-2.0 | C# |
bdd6df1a23292d8adb7377a61ce99591ee924daf | Call ShowPlayPauseControls and ShowNavigationControls setters in base constructor | martijn00/XamarinMediaManager,mike-rowley/XamarinMediaManager,mike-rowley/XamarinMediaManager,martijn00/XamarinMediaManager | MediaManager/Notifications/NotificationManagerBase.cs | MediaManager/Notifications/NotificationManagerBase.cs | using System;
using System.Collections.Generic;
using System.Text;
namespace MediaManager
{
public abstract class NotificationManagerBase : INotificationManager
{
protected NotificationManagerBase()
{
Enabled = true;
ShowPlayPauseControls = true;
ShowNavigationControls = true;
}
private bool _enabled;
private bool _showPlayPauseControls;
private bool _showNavigationControls;
public virtual bool Enabled
{
get => _enabled;
set
{
_enabled = value;
UpdateNotification();
}
}
public virtual bool ShowPlayPauseControls
{
get => _showPlayPauseControls;
set
{
_showPlayPauseControls = value;
UpdateNotification();
}
}
public virtual bool ShowNavigationControls
{
get => _showNavigationControls;
set
{
_showNavigationControls = value;
UpdateNotification();
}
}
public abstract void UpdateNotification();
}
}
| using System;
using System.Collections.Generic;
using System.Text;
namespace MediaManager
{
public abstract class NotificationManagerBase : INotificationManager
{
protected NotificationManagerBase()
{
Enabled = true;
}
private bool _enabled = true;
private bool _showPlayPauseControls = true;
private bool _showNavigationControls = true;
public virtual bool Enabled
{
get => _enabled;
set
{
_enabled = value;
UpdateNotification();
}
}
public virtual bool ShowPlayPauseControls
{
get => _showPlayPauseControls;
set
{
_showPlayPauseControls = value;
UpdateNotification();
}
}
public virtual bool ShowNavigationControls
{
get => _showNavigationControls;
set
{
_showNavigationControls = value;
UpdateNotification();
}
}
public abstract void UpdateNotification();
}
}
| mit | C# |
d05ef019a2ef7bdec512870c3cd7e92c6facc0dd | Change namespace | tugberkugurlu/Owin.Limits,damianh/LimitsMiddleware,damianh/LimitsMiddleware | src/Owin.Limits.Tests/AppBuilderExtensions.cs | src/Owin.Limits.Tests/AppBuilderExtensions.cs | namespace Owin.Limits
{
using System;
internal static class AppBuilderExtensions
{
internal static Action<MidFunc> Use(this IAppBuilder builder)
{
return middleware => builder.Use(middleware);
}
internal static IAppBuilder Use(this Action<MidFunc> middleware, IAppBuilder builder)
{
return builder;
}
}
} | namespace Owin
{
using System;
using Owin.Limits;
internal static class AppBuilderExtensions
{
internal static Action<MidFunc> Use(this IAppBuilder builder)
{
return middleware => builder.Use(middleware);
}
internal static IAppBuilder Use(this Action<MidFunc> middleware, IAppBuilder builder)
{
return builder;
}
}
} | mit | C# |
59b26718d365e50ac3df9934ab4c117028e9c56b | switch build verbosity to quiet | xbehave/xbehave.net,adamralph/xbehave.net | targets/Program.cs | targets/Program.cs | using System;
using System.Threading.Tasks;
using SimpleExec;
using static Bullseye.Targets;
using static SimpleExec.Command;
internal class Program
{
public static Task Main(string[] args)
{
Target("default", DependsOn("pack", "test"));
Target("build", () => RunAsync("dotnet", $"build --configuration Release --nologo --verbosity quiet"));
Target(
"pack",
DependsOn("build"),
ForEach("Xbehave.Core.nuspec", "Xbehave.nuspec"),
async nuspec =>
{
Environment.SetEnvironmentVariable("NUSPEC_FILE", nuspec, EnvironmentVariableTarget.Process);
await RunAsync("dotnet", $"pack src/Xbehave.Core --configuration Release --no-build --nologo");
});
Target(
"test-core",
DependsOn("build"),
() => RunAsync("dotnet", $"test --configuration Release --no-build --framework netcoreapp3.0 --nologo"));
Target(
"test-net",
DependsOn("build"),
() => RunAsync("dotnet", $"test --configuration Release --no-build --framework net472 --nologo"));
Target("test", DependsOn("test-core", "test-net"));
return RunTargetsAndExitAsync(args, ex => ex is NonZeroExitCodeException);
}
}
| using System;
using System.Threading.Tasks;
using SimpleExec;
using static Bullseye.Targets;
using static SimpleExec.Command;
internal class Program
{
public static Task Main(string[] args)
{
Target("default", DependsOn("pack", "test"));
Target("build", () => RunAsync("dotnet", $"build --configuration Release --nologo"));
Target(
"pack",
DependsOn("build"),
ForEach("Xbehave.Core.nuspec", "Xbehave.nuspec"),
async nuspec =>
{
Environment.SetEnvironmentVariable("NUSPEC_FILE", nuspec, EnvironmentVariableTarget.Process);
await RunAsync("dotnet", $"pack src/Xbehave.Core --configuration Release --no-build --nologo");
});
Target(
"test-core",
DependsOn("build"),
() => RunAsync("dotnet", $"test --configuration Release --no-build --framework netcoreapp3.0 --nologo"));
Target(
"test-net",
DependsOn("build"),
() => RunAsync("dotnet", $"test --configuration Release --no-build --framework net472 --nologo"));
Target("test", DependsOn("test-core", "test-net"));
return RunTargetsAndExitAsync(args, ex => ex is NonZeroExitCodeException);
}
}
| mit | C# |
a3c9b4d102bc2b45a815d4903322d202b58defc9 | Destroy collider of visitor as soon as fading starts | CupWorks/IGJAM16 | Source/StaffStuff/Assets/Scripts/VisitorController.cs | Source/StaffStuff/Assets/Scripts/VisitorController.cs | using UnityEngine;
public class VisitorController : MonoBehaviour
{
public VisitorTypes visitorType = VisitorTypes.Cosplayer;
public float movmentSpeed = 5.0f;
public Vector3 moveTo = new Vector3(0.0f, 0.0f, 0.0f);
public VisitorMovementMode movementMode = VisitorMovementMode.Target;
private bool isDestroyed = false;
public float fadeOutTime = 3.0f;
private float gonesFadeoutTime = 0.0f;
private float alpha = 1.0f;
private Rigidbody2D spriteRigidbody;
private void Start()
{
spriteRigidbody = GetComponent<Rigidbody2D>();
}
private void Update()
{
if (!isDestroyed) {
var velocity = (moveTo - transform.position).normalized * movmentSpeed;
spriteRigidbody.velocity = velocity;
}
else {
if (alpha == 1.0f) {
spriteRigidbody.velocity = Vector3.zero;
GetComponent<Collider2D> ().enabled = false;
}
alpha = 1.0f - gonesFadeoutTime / fadeOutTime;
gonesFadeoutTime += Time.deltaTime;
if (alpha < 0.2f) {
Destroy (gameObject);
}
var oldColor = GetComponent<Renderer> ().material.color;
oldColor.a = alpha;
GetComponent<Renderer> ().material.color = oldColor;
}
}
private void OnCollisionEnter2D(Collision2D collision)
{
if (!isDestroyed && collision.gameObject.tag == "Stage")
{
GameSession.Instance.DecreasePopularity(visitorType);
//Destroy(gameObject);
isDestroyed = true;
}
}
}
| using UnityEngine;
public class VisitorController : MonoBehaviour
{
public VisitorTypes visitorType = VisitorTypes.Cosplayer;
public float movmentSpeed = 5.0f;
public Vector3 moveTo = new Vector3(0.0f, 0.0f, 0.0f);
public VisitorMovementMode movementMode = VisitorMovementMode.Target;
private bool isDestroyed = false;
public float fadeOutTime = 3.0f;
private float gonesFadeoutTime = 0.0f;
private float alpha = 1.0f;
private Rigidbody2D spriteRigidbody;
private void Start()
{
spriteRigidbody = GetComponent<Rigidbody2D>();
}
private void Update()
{
if (!isDestroyed) {
var velocity = (moveTo - transform.position).normalized * movmentSpeed;
spriteRigidbody.velocity = velocity;
}
else {
alpha = 1.0f - gonesFadeoutTime / fadeOutTime;
gonesFadeoutTime += Time.deltaTime;
if (alpha < 0.2f) {
Destroy (gameObject);
}
if (alpha < 0.5f) {
GetComponent<Rigidbody> ().detectCollisions = false;
}
var oldColor = GetComponent<Renderer> ().material.color;
oldColor.a = alpha;
GetComponent<Renderer> ().material.color = oldColor;
}
}
private void OnCollisionEnter2D(Collision2D collision)
{
if (!isDestroyed && collision.gameObject.tag == "Stage")
{
GameSession.Instance.DecreasePopularity(visitorType);
//Destroy(gameObject);
isDestroyed = true;
}
}
}
| mit | C# |
0887b5777041555334c4a14a86af161427e7d7f4 | Update Authorize attribute to use Bearer policy | drussilla/LearnWordsFast,drussilla/LearnWordsFast | src/LearnWordsFast.API/Controllers/TrainingController.cs | src/LearnWordsFast.API/Controllers/TrainingController.cs | using LearnWordsFast.API.Exceptions;
using LearnWordsFast.API.Services;
using LearnWordsFast.API.ViewModels.TrainingController;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
namespace LearnWordsFast.API.Controllers
{
[Route("api/Training")]
[Authorize("Bearer")]
public class TrainingController : ApiController
{
private readonly ITrainingService _trainingService;
private readonly ILogger<TrainingController> _log;
public TrainingController(
ITrainingService trainingService,
ILogger<TrainingController> log)
{
_trainingService = trainingService;
_log = log;
}
[HttpGet]
public IActionResult Get()
{
_log.LogInformation("Get next training");
var training = _trainingService.CreateTraining(UserId);
if (training == null)
{
return NotFound();
}
return Ok(training);
}
[HttpPost]
public IActionResult Finish([FromBody]TrainingResultViewModel[] results)
{
_log.LogInformation("Finish training");
foreach (var result in results)
{
try
{
_trainingService.FinishTraining(UserId, result);
}
catch (NotFoundException)
{
return NotFound(result.WordId);
}
}
return Ok();
}
}
} | using LearnWordsFast.API.Exceptions;
using LearnWordsFast.API.Services;
using LearnWordsFast.API.ViewModels.TrainingController;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
namespace LearnWordsFast.API.Controllers
{
[Route("api/Training")]
[Authorize]
public class TrainingController : ApiController
{
private readonly ITrainingService _trainingService;
private readonly ILogger<TrainingController> _log;
public TrainingController(
ITrainingService trainingService,
ILogger<TrainingController> log)
{
_trainingService = trainingService;
_log = log;
}
[HttpGet]
public IActionResult Get()
{
_log.LogInformation("Get next training");
var training = _trainingService.CreateTraining(UserId);
if (training == null)
{
return NotFound();
}
return Ok(training);
}
[HttpPost]
public IActionResult Finish([FromBody]TrainingResultViewModel[] results)
{
_log.LogInformation("Finish training");
foreach (var result in results)
{
try
{
_trainingService.FinishTraining(UserId, result);
}
catch (NotFoundException)
{
return NotFound(result.WordId);
}
}
return Ok();
}
}
} | mit | C# |
25d9e432c320226b2a6a9fce04ee91fd5edeccc2 | Remove space | JimBobSquarePants/Umbraco-CMS,dawoe/Umbraco-CMS,abjerner/Umbraco-CMS,marcemarc/Umbraco-CMS,leekelleher/Umbraco-CMS,robertjf/Umbraco-CMS,mattbrailsford/Umbraco-CMS,aaronpowell/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,mattbrailsford/Umbraco-CMS,NikRimington/Umbraco-CMS,marcemarc/Umbraco-CMS,hfloyd/Umbraco-CMS,umbraco/Umbraco-CMS,tcmorris/Umbraco-CMS,arknu/Umbraco-CMS,robertjf/Umbraco-CMS,arknu/Umbraco-CMS,tcmorris/Umbraco-CMS,bjarnef/Umbraco-CMS,rasmuseeg/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,mattbrailsford/Umbraco-CMS,leekelleher/Umbraco-CMS,NikRimington/Umbraco-CMS,rasmuseeg/Umbraco-CMS,tcmorris/Umbraco-CMS,lars-erik/Umbraco-CMS,umbraco/Umbraco-CMS,marcemarc/Umbraco-CMS,WebCentrum/Umbraco-CMS,lars-erik/Umbraco-CMS,KevinJump/Umbraco-CMS,abjerner/Umbraco-CMS,mattbrailsford/Umbraco-CMS,umbraco/Umbraco-CMS,KevinJump/Umbraco-CMS,lars-erik/Umbraco-CMS,dawoe/Umbraco-CMS,leekelleher/Umbraco-CMS,rasmuseeg/Umbraco-CMS,marcemarc/Umbraco-CMS,aaronpowell/Umbraco-CMS,arknu/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,marcemarc/Umbraco-CMS,tompipe/Umbraco-CMS,bjarnef/Umbraco-CMS,abjerner/Umbraco-CMS,robertjf/Umbraco-CMS,bjarnef/Umbraco-CMS,leekelleher/Umbraco-CMS,tcmorris/Umbraco-CMS,lars-erik/Umbraco-CMS,dawoe/Umbraco-CMS,robertjf/Umbraco-CMS,JeffreyPerplex/Umbraco-CMS,abryukhov/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,tcmorris/Umbraco-CMS,hfloyd/Umbraco-CMS,tcmorris/Umbraco-CMS,NikRimington/Umbraco-CMS,lars-erik/Umbraco-CMS,madsoulswe/Umbraco-CMS,madsoulswe/Umbraco-CMS,JeffreyPerplex/Umbraco-CMS,WebCentrum/Umbraco-CMS,KevinJump/Umbraco-CMS,umbraco/Umbraco-CMS,KevinJump/Umbraco-CMS,hfloyd/Umbraco-CMS,arknu/Umbraco-CMS,tompipe/Umbraco-CMS,hfloyd/Umbraco-CMS,WebCentrum/Umbraco-CMS,leekelleher/Umbraco-CMS,dawoe/Umbraco-CMS,abryukhov/Umbraco-CMS,bjarnef/Umbraco-CMS,hfloyd/Umbraco-CMS,abryukhov/Umbraco-CMS,abryukhov/Umbraco-CMS,KevinJump/Umbraco-CMS,JeffreyPerplex/Umbraco-CMS,abjerner/Umbraco-CMS,tompipe/Umbraco-CMS,aaronpowell/Umbraco-CMS,robertjf/Umbraco-CMS,dawoe/Umbraco-CMS,madsoulswe/Umbraco-CMS | src/Umbraco.Web/PropertyEditors/EmailAddressPropertyEditor.cs | src/Umbraco.Web/PropertyEditors/EmailAddressPropertyEditor.cs | using Umbraco.Core;
using Umbraco.Core.PropertyEditors;
namespace Umbraco.Web.PropertyEditors
{
[PropertyEditor(Constants.PropertyEditors.EmailAddressAlias, "Email address", "email", IsParameterEditor = true, Icon="icon-message")]
public class EmailAddressPropertyEditor : PropertyEditor
{
protected override PropertyValueEditor CreateValueEditor()
{
var editor = base.CreateValueEditor();
//add an email address validator
editor.Validators.Add(new EmailValidator());
return editor;
}
protected override PreValueEditor CreatePreValueEditor()
{
return new EmailAddressePreValueEditor();
}
internal class EmailAddressePreValueEditor : PreValueEditor
{
//TODO: This doesn't seem necessary since it can be specified at the property type level - this will however be useful if/when
// we support overridden property value pre-value options.
[PreValueField("Required?", "boolean")]
public bool IsRequired { get; set; }
}
}
}
| using Umbraco.Core;
using Umbraco.Core.PropertyEditors;
namespace Umbraco.Web.PropertyEditors
{
[PropertyEditor(Constants.PropertyEditors.EmailAddressAlias, "Email address", "email", IsParameterEditor = true, Icon ="icon-message")]
public class EmailAddressPropertyEditor : PropertyEditor
{
protected override PropertyValueEditor CreateValueEditor()
{
var editor = base.CreateValueEditor();
//add an email address validator
editor.Validators.Add(new EmailValidator());
return editor;
}
protected override PreValueEditor CreatePreValueEditor()
{
return new EmailAddressePreValueEditor();
}
internal class EmailAddressePreValueEditor : PreValueEditor
{
//TODO: This doesn't seem necessary since it can be specified at the property type level - this will however be useful if/when
// we support overridden property value pre-value options.
[PreValueField("Required?", "boolean")]
public bool IsRequired { get; set; }
}
}
}
| mit | C# |
3ceb75ff604f91c106a0fa8a469c6a8452afbc8a | Disable hanging integration tests. | martincostello/electronicupdates,experiandataquality/electronicupdates,martincostello/electronicupdates,martincostello/electronicupdates,experiandataquality/electronicupdates,experiandataquality/electronicupdates,martincostello/electronicupdates,martincostello/electronicupdates,experiandataquality/electronicupdates,experiandataquality/electronicupdates | src/CSharp/MetadataWebApi/MetadataWebApi.Tests/RequiresServiceCredentialsFactAttribute.cs | src/CSharp/MetadataWebApi/MetadataWebApi.Tests/RequiresServiceCredentialsFactAttribute.cs | //-----------------------------------------------------------------------
// <copyright file="RequiresServiceCredentialsFactAttribute.cs" company="Experian Data Quality">
// Copyright (c) Experian. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
using System;
using Xunit;
namespace Experian.Qas.Updates.Metadata.WebApi.V1
{
/// <summary>
/// A test that requires service credentials to be configured as environment variables. This class cannot be inherited.
/// </summary>
internal sealed class RequiresServiceCredentialsFactAttribute : FactAttribute
{
/// <summary>
/// Initializes a new instance of the <see cref="RequiresServiceCredentialsFactAttribute"/> class.
/// </summary>
public RequiresServiceCredentialsFactAttribute()
: base()
{
if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("CI")))
{
this.Skip = "Temporarily disabled as AppVeyor CI test run hangs.";
}
else if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("QAS_ElectronicUpdates_UserName")) ||
string.IsNullOrEmpty(Environment.GetEnvironmentVariable("QAS_ElectronicUpdates_Password")))
{
this.Skip = "No service credentials are configured.";
}
}
}
} | //-----------------------------------------------------------------------
// <copyright file="RequiresServiceCredentialsFactAttribute.cs" company="Experian Data Quality">
// Copyright (c) Experian. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
using System;
using Xunit;
namespace Experian.Qas.Updates.Metadata.WebApi.V1
{
/// <summary>
/// A test that requires service credentials to be configured as environment variables. This class cannot be inherited.
/// </summary>
internal sealed class RequiresServiceCredentialsFactAttribute : FactAttribute
{
/// <summary>
/// Initializes a new instance of the <see cref="RequiresServiceCredentialsFactAttribute"/> class.
/// </summary>
public RequiresServiceCredentialsFactAttribute()
: base()
{
if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("QAS_ElectronicUpdates_UserName")) ||
string.IsNullOrEmpty(Environment.GetEnvironmentVariable("QAS_ElectronicUpdates_Password")))
{
this.Skip = "No service credentials are configured.";
}
}
}
} | apache-2.0 | C# |
a117d6be925a0b090d40ca5ce1fe4223a946270d | Fix test for linux: use temp folder inside content root | umbraco/Umbraco-CMS,abryukhov/Umbraco-CMS,robertjf/Umbraco-CMS,dawoe/Umbraco-CMS,KevinJump/Umbraco-CMS,KevinJump/Umbraco-CMS,arknu/Umbraco-CMS,robertjf/Umbraco-CMS,robertjf/Umbraco-CMS,marcemarc/Umbraco-CMS,robertjf/Umbraco-CMS,abryukhov/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,arknu/Umbraco-CMS,KevinJump/Umbraco-CMS,marcemarc/Umbraco-CMS,arknu/Umbraco-CMS,abjerner/Umbraco-CMS,dawoe/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,abjerner/Umbraco-CMS,umbraco/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,umbraco/Umbraco-CMS,KevinJump/Umbraco-CMS,abryukhov/Umbraco-CMS,arknu/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,marcemarc/Umbraco-CMS,abryukhov/Umbraco-CMS,abjerner/Umbraco-CMS,dawoe/Umbraco-CMS,KevinJump/Umbraco-CMS,robertjf/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,dawoe/Umbraco-CMS,marcemarc/Umbraco-CMS,abjerner/Umbraco-CMS,marcemarc/Umbraco-CMS,umbraco/Umbraco-CMS,dawoe/Umbraco-CMS | src/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HostedServices/TempFileCleanupTests.cs | src/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HostedServices/TempFileCleanupTests.cs | using System;
using System.IO;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Moq;
using NUnit.Framework;
using Umbraco.Core;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Infrastructure.HostedServices;
namespace Umbraco.Tests.UnitTests.Umbraco.Infrastructure.HostedServices
{
[TestFixture]
public class TempFileCleanupTests
{
private Mock<IIOHelper> _mockIOHelper;
private string _testPath = Path.Combine(TestContext.CurrentContext.TestDirectory.Split("bin")[0], "App_Data", "TEMP");
[Test]
public async Task Does_Not_Execute_When_Not_Main_Dom()
{
var sut = CreateTempFileCleanup(isMainDom: false);
await sut.PerformExecuteAsync(null);
VerifyFilesNotCleaned();
}
[Test]
public async Task Executes_And_Cleans_Files()
{
var sut = CreateTempFileCleanup();
await sut.PerformExecuteAsync(null);
VerifyFilesCleaned();
}
private TempFileCleanup CreateTempFileCleanup(bool isMainDom = true)
{
var mockMainDom = new Mock<IMainDom>();
mockMainDom.SetupGet(x => x.IsMainDom).Returns(isMainDom);
_mockIOHelper = new Mock<IIOHelper>();
_mockIOHelper.Setup(x => x.GetTempFolders())
.Returns(new DirectoryInfo[] { new DirectoryInfo(_testPath) });
_mockIOHelper.Setup(x => x.CleanFolder(It.IsAny<DirectoryInfo>(), It.IsAny<TimeSpan>()))
.Returns(CleanFolderResult.Success());
var mockLogger = new Mock<ILogger<TempFileCleanup>>();
var mockProfilingLogger = new Mock<IProfilingLogger>();
return new TempFileCleanup(_mockIOHelper.Object, mockMainDom.Object, mockLogger.Object);
}
private void VerifyFilesNotCleaned()
{
VerifyFilesCleaned(Times.Never());
}
private void VerifyFilesCleaned()
{
VerifyFilesCleaned(Times.Once());
}
private void VerifyFilesCleaned(Times times)
{
_mockIOHelper.Verify(x => x.CleanFolder(It.Is<DirectoryInfo>(y => y.FullName == _testPath), It.IsAny<TimeSpan>()), times);
}
}
}
| using System;
using System.IO;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Moq;
using NUnit.Framework;
using Umbraco.Core;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Infrastructure.HostedServices;
namespace Umbraco.Tests.UnitTests.Umbraco.Infrastructure.HostedServices
{
[TestFixture]
public class TempFileCleanupTests
{
private Mock<IIOHelper> _mockIOHelper;
private string _testPath = Path.GetTempPath();
[Test]
public async Task Does_Not_Execute_When_Not_Main_Dom()
{
var sut = CreateTempFileCleanup(isMainDom: false);
await sut.PerformExecuteAsync(null);
VerifyFilesNotCleaned();
}
[Test]
public async Task Executes_And_Cleans_Files()
{
var sut = CreateTempFileCleanup();
await sut.PerformExecuteAsync(null);
VerifyFilesCleaned();
}
private TempFileCleanup CreateTempFileCleanup(bool isMainDom = true)
{
var mockMainDom = new Mock<IMainDom>();
mockMainDom.SetupGet(x => x.IsMainDom).Returns(isMainDom);
_mockIOHelper = new Mock<IIOHelper>();
_mockIOHelper.Setup(x => x.GetTempFolders())
.Returns(new DirectoryInfo[] { new DirectoryInfo(_testPath) });
_mockIOHelper.Setup(x => x.CleanFolder(It.IsAny<DirectoryInfo>(), It.IsAny<TimeSpan>()))
.Returns(CleanFolderResult.Success());
var mockLogger = new Mock<ILogger<TempFileCleanup>>();
var mockProfilingLogger = new Mock<IProfilingLogger>();
return new TempFileCleanup(_mockIOHelper.Object, mockMainDom.Object, mockLogger.Object);
}
private void VerifyFilesNotCleaned()
{
VerifyFilesCleaned(Times.Never());
}
private void VerifyFilesCleaned()
{
VerifyFilesCleaned(Times.Once());
}
private void VerifyFilesCleaned(Times times)
{
_mockIOHelper.Verify(x => x.CleanFolder(It.Is<DirectoryInfo>(y => y.FullName == _testPath), It.IsAny<TimeSpan>()), times);
}
}
}
| mit | C# |
d145ed598f814dfd1c28613527380700ce89b7e5 | Update version to 2.1.0.0 | grantcolley/wpfcontrols | DevelopmentInProgress.WPFControls/Properties/AssemblyInfo.cs | DevelopmentInProgress.WPFControls/Properties/AssemblyInfo.cs | using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// 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("DipWpfControls")]
[assembly: AssemblyDescription("Custom WPF controls")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Development In Progress Ltd")]
[assembly: AssemblyProduct("DipWpfControls")]
[assembly: AssemblyCopyright("Copyright © Development In Progress Ltd 2015")]
[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)]
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly:ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
// 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.1.0.0")]
[assembly: AssemblyFileVersion("2.1.0.0")]
| using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// 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("DipWpfControls")]
[assembly: AssemblyDescription("Custom WPF controls")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Development In Progress Ltd")]
[assembly: AssemblyProduct("DipWpfControls")]
[assembly: AssemblyCopyright("Copyright © Development In Progress Ltd 2015")]
[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)]
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly:ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
// 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.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
| apache-2.0 | C# |
ca158aecf7d0b86f9ba4c4428647053205d886b4 | Fix ArgumentNullException wrong name | corngood/omnisharp-server,mispencer/OmniSharpServer,x335/omnisharp-server,OmniSharp/omnisharp-server,corngood/omnisharp-server,svermeulen/omnisharp-server,syl20bnr/omnisharp-server,x335/omnisharp-server,syl20bnr/omnisharp-server | OmniSharp/AutoComplete/Overrides/GetOverrideTargetsResponse.cs | OmniSharp/AutoComplete/Overrides/GetOverrideTargetsResponse.cs | using System;
using System.Collections.Generic;
using ICSharpCode.NRefactory.CSharp.Refactoring;
using ICSharpCode.NRefactory.CSharp.Resolver;
using ICSharpCode.NRefactory.CSharp.TypeSystem;
using ICSharpCode.NRefactory.TypeSystem;
using OmniSharp.AutoComplete.Overrides;
namespace OmniSharp.AutoComplete.Overrides {
public class GetOverrideTargetsResponse {
public GetOverrideTargetsResponse() {}
public GetOverrideTargetsResponse
( IMember m
, CSharpTypeResolveContext resolveContext) {
if (resolveContext == null)
throw new ArgumentNullException("resolveContext");
if (m == null)
throw new ArgumentNullException("m");
var builder = new TypeSystemAstBuilder
(new CSharpResolver(resolveContext));
this.OverrideTargetName =
builder.ConvertEntity(m).GetText()
// Builder automatically adds a trailing newline
.TrimEnd(Environment.NewLine.ToCharArray());
}
/// <summary>
/// A human readable signature of the member that is to be
/// overridden.
/// </summary>
public string OverrideTargetName {get; set;}
}
}
| using System;
using System.Collections.Generic;
using ICSharpCode.NRefactory.CSharp.Refactoring;
using ICSharpCode.NRefactory.CSharp.Resolver;
using ICSharpCode.NRefactory.CSharp.TypeSystem;
using ICSharpCode.NRefactory.TypeSystem;
using OmniSharp.AutoComplete.Overrides;
namespace OmniSharp.AutoComplete.Overrides {
public class GetOverrideTargetsResponse {
public GetOverrideTargetsResponse() {}
public GetOverrideTargetsResponse
( IMember m
, CSharpTypeResolveContext resolveContext) {
if (resolveContext == null)
throw new ArgumentNullException("overrideContext");
if (m == null)
throw new ArgumentNullException("m");
var builder = new TypeSystemAstBuilder
(new CSharpResolver(resolveContext));
this.OverrideTargetName =
builder.ConvertEntity(m).GetText()
// Builder automatically adds a trailing newline
.TrimEnd(Environment.NewLine.ToCharArray());
}
/// <summary>
/// A human readable signature of the member that is to be
/// overridden.
/// </summary>
public string OverrideTargetName {get; set;}
}
}
| mit | C# |
e0f3651cba281e5b42ea09b6575c60e2d3df1fd5 | fix bottom right corner on osx. | jkoritzinsky/Avalonia,wieslawsoltes/Perspex,Perspex/Perspex,SuperJMN/Avalonia,Perspex/Perspex,SuperJMN/Avalonia,jkoritzinsky/Avalonia,wieslawsoltes/Perspex,jkoritzinsky/Perspex,AvaloniaUI/Avalonia,AvaloniaUI/Avalonia,akrisiun/Perspex,jkoritzinsky/Avalonia,SuperJMN/Avalonia,grokys/Perspex,jkoritzinsky/Avalonia,wieslawsoltes/Perspex,AvaloniaUI/Avalonia,jkoritzinsky/Avalonia,SuperJMN/Avalonia,SuperJMN/Avalonia,AvaloniaUI/Avalonia,wieslawsoltes/Perspex,grokys/Perspex,wieslawsoltes/Perspex,SuperJMN/Avalonia,AvaloniaUI/Avalonia,jkoritzinsky/Avalonia,SuperJMN/Avalonia,wieslawsoltes/Perspex,wieslawsoltes/Perspex,AvaloniaUI/Avalonia,jkoritzinsky/Avalonia,AvaloniaUI/Avalonia | src/Avalonia.Controls/Primitives/PopupPositioning/ManagedPopupPositionerPopupImplHelper.cs | src/Avalonia.Controls/Primitives/PopupPositioning/ManagedPopupPositionerPopupImplHelper.cs | using System;
using System.Collections.Generic;
using System.Linq;
using Avalonia.Platform;
namespace Avalonia.Controls.Primitives.PopupPositioning
{
/// <summary>
/// This class is used to simplify integration of IPopupImpl implementations with popup positioner
/// </summary>
public class ManagedPopupPositionerPopupImplHelper : IManagedPopupPositionerPopup
{
private readonly IWindowBaseImpl _parent;
public delegate void MoveResizeDelegate(PixelPoint position, Size size, double scaling);
private readonly MoveResizeDelegate _moveResize;
public ManagedPopupPositionerPopupImplHelper(IWindowBaseImpl parent, MoveResizeDelegate moveResize)
{
_parent = parent;
_moveResize = moveResize;
}
public IReadOnlyList<ManagedPopupPositionerScreenInfo> Screens =>
_parent.Screen.AllScreens.Select(s => new ManagedPopupPositionerScreenInfo(
s.Bounds.ToRect(1), s.WorkingArea.ToRect(1))).ToList();
public Rect ParentClientAreaScreenGeometry
{
get
{
// Popup positioner operates with abstract coordinates, but in our case they are pixel ones
var point = _parent.PointToScreen(default);
var size = TranslateSize(_parent.ClientSize);
return new Rect(point.X, point.Y, size.Width, size.Height);
}
}
public void MoveAndResize(Point devicePoint, Size virtualSize)
{
_moveResize(new PixelPoint((int)devicePoint.X, (int)devicePoint.Y), virtualSize, _parent.Scaling);
}
public virtual Point TranslatePoint(Point pt) => pt * _parent.Scaling;
public virtual Size TranslateSize(Size size) => size * _parent.Scaling;
}
}
| using System;
using System.Collections.Generic;
using System.Linq;
using Avalonia.Platform;
namespace Avalonia.Controls.Primitives.PopupPositioning
{
/// <summary>
/// This class is used to simplify integration of IPopupImpl implementations with popup positioner
/// </summary>
public class ManagedPopupPositionerPopupImplHelper : IManagedPopupPositionerPopup
{
private readonly IWindowBaseImpl _parent;
public delegate void MoveResizeDelegate(PixelPoint position, Size size, double scaling);
private readonly MoveResizeDelegate _moveResize;
public ManagedPopupPositionerPopupImplHelper(IWindowBaseImpl parent, MoveResizeDelegate moveResize)
{
_parent = parent;
_moveResize = moveResize;
}
public IReadOnlyList<ManagedPopupPositionerScreenInfo> Screens =>
_parent.Screen.AllScreens.Select(s => new ManagedPopupPositionerScreenInfo(
s.Bounds.ToRect(1), s.WorkingArea.ToRect(1))).ToList();
public Rect ParentClientAreaScreenGeometry
{
get
{
// Popup positioner operates with abstract coordinates, but in our case they are pixel ones
var point = _parent.PointToScreen(default);
var size = PixelSize.FromSize(_parent.ClientSize, _parent.Scaling);
return new Rect(point.X, point.Y, size.Width, size.Height);
}
}
public void MoveAndResize(Point devicePoint, Size virtualSize)
{
_moveResize(new PixelPoint((int)devicePoint.X, (int)devicePoint.Y), virtualSize, _parent.Scaling);
}
public virtual Point TranslatePoint(Point pt) => pt * _parent.Scaling;
public virtual Size TranslateSize(Size size) => size * _parent.Scaling;
}
}
| mit | C# |
49b547c83564fb47ba0a544a10022abb48ae2b85 | Update existing documentation for movie ids. | henrikfroehling/TraktApiSharp | Source/Lib/TraktApiSharp/Objects/Get/Movies/TraktMovieIds.cs | Source/Lib/TraktApiSharp/Objects/Get/Movies/TraktMovieIds.cs | namespace TraktApiSharp.Objects.Get.Movies
{
using Newtonsoft.Json;
using System.Globalization;
/// <summary>A collection of ids for various web services, including the Trakt id, for a Trakt movie.</summary>
public class TraktMovieIds
{
/// <summary>Gets or sets the Trakt numeric id.</summary>
[JsonProperty(PropertyName = "trakt")]
public int Trakt { get; set; }
/// <summary>Gets or sets the Trakt slug.</summary>
[JsonProperty(PropertyName = "slug")]
public string Slug { get; set; }
/// <summary>Gets or sets the id from imdb.com</summary>
[JsonProperty(PropertyName = "imdb")]
public string Imdb { get; set; }
/// <summary>Gets or sets the numeric id from themoviedb.org</summary>
[JsonProperty(PropertyName = "tmdb")]
public int? Tmdb { get; set; }
/// <summary>Returns, whether any id has been set.</summary>
[JsonIgnore]
public bool HasAnyId => Trakt > 0 || !string.IsNullOrEmpty(Slug) || !string.IsNullOrEmpty(Imdb) || Tmdb > 0;
/// <summary>Gets the most reliable id from those that have been set.</summary>
/// <returns>The id as a string or an empty string, if no id is set.</returns>
public string GetBestId()
{
if (Trakt > 0)
return Trakt.ToString(CultureInfo.InvariantCulture);
if (!string.IsNullOrEmpty(Slug))
return Slug;
if (!string.IsNullOrEmpty(Imdb))
return Imdb;
if (Tmdb.HasValue && Tmdb.Value > 0)
return Tmdb.Value.ToString();
return string.Empty;
}
}
}
| namespace TraktApiSharp.Objects.Get.Movies
{
using Newtonsoft.Json;
using System.Globalization;
/// <summary>
/// A collection of ids for various web services for a Trakt movie.
/// </summary>
public class TraktMovieIds
{
/// <summary>
/// The Trakt numeric id for the movie.
/// </summary>
[JsonProperty(PropertyName = "trakt")]
public int Trakt { get; set; }
/// <summary>
/// The Trakt slug for the movie.
/// </summary>
[JsonProperty(PropertyName = "slug")]
public string Slug { get; set; }
/// <summary>
/// The id for the movie from imdb.com
/// </summary>
[JsonProperty(PropertyName = "imdb")]
public string Imdb { get; set; }
/// <summary>
/// The numeric id for the movie from themoviedb.org
/// </summary>
[JsonProperty(PropertyName = "tmdb")]
public int? Tmdb { get; set; }
/// <summary>
/// Tests, if at least one id has been set.
/// </summary>
[JsonIgnore]
public bool HasAnyId => Trakt > 0 || !string.IsNullOrEmpty(Slug) || !string.IsNullOrEmpty(Imdb) || Tmdb > 0;
/// <summary>
/// Get the most reliable id from those that have been set for the movie.
/// </summary>
/// <returns>The id as a string.</returns>
public string GetBestId()
{
if (Trakt > 0)
return Trakt.ToString(CultureInfo.InvariantCulture);
if (!string.IsNullOrEmpty(Slug))
return Slug;
if (!string.IsNullOrEmpty(Imdb))
return Imdb;
return string.Empty;
}
}
}
| mit | C# |
617c5d955c1084194abfdcb0ca86cd8e162ae584 | Update IUnitOfWork.cs | tiksn/TIKSN-Framework | TIKSN.Core/Data/IUnitOfWork.cs | TIKSN.Core/Data/IUnitOfWork.cs | using System;
using System.Threading;
using System.Threading.Tasks;
namespace TIKSN.Data
{
public interface IUnitOfWork : IDisposable, IAsyncDisposable
{
Task CompleteAsync(CancellationToken cancellationToken);
Task DiscardAsync(CancellationToken cancellationToken);
}
} | using System;
using System.Threading;
using System.Threading.Tasks;
namespace TIKSN.Data
{
public interface IUnitOfWork : IDisposable
{
Task CompleteAsync(CancellationToken cancellationToken);
}
} | mit | C# |
81896884918031df0a6d7e976422f8dc3d97fad1 | Fix a crash bug(Win32) | Waynext/HttpLibrary.Net | src/HttpLibrary.Platform.Win32/DeviceInfoWin32.cs | src/HttpLibrary.Platform.Win32/DeviceInfoWin32.cs | using HttpLibrary.Interop;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace HttpLibrary.Platform.Win32
{
class DeviceInfoWin32 : IDeviceInfo
{
private string appName;
public string Application
{
get
{
AssemblyName assemblyName = null;
var assembly = Assembly.GetEntryAssembly();
if(assembly != null)
{
assemblyName = assembly.GetName();
}
if(assemblyName != null)
return string.IsNullOrEmpty(appName) ? (string.Format("{0}/{1}", assemblyName.Name, assemblyName.Version.ToString())) : appName;
else
{
return string.IsNullOrEmpty(appName) ? "App" : appName;
}
}
set
{
appName = value;
}
}
public string Device
{
get
{
return "PC";
}
}
public string System
{
get
{
return Environment.OSVersion.ToString();
}
}
}
}
| using HttpLibrary.Interop;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace HttpLibrary.Platform.Win32
{
class DeviceInfoWin32 : IDeviceInfo
{
private string appName;
public string Application
{
get
{
var assemblyName = Assembly.GetEntryAssembly().GetName();
return string.IsNullOrEmpty(appName) ? (string.Format("{0}/{1}", assemblyName.Name, assemblyName.Version.ToString())) : appName;
}
set
{
appName = value;
}
}
public string Device
{
get
{
return "PC";
}
}
public string System
{
get
{
return Environment.OSVersion.ToString();
}
}
}
}
| mit | C# |
4a5a3ad0b1d531bdf122d65a36e03853b3200708 | Test distaccamenti Lecco fixato | vvfosprojects/sovvf,vvfosprojects/sovvf,vvfosprojects/sovvf,vvfosprojects/sovvf,vvfosprojects/sovvf | src/backend/SO115App.API.SOVVF.FakeImplementations.Test/Modello/Organigramma/Test_GetUnitaOperativaRadice_Con_Dir_Com_Dist.cs | src/backend/SO115App.API.SOVVF.FakeImplementations.Test/Modello/Organigramma/Test_GetUnitaOperativaRadice_Con_Dir_Com_Dist.cs | //-----------------------------------------------------------------------
// <copyright file="Test_GetUnitaOperativaRadice_Con_Dir_Com_Dist.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 System.Linq;
using NUnit.Framework;
using SO115App.API.SOVVF.FakeImplementations.Modello.Organigramma;
namespace Tests.Modello.Organigramma
{
public class Test_GetUnitaOperativaRadice_Con_Dir_Com_Dist
{
[Test]
public void IlComandoDiLeccoHaTreDistaccamenti()
{
var organigramma = new GetUnitaOperativaRadice_Con_Dir_Com_Dist();
var radice = organigramma.Get();
var lecco = radice.GetSottoAlbero().Single(uo => uo.Codice == "LC");
var numeroDistaccamentiLecco = lecco.GetSottoAlbero()
.Where(uo => uo.Codice != "LC")
.Count();
Assert.That(numeroDistaccamentiLecco, Is.EqualTo(3));
}
[Test]
public void IlComandoDiRomaHaIlDistaccamentoTuscolanoII()
{
var organigramma = new GetUnitaOperativaRadice_Con_Dir_Com_Dist();
var radice = organigramma.Get();
var roma = radice.GetSottoAlbero().Single(uo => uo.Codice == "RM");
Assert.DoesNotThrow(() => roma.GetSottoAlbero().Single(uo => uo.Codice == "RM.1008"));
}
}
}
| //-----------------------------------------------------------------------
// <copyright file="Test_GetUnitaOperativaRadice_Con_Dir_Com_Dist.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 System.Linq;
using NUnit.Framework;
using SO115App.API.SOVVF.FakeImplementations.Modello.Organigramma;
namespace Tests.Modello.Organigramma
{
public class Test_GetUnitaOperativaRadice_Con_Dir_Com_Dist
{
[Test]
public void IlComandoDiLeccoHaQuattroDistaccamenti()
{
var organigramma = new GetUnitaOperativaRadice_Con_Dir_Com_Dist();
var radice = organigramma.Get();
var lecco = radice.GetSottoAlbero().Single(uo => uo.Codice == "LC");
var numeroDistaccamentiLecco = lecco.GetSottoAlbero().Count();
Assert.That(numeroDistaccamentiLecco, Is.EqualTo(4));
}
[Test]
public void IlComandoDiRomaHaIlDistaccamentoTuscolanoII()
{
var organigramma = new GetUnitaOperativaRadice_Con_Dir_Com_Dist();
var radice = organigramma.Get();
var roma = radice.GetSottoAlbero().Single(uo => uo.Codice == "RM");
Assert.DoesNotThrow(() => roma.GetSottoAlbero().Single(uo => uo.Codice == "RM.1008"));
}
}
}
| agpl-3.0 | C# |
45e9c2862abb83c7b4af5161ccc444c2f3f5fc9f | Fix occasional YSOD under IIS7 when config changes | OrchardCMS/Orchard-Harvest-Website,LaserSrl/Orchard,cryogen/orchard,Serlead/Orchard,phillipsj/Orchard,omidnasri/Orchard,mgrowan/Orchard,vard0/orchard.tan,luchaoshuai/Orchard,johnnyqian/Orchard,openbizgit/Orchard,omidnasri/Orchard,smartnet-developers/Orchard,grapto/Orchard.CloudBust,salarvand/Portal,smartnet-developers/Orchard,geertdoornbos/Orchard,jagraz/Orchard,harmony7/Orchard,Codinlab/Orchard,omidnasri/Orchard,dcinzona/Orchard,rtpHarry/Orchard,qt1/Orchard,harmony7/Orchard,infofromca/Orchard,dcinzona/Orchard,caoxk/orchard,omidnasri/Orchard,yonglehou/Orchard,jersiovic/Orchard,patricmutwiri/Orchard,OrchardCMS/Orchard,jimasp/Orchard,TalaveraTechnologySolutions/Orchard,Anton-Am/Orchard,enspiral-dev-academy/Orchard,jaraco/orchard,RoyalVeterinaryCollege/Orchard,Serlead/Orchard,princeppy/JPYSites-Orchard-Azure-Live-SourceCode,TaiAivaras/Orchard,vard0/orchard.tan,hhland/Orchard,xiaobudian/Orchard,Serlead/Orchard,armanforghani/Orchard,mgrowan/Orchard,jersiovic/Orchard,yersans/Orchard,mvarblow/Orchard,vard0/orchard.tan,kgacova/Orchard,Morgma/valleyviewknolls,jtkech/Orchard,oxwanawxo/Orchard,yersans/Orchard,Cphusion/Orchard,OrchardCMS/Orchard-Harvest-Website,OrchardCMS/Orchard-Harvest-Website,grapto/Orchard.CloudBust,salarvand/orchard,ehe888/Orchard,MpDzik/Orchard,yersans/Orchard,AdvantageCS/Orchard,openbizgit/Orchard,stormleoxia/Orchard,TaiAivaras/Orchard,jerryshi2007/Orchard,LaserSrl/Orchard,JRKelso/Orchard,huoxudong125/Orchard,dcinzona/Orchard,yonglehou/Orchard,RoyalVeterinaryCollege/Orchard,Sylapse/Orchard.HttpAuthSample,SzymonSel/Orchard,MpDzik/Orchard,alejandroaldana/Orchard,Cphusion/Orchard,sfmskywalker/Orchard,OrchardCMS/Orchard-Harvest-Website,AndreVolksdorf/Orchard,omidnasri/Orchard,spraiin/Orchard,Praggie/Orchard,hhland/Orchard,stormleoxia/Orchard,Anton-Am/Orchard,xkproject/Orchard,Ermesx/Orchard,ehe888/Orchard,Cphusion/Orchard,Lombiq/Orchard,alejandroaldana/Orchard,kouweizhong/Orchard,alejandroaldana/Orchard,marcoaoteixeira/Orchard,dcinzona/Orchard-Harvest-Website,dcinzona/Orchard,Serlead/Orchard,jtkech/Orchard,geertdoornbos/Orchard,fortunearterial/Orchard,li0803/Orchard,kgacova/Orchard,jerryshi2007/Orchard,Sylapse/Orchard.HttpAuthSample,Morgma/valleyviewknolls,DonnotRain/Orchard,jchenga/Orchard,vairam-svs/Orchard,hbulzy/Orchard,infofromca/Orchard,Anton-Am/Orchard,dburriss/Orchard,OrchardCMS/Orchard-Harvest-Website,TalaveraTechnologySolutions/Orchard,Inner89/Orchard,jagraz/Orchard,KeithRaven/Orchard,spraiin/Orchard,NIKASoftwareDevs/Orchard,sfmskywalker/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,kouweizhong/Orchard,smartnet-developers/Orchard,LaserSrl/Orchard,Dolphinsimon/Orchard,abhishekluv/Orchard,grapto/Orchard.CloudBust,Dolphinsimon/Orchard,angelapper/Orchard,SzymonSel/Orchard,AEdmunds/beautiful-springtime,jerryshi2007/Orchard,Lombiq/Orchard,jerryshi2007/Orchard,sfmskywalker/Orchard,AEdmunds/beautiful-springtime,TaiAivaras/Orchard,xiaobudian/Orchard,TalaveraTechnologySolutions/Orchard,DonnotRain/Orchard,arminkarimi/Orchard,salarvand/Portal,arminkarimi/Orchard,Morgma/valleyviewknolls,Praggie/Orchard,infofromca/Orchard,brownjordaninternational/OrchardCMS,enspiral-dev-academy/Orchard,DonnotRain/Orchard,hbulzy/Orchard,brownjordaninternational/OrchardCMS,escofieldnaxos/Orchard,dcinzona/Orchard,openbizgit/Orchard,ehe888/Orchard,NIKASoftwareDevs/Orchard,caoxk/orchard,mgrowan/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,jchenga/Orchard,dcinzona/Orchard-Harvest-Website,emretiryaki/Orchard,spraiin/Orchard,Fogolan/OrchardForWork,tobydodds/folklife,andyshao/Orchard,rtpHarry/Orchard,salarvand/orchard,qt1/orchard4ibn,angelapper/Orchard,princeppy/JPYSites-Orchard-Azure-Live-SourceCode,kouweizhong/Orchard,oxwanawxo/Orchard,alejandroaldana/Orchard,grapto/Orchard.CloudBust,emretiryaki/Orchard,xkproject/Orchard,grapto/Orchard.CloudBust,TalaveraTechnologySolutions/Orchard,SzymonSel/Orchard,tobydodds/folklife,xiaobudian/Orchard,SzymonSel/Orchard,jagraz/Orchard,m2cms/Orchard,andyshao/Orchard,SeyDutch/Airbrush,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,bigfont/orchard-cms-modules-and-themes,patricmutwiri/Orchard,geertdoornbos/Orchard,brownjordaninternational/OrchardCMS,Cphusion/Orchard,LaserSrl/Orchard,OrchardCMS/Orchard,RoyalVeterinaryCollege/Orchard,gcsuk/Orchard,enspiral-dev-academy/Orchard,NIKASoftwareDevs/Orchard,AdvantageCS/Orchard,arminkarimi/Orchard,stormleoxia/Orchard,Inner89/Orchard,OrchardCMS/Orchard,ericschultz/outercurve-orchard,enspiral-dev-academy/Orchard,enspiral-dev-academy/Orchard,sfmskywalker/Orchard,yonglehou/Orchard,LaserSrl/Orchard,planetClaire/Orchard-LETS,SeyDutch/Airbrush,grapto/Orchard.CloudBust,omidnasri/Orchard,Lombiq/Orchard,JRKelso/Orchard,qt1/orchard4ibn,bedegaming-aleksej/Orchard,armanforghani/Orchard,fassetar/Orchard,jchenga/Orchard,jagraz/Orchard,abhishekluv/Orchard,bedegaming-aleksej/Orchard,jagraz/Orchard,sebastienros/msc,stormleoxia/Orchard,smartnet-developers/Orchard,phillipsj/Orchard,omidnasri/Orchard,dburriss/Orchard,tobydodds/folklife,Codinlab/Orchard,SouleDesigns/SouleDesigns.Orchard,hbulzy/Orchard,Morgma/valleyviewknolls,KeithRaven/Orchard,OrchardCMS/Orchard-Harvest-Website,rtpHarry/Orchard,arminkarimi/Orchard,jersiovic/Orchard,Fogolan/OrchardForWork,salarvand/orchard,qt1/Orchard,SeyDutch/Airbrush,spraiin/Orchard,jaraco/orchard,kgacova/Orchard,sfmskywalker/Orchard,jersiovic/Orchard,geertdoornbos/Orchard,Cphusion/Orchard,li0803/Orchard,escofieldnaxos/Orchard,vairam-svs/Orchard,bigfont/orchard-continuous-integration-demo,marcoaoteixeira/Orchard,harmony7/Orchard,Praggie/Orchard,sfmskywalker/Orchard,hbulzy/Orchard,andyshao/Orchard,yonglehou/Orchard,planetClaire/Orchard-LETS,emretiryaki/Orchard,Sylapse/Orchard.HttpAuthSample,AndreVolksdorf/Orchard,Praggie/Orchard,SouleDesigns/SouleDesigns.Orchard,fassetar/Orchard,phillipsj/Orchard,luchaoshuai/Orchard,planetClaire/Orchard-LETS,smartnet-developers/Orchard,geertdoornbos/Orchard,openbizgit/Orchard,infofromca/Orchard,yersans/Orchard,andyshao/Orchard,sfmskywalker/Orchard,hhland/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,hhland/Orchard,qt1/Orchard,fortunearterial/Orchard,huoxudong125/Orchard,KeithRaven/Orchard,SeyDutch/Airbrush,Fogolan/OrchardForWork,ericschultz/outercurve-orchard,Ermesx/Orchard,austinsc/Orchard,neTp9c/Orchard,KeithRaven/Orchard,ericschultz/outercurve-orchard,omidnasri/Orchard,li0803/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,aaronamm/Orchard,patricmutwiri/Orchard,salarvand/Portal,AEdmunds/beautiful-springtime,escofieldnaxos/Orchard,bigfont/orchard-cms-modules-and-themes,dmitry-urenev/extended-orchard-cms-v10.1,emretiryaki/Orchard,xkproject/Orchard,li0803/Orchard,vard0/orchard.tan,asabbott/chicagodevnet-website,vard0/orchard.tan,SzymonSel/Orchard,mvarblow/Orchard,Anton-Am/Orchard,phillipsj/Orchard,dcinzona/Orchard-Harvest-Website,IDeliverable/Orchard,qt1/orchard4ibn,IDeliverable/Orchard,kouweizhong/Orchard,m2cms/Orchard,cryogen/orchard,Dolphinsimon/Orchard,jersiovic/Orchard,tobydodds/folklife,Anton-Am/Orchard,aaronamm/Orchard,luchaoshuai/Orchard,Dolphinsimon/Orchard,OrchardCMS/Orchard,marcoaoteixeira/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,dmitry-urenev/extended-orchard-cms-v10.1,rtpHarry/Orchard,jtkech/Orchard,yonglehou/Orchard,aaronamm/Orchard,tobydodds/folklife,MetSystem/Orchard,vairam-svs/Orchard,caoxk/orchard,sebastienros/msc,Codinlab/Orchard,escofieldnaxos/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,mgrowan/Orchard,Ermesx/Orchard,caoxk/orchard,tobydodds/folklife,NIKASoftwareDevs/Orchard,huoxudong125/Orchard,luchaoshuai/Orchard,huoxudong125/Orchard,xkproject/Orchard,AdvantageCS/Orchard,AEdmunds/beautiful-springtime,abhishekluv/Orchard,RoyalVeterinaryCollege/Orchard,jtkech/Orchard,mgrowan/Orchard,brownjordaninternational/OrchardCMS,harmony7/Orchard,austinsc/Orchard,salarvand/Portal,JRKelso/Orchard,mvarblow/Orchard,bedegaming-aleksej/Orchard,KeithRaven/Orchard,dozoft/Orchard,xiaobudian/Orchard,salarvand/orchard,escofieldnaxos/Orchard,dcinzona/Orchard-Harvest-Website,jaraco/orchard,neTp9c/Orchard,oxwanawxo/Orchard,TalaveraTechnologySolutions/Orchard,hannan-azam/Orchard,patricmutwiri/Orchard,vard0/orchard.tan,fortunearterial/Orchard,hannan-azam/Orchard,Inner89/Orchard,oxwanawxo/Orchard,dburriss/Orchard,SouleDesigns/SouleDesigns.Orchard,Praggie/Orchard,xiaobudian/Orchard,arminkarimi/Orchard,mvarblow/Orchard,fortunearterial/Orchard,JRKelso/Orchard,Sylapse/Orchard.HttpAuthSample,austinsc/Orchard,jimasp/Orchard,angelapper/Orchard,MpDzik/Orchard,Serlead/Orchard,harmony7/Orchard,princeppy/JPYSites-Orchard-Azure-Live-SourceCode,MetSystem/Orchard,RoyalVeterinaryCollege/Orchard,stormleoxia/Orchard,cooclsee/Orchard,Dolphinsimon/Orchard,bedegaming-aleksej/Orchard,jchenga/Orchard,TalaveraTechnologySolutions/Orchard,cryogen/orchard,SeyDutch/Airbrush,Morgma/valleyviewknolls,aaronamm/Orchard,gcsuk/Orchard,abhishekluv/Orchard,bigfont/orchard-cms-modules-and-themes,AndreVolksdorf/Orchard,Sylapse/Orchard.HttpAuthSample,MpDzik/Orchard,patricmutwiri/Orchard,dburriss/Orchard,Lombiq/Orchard,alejandroaldana/Orchard,marcoaoteixeira/Orchard,emretiryaki/Orchard,TaiAivaras/Orchard,AdvantageCS/Orchard,MetSystem/Orchard,dozoft/Orchard,abhishekluv/Orchard,xkproject/Orchard,gcsuk/Orchard,AdvantageCS/Orchard,angelapper/Orchard,salarvand/orchard,JRKelso/Orchard,dcinzona/Orchard-Harvest-Website,jimasp/Orchard,oxwanawxo/Orchard,bedegaming-aleksej/Orchard,kgacova/Orchard,hhland/Orchard,MetSystem/Orchard,jimasp/Orchard,sebastienros/msc,dburriss/Orchard,dcinzona/Orchard-Harvest-Website,angelapper/Orchard,m2cms/Orchard,princeppy/JPYSites-Orchard-Azure-Live-SourceCode,phillipsj/Orchard,vairam-svs/Orchard,bigfont/orchard-continuous-integration-demo,Lombiq/Orchard,armanforghani/Orchard,fassetar/Orchard,austinsc/Orchard,fassetar/Orchard,NIKASoftwareDevs/Orchard,bigfont/orchard-cms-modules-and-themes,bigfont/orchard-continuous-integration-demo,spraiin/Orchard,ericschultz/outercurve-orchard,dozoft/Orchard,qt1/Orchard,IDeliverable/Orchard,DonnotRain/Orchard,abhishekluv/Orchard,infofromca/Orchard,princeppy/JPYSites-Orchard-Azure-Live-SourceCode,sfmskywalker/Orchard,armanforghani/Orchard,openbizgit/Orchard,vairam-svs/Orchard,dozoft/Orchard,salarvand/Portal,AndreVolksdorf/Orchard,aaronamm/Orchard,fortunearterial/Orchard,OrchardCMS/Orchard,Ermesx/Orchard,hannan-azam/Orchard,TaiAivaras/Orchard,Inner89/Orchard,ehe888/Orchard,jtkech/Orchard,luchaoshuai/Orchard,jerryshi2007/Orchard,fassetar/Orchard,armanforghani/Orchard,SouleDesigns/SouleDesigns.Orchard,MpDzik/Orchard,johnnyqian/Orchard,yersans/Orchard,bigfont/orchard-cms-modules-and-themes,SouleDesigns/SouleDesigns.Orchard,mvarblow/Orchard,AndreVolksdorf/Orchard,Codinlab/Orchard,qt1/orchard4ibn,neTp9c/Orchard,qt1/orchard4ibn,johnnyqian/Orchard,brownjordaninternational/OrchardCMS,jchenga/Orchard,hannan-azam/Orchard,neTp9c/Orchard,sebastienros/msc,gcsuk/Orchard,MetSystem/Orchard,jaraco/orchard,planetClaire/Orchard-LETS,gcsuk/Orchard,Fogolan/OrchardForWork,cryogen/orchard,cooclsee/Orchard,dozoft/Orchard,planetClaire/Orchard-LETS,austinsc/Orchard,cooclsee/Orchard,asabbott/chicagodevnet-website,IDeliverable/Orchard,hannan-azam/Orchard,neTp9c/Orchard,m2cms/Orchard,huoxudong125/Orchard,qt1/Orchard,kgacova/Orchard,omidnasri/Orchard,kouweizhong/Orchard,cooclsee/Orchard,Inner89/Orchard,Fogolan/OrchardForWork,cooclsee/Orchard,bigfont/orchard-continuous-integration-demo,jimasp/Orchard,johnnyqian/Orchard,m2cms/Orchard,MpDzik/Orchard,andyshao/Orchard,johnnyqian/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,rtpHarry/Orchard,DonnotRain/Orchard,qt1/orchard4ibn,Ermesx/Orchard,TalaveraTechnologySolutions/Orchard,marcoaoteixeira/Orchard,IDeliverable/Orchard,asabbott/chicagodevnet-website,TalaveraTechnologySolutions/Orchard,asabbott/chicagodevnet-website,li0803/Orchard,hbulzy/Orchard,Codinlab/Orchard,sebastienros/msc,ehe888/Orchard | src/Orchard/Environment/DefaultHostEnvironment.cs | src/Orchard/Environment/DefaultHostEnvironment.cs | using System;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Web;
using System.Web.Hosting;
using Orchard.Mvc;
using Orchard.Services;
using Orchard.Utility.Extensions;
namespace Orchard.Environment
{
public class DefaultHostEnvironment : IHostEnvironment
{
private readonly IClock _clock;
private readonly IHttpContextAccessor _httpContextAccessor;
public DefaultHostEnvironment(IClock clock, IHttpContextAccessor httpContextAccessor) {
_clock = clock;
_httpContextAccessor = httpContextAccessor;
}
public bool IsFullTrust
{
get { return AppDomain.CurrentDomain.IsFullyTrusted; }
}
public string MapPath(string virtualPath)
{
return HostingEnvironment.MapPath(virtualPath);
}
public bool IsAssemblyLoaded(string name)
{
return AppDomain.CurrentDomain.GetAssemblies().Any(assembly => new AssemblyName(assembly.FullName).Name == name);
}
public void RestartAppDomain()
{
ResetSiteCompilation();
}
public void ResetSiteCompilation()
{
// Touch web.config
File.SetLastWriteTimeUtc(MapPath("~/web.config"), _clock.UtcNow);
// If setting up extensions/modules requires an AppDomain restart, it's very unlikely the
// current request can be processed correctly. So, we redirect to the same URL, so that the
// new request will come to the newly started AppDomain.
var httpContext = _httpContextAccessor.Current();
if (httpContext != null)
{
// Don't redirect posts...
if (httpContext.Request.RequestType == "GET")
{
httpContext.Response.Redirect(HttpContext.Current.Request.ToUrlString(), true /*endResponse*/);
}
else
{
httpContext.Response.WriteFile("~/Refresh.html");
httpContext.Response.End();
}
}
}
}
} | using System;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Web;
using System.Web.Hosting;
using Orchard.Services;
using Orchard.Utility.Extensions;
namespace Orchard.Environment
{
public class DefaultHostEnvironment : IHostEnvironment
{
private readonly IClock _clock;
public DefaultHostEnvironment(IClock clock)
{
_clock = clock;
}
public bool IsFullTrust
{
get { return AppDomain.CurrentDomain.IsFullyTrusted; }
}
public string MapPath(string virtualPath)
{
return HostingEnvironment.MapPath(virtualPath);
}
public bool IsAssemblyLoaded(string name)
{
return AppDomain.CurrentDomain.GetAssemblies().Any(assembly => new AssemblyName(assembly.FullName).Name == name);
}
public void RestartAppDomain()
{
ResetSiteCompilation();
}
public void ResetSiteCompilation()
{
// Touch web.config
File.SetLastWriteTimeUtc(MapPath("~/web.config"), _clock.UtcNow);
// If setting up extensions/modules requires an AppDomain restart, it's very unlikely the
// current request can be processed correctly. So, we redirect to the same URL, so that the
// new request will come to the newly started AppDomain.
if (HttpContext.Current != null)
{
// Don't redirect posts...
if (HttpContext.Current.Request.RequestType == "GET")
{
HttpContext.Current.Response.Redirect(HttpContext.Current.Request.ToUrlString(), true /*endResponse*/);
}
else
{
HttpContext.Current.Response.WriteFile("~/Refresh.html");
HttpContext.Current.Response.End();
}
}
}
}
} | bsd-3-clause | C# |
c4003f4d491f5fa28e565939d22bc9a13f667344 | update page title to Planet PowerShell | planetpowershell/planetpowershell,planetpowershell/planetpowershell,planetpowershell/planetpowershell,planetpowershell/planetpowershell | src/Firehose.Web/Views/Authors/BusinessCard.cshtml | src/Firehose.Web/Views/Authors/BusinessCard.cshtml | @using Firehose.Web.Infrastructure
@model IAmACommunityMember
<div class="businessCard">
<span class="mugShot" style="background-image: url('@Model.GravatarImage()');"></span>
<p>
<strong>@Model.FirstName @Model.LastName</strong><br />
<span title="Planet PowerShell | @Model.ShortBioOrTagLine">@Model.ShortBioOrTagLine</span><br />
@Model.StateOrRegion<br />
@if (Model is IAmAMicrosoftMVP)
{
string output = string.Empty;
var microsoftMvpModel = Model as IAmAMicrosoftMVP;
if (microsoftMvpModel != null)
{
output += " Microsoft MVP";
}
<text>@output</text>
}
</p>
<p>
</p>
<p>
<a href="https://twitter.com/@Model.TwitterHandle" class="twitter-follow-button" data-show-count="false">Follow @@@Model.TwitterHandle</a>
</p>
<p>
<a class="contactDetail" href="https://twitter.com/@Model.TwitterHandle">Twitter</a><br />
@foreach (var uri in Model.FeedUris)
{
<a class="contactDetail" href="@uri.ToString()" title="@uri.ToString()">RSS</a>
}
<br />
<a href="@(Model.WebSite.ToString())" title="@Model.WebSite.ToString()">@Model.WebSite.ToString()</a>
</p>
</div> | @using Firehose.Web.Infrastructure
@model IAmACommunityMember
<div class="businessCard">
<span class="mugShot" style="background-image: url('@Model.GravatarImage()');"></span>
<p>
<strong>@Model.FirstName @Model.LastName</strong><br />
<span title="Planet Xamarin | @Model.ShortBioOrTagLine">@Model.ShortBioOrTagLine</span><br />
@Model.StateOrRegion<br />
@if (Model is IAmAMicrosoftMVP)
{
string output = string.Empty;
var microsoftMvpModel = Model as IAmAMicrosoftMVP;
if (microsoftMvpModel != null)
{
output += " Microsoft MVP";
}
<text>@output</text>
}
</p>
<p>
</p>
<p>
<a href="https://twitter.com/@Model.TwitterHandle" class="twitter-follow-button" data-show-count="false">Follow @@@Model.TwitterHandle</a>
</p>
<p>
<a class="contactDetail" href="https://twitter.com/@Model.TwitterHandle">Twitter</a><br />
@foreach (var uri in Model.FeedUris)
{
<a class="contactDetail" href="@uri.ToString()" title="@uri.ToString()">RSS</a>
}
<br />
<a href="@(Model.WebSite.ToString())" title="@Model.WebSite.ToString()">@Model.WebSite.ToString()</a>
</p>
</div> | mit | C# |
316948064199493c6823bf97d4493c0869983ede | Use Pascal casing for method name | nobuoka/WindowsRuntimeSupportLibForJS,nobuoka/WindowsRuntimeSupportLibForJS,nobuoka/WindowsRuntimeSupportLibForJS,nobuoka/WindowsRuntimeSupportLibForJS | WinRSJS.Runtime/Collections.cs | WinRSJS.Runtime/Collections.cs | using System;
using System.Collections.Generic;
namespace WinRSJS
{
public sealed class Collections
{
static public object /* IMap<?, ?> */ CreateMap(string keyTypeName, string valTypeName)
{
Type typeKey = Type.GetType(keyTypeName);
if (typeKey == null)
{
throw new ArgumentException("Key type name `" + keyTypeName + "` is invalid.");
}
Type typeVal = Type.GetType(valTypeName);
if (typeVal == null)
{
throw new ArgumentException("Value type name `" + valTypeName + "` is invalid.");
}
Type typeDict = typeof(Dictionary<,>).MakeGenericType(new Type[] { typeKey, typeVal });
return Activator.CreateInstance(typeDict);
}
}
}
| using System;
using System.Collections.Generic;
namespace WinRSJS
{
public sealed class Collections
{
static public object /* IMap<?, ?> */ createMap(string keyTypeName, string valTypeName)
{
Type typeKey = Type.GetType(keyTypeName);
if (typeKey == null)
{
throw new ArgumentException("Key type name `" + keyTypeName + "` is invalid.");
}
Type typeVal = Type.GetType(valTypeName);
if (typeVal == null)
{
throw new ArgumentException("Value type name `" + valTypeName + "` is invalid.");
}
Type typeDict = typeof(Dictionary<,>).MakeGenericType(new Type[] { typeKey, typeVal });
return Activator.CreateInstance(typeDict);
}
}
}
| apache-2.0 | C# |
5d8a901eb5d086b972318261f766981ccb4fc03e | Add logging if HMRC should not return a name for the empref | SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice | src/SFA.DAS.EmployerApprenticeshipsService.Application/Queries/GetHmrcEmployerInformation/GetHmrcEmployerInformationHandler.cs | src/SFA.DAS.EmployerApprenticeshipsService.Application/Queries/GetHmrcEmployerInformation/GetHmrcEmployerInformationHandler.cs | using System.Data;
using System.Threading.Tasks;
using MediatR;
using SFA.DAS.EAS.Application.Queries.GetPayeSchemeInUse;
using SFA.DAS.Validation;
using SFA.DAS.EAS.Domain.Interfaces;
using SFA.DAS.NLog.Logger;
namespace SFA.DAS.EAS.Application.Queries.GetHmrcEmployerInformation
{
public class GetHmrcEmployerInformationHandler : IAsyncRequestHandler<GetHmrcEmployerInformationQuery, GetHmrcEmployerInformationResponse>
{
private readonly IValidator<GetHmrcEmployerInformationQuery> _validator;
private readonly IHmrcService _hmrcService;
private readonly IMediator _mediator;
private readonly ILog _logger;
public GetHmrcEmployerInformationHandler(IValidator<GetHmrcEmployerInformationQuery> validator, IHmrcService hmrcService, IMediator mediator, ILog logger)
{
_validator = validator;
_hmrcService = hmrcService;
_mediator = mediator;
_logger = logger;
}
public async Task<GetHmrcEmployerInformationResponse> Handle(GetHmrcEmployerInformationQuery message)
{
var result = _validator.Validate(message);
if (!result.IsValid())
{
throw new InvalidRequestException(result.ValidationDictionary);
}
var empref = await _hmrcService.DiscoverEmpref(message.AuthToken);
if (string.IsNullOrEmpty(empref))
{
throw new NotFoundException($"{empref} no paye scheme exists");
}
var emprefInformation = await _hmrcService.GetEmprefInformation(message.AuthToken, empref);
if (string.IsNullOrWhiteSpace(emprefInformation?.Employer?.Name?.EmprefAssociatedName))
{
_logger.Warn($"The call to GetEmprefInformation() for employer reference '{empref}' has not return a name - continuing but the name in the database will be empty");
}
var schemeCheck = await _mediator.SendAsync(new GetPayeSchemeInUseQuery { Empref = empref });
if (schemeCheck.PayeScheme != null)
{
_logger.Warn($"PAYE scheme {empref} already in use.");
throw new ConstraintException("PAYE scheme already in use");
}
return new GetHmrcEmployerInformationResponse { EmployerLevyInformation = emprefInformation, Empref = empref };
}
}
}
| using System.Data;
using System.Threading.Tasks;
using MediatR;
using SFA.DAS.EAS.Application.Queries.GetPayeSchemeInUse;
using SFA.DAS.Validation;
using SFA.DAS.EAS.Domain.Interfaces;
using SFA.DAS.NLog.Logger;
namespace SFA.DAS.EAS.Application.Queries.GetHmrcEmployerInformation
{
public class GetHmrcEmployerInformationHandler : IAsyncRequestHandler<GetHmrcEmployerInformationQuery, GetHmrcEmployerInformationResponse>
{
private readonly IValidator<GetHmrcEmployerInformationQuery> _validator;
private readonly IHmrcService _hmrcService;
private readonly IMediator _mediator;
private readonly ILog _logger;
public GetHmrcEmployerInformationHandler(IValidator<GetHmrcEmployerInformationQuery> validator, IHmrcService hmrcService, IMediator mediator, ILog logger)
{
_validator = validator;
_hmrcService = hmrcService;
_mediator = mediator;
_logger = logger;
}
public async Task<GetHmrcEmployerInformationResponse> Handle(GetHmrcEmployerInformationQuery message)
{
var result = _validator.Validate(message);
if (!result.IsValid())
{
throw new InvalidRequestException(result.ValidationDictionary);
}
var empref = await _hmrcService.DiscoverEmpref(message.AuthToken);
if (string.IsNullOrEmpty(empref))
{
throw new NotFoundException($"{empref} no paye scheme exists");
}
var emprefInformation = await _hmrcService.GetEmprefInformation(message.AuthToken, empref);
var schemeCheck = await _mediator.SendAsync(new GetPayeSchemeInUseQuery { Empref = empref });
if (schemeCheck.PayeScheme != null)
{
_logger.Warn($"PAYE scheme {empref} already in use.");
throw new ConstraintException("PAYE scheme already in use");
}
return new GetHmrcEmployerInformationResponse { EmployerLevyInformation = emprefInformation, Empref = empref };
}
}
}
| mit | C# |
a20852c6e4309a60317858e151913106f8775f0f | implement generate random number for ChargeUtils | innerfence/chargedemo-windows | InnerFence.ChargeDemo.Phone/ChargeAPI/ChargeUtilsPhone.cs | InnerFence.ChargeDemo.Phone/ChargeAPI/ChargeUtilsPhone.cs | using System;
using System.Collections.Generic;
using System.IO.IsolatedStorage;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
namespace InnerFence.ChargeAPI
{
public static partial class ChargeUtils
{
private static RandomNumberGenerator s_rng;
public static void DeleteLocalData(string key)
{
IsolatedStorageSettings.ApplicationSettings.Remove(key);
}
public static object RetrieveLocalData(string key)
{
if (IsolatedStorageSettings.ApplicationSettings.Contains(key))
{
return IsolatedStorageSettings.ApplicationSettings[key];
}
return null;
}
public static void SaveLocalData(string key, object value)
{
IsolatedStorageSettings.ApplicationSettings[key] = value;
IsolatedStorageSettings.ApplicationSettings.Save();
}
public static void SubmitChargeRequest(ChargeRequest chargeRequest)
{
throw new NotImplementedException();
}
public static uint GenerateRandomNumber()
{
if (s_rng == null)
{
s_rng = new RNGCryptoServiceProvider();
}
byte[] bytes = new byte[8];
s_rng.GetBytes(bytes);
return BitConverter.ToUInt32(bytes, 0);
}
}
}
| using System;
using System.Collections.Generic;
using System.IO.IsolatedStorage;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace InnerFence.ChargeAPI
{
public static partial class ChargeUtils
{
public static void DeleteLocalData(string key)
{
IsolatedStorageSettings.ApplicationSettings.Remove(key);
}
public static object RetrieveLocalData(string key)
{
if (IsolatedStorageSettings.ApplicationSettings.Contains(key))
{
return IsolatedStorageSettings.ApplicationSettings[key];
}
return null;
}
public static void SaveLocalData(string key, object value)
{
IsolatedStorageSettings.ApplicationSettings[key] = value;
IsolatedStorageSettings.ApplicationSettings.Save();
}
public static void SubmitChargeRequest(ChargeRequest chargeRequest)
{
throw new NotImplementedException();
}
public static uint GenerateRandomNumber()
{
throw new NotImplementedException();
}
}
}
| mit | C# |
255cbab7d0fb9178b1436841defe3788edd4e637 | Fix formatting | meziantou/Meziantou.Framework,meziantou/Meziantou.Framework,meziantou/Meziantou.Framework,meziantou/Meziantou.Framework | tests/Meziantou.Framework.Win32.ProjectedFileSystem.Tests/ProjectedFileSystemFactAttribute.cs | tests/Meziantou.Framework.Win32.ProjectedFileSystem.Tests/ProjectedFileSystemFactAttribute.cs | using System;
using System.IO;
using Xunit;
namespace Meziantou.Framework.Win32.ProjectedFileSystem
{
[AttributeUsage(AttributeTargets.All)]
public sealed class ProjectedFileSystemFactAttribute : FactAttribute
{
public ProjectedFileSystemFactAttribute()
{
var guid = Guid.NewGuid();
var fullPath = Path.Combine(Path.GetTempPath(), "projFS", guid.ToString("N"));
try
{
Directory.CreateDirectory(fullPath);
try
{
using var vfs = new SampleVirtualFileSystem(fullPath);
var options = new ProjectedFileSystemStartOptions();
try
{
vfs.Start(options);
}
catch (NotSupportedException ex)
{
Skip = ex.Message;
}
}
catch
{
}
}
finally
{
try
{
Directory.Delete(fullPath, recursive: true);
}
catch
{
}
}
}
}
}
| using System;
using System.IO;
using Xunit;
namespace Meziantou.Framework.Win32.ProjectedFileSystem
{
[AttributeUsage(AttributeTargets.All)]
public sealed class ProjectedFileSystemFactAttribute : FactAttribute
{
public ProjectedFileSystemFactAttribute()
{
var guid = Guid.NewGuid();
var fullPath = Path.Combine(Path.GetTempPath(), "projFS", guid.ToString("N"));
try
{
Directory.CreateDirectory(fullPath);
try
{
using var vfs = new SampleVirtualFileSystem(fullPath);
var options = new ProjectedFileSystemStartOptions();
try
{
vfs.Start(options);
}
catch (NotSupportedException ex)
{
Skip = ex.Message;
}
}
catch
{
}
}
finally
{
try
{
Directory.Delete(fullPath, recursive: true);
}
catch
{
}
}
}
}
}
| mit | C# |
b43c6bd3b501ed8906cfcc1ca0abcc9e61c31d54 | Implement PlayerPrefs for score storage | 00christian00/unity3d-levelup,00christian00/unity3d-levelup,vedi/unity3d-levelup,vedi/unity3d-levelup,00christian00/unity3d-levelup,00christian00/unity3d-levelup,00christian00/unity3d-levelup,vedi/unity3d-levelup,vedi/unity3d-levelup,vedi/unity3d-levelup | Soomla/Assets/Plugins/Soomla/Levelup/data/ScoreStorage.cs | Soomla/Assets/Plugins/Soomla/Levelup/data/ScoreStorage.cs | /// Copyright (C) 2012-2014 Soomla Inc.
///
/// 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.
using UnityEngine;
using System;
namespace Soomla.Levelup
{
public class ScoreStorage
{
protected const string TAG = "SOOMLA ScoreStorage"; // used for Log error messages
static ScoreStorage _instance = null;
static ScoreStorage instance {
get {
if(_instance == null) {
#if UNITY_ANDROID && !UNITY_EDITOR
_instance = new ScoreStorageAndroid();
#elif UNITY_IOS && !UNITY_EDITOR
_instance = new ScoreStorageIOS();
#else
_instance = new ScoreStorage();
#endif
}
return _instance;
}
}
public static void SetLatestScore(Score score, double latest) {
instance._setLatestScore (score, latest);
}
public static double GetLatestScore(Score score) {
return instance._getLatestScore (score);
}
public static void SetRecordScore(Score score, double record) {
instance._setRecordScore (score, record);
}
public static double GetRecordScore(Score score) {
return instance._getRecordScore (score);
}
protected void _setLatestScore(Score score, double latest) {
string key = keyLatestScore (score.ScoreId);
string val = latest.ToString ();
PlayerPrefs.SetString (key, val);
}
protected double _getLatestScore(Score score) {
string key = keyLatestScore (score.ScoreId);
string val = PlayerPrefs.GetString (key);
return val == null ? 0 : double.Parse (val);
}
protected void _setRecordScore(Score score, double record) {
string key = keyRecordScore (score.ScoreId);
string val = record.ToString ();
PlayerPrefs.SetString (key, val);
LevelUpEvents.OnScoreRecordChanged (score);
}
protected double _getRecordScore(Score score) {
string key = keyRecordScore (score.ScoreId);
string val = PlayerPrefs.GetString (key);
return val == null ? 0 : double.Parse (val);
}
private static string keyScores(string scoreId, string postfix) {
return LevelUp.DB_KEY_PREFIX + "scores." + scoreId + "." + postfix;
}
private static string keyLatestScore(string scoreId) {
return keyScores(scoreId, "latest");
}
private static string keyRecordScore(string scoreId) {
return keyScores(scoreId, "record");
}
}
}
| /// Copyright (C) 2012-2014 Soomla Inc.
///
/// 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.
using UnityEngine;
using System;
namespace Soomla.Levelup
{
public class ScoreStorage
{
protected const string TAG = "SOOMLA ScoreStorage"; // used for Log error messages
static ScoreStorage _instance = null;
static ScoreStorage instance {
get {
if(_instance == null) {
#if UNITY_ANDROID && !UNITY_EDITOR
_instance = new ScoreStorageAndroid();
#elif UNITY_IOS && !UNITY_EDITOR
_instance = new ScoreStorageIOS();
#else
_instance = new ScoreStorage();
#endif
}
return _instance;
}
}
public static void SetLatestScore(Score score, double latest) {
instance._setLatestScore (score, latest);
}
public static double GetLatestScore(Score score) {
return instance._getLatestScore (score);
}
public static void SetRecordScore(Score score, double record) {
instance._setRecordScore (score, record);
}
public static double GetRecordScore(Score score) {
return instance._getRecordScore (score);
}
virtual protected void _setLatestScore(Score score, double latest) {
// TODO: WIE
}
virtual protected double _getLatestScore(Score score) {
// TODO: WIE
return 0;
}
virtual protected void _setRecordScore(Score score, double record) {
// TODO: WIE
}
virtual protected double _getRecordScore(Score score) {
// TODO: WIE
return 0;
}
}
}
| apache-2.0 | C# |
9dba94d6fa7531cd2dc7f2b8debbe6f88fbbfa89 | Bump Version | UniqProject/BDInfo | BDInfo/Properties/AssemblyInfo.cs | BDInfo/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("BDInfo")]
[assembly: AssemblyDescription("Blu-ray Video and Audio Specifications Collection Tool")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Cinema Squid & UniqProject")]
[assembly: AssemblyProduct("BDInfo")]
[assembly: AssemblyCopyright("Copyright © Cinema Squid 2011 & UniqProject 2017-2018")]
[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("6a516a5c-6c0d-4ab0-bb8d-f113d544355e")]
// 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.7.5.4")]
[assembly: AssemblyFileVersion("0.7.5.4")]
| 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("BDInfo")]
[assembly: AssemblyDescription("Blu-ray Video and Audio Specifications Collection Tool")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Cinema Squid & UniqProject")]
[assembly: AssemblyProduct("BDInfo")]
[assembly: AssemblyCopyright("Copyright © Cinema Squid 2011 & UniqProject 2017-2018")]
[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("6a516a5c-6c0d-4ab0-bb8d-f113d544355e")]
// 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.7.5.3")]
[assembly: AssemblyFileVersion("0.7.5.3")]
| lgpl-2.1 | C# |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.