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
f67a09d50c95657a70784d10aa94bcaa2a87ea0b
Add some docs
mminns/xwt,residuum/xwt,mono/xwt,sevoku/xwt,cra0zy/xwt,hamekoz/xwt,antmicro/xwt,hwthomas/xwt,akrisiun/xwt,iainx/xwt,lytico/xwt,steffenWi/xwt,TheBrainTech/xwt,mminns/xwt,directhex/xwt
Xwt/Xwt.Backends/IScrollAdjustmentBackend.cs
Xwt/Xwt.Backends/IScrollAdjustmentBackend.cs
// // IScrollAdjustmentBackend.cs // // Author: // Lluis Sanchez <lluis@xamarin.com> // // Copyright (c) 2012 Xamarin 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. using System; namespace Xwt.Backends { /// <summary> /// A backend for a scrollbar /// </summary> public interface IScrollAdjustmentBackend: IBackend { /// <summary> /// Called to initialize the backend /// </summary> /// <param name='eventSink'> /// The event sink to be used to report events /// </param> void Initialize (IScrollAdjustmentEventSink eventSink); /// <summary> /// Gets or sets the current position of the scrollbar. /// </summary> /// <value> /// The position /// </value> /// <remarks> /// Value is the position of top coordinate of the visible rect (or left for horizontal scrollbars). /// So for example, if you set Value=35 and PageSize=100, the visible range will be 35 to 135. /// Value must be >= LowerValue and <= (UpperValue - PageSize). /// </remarks> double Value { get; set; } /// <summary> /// Gets or sets the lowest value of the scroll range. /// </summary> /// <value> /// The lower value. /// </value> /// <remarks>It must be <= UpperValue</remarks> double LowerValue { get; set; } /// <summary> /// Gets or sets the highest value of the scroll range /// </summary> /// <value> /// The upper value. /// </value> /// <remarks>It must be >= LowerValue</remarks> double UpperValue { get; set; } /// <summary> /// How much Value will be incremented when you click on the scrollbar to move /// to the next page (when the scrollbar supports it) /// </summary> /// <value> /// The page increment. /// </value> double PageIncrement { get; set; } /// <summary> /// How much the Value is incremented/decremented when you click on the down/up button in the scrollbar /// </summary> /// <value> /// The step increment. /// </value> double StepIncrement { get; set; } /// <summary> /// Size of the visible range /// </summary> /// <remarks> /// For example, if LowerValue=0, UpperValue=100, Value=25 and PageSize=50, the visible range will be 25 to 75 /// </remarks> double PageSize { get; set; } } public interface IScrollAdjustmentEventSink { /// <summary> /// Raised when the position of the scrollbar changes /// </summary> void OnValueChanged (); } public enum ScrollAdjustmentEvent { ValueChanged } }
// // IScrollAdjustmentBackend.cs // // Author: // Lluis Sanchez <lluis@xamarin.com> // // Copyright (c) 2012 Xamarin 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. using System; namespace Xwt.Backends { public interface IScrollAdjustmentBackend: IBackend { void Initialize (IScrollAdjustmentEventSink eventSink); double Value { get; set; } double LowerValue { get; set; } double UpperValue { get; set; } double PageIncrement { get; set; } double StepIncrement { get; set; } double PageSize { get; set; } } public interface IScrollAdjustmentEventSink { void OnValueChanged (); } public enum ScrollAdjustmentEvent { ValueChanged } }
mit
C#
bf9c2c04ad712351a1d538562132f5480bae253d
Fix disabling check boxes
leotsarev/joinrpg-net,joinrpg/joinrpg-net,leotsarev/joinrpg-net,leotsarev/joinrpg-net,leotsarev/joinrpg-net,joinrpg/joinrpg-net,kirillkos/joinrpg-net,kirillkos/joinrpg-net,joinrpg/joinrpg-net,joinrpg/joinrpg-net
Joinrpg/Views/Shared/EditorTemplates/SubscribeSettingsViewModel.cshtml
Joinrpg/Views/Shared/EditorTemplates/SubscribeSettingsViewModel.cshtml
@model JoinRpg.Web.Models.SubscribeSettingsViewModel @functions { private object CheckBoxEnabled(bool enabled) { return enabled ? null : new {@disabled = "disabled"}; } } <div class="form-horizontal"> <h4>Настройки подписки</h4> <hr/> @Html.ValidationSummary(true, "", new {@class = "text-danger"}) <div class="form-group"> @Html.LabelFor(model => model.ClaimStatusChange, htmlAttributes: new {@class = "control-label col-md-2"}) <div class="col-md-10"> <div class="checkbox"> @Html.CheckBoxFor(model => model.ClaimStatusChange, CheckBoxEnabled(Model.ClaimStatusChangeEnabled)) @Html.ValidationMessageFor(model => model.ClaimStatusChange, "", new {@class = "text-danger"}) </div> </div> @Html.HiddenFor(model => model.ClaimStatusChangeEnabled) </div> <div class="form-group"> @Html.LabelFor(model => model.Comments, htmlAttributes: new {@class = "control-label col-md-2"}) <div class="col-md-10"> <div class="checkbox"> @Html.CheckBoxFor(model => model.Comments, CheckBoxEnabled(Model.CommentsEnabled)) @Html.ValidationMessageFor(model => model.Comments, "", new {@class = "text-danger"}) </div> </div> @Html.HiddenFor(model => model.CommentsEnabled) </div> <div class="form-group"> @Html.LabelFor(model => model.FieldChange, htmlAttributes: new {@class = "control-label col-md-2"}) <div class="col-md-10"> <div class="checkbox"> @Html.CheckBoxFor(model => model.FieldChange, CheckBoxEnabled(Model.FieldChangeEnabled)) @Html.ValidationMessageFor(model => model.FieldChange, "", new {@class = "text-danger"}) </div> </div> </div> @Html.HiddenFor(model => model.FieldChangeEnabled) </div>
@model JoinRpg.Web.Models.SubscribeSettingsViewModel <div class="form-horizontal"> <h4>Настройки подписки</h4> <hr/> @Html.ValidationSummary(true, "", new {@class = "text-danger"}) <div class="form-group"> @Html.LabelFor(model => model.ClaimStatusChange, htmlAttributes: new {@class = "control-label col-md-2"}) <div class="col-md-10"> <div class="checkbox"> @Html.CheckBoxFor(model => model.ClaimStatusChange, new {@disabled = !Model.ClaimStatusChangeEnabled}) @Html.ValidationMessageFor(model => model.ClaimStatusChange, "", new {@class = "text-danger"}) </div> </div> @Html.HiddenFor(model => model.ClaimStatusChangeEnabled) </div> <div class="form-group"> @Html.LabelFor(model => model.Comments, htmlAttributes: new {@class = "control-label col-md-2"}) <div class="col-md-10"> <div class="checkbox"> @Html.CheckBoxFor(model => model.Comments, new {@disabled = !Model.CommentsEnabled}) @Html.ValidationMessageFor(model => model.Comments, "", new {@class = "text-danger"}) </div> </div> @Html.HiddenFor(model => model.CommentsEnabled) </div> <div class="form-group"> @Html.LabelFor(model => model.FieldChange, htmlAttributes: new {@class = "control-label col-md-2"}) <div class="col-md-10"> <div class="checkbox"> @Html.CheckBoxFor(model => model.FieldChange, new {@disabled = !Model.FieldChangeEnabled}) @Html.ValidationMessageFor(model => model.FieldChange, "", new {@class = "text-danger"}) </div> </div> </div> @Html.HiddenFor(model => model.FieldChangeEnabled) </div>
mit
C#
6449fa9617e9ccefa22f5c59f8294c50a4583724
implement IComparable for teams
svmnotn/cuddly-octo-adventure
Core/Data/Team.cs
Core/Data/Team.cs
namespace COA.Data { using System; using System.Drawing; public class Team : IComparable<Team> { public string name; public Color color; public Font font; [NonSerialized] public int score; public int CompareTo(Team other) { if(score > other.score) { return -1; } else if(score < other.score) { return 1; } return 0; } } }
namespace COA.Data { using System; using System.Drawing; public class Team { public string name; public Color color; public Font font; [NonSerialized] public int score; } }
mit
C#
0bc918ee43487331d1bf0d5d7ca3e80d755fe94b
Fix name violation
nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet
WalletWasabi.Fluent/ViewModels/Dialogs/DialogViewModelBaseOfTResult.cs
WalletWasabi.Fluent/ViewModels/Dialogs/DialogViewModelBaseOfTResult.cs
using ReactiveUI; using System; using System.Reactive.Linq; using System.Threading.Tasks; namespace WalletWasabi.Fluent.ViewModels.Dialogs { /// <summary> /// Base ViewModel class for Dialogs that returns a value back. /// Do not reuse all types derived from this after calling ShowDialogAsync. /// Spawn a new instance instead after that. /// </summary> /// <typeparam name="TResult">The type of the value to be returned when the dialog is finished.</typeparam> public abstract class DialogViewModelBase<TResult> : DialogViewModelBase { private readonly IDisposable Disposable; private readonly TaskCompletionSource<TResult> CurrentTaskCompletionSource; private bool _isDialogOpen; protected DialogViewModelBase() { CurrentTaskCompletionSource = new TaskCompletionSource<TResult>(); Disposable = this.WhenAnyValue(x => x.IsDialogOpen) .Skip(1) // Skip the initial value change (which is false). .DistinctUntilChanged() .Subscribe(OnIsDialogOpenChanged); } /// <summary> /// Gets or sets if the dialog is opened/closed. /// </summary> public bool IsDialogOpen { get => _isDialogOpen; set => this.RaiseAndSetIfChanged(ref _isDialogOpen, value); } private void OnIsDialogOpenChanged(bool dialogState) { // Triggered when closed abruptly (via the dialog overlay or the back button). if (!dialogState) { Close(); } } /// <summary> /// Method to be called when the dialog intends to close /// and ready to pass a value back to the caller. /// </summary> /// <param name="value">The return value of the dialog</param> protected void Close(TResult value = default) { if (CurrentTaskCompletionSource.Task.IsCompleted) { throw new InvalidOperationException("Dialog is already closed."); } CurrentTaskCompletionSource.SetResult(value); Disposable.Dispose(); IsDialogOpen = false; OnDialogClosed(); } /// <summary> /// Shows the dialog. /// </summary> /// <returns>The value to be returned when the dialog is finished.</returns> public Task<TResult> ShowDialogAsync(IDialogHost host) { host.CurrentDialog = this; IsDialogOpen = true; return CurrentTaskCompletionSource.Task; } /// <summary> /// Method that is triggered when the dialog is closed. /// </summary> protected abstract void OnDialogClosed(); } }
using ReactiveUI; using System; using System.Reactive.Linq; using System.Threading.Tasks; namespace WalletWasabi.Fluent.ViewModels.Dialogs { /// <summary> /// Base ViewModel class for Dialogs that returns a value back. /// Do not reuse all types derived from this after calling ShowDialogAsync. /// Spawn a new instance instead after that. /// </summary> /// <typeparam name="TResult">The type of the value to be returned when the dialog is finished.</typeparam> public abstract class DialogViewModelBase<TResult> : DialogViewModelBase { private readonly IDisposable _disposable; private readonly TaskCompletionSource<TResult> _currentTaskCompletionSource; private bool _isDialogOpen; protected DialogViewModelBase() { _currentTaskCompletionSource = new TaskCompletionSource<TResult>(); _disposable = this.WhenAnyValue(x => x.IsDialogOpen) .Skip(1) // Skip the initial value change (which is false). .DistinctUntilChanged() .Subscribe(OnIsDialogOpenChanged); } /// <summary> /// Gets or sets if the dialog is opened/closed. /// </summary> public bool IsDialogOpen { get => _isDialogOpen; set => this.RaiseAndSetIfChanged(ref _isDialogOpen, value); } private void OnIsDialogOpenChanged(bool dialogState) { // Triggered when closed abruptly (via the dialog overlay or the back button). if (!dialogState) { Close(); } } /// <summary> /// Method to be called when the dialog intends to close /// and ready to pass a value back to the caller. /// </summary> /// <param name="value">The return value of the dialog</param> protected void Close(TResult value = default) { if (_currentTaskCompletionSource.Task.IsCompleted) { throw new InvalidOperationException("Dialog is already closed."); } _currentTaskCompletionSource.SetResult(value); _disposable.Dispose(); IsDialogOpen = false; OnDialogClosed(); } /// <summary> /// Shows the dialog. /// </summary> /// <returns>The value to be returned when the dialog is finished.</returns> public Task<TResult> ShowDialogAsync(IDialogHost host) { host.CurrentDialog = this; IsDialogOpen = true; return _currentTaskCompletionSource.Task; } /// <summary> /// Method that is triggered when the dialog is closed. /// </summary> protected abstract void OnDialogClosed(); } }
mit
C#
f0c5c04fb66a1099a9d1cd4330f8804e1a6f8c1d
Fix for: MPLY-6962. The data binding properties were not being set or notified. Buddy: John
eegeo/eegeo-example-app,eegeo/eegeo-example-app,wrld3d/wrld-example-app,wrld3d/wrld-example-app,eegeo/eegeo-example-app,wrld3d/wrld-example-app,eegeo/eegeo-example-app,eegeo/eegeo-example-app,wrld3d/wrld-example-app,wrld3d/wrld-example-app,eegeo/eegeo-example-app,wrld3d/wrld-example-app,eegeo/eegeo-example-app,wrld3d/wrld-example-app,wrld3d/wrld-example-app
windows/ExampleApp/ExampleAppWPF/Views/SearchResultPoi/GeonamesSearchResultsPoiView.cs
windows/ExampleApp/ExampleAppWPF/Views/SearchResultPoi/GeonamesSearchResultsPoiView.cs
using System; using System.Windows; using System.Windows.Controls; namespace ExampleAppWPF { public class GeoNamesSearchResultsPoiView : SearchResultPoiViewBase { private ExampleApp.SearchResultModelCLI m_model; private Image m_categoryIcon; private string m_title; private string m_country; public string Title { get { return m_title; } set { if (m_country != value) { m_title = value; OnPropertyChanged("Title"); } } } public string Country { get { return m_country; } set { if (m_country != value) { m_country = value; OnPropertyChanged("Country"); } } } static GeoNamesSearchResultsPoiView() { DefaultStyleKeyProperty.OverrideMetadata(typeof(GeoNamesSearchResultsPoiView), new FrameworkPropertyMetadata(typeof(GeoNamesSearchResultsPoiView))); } public GeoNamesSearchResultsPoiView(IntPtr nativeCallerPointer) : base(nativeCallerPointer) { } public override void OnApplyTemplate() { base.OnApplyTemplate(); m_categoryIcon = (Image)GetTemplateChild("CategoryIcon"); m_mainContainer = (FrameworkElement)GetTemplateChild("GeoNamesResultView"); } public override void DisplayPoiInfo(Object modelObject, bool isPinned) { m_model = modelObject as ExampleApp.SearchResultModelCLI; m_categoryIcon.Source = StartupResourceLoader.GetBitmap(SearchResultCategoryMapper.GetIconImageName(m_model.Category)); m_closing = false; Title = m_model.Title; Country = m_model.Subtitle; m_isPinned = isPinned; ShowAll(); } public override void UpdateImageData(string url, bool hasImage, byte[] imgData) { // No image for this view type } } }
using System; using System.Windows; using System.Windows.Controls; namespace ExampleAppWPF { public class GeoNamesSearchResultsPoiView : SearchResultPoiViewBase { private ExampleApp.SearchResultModelCLI m_model; private Image m_categoryIcon; public string Title { get; set; } public string Country { get; set; } static GeoNamesSearchResultsPoiView() { DefaultStyleKeyProperty.OverrideMetadata(typeof(GeoNamesSearchResultsPoiView), new FrameworkPropertyMetadata(typeof(GeoNamesSearchResultsPoiView))); } public GeoNamesSearchResultsPoiView(IntPtr nativeCallerPointer) : base(nativeCallerPointer) { } public override void OnApplyTemplate() { base.OnApplyTemplate(); m_categoryIcon = (Image)GetTemplateChild("CategoryIcon"); m_mainContainer = (FrameworkElement)GetTemplateChild("GeoNamesResultView"); } public override void DisplayPoiInfo(Object modelObject, bool isPinned) { m_model = modelObject as ExampleApp.SearchResultModelCLI; m_categoryIcon.Source = StartupResourceLoader.GetBitmap(SearchResultCategoryMapper.GetIconImageName(m_model.Category)); m_closing = false; Title = m_model.Title; Country = m_model.Subtitle; m_isPinned = isPinned; ShowAll(); } public override void UpdateImageData(string url, bool hasImage, byte[] imgData) { // No image for this view type } } }
bsd-2-clause
C#
0f69b2d030822d2c810c3cc8dc372dd99065c65c
Update UnprotectingPasswordProtectedWorksheet.cs
maria-shahid-aspose/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,maria-shahid-aspose/Aspose.Cells-for-.NET,maria-shahid-aspose/Aspose.Cells-for-.NET,aspose-cells/Aspose.Cells-for-.NET,aspose-cells/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,maria-shahid-aspose/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,aspose-cells/Aspose.Cells-for-.NET,aspose-cells/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET
Examples/CSharp/Worksheets/Security/Unprotect/UnprotectingPasswordProtectedWorksheet.cs
Examples/CSharp/Worksheets/Security/Unprotect/UnprotectingPasswordProtectedWorksheet.cs
using System.IO; using Aspose.Cells; namespace Aspose.Cells.Examples.Worksheets.Security.Unprotect { public class UnprotectingPasswordProtectedWorksheet { public static void Main(string[] args) { //ExStart:1 // The path to the documents directory. string dataDir = Aspose.Cells.Examples.Utils.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); //Instantiating a Workbook object Workbook workbook = new Workbook(dataDir + "book1.xls"); //Accessing the first worksheet in the Excel file Worksheet worksheet = workbook.Worksheets[0]; //Unprotecting the worksheet with a password worksheet.Unprotect("aspose"); //Save Workbook workbook.Save(dataDir + "output.out.xls"); //ExEnd:1 } } }
using System.IO; using Aspose.Cells; namespace Aspose.Cells.Examples.Worksheets.Security.Unprotect { public class UnprotectingPasswordProtectedWorksheet { public static void Main(string[] args) { // The path to the documents directory. string dataDir = Aspose.Cells.Examples.Utils.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); //Instantiating a Workbook object Workbook workbook = new Workbook(dataDir + "book1.xls"); //Accessing the first worksheet in the Excel file Worksheet worksheet = workbook.Worksheets[0]; //Unprotecting the worksheet with a password worksheet.Unprotect("aspose"); //Save Workbook workbook.Save(dataDir + "output.out.xls"); } } }
mit
C#
6ae2f65fd6c733b2216eb9c3683055de176b6a32
build v0.5.2
Netuitive/collectdwin,pall-valmundsson/collectdwin,bloomberg/collectdwin,Netuitive/netuitive-windows-agent
src/CollectdWinService/Properties/AssemblyInfo.cs
src/CollectdWinService/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("CollectdWinService")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Bloomberg LP")] [assembly: AssemblyProduct("CollectdWinService")] [assembly: AssemblyCopyright("Copyright © Bloomberg LP 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)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("dc0404f4-acd7-40b3-ab7a-6e63f023ac40")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.5.2.0")] [assembly: AssemblyFileVersion("0.5.2.0")]
using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("CollectdWinService")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Bloomberg LP")] [assembly: AssemblyProduct("CollectdWinService")] [assembly: AssemblyCopyright("Copyright © Bloomberg LP 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)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("dc0404f4-acd7-40b3-ab7a-6e63f023ac40")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.5.1.0")] [assembly: AssemblyFileVersion("0.5.1.0")]
apache-2.0
C#
e7147965518c4267236ebcf2c9569bc0d31507f6
Set version to 0.4.0
hazzik/DelegateDecompiler,jaenyph/DelegateDecompiler,morgen2009/DelegateDecompiler
src/DelegateDecompiler/Properties/AssemblyInfo.cs
src/DelegateDecompiler/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("DelegateDecompiller")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("DelegateDecompiller")] [assembly: AssemblyCopyright("Copyright © hazzik 2012")] [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("cec0a257-502b-4718-91c3-9e67555c5e1b")] // 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.4.0.0")] [assembly: AssemblyFileVersion("0.4.0.0")]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("DelegateDecompiller")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("DelegateDecompiller")] [assembly: AssemblyCopyright("Copyright © hazzik 2012")] [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("cec0a257-502b-4718-91c3-9e67555c5e1b")] // 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.3.0.0")] [assembly: AssemblyFileVersion("0.3.0.0")]
mit
C#
a34be74f263f1713c94dd4524244dec4625ddb36
Fix bug with writing file name as timestamp
anthonyvscode/FluentEmail,anthonyvscode/FluentEmail,lukencode/FluentEmail,lukencode/FluentEmail
src/FluentEmail.Core/Defaults/SaveToDiskSender.cs
src/FluentEmail.Core/Defaults/SaveToDiskSender.cs
using System; using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; using FluentEmail.Core.Interfaces; using FluentEmail.Core.Models; namespace FluentEmail.Core.Defaults { public class SaveToDiskSender : ISender { private readonly string _directory; public SaveToDiskSender(string directory) { _directory = directory; } public SendResponse Send(IFluentEmail email, CancellationToken? token = null) { return SendAsync(email, token).GetAwaiter().GetResult(); } public async Task<SendResponse> SendAsync(IFluentEmail email, CancellationToken? token = null) { var response = new SendResponse(); await SaveEmailToDisk(email); return response; } private async Task<bool> SaveEmailToDisk(IFluentEmail email) { var random = new Random(); var filename = $"{_directory.TrimEnd('\\')}\\{DateTime.Now:yyyy-MM-dd_HH-mm-ss}_{random.Next(1000)}"; using (var sw = new StreamWriter(File.OpenWrite(filename))) { sw.WriteLine($"From: {email.Data.FromAddress.Name} <{email.Data.FromAddress.EmailAddress}>"); sw.WriteLine($"To: {string.Join(",", email.Data.ToAddresses.Select(x => $"{x.Name} <{x.EmailAddress}>"))}"); sw.WriteLine($"Cc: {string.Join(",", email.Data.CcAddresses.Select(x => $"{x.Name} <{x.EmailAddress}>"))}"); sw.WriteLine($"Bcc: {string.Join(",", email.Data.BccAddresses.Select(x => $"{x.Name} <{x.EmailAddress}>"))}"); sw.WriteLine($"ReplyTo: {string.Join(",", email.Data.ReplyToAddresses.Select(x => $"{x.Name} <{x.EmailAddress}>"))}"); sw.WriteLine($"Subject: {email.Data.Subject}"); sw.WriteLine(); await sw.WriteAsync(email.Data.Body); } return true; } } }
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; using FluentEmail.Core.Interfaces; using FluentEmail.Core.Models; namespace FluentEmail.Core.Defaults { public class SaveToDiskSender : ISender { private readonly string _directory; public SaveToDiskSender(string directory) { _directory = directory; } public SendResponse Send(IFluentEmail email, CancellationToken? token = null) { return SendAsync(email, token).GetAwaiter().GetResult(); } public async Task<SendResponse> SendAsync(IFluentEmail email, CancellationToken? token = null) { var response = new SendResponse(); await SaveEmailToDisk(email); return response; } private async Task<bool> SaveEmailToDisk(IFluentEmail email) { var random = new Random(); var filename = $"{_directory.TrimEnd('\\')}\\{DateTime.Now:yyyy-MM-dd_hh-mm-ss}_{random.Next(1000)}"; using (var sw = new StreamWriter(File.OpenWrite(filename))) { sw.WriteLine($"From: {email.Data.FromAddress.Name} <{email.Data.FromAddress.EmailAddress}>"); sw.WriteLine($"To: {string.Join(",", email.Data.ToAddresses.Select(x => $"{x.Name} <{x.EmailAddress}>"))}"); sw.WriteLine($"Cc: {string.Join(",", email.Data.CcAddresses.Select(x => $"{x.Name} <{x.EmailAddress}>"))}"); sw.WriteLine($"Bcc: {string.Join(",", email.Data.BccAddresses.Select(x => $"{x.Name} <{x.EmailAddress}>"))}"); sw.WriteLine($"ReplyTo: {string.Join(",", email.Data.ReplyToAddresses.Select(x => $"{x.Name} <{x.EmailAddress}>"))}"); sw.WriteLine($"Subject: {email.Data.Subject}"); sw.WriteLine(); await sw.WriteAsync(email.Data.Body); } return true; } } }
mit
C#
29e3b7097027fb175176bb052f9fb6ea8afdec34
Move arguments to the MinerConfiguration (instead of Launch parameter)
IWBWbiz/MultiMiner,nwoolls/MultiMiner,nwoolls/MultiMiner,IWBWbiz/MultiMiner
MultiMiner.Xgminer/MinerConfiguration.cs
MultiMiner.Xgminer/MinerConfiguration.cs
using System.Collections.Generic; namespace MultiMiner.Xgminer { public class MinerConfiguration { public MinerConfiguration() { this.DeviceIndexes = new List<int>(); } public string ExecutablePath { get; set; } public List<MiningPool> Pools { get; set; } public CoinAlgorithm Algorithm { get; set; } public int ApiPort { get; set; } public bool ApiListen { get; set; } public List<int> DeviceIndexes { get; set; } public string Arguments { get; set; } } }
using System.Collections.Generic; namespace MultiMiner.Xgminer { public class MinerConfiguration { public MinerConfiguration() { this.DeviceIndexes = new List<int>(); } public string ExecutablePath { get; set; } public List<MiningPool> Pools { get; set; } public CoinAlgorithm Algorithm { get; set; } public int ApiPort { get; set; } public bool ApiListen { get; set; } public List<int> DeviceIndexes { get; set; } } }
mit
C#
88e1348e09e7a850e25db558fd54eac13c3242f5
Update copyright and default assembly file version
Seddryck/NBi,Seddryck/NBi
AssemblyInfo.cs
AssemblyInfo.cs
using System.Reflection; using System.Runtime.CompilerServices; // 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: AssemblyCompany("NBi Team - Cdric L. Charlier")] [assembly: AssemblyProduct("NBi")] [assembly: AssemblyCopyright("Copyright Cdric L. Charlier 2012-2021")] [assembly: AssemblyDescription("NBi is a testing framework (add-on to NUnit) for Microsoft Business Intelligence platform and Data Access. The main goal of this framework is to let users create tests with a declarative approach based on an Xml syntax. By the means of NBi, you don't need to develop C# code to specify your tests! Either, you don't need Visual Studio to compile your test suite. Just create an Xml file and let the framework interpret it and play your tests. The framework is designed as an add-on of NUnit but with the possibility to port it easily to other testing frameworks.")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] //Reference the testing class to ensure access to internal members [assembly: InternalsVisibleTo("NBi.Testing")] [assembly: InternalsVisibleTo("NBi.Testing.Core")] [assembly: InternalsVisibleTo("NBi.Testing.Framework")] [assembly: InternalsVisibleTo("NBi.Testing.GenbiL")] [assembly: InternalsVisibleTo("NBi.Testing.Xml")] // 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.23")] [assembly: AssemblyFileVersion("1.23")] [assembly: AssemblyInformationalVersion("1.23")]
using System.Reflection; using System.Runtime.CompilerServices; // 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: AssemblyCompany("NBi Team - Cdric L. Charlier")] [assembly: AssemblyProduct("NBi")] [assembly: AssemblyCopyright("Copyright Cdric L. Charlier 2012-2017")] [assembly: AssemblyDescription("NBi is a testing framework (add-on to NUnit) for Microsoft Business Intelligence platform and Data Access. The main goal of this framework is to let users create tests with a declarative approach based on an Xml syntax. By the means of NBi, you don't need to develop C# code to specify your tests! Either, you don't need Visual Studio to compile your test suite. Just create an Xml file and let the framework interpret it and play your tests. The framework is designed as an add-on of NUnit but with the possibility to port it easily to other testing frameworks.")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] //Reference the testing class to ensure access to internal members [assembly: InternalsVisibleTo("NBi.Testing")] [assembly: InternalsVisibleTo("NBi.Testing.Core")] [assembly: InternalsVisibleTo("NBi.Testing.Framework")] [assembly: InternalsVisibleTo("NBi.Testing.GenbiL")] [assembly: InternalsVisibleTo("NBi.Testing.Xml")] // 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.19")] [assembly: AssemblyFileVersion("1.19")] [assembly: AssemblyInformationalVersion("1.19")]
apache-2.0
C#
e89ac3b0e6fba5055e64f965138f5169c773f8d9
Bump version
roman-yagodin/R7.University,roman-yagodin/R7.University,roman-yagodin/R7.University
R7.University/Properties/AssemblyInfo.cs
R7.University/Properties/AssemblyInfo.cs
using System.Reflection; // Information about this assembly is defined by the following attributes. // Change them to the values specific to your project. [assembly: AssemblyTitle("R7.University")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("R7.Labs")] [assembly: AssemblyProduct("R7.University")] [assembly: AssemblyCopyright("Roman M. Yagodin")] [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("2.0.0.*")] [assembly: AssemblyInformationalVersion("2.0.0-rc.3")] // 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; // Information about this assembly is defined by the following attributes. // Change them to the values specific to your project. [assembly: AssemblyTitle("R7.University")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("R7.Labs")] [assembly: AssemblyProduct("R7.University")] [assembly: AssemblyCopyright("Roman M. Yagodin")] [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("2.0.0.*")] [assembly: AssemblyInformationalVersion("2.0.0-rc.2")] // 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("")]
agpl-3.0
C#
5788ceb5d3aa8db1ca7c9ce4dffa322d83420291
change assembly title
alexrster/SAML2,elerch/SAML2
src/SAML2.Core/Properties/AssemblyInfo.cs
src/SAML2.Core/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("SAML2.Core")] [assembly: AssemblyDescription("Based on http://www.nuget.org/packages/SAML2/, this removes dependencies on System.Web. Packages SAML2.AspNet and Owin.Security.Saml will implement SAML in those environments")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Emil Lerch")] [assembly: AssemblyProduct("SAML2.Core")] [assembly: AssemblyCopyright("Copyright © 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)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("ec9e0c1d-3496-4b98-a470-8d743a4eabab")] // 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")]
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("SAML2")] [assembly: AssemblyDescription("Based on http://www.nuget.org/packages/SAML2/, this removes dependencies on System.Web. Packages SAML2.AspNet and Owin.Security.Saml will implement SAML in those environments")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Emil Lerch")] [assembly: AssemblyProduct("SAML2.Core")] [assembly: AssemblyCopyright("Copyright © 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)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("ec9e0c1d-3496-4b98-a470-8d743a4eabab")] // 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")]
mpl-2.0
C#
ba09734a632296437805aea94b908776951e6a0e
Add Optional.Empty
ethanmoffat/EndlessClient
EOLib/Optional.cs
EOLib/Optional.cs
// Original Work Copyright (c) Ethan Moffat 2014-2016 // This file is subject to the GPL v2 License // For additional details, see the LICENSE file namespace EOLib { public class Optional<T> { private static readonly Optional<T> _readOnlyEmpty = new Optional<T>(); public static Optional<T> Empty { get { return _readOnlyEmpty; } } public T Value { get; private set; } public bool HasValue { get; private set; } public Optional() { Value = default(T); HasValue = false; } public Optional(T value) { Value = value; HasValue = true; } public static implicit operator Optional<T>(T value) { return new Optional<T>(value); } public static implicit operator T(Optional<T> optional) { return optional.Value; } } }
// Original Work Copyright (c) Ethan Moffat 2014-2016 // This file is subject to the GPL v2 License // For additional details, see the LICENSE file namespace EOLib { public class Optional<T> { public T Value { get; private set; } public bool HasValue { get; private set; } public Optional() { Value = default(T); HasValue = false; } public Optional(T value) { Value = value; HasValue = true; } public static implicit operator Optional<T>(T value) { return new Optional<T>(value); } public static implicit operator T(Optional<T> optional) { return optional.Value; } } }
mit
C#
38a81a9083d4a07ff89d16a0ddf08a785c1a6f10
Use POL.OpenPOLUtilsConfigKey() where applicable.
Vicrelant/polutils,Vicrelant/polutils,graspee/polutils,graspee/polutils
PlayOnline.Utils.FFXIDataBrowser/IItemExporter.cs
PlayOnline.Utils.FFXIDataBrowser/IItemExporter.cs
using System; using System.IO; using System.Windows.Forms; using Microsoft.Win32; using PlayOnline.Core; using PlayOnline.FFXI; namespace PlayOnline.Utils.FFXIDataBrowser { internal abstract class IItemExporter { public abstract void DoExport(FFXIItem[] Items); private static FolderBrowserDialog dlgBrowseFolder = null; private static void PrepareFolderBrowser() { if (IItemExporter.dlgBrowseFolder == null) { IItemExporter.dlgBrowseFolder = new FolderBrowserDialog(); IItemExporter.dlgBrowseFolder.Description = I18N.GetText("Export:DirDialogDesc"); string DefaultLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), Path.Combine("POLUtils", "Exported Item Data")); string InitialLocation = null; using (RegistryKey RK = POL.OpenPOLUtilsConfigKey()) { if (RK != null) InitialLocation = RK.GetValue(@"Data Browser\Export Location", null) as string; } if (InitialLocation == null || InitialLocation == String.Empty) InitialLocation = DefaultLocation; if (!Directory.Exists(InitialLocation)) Directory.CreateDirectory(InitialLocation); IItemExporter.dlgBrowseFolder.SelectedPath = InitialLocation; } } public static string OutputPath { get { IItemExporter.PrepareFolderBrowser(); return IItemExporter.dlgBrowseFolder.SelectedPath; } } public static void BrowseForOutputPath() { IItemExporter.PrepareFolderBrowser(); if (IItemExporter.dlgBrowseFolder.ShowDialog() == DialogResult.OK) { using (RegistryKey RK = POL.OpenPOLUtilsConfigKey()) { if (RK != null) RK.SetValue(@"Data Browser\Export Location", IItemExporter.dlgBrowseFolder.SelectedPath); } } } } }
using System; using System.IO; using System.Windows.Forms; using Microsoft.Win32; using PlayOnline.Core; using PlayOnline.FFXI; namespace PlayOnline.Utils.FFXIDataBrowser { internal abstract class IItemExporter { public abstract void DoExport(FFXIItem[] Items); private static FolderBrowserDialog dlgBrowseFolder = null; private static void PrepareFolderBrowser() { if (IItemExporter.dlgBrowseFolder == null) { IItemExporter.dlgBrowseFolder = new FolderBrowserDialog(); IItemExporter.dlgBrowseFolder.Description = I18N.GetText("Export:DirDialogDesc"); string DefaultLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), Path.Combine("POLUtils", "Exported Item Data")); string InitialLocation = null; try { RegistryKey RK = Registry.CurrentUser.CreateSubKey(@"Software\Pebbles\POLUtils"); InitialLocation = RK.GetValue("Export Location", null) as string; RK.Close(); } catch { } if (InitialLocation == null || InitialLocation == String.Empty) InitialLocation = DefaultLocation; if (!Directory.Exists(InitialLocation)) Directory.CreateDirectory(InitialLocation); IItemExporter.dlgBrowseFolder.SelectedPath = InitialLocation; } } public static string OutputPath { get { IItemExporter.PrepareFolderBrowser(); return IItemExporter.dlgBrowseFolder.SelectedPath; } } public static void BrowseForOutputPath() { IItemExporter.PrepareFolderBrowser(); if (IItemExporter.dlgBrowseFolder.ShowDialog() == DialogResult.OK) { try { RegistryKey RK = Registry.CurrentUser.CreateSubKey(@"Software\Pebbles\POLUtils"); RK.SetValue("Export Location", IItemExporter.dlgBrowseFolder.SelectedPath); RK.Close(); } catch { } } } } }
apache-2.0
C#
a4c3f76f00bd7c9196559ddc7977ec6f5ee89b43
Extend cookie timeout to 1 day
mattgwagner/Battery-Commander,mattgwagner/Battery-Commander,mattgwagner/Battery-Commander,mattgwagner/Battery-Commander
BatteryCommander.Web/IdentityConfig.cs
BatteryCommander.Web/IdentityConfig.cs
[assembly: Microsoft.Owin.OwinStartup(typeof(BatteryCommander.Web.Startup))] namespace BatteryCommander.Web { using Microsoft.AspNet.Identity; using Microsoft.Owin; using Microsoft.Owin.Security.Cookies; using Owin; using System; public partial class Startup { public void Configuration(IAppBuilder app) { app.UseCookieAuthentication(new CookieAuthenticationOptions { AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie, LoginPath = new PathString("/Auth/Login"), LogoutPath = new PathString("/Auth/Logout"), ExpireTimeSpan = TimeSpan.FromDays(1), SlidingExpiration = true, CookieHttpOnly = true, CookieSecure = CookieSecureOption.SameAsRequest // CookieDomain = "", // CookieName = "" }); app.UseTwoFactorSignInCookie(DefaultAuthenticationTypes.TwoFactorCookie, TimeSpan.FromMinutes(5)); app.UseTwoFactorRememberBrowserCookie(DefaultAuthenticationTypes.TwoFactorRememberBrowserCookie); } } }
[assembly: Microsoft.Owin.OwinStartup(typeof(BatteryCommander.Web.Startup))] namespace BatteryCommander.Web { using Microsoft.AspNet.Identity; using Microsoft.Owin; using Microsoft.Owin.Security.Cookies; using Owin; using System; public partial class Startup { public void Configuration(IAppBuilder app) { app.UseCookieAuthentication(new CookieAuthenticationOptions { AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie, LoginPath = new PathString("/Auth/Login"), LogoutPath = new PathString("/Auth/Logout"), ExpireTimeSpan = TimeSpan.FromHours(1), SlidingExpiration = true, CookieHttpOnly = true, CookieSecure = CookieSecureOption.SameAsRequest // CookieDomain = "", // CookieName = "" }); app.UseTwoFactorSignInCookie(DefaultAuthenticationTypes.TwoFactorCookie, TimeSpan.FromMinutes(5)); app.UseTwoFactorRememberBrowserCookie(DefaultAuthenticationTypes.TwoFactorRememberBrowserCookie); } } }
mit
C#
c7ff0399a0ce02ea7b01396d7c733708d95b47cc
Update AssemblyInfo
Vtek/Bartender
Cheers.Cqrs/Properties/AssemblyInfo.cs
Cheers.Cqrs/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("Cheers.Cqrs")] [assembly: AssemblyDescription("Cheers CQRS contracts")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Cheers")] [assembly: AssemblyProduct("Cheers")] [assembly: AssemblyCopyright("© 2016 Cheers")] [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.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("Cheers.Cqrs")] [assembly: AssemblyDescription("Cheers CQRS contracts")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("CheersTeam")] [assembly: AssemblyProduct("Cheers")] [assembly: AssemblyCopyright("© 2016 CheersTeam")] [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.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("")]
mit
C#
342ff5f43b540998b0bb0e12af543809ba58fc2d
Fix server crash when attempting to deploy AME part in space or in your hands.
space-wizards/space-station-14,space-wizards/space-station-14,space-wizards/space-station-14,space-wizards/space-station-14,space-wizards/space-station-14,space-wizards/space-station-14
Content.Server/GameObjects/Components/Power/AME/AMEPartComponent.cs
Content.Server/GameObjects/Components/Power/AME/AMEPartComponent.cs
#nullable enable using System.Threading.Tasks; using System.Linq; using Content.Server.GameObjects.Components.Interactable; using Content.Server.Interfaces.GameObjects.Components.Items; using Content.Shared.GameObjects.Components.Interactable; using Content.Shared.Interfaces; using Content.Shared.Interfaces.GameObjects.Components; using Robust.Server.GameObjects; using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Localization; using Robust.Shared.Map; namespace Content.Server.GameObjects.Components.Power.AME { [RegisterComponent] [ComponentReference(typeof(IInteractUsing))] public class AMEPartComponent : Component, IInteractUsing { [Dependency] private readonly IMapManager _mapManager = default!; [Dependency] private readonly IServerEntityManager _serverEntityManager = default!; public override string Name => "AMEPart"; private string _unwrap = "/Audio/Effects/unwrap.ogg"; async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs args) { if (!args.User.TryGetComponent<IHandsComponent>(out var hands)) { Owner.PopupMessage(args.User, Loc.GetString("You have no hands.")); return true; } if (!args.Using.TryGetComponent<ToolComponent>(out var multitool) || multitool.Qualities != ToolQuality.Multitool) return true; if (!_mapManager.TryGetGrid(args.ClickLocation.GetGridId(_serverEntityManager), out var mapGrid)) return false; // No AME in space. var snapPos = mapGrid.SnapGridCellFor(args.ClickLocation, SnapGridOffset.Center); if (mapGrid.GetSnapGridCell(snapPos, SnapGridOffset.Center).Any(sc => sc.Owner.HasComponent<AMEShieldComponent>())) { Owner.PopupMessage(args.User, Loc.GetString("Shielding is already there!")); return true; } var ent = _serverEntityManager.SpawnEntity("AMEShielding", mapGrid.GridTileToLocal(snapPos)); ent.Transform.LocalRotation = Owner.Transform.LocalRotation; EntitySystem.Get<AudioSystem>().PlayFromEntity(_unwrap, Owner); Owner.Delete(); return true; } } }
#nullable enable using System.Threading.Tasks; using System.Linq; using Content.Server.GameObjects.Components.Interactable; using Content.Server.Interfaces.GameObjects.Components.Items; using Content.Shared.GameObjects.Components.Interactable; using Content.Shared.Interfaces; using Content.Shared.Interfaces.GameObjects.Components; using Robust.Server.GameObjects; using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Localization; using Robust.Shared.Map; namespace Content.Server.GameObjects.Components.Power.AME { [RegisterComponent] [ComponentReference(typeof(IInteractUsing))] public class AMEPartComponent : Component, IInteractUsing { [Dependency] private readonly IMapManager _mapManager = default!; [Dependency] private readonly IServerEntityManager _serverEntityManager = default!; public override string Name => "AMEPart"; private string _unwrap = "/Audio/Effects/unwrap.ogg"; async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs args) { if (!args.User.TryGetComponent<IHandsComponent>(out var hands)) { Owner.PopupMessage(args.User, Loc.GetString("You have no hands.")); return true; } if (args.Using.TryGetComponent<ToolComponent>(out var multitool) && multitool.Qualities == ToolQuality.Multitool) { var mapGrid = _mapManager.GetGrid(args.ClickLocation.GetGridId(_serverEntityManager)); var snapPos = mapGrid.SnapGridCellFor(args.ClickLocation, SnapGridOffset.Center); if (mapGrid.GetSnapGridCell(snapPos, SnapGridOffset.Center).Any(sc => sc.Owner.HasComponent<AMEShieldComponent>())) { Owner.PopupMessage(args.User, Loc.GetString("Shielding is already there!")); return true; } var ent = _serverEntityManager.SpawnEntity("AMEShielding", mapGrid.GridTileToLocal(snapPos)); ent.Transform.LocalRotation = Owner.Transform.LocalRotation; EntitySystem.Get<AudioSystem>().PlayFromEntity(_unwrap, Owner); Owner.Delete(); } return true; } } }
mit
C#
aaf13deb5182b8768ef82a23de4ee87f6fb582d6
移動File_Write方法
60071jimmy/UartOscilloscope,60071jimmy/UartOscilloscope
UartOscilloscope/CSharpFiles/FileIO.cs
UartOscilloscope/CSharpFiles/FileIO.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace UartOscilloscope { public class FileIO { public void File_Write(string File_name, string Input_string) // 宣告File_Write副程式,將資料寫入檔案 // File_name為欲寫入檔案名稱 // Input_string為欲寫入檔案之字串資料 { // 進入File_Write副程式 FileStream file_stream = new FileStream(File_name, FileMode.Append); // 建立檔案指標,指向指定檔案名稱,模式為傳入之File_mode byte[] Input_data = System.Text.Encoding.Default.GetBytes(Input_string); // 將填入資料轉為位元陣列 file_stream.Write(Input_data, 0, Input_data.Length); // 寫入資料至檔案中 file_stream.Flush(); // 清除緩衝區 file_stream.Close(); // 關閉檔案 } // 結束File_Write副程式 public void File_Write(string File_name, string Input_string, FileMode File_mode) // 宣告File_Write副程式,將資料寫入檔案 // File_name為欲寫入檔案名稱 // Input_string為欲寫入檔案之字串資料 // File_mode為開啟檔案模式 { // 進入File_Write副程式 FileStream file_stream = new FileStream(File_name, File_mode); // 建立檔案指標,指向指定檔案名稱,模式為傳入之File_mode byte[] Input_data = System.Text.Encoding.Default.GetBytes(Input_string); // 將填入資料轉為位元陣列 file_stream.Write(Input_data, 0, Input_data.Length); // 寫入資料至檔案中 file_stream.Flush(); // 清除緩衝區 file_stream.Close(); // 關閉檔案 } // 結束File_Write副程式 } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace UartOscilloscope { public class FileIO { } }
apache-2.0
C#
14d789c7c935c2f78e7dc885ba1ea5798d71d18b
Update Program.cs
sgbj/Dukpt.NET
Test/Program.cs
Test/Program.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using DukptSharp; namespace Test { class Program { static void Main(string[] args) { var test = "%B5452300551227189^HOGAN/PAUL ^08043210000000725000000?\0\0\0\0"; // Decrypting var bdk = "0123456789ABCDEFFEDCBA9876543210"; var ksn = "FFFF9876543210E00008"; var track = "C25C1D1197D31CAA87285D59A892047426D9182EC11353C051ADD6D0F072A6CB3436560B3071FC1FD11D9F7E74886742D9BEE0CFD1EA1064C213BB55278B2F12"; var decBytes = Dukpt.Decrypt(bdk, ksn, BigInt.FromHex(track).GetBytes()); var decrypted = UTF8Encoding.UTF8.GetString(decBytes); Console.WriteLine(decrypted == test); // Encrypting var encBytes = Dukpt.Encrypt(bdk, ksn, decBytes); var encrypted = BitConverter.ToString(encBytes).Replace("-", ""); Console.WriteLine(encrypted == track); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using DukptSharp; namespace Test { class Program { static void Main(string[] args) { var test = "%B5452300551227189^HOGAN/PAUL ^08043210000000725000000?\0\0\0\0"; // Decrypting var bdk = "0123456789ABCDEFFEDCBA9876543210"; var ksn = "FFFF9876543210E00008"; var track = "C25C1D1197D31CAA87285D59A892047426D9182EC11353C051ADD6D0F072A6CB3436560B3071FC1FD11D9F7E74886742D9BEE0CFD1EA1064C213BB55278B2F12"; var decBytes = Dukpt.Encrypt(bdk, ksn, BigInt.FromHex(track).GetBytes(), false); var decrypted = UTF8Encoding.UTF8.GetString(decBytes); Console.WriteLine(decrypted == test); // Encrypting var encBytes = Dukpt.Encrypt(bdk, ksn, decBytes, true); var encrypted = BitConverter.ToString(encBytes).Replace("-", ""); Console.WriteLine(encrypted == track); } } }
mit
C#
41acbcf90ed302bc1b3689bd46237838f098b3f7
Fix compilation issues on AWS side.
bstark23/Cloud.Storage
src/Cloud.Storage.AWS/Queues/Queue.cs
src/Cloud.Storage.AWS/Queues/Queue.cs
using System; using System.Collections.Generic; using System.Threading.Tasks; using Cloud.Storage.Queues; namespace Cloud.Storage.AWS.Queues { public class Queue : IQueue { public Task AddMessage(IMessage message) { throw new NotImplementedException(); } public Task Clear() { throw new NotImplementedException(); } public IMessage CreateMessage(byte[] messageContents) { throw new NotImplementedException(); } public IMessage CreateMessage(string messageContents) { throw new NotImplementedException(); } public int GetApproximateMessageCount() { throw new NotImplementedException(); } public Task<List<IMessage>> GetMessages(int numMessages, TimeSpan? visibilityTimeout = default(TimeSpan?)) { throw new NotImplementedException(); } public Task<IMessage> GetNextMessage(TimeSpan? visibilityTimeout = default(TimeSpan?)) { throw new NotImplementedException(); } public Task<List<IMessage>> PeekMessages(int numMessages) { throw new NotImplementedException(); } public Task<IMessage> PeekNextMessage() { throw new NotImplementedException(); } } }
using System; using System.Collections.Generic; using System.Threading.Tasks; using Cloud.Storage.Queues; namespace Cloud.Storage.AWS.Queues { public class Queue : IQueue { public Task AddMessage(IMessage message) { throw new NotImplementedException(); } public IMessage CreateMessage(byte[] messageContents) { throw new NotImplementedException(); } public IMessage CreateMessage(string messageContents) { throw new NotImplementedException(); } public Task<List<IMessage>> GetMessages(int numMessages, TimeSpan? visibilityTimeout = default(TimeSpan?)) { throw new NotImplementedException(); } public Task<IMessage> GetNextMessage(TimeSpan? visibilityTimeout = default(TimeSpan?)) { throw new NotImplementedException(); } public Task<List<IMessage>> PeekMessages(int numMessages) { throw new NotImplementedException(); } public Task<IMessage> PeekNextMessage() { throw new NotImplementedException(); } } }
mit
C#
030271e2476fb19bb7465578b65fd989cd290d68
Trim email addresses
mwcaisse/portfolio,mwcaisse/portfolio,mwcaisse/portfolio
Portfolio/Portfolio.API/Startup.cs
Portfolio/Portfolio.API/Startup.cs
using System; using System.Linq; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Serilog; namespace Portfolio.API { public class Startup { public Startup(IHostingEnvironment env) { var builder = new ConfigurationBuilder() .SetBasePath(env.ContentRootPath) .AddJsonFile("settings.json", true) .AddEnvironmentVariables(prefix: "PORTFOLIO_API_"); Configuration = builder.Build(); } public IConfiguration Configuration { get; } // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); var applicationConfiguration = new ApplicationConfiguration() { SendGridApiKey = Configuration.GetValue<string>("sendGridApiKey"), FromEmailAddress = Configuration.GetValue<string>("fromEmailAddress").Trim(), ToEmailAddress = Configuration.GetValue<string>("toEmailAddress").Trim() }; services.AddSingleton(applicationConfiguration); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseMiddleware<RequestLoggingMiddleware>(); app.UseRouting(); app.UseEndpoints(routes => { routes.MapControllers(); }); } } }
using System; using System.Linq; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Serilog; namespace Portfolio.API { public class Startup { public Startup(IHostingEnvironment env) { var builder = new ConfigurationBuilder() .SetBasePath(env.ContentRootPath) .AddJsonFile("settings.json", true) .AddEnvironmentVariables(prefix: "PORTFOLIO_API_"); Configuration = builder.Build(); } public IConfiguration Configuration { get; } // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); var applicationConfiguration = new ApplicationConfiguration() { SendGridApiKey = Configuration.GetValue<string>("sendGridApiKey"), FromEmailAddress = Configuration.GetValue<string>("fromEmailAddress"), ToEmailAddress = Configuration.GetValue<string>("toEmailAddress") }; services.AddSingleton(applicationConfiguration); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseMiddleware<RequestLoggingMiddleware>(); app.UseRouting(); app.UseEndpoints(routes => { routes.MapControllers(); }); } } }
mit
C#
3048c13ee95577dd103b21ad468f6cd154fd1914
Remove unneeded using
jetheredge/SquishIt,wolfgang42/SquishIt,farans/SquishIt,farans/SquishIt,jetheredge/SquishIt,farans/SquishIt,0liver/SquishIt,Worthaboutapig/SquishIt,AlexCuse/SquishIt,wolfgang42/SquishIt,0liver/SquishIt,0liver/SquishIt,0liver/SquishIt,AlexCuse/SquishIt,wolfgang42/SquishIt,AlexCuse/SquishIt,wolfgang42/SquishIt,Worthaboutapig/SquishIt,AlexCuse/SquishIt,Worthaboutapig/SquishIt,Worthaboutapig/SquishIt,Worthaboutapig/AC-SquishIt,wolfgang42/SquishIt,jetheredge/SquishIt,jetheredge/SquishIt,AlexCuse/SquishIt,Worthaboutapig/SquishIt,AlexCuse/SquishIt,farans/SquishIt,Worthaboutapig/AC-SquishIt,Worthaboutapig/AC-SquishIt,Worthaboutapig/AC-SquishIt,jetheredge/SquishIt,0liver/SquishIt,farans/SquishIt,jetheredge/SquishIt,Worthaboutapig/AC-SquishIt
SquishIt.Framework/Coffee/CoffeescriptCompiler.cs
SquishIt.Framework/Coffee/CoffeescriptCompiler.cs
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; using System.Text; using Jurassic; namespace SquishIt.Framework.Coffee { public class CoffeescriptCompiler { private static string _coffeescript; private static ScriptEngine _engine; public string Compile(string input) { CoffeeScriptEngine.SetGlobalValue("Source", input); // Errors go from here straight on to the rendered page; // we don't want to hide them because they provide valuable feedback // on the location of the error string result = CoffeeScriptEngine.Evaluate<string>("CoffeeScript.compile(Source, {bare: true})"); return result; } private static ScriptEngine CoffeeScriptEngine { get { if(_engine == null) { var engine = new ScriptEngine(); engine.ForceStrictMode = true; engine.Execute(Compiler); _engine = engine; } return _engine; } } public static string Compiler { get { if (_coffeescript == null) _coffeescript = LoadCoffeescript(); return _coffeescript; } } private static string LoadCoffeescript() { using(var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("SquishIt.Framework.Coffee.coffee-script.js")) { using(var reader = new StreamReader(stream)) { return reader.ReadToEnd(); } } } } }
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; using System.Text; using EcmaScript.NET; using Jurassic; namespace SquishIt.Framework.Coffee { public class CoffeescriptCompiler { private static string _coffeescript; private static ScriptEngine _engine; public string Compile(string input) { CoffeeScriptEngine.SetGlobalValue("Source", input); // Errors go from here straight on to the rendered page; // we don't want to hide them because they provide valuable feedback // on the location of the error string result = CoffeeScriptEngine.Evaluate<string>("CoffeeScript.compile(Source, {bare: true})"); return result; } private static ScriptEngine CoffeeScriptEngine { get { if(_engine == null) { var engine = new ScriptEngine(); engine.ForceStrictMode = true; engine.Execute(Compiler); _engine = engine; } return _engine; } } public static string Compiler { get { if (_coffeescript == null) _coffeescript = LoadCoffeescript(); return _coffeescript; } } private static string LoadCoffeescript() { using(var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("SquishIt.Framework.Coffee.coffee-script.js")) { using(var reader = new StreamReader(stream)) { return reader.ReadToEnd(); } } } } }
mit
C#
4f59fc15a50910eb4716f3968779e64b28856acc
Mark `BeatmapSet` as nullable for the time being
peppy/osu-new,ppy/osu,peppy/osu,NeoAdonis/osu,peppy/osu,ppy/osu,peppy/osu,smoogipoo/osu,NeoAdonis/osu,smoogipoo/osu,NeoAdonis/osu,ppy/osu,smoogipooo/osu,smoogipoo/osu
osu.Game/Beatmaps/IBeatmapInfo.cs
osu.Game/Beatmaps/IBeatmapInfo.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Game.Database; using osu.Game.Rulesets; #nullable enable namespace osu.Game.Beatmaps { /// <summary> /// A single beatmap difficulty. /// </summary> public interface IBeatmapInfo : IHasOnlineID { /// <summary> /// The user-specified name given to this beatmap. /// </summary> string DifficultyName { get; } /// <summary> /// The metadata representing this beatmap. May be shared between multiple beatmaps. /// </summary> IBeatmapMetadataInfo? Metadata { get; } /// <summary> /// The difficulty settings for this beatmap. /// </summary> IBeatmapDifficultyInfo Difficulty { get; } /// <summary> /// The beatmap set this beatmap is part of. /// </summary> IBeatmapSetInfo? BeatmapSet { get; } /// <summary> /// The playable length in milliseconds of this beatmap. /// </summary> double Length { get; } /// <summary> /// The most common BPM of this beatmap. /// </summary> double BPM { get; } /// <summary> /// The SHA-256 hash representing this beatmap's contents. /// </summary> string Hash { get; } /// <summary> /// MD5 is kept for legacy support (matching against replays etc.). /// </summary> string MD5Hash { get; } /// <summary> /// The ruleset this beatmap was made for. /// </summary> IRulesetInfo Ruleset { get; } /// <summary> /// The basic star rating for this beatmap (with no mods applied). /// </summary> double StarRating { get; } } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Game.Database; using osu.Game.Rulesets; #nullable enable namespace osu.Game.Beatmaps { /// <summary> /// A single beatmap difficulty. /// </summary> public interface IBeatmapInfo : IHasOnlineID { /// <summary> /// The user-specified name given to this beatmap. /// </summary> string DifficultyName { get; } /// <summary> /// The metadata representing this beatmap. May be shared between multiple beatmaps. /// </summary> IBeatmapMetadataInfo? Metadata { get; } /// <summary> /// The difficulty settings for this beatmap. /// </summary> IBeatmapDifficultyInfo Difficulty { get; } /// <summary> /// The beatmap set this beatmap is part of. /// </summary> IBeatmapSetInfo BeatmapSet { get; } /// <summary> /// The playable length in milliseconds of this beatmap. /// </summary> double Length { get; } /// <summary> /// The most common BPM of this beatmap. /// </summary> double BPM { get; } /// <summary> /// The SHA-256 hash representing this beatmap's contents. /// </summary> string Hash { get; } /// <summary> /// MD5 is kept for legacy support (matching against replays etc.). /// </summary> string MD5Hash { get; } /// <summary> /// The ruleset this beatmap was made for. /// </summary> IRulesetInfo Ruleset { get; } /// <summary> /// The basic star rating for this beatmap (with no mods applied). /// </summary> double StarRating { get; } } }
mit
C#
4625edf8c331ea20bd3943be1e1b1275082902a9
add basic character movement
Natsirtt/office-rituals
Assets/Scripts/Character.cs
Assets/Scripts/Character.cs
using UnityEngine; using System.Collections; public abstract class Meter { public float Value; void Start() { Value = 0.0f; } public abstract void CalcWork(ref float value); } public class Character : MonoBehaviour { private float WorkMeter; private float CoffeeMeter; private Location previousLocation; // Use this for initialization void Start() { this.WorkMeter = 0.0f; this.CoffeeMeter = 50.0f; } // Update is called once per frame void Update() { const float moveSpeed = 1.0f; Vector3 move = Vector3.zero; if (Input.GetKey("up")) move.y += moveSpeed; if (Input.GetKey("down")) move.y -= moveSpeed; if (Input.GetKey("left")) move.x -= moveSpeed; if (Input.GetKey("right")) move.x += moveSpeed; transform.Translate(move * Time.deltaTime); } public void SetLocation(Location location) { previousLocation = location; } public void DoLocationAction() { if (previousLocation != null) { previousLocation.LocationAction(this); } } public void AddCoffee(float value) { CoffeeMeter += value; CoffeeMeter = Mathf.Clamp(CoffeeMeter, 0.0f, 100.0f); } public void AddWork(float value) { WorkMeter += value; WorkMeter = Mathf.Clamp(WorkMeter, 0.0f, 100.0f); if (WorkMeter >= 100.0f) { // Win? } } }
using UnityEngine; using System.Collections; public abstract class Meter { public float Value; void Start() { Value = 0.0f; } public abstract void CalcWork(ref float value); } public class Character : MonoBehaviour { private float WorkMeter; private float CoffeeMeter; private Location previousLocation; // Use this for initialization void Start() { this.WorkMeter = 0.0f; this.CoffeeMeter = 50.0f; } // Update is called once per frame void Update() { } public void SetLocation(Location location) { } public void DoLocationAction() { } public void AddCoffee(float value) { CoffeeMeter += value; CoffeeMeter = Mathf.Clamp(CoffeeMeter, 0.0f, 100.0f); } public void AddWork(float value) { WorkMeter += value; WorkMeter = Mathf.Clamp(WorkMeter, 0.0f, 100.0f); if (WorkMeter >= 100.0f) { // Win? } } }
cc0-1.0
C#
f31ff2411e3c81c076f70685cc62986337f6ffe7
Adjust max size of contents read from incoming request headers to be 1k
Microsoft/ApplicationInsights-aspnet5,Microsoft/ApplicationInsights-aspnet5,Microsoft/ApplicationInsights-aspnet5,Microsoft/ApplicationInsights-aspnetcore,Microsoft/ApplicationInsights-aspnetcore,Microsoft/ApplicationInsights-aspnetcore
src/Microsoft.ApplicationInsights.AspNetCore/Common/InjectionGuardConstants.cs
src/Microsoft.ApplicationInsights.AspNetCore/Common/InjectionGuardConstants.cs
namespace Microsoft.ApplicationInsights.AspNetCore.Common { /// <summary> /// These values are listed to guard against malicious injections by limiting the max size allowed in an HTTP Response. /// These max limits are intentionally exaggerated to allow for unexpected responses, while still guarding against unreasonably large responses. /// Example: While a 32 character response may be expected, 50 characters may be permitted while a 10,000 character response would be unreasonable and malicious. /// </summary> public static class InjectionGuardConstants { /// <summary> /// Max length of AppId allowed in response from Breeze. /// </summary> public const int AppIdMaxLengeth = 50; /// <summary> /// Max length of incoming Request Header value allowed. /// </summary> public const int RequestHeaderMaxLength = 1024; /// <summary> /// Max length of context header key. /// </summary> public const int ContextHeaderKeyMaxLength = 50; /// <summary> /// Max length of context header value. /// </summary> public const int ContextHeaderValueMaxLength = 1024; } }
namespace Microsoft.ApplicationInsights.AspNetCore.Common { /// <summary> /// These values are listed to guard against malicious injections by limiting the max size allowed in an HTTP Response. /// These max limits are intentionally exaggerated to allow for unexpected responses, while still guarding against unreasonably large responses. /// Example: While a 32 character response may be expected, 50 characters may be permitted while a 10,000 character response would be unreasonable and malicious. /// </summary> public static class InjectionGuardConstants { /// <summary> /// Max length of AppId allowed in response from Breeze. /// </summary> public const int AppIdMaxLengeth = 50; /// <summary> /// Max length of incoming Request Header value allowed. /// </summary> public const int RequestHeaderMaxLength = 1024; /// <summary> /// Max length of context header key. /// </summary> public const int ContextHeaderKeyMaxLength = 50; /// <summary> /// Max length of context header value. /// </summary> public const int ContextHeaderValueMaxLength = 100; } }
mit
C#
ea3505fd17a2c33067c978bb9d8b0e51c9c55ef2
Fix "Sequence contains no elements" error.
stackia/DNSAgent
DNSAgent/DnsMessageCache.cs
DNSAgent/DnsMessageCache.cs
using System; using System.Collections.Concurrent; using System.Linq; using ARSoft.Tools.Net.Dns; namespace DNSAgent { internal class DnsCacheMessageEntry { public DnsCacheMessageEntry(DnsMessage message, int timeToLive) { Message = message; var records = message.AnswerRecords.Concat(message.AuthorityRecords).ToList(); if (records.Any()) timeToLive = Math.Max(records.Min(record => record.TimeToLive), timeToLive); ExpireTime = DateTime.Now.AddSeconds(timeToLive); } public DnsMessage Message { get; set; } public DateTime ExpireTime { get; set; } public bool IsExpired { get { return DateTime.Now > ExpireTime; } } } internal class DnsMessageCache : ConcurrentDictionary<string, ConcurrentDictionary<RecordType, DnsCacheMessageEntry>> { public void Update(DnsQuestion question, DnsMessage message, int timeToLive) { if (!ContainsKey(question.Name)) this[question.Name] = new ConcurrentDictionary<RecordType, DnsCacheMessageEntry>(); this[question.Name][question.RecordType] = new DnsCacheMessageEntry(message, timeToLive); } } }
using System; using System.Collections.Concurrent; using System.Linq; using ARSoft.Tools.Net.Dns; namespace DNSAgent { internal class DnsCacheMessageEntry { public DnsCacheMessageEntry(DnsMessage message, int timeToLive) { Message = message; timeToLive = Math.Max(message.AnswerRecords.Concat(message.AuthorityRecords).Min(record => record.TimeToLive), timeToLive); ExpireTime = DateTime.Now.AddSeconds(timeToLive); } public DnsMessage Message { get; set; } public DateTime ExpireTime { get; set; } public bool IsExpired { get { return DateTime.Now > ExpireTime; } } } internal class DnsMessageCache : ConcurrentDictionary<string, ConcurrentDictionary<RecordType, DnsCacheMessageEntry>> { public void Update(DnsQuestion question, DnsMessage message, int timeToLive) { if (!ContainsKey(question.Name)) this[question.Name] = new ConcurrentDictionary<RecordType, DnsCacheMessageEntry>(); this[question.Name][question.RecordType] = new DnsCacheMessageEntry(message, timeToLive); } } }
mit
C#
f077b9c727067f4f5bd77e594a68ea74cc255043
remove unnecessary callback
StefanoFiumara/Harry-Potter-Unity
Assets/Scripts/HarryPotterUnity/Cards/BaseSpell.cs
Assets/Scripts/HarryPotterUnity/Cards/BaseSpell.cs
using System.Collections.Generic; using HarryPotterUnity.Enums; using HarryPotterUnity.Game; using HarryPotterUnity.Tween; using UnityEngine; namespace HarryPotterUnity.Cards { public abstract class BaseSpell : BaseCard { private static readonly Vector3 _spellOffset = new Vector3(0f, 0f, -400f); protected sealed override void OnPlayFromHandAction(List<BaseCard> targets) { Enable(); PreviewSpell(); Player.Discard.Add(this); SpellAction(targets); } protected abstract void SpellAction(List<BaseCard> targets); private void PreviewSpell() { State = State.Discarded; var rotateType = Player.OppositePlayer.IsLocalPlayer ? TweenRotationType.Rotate180 : TweenRotationType.NoRotate; var tween = new MoveTween { Target = gameObject, Position = _spellOffset, Time = 0.5f, Flip = FlipState.FaceUp, Rotate = rotateType, TimeUntilNextTween = 0.6f }; GameManager.TweenQueue.AddTweenToQueue(tween); } protected sealed override Type GetCardType() { return Type.Spell; } } }
using System.Collections.Generic; using HarryPotterUnity.Enums; using HarryPotterUnity.Game; using HarryPotterUnity.Tween; using UnityEngine; namespace HarryPotterUnity.Cards { public abstract class BaseSpell : BaseCard { private static readonly Vector3 _spellOffset = new Vector3(0f, 0f, -400f); protected sealed override void OnPlayFromHandAction(List<BaseCard> targets) { Enable(); PreviewSpell(); Player.Discard.Add(this); SpellAction(targets); } protected abstract void SpellAction(List<BaseCard> targets); private void PreviewSpell() { //TODO: Why is the State set here and in the callback? //TODO: Probably do not need to set the state in the callback, remove callback and see what happens State = State.Discarded; var rotateType = Player.OppositePlayer.IsLocalPlayer ? TweenRotationType.Rotate180 : TweenRotationType.NoRotate; var tween = new MoveTween { Target = gameObject, Position = _spellOffset, Time = 0.5f, Flip = FlipState.FaceUp, Rotate = rotateType, OnCompleteCallback = () => State = State.Discarded, TimeUntilNextTween = 0.6f }; GameManager.TweenQueue.AddTweenToQueue(tween); } protected sealed override Type GetCardType() { return Type.Spell; } } }
mit
C#
66f8c81b1513158856f756502760bdff164aae32
Increment version to v1.1.0.10
MatthewSteeples/XeroAPI.Net,jcvandan/XeroAPI.Net,TDaphneB/XeroAPI.Net,XeroAPI/XeroAPI.Net
source/XeroApi/Properties/AssemblyInfo.cs
source/XeroApi/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("XeroApi")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Xero")] [assembly: AssemblyProduct("XeroApi")] [assembly: AssemblyCopyright("Copyright © Xero 2011")] [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("e18a84e7-ba04-4368-b4c9-0ea0cc78ddef")] // 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.10")] [assembly: AssemblyFileVersion("1.1.0.10")]
using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("XeroApi")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Xero")] [assembly: AssemblyProduct("XeroApi")] [assembly: AssemblyCopyright("Copyright © Xero 2011")] [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("e18a84e7-ba04-4368-b4c9-0ea0cc78ddef")] // 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.9")] [assembly: AssemblyFileVersion("1.1.0.9")]
mit
C#
1e1c80da0a449043282d5b449b9525a0c5607ccd
Update Customization.cs
apemost/Newq,apemost/Newq
src/Newq/Customization.cs
src/Newq/Customization.cs
namespace Newq { using System; using System.Linq.Expressions; /// <summary> /// /// </summary> public abstract class Customization { /// <summary> /// /// </summary> protected Context context; /// <summary> /// /// </summary> /// <param name="context"></param> public Customization(Context context) { if (context == null) { throw new ArgumentNullException(nameof(context)); } this.context = context; } /// <summary> /// Returns a string that represents the current customization. /// </summary> /// <returns></returns> public abstract string GetCustomization(); /// <summary> /// /// </summary> /// <typeparam name="T"></typeparam> /// <param name="expr"></param> /// <returns></returns> public Column Table<T>(Expression<Func<T, object>> expr) { var split = expr.Body.ToString().Split("(.)".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); var columnName = split[split.Length - 1]; return context[typeof(T).Name, columnName]; } } }
namespace Newq { using System; /// <summary> /// /// </summary> public abstract class Customization { /// <summary> /// /// </summary> protected Context context; /// <summary> /// /// </summary> /// <param name="context"></param> public Customization(Context context) { if (context == null) { throw new ArgumentNullException(nameof(context)); } this.context = context; } /// <summary> /// Returns a string that represents the current customization. /// </summary> /// <returns></returns> public abstract string GetCustomization(); /// <summary> /// /// </summary> /// <typeparam name="T"></typeparam> /// <param name="expr"></param> /// <returns></returns> public Column Table<T>(Expression<Func<T, object>> expr) { var split = expr.Body.ToString().Split("(.)".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); var columnName = split[split.Length - 1]; return context[typeof(T).Name, columnName]; } } }
mit
C#
a6320291d142c10fea7d9983f48697ef93d2c929
Update IDisposable #406
masterdidoo/LiteDB,RytisLT/LiteDB,mbdavid/LiteDB,falahati/LiteDB,masterdidoo/LiteDB,RytisLT/LiteDB,89sos98/LiteDB,89sos98/LiteDB,falahati/LiteDB
LiteDB/Utils/LockControl.cs
LiteDB/Utils/LockControl.cs
using System; using System.Threading; namespace LiteDB { /// <summary> /// A class to control locking disposal. Can be a "new lock" - when a lock is not not coming from other lock state /// </summary> public class LockControl : IDisposable { // dispose based on // https://lostechies.com/chrispatterson/2012/11/29/idisposable-done-right/ private Action _dispose; private bool _disposed; internal LockControl(Action dispose) { _dispose = dispose; } ~LockControl() { Dispose(false); } public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } protected virtual void Dispose(bool disposing) { if (_disposed) return; _disposed = true; if (disposing) { } if (_dispose != null) _dispose(); } } }
using System; using System.Threading; namespace LiteDB { /// <summary> /// A class to control locking disposal. Can be a "new lock" - when a lock is not not coming from other lock state /// </summary> public class LockControl : IDisposable { // dispose based on // https://lostechies.com/chrispatterson/2012/11/29/idisposable-done-right/ private Action _dispose; private bool _disposed; internal LockControl(Action dispose) { _dispose = dispose; } ~LockControl() { Dispose(false); } public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } protected virtual void Dispose(bool disposing) { if (_disposed) return; if (disposing) { } if (_dispose != null) _dispose(); _disposed = true; } } }
mit
C#
3675469c58b057e64a267f8811ab03d00c58ff1e
Add some documentation and rename some method args (no api changes)
activelylazy/TestFirst.Net,activelylazy/TestFirst.Net,TestFirstNet/TestFirst.Net,TestFirstNet/TestFirst.Net
TestFirst.Net/IMatchDiagnostics.cs
TestFirst.Net/IMatchDiagnostics.cs
using System; namespace TestFirst.Net { public interface IMatchDiagnostics:IDescription { IMatchDiagnostics Matched(String text, params Object[] args); IMatchDiagnostics Matched(ISelfDescribing selfDescribing); IMatchDiagnostics MisMatched(String text, params Object[] args); IMatchDiagnostics MisMatched(ISelfDescribing selfDescribing); /// <summary> /// Use the given matcher to match the given input. Attempts to pretty format the response /// </summary> /// <returns><c>true</c>, if match was successfull, <c>false</c> otherwise.</returns> /// <param name="actual">Object to match</param> /// <param name="actualIndex">On failure include this as the index for the object</param> /// <param name="childMatcher">The matcher to use against the provided object</param> bool TryMatch(Object actual, int actualIndex, IMatcher childMatcher); /// <summary> /// Use the given matcher to match the given input. Attempts to pretty format the response /// </summary> /// <returns><c>true</c>, if match was successfull, <c>false</c> otherwise.</returns> /// <param name="actual">Object to match</param> /// <param name="actualIndex">On failure include this as the index for the object</param> /// <param name="childMatcher">The matcher to use against the provided object</param> bool TryMatch<T>(T actual, int actualIndex, IMatcher<T> childMatcher); /// <summary> /// Use the given matcher to match the given input. Attempts to pretty format the response /// </summary> /// <returns><c>true</c>, if match was successfull, <c>false</c> otherwise.</returns> /// <param name="actual">Object to match</param> /// <param name="childMatcher">The matcher to use against the provided object</param> bool TryMatch(Object actual, IMatcher childMatcher); /// <summary> /// Use the given matcher to match the given input. Attempts to pretty format the response /// </summary> /// <returns><c>true</c>, if match was successfull, <c>false</c> otherwise.</returns> /// <param name="actual">Object to match</param> /// <param name="childMatcher">The matcher to use against the provided object</param> bool TryMatch<T>(T actual, IMatcher<T> childMatcher); /// <summary> /// Use the given matcher to match the given input. Attempts to pretty format the response /// </summary> /// <returns><c>true</c>, if match was successfull, <c>false</c> otherwise.</returns> /// <param name="actual">Object to match</param> /// <param name="actualLabel">On failure include this as a label for the object</param> /// <param name="childMatcher">The matcher to use against the provided object</param> bool TryMatch(Object actual, String actualLabel, IMatcher childMatcher); /// <summary> /// Use the given matcher to match the given input. Attempts to pretty format the response /// </summary> /// <returns><c>true</c>, if match was successfull, <c>false</c> otherwise.</returns> /// <param name="actual">Object to match</param> /// <param name="actualLabel">On failure include this as a label for the object</param> /// <param name="childMatcher">The matcher to use against the provided object</param> bool TryMatch<T>(T actual, String actualLabel, IMatcher<T> childMatcher); bool TryMatch(Object actual, IMatcher childMatcher, ISelfDescribing selfDescribing); bool TryMatch<T>(T actual, IMatcher<T> childMatcher, ISelfDescribing selfDescribing); /// <summary> /// Return a child diagnostics context. This allows for performing sub matches and optionally /// including the match/mismatch messages. /// /// The return type is the same type as the current diagnostics. /// </summary> /// <returns>A new child (or the same instance in the case of a null diagnostics)</returns> IMatchDiagnostics NewChild(); } }
using System; namespace TestFirst.Net { public interface IMatchDiagnostics:IDescription { IMatchDiagnostics Matched(String text, params Object[] args); IMatchDiagnostics Matched(ISelfDescribing selfDescribing); IMatchDiagnostics MisMatched(String text, params Object[] args); IMatchDiagnostics MisMatched(ISelfDescribing selfDescribing); bool TryMatch(Object actual, int index, IMatcher childMatcher); bool TryMatch<T>(T actual, int index, IMatcher<T> childMatcher); bool TryMatch(Object actual, IMatcher childMatcher); bool TryMatch<T>(T actual, IMatcher<T> childMatcher); /// <summary> /// Use the given matcher to match the given inpout. Attempts to pretty format the response /// </summary> /// <returns>if the child matcher matched</returns> bool TryMatch(Object actual, String actualName, IMatcher childMatcher); bool TryMatch<T>(T actual, String actualName, IMatcher<T> childMatcher); bool TryMatch(Object actual, IMatcher childMatcher, ISelfDescribing selfDescribing); bool TryMatch<T>(T actual, IMatcher<T> childMatcher, ISelfDescribing selfDescribing); IMatchDiagnostics NewChild(); } }
bsd-2-clause
C#
9b869466a777187cb93e0c19892e57523c0a8a77
Clean up: register view
ramzzzay/GalleryMVC_With_Auth,ramzzzay/GalleryMVC_With_Auth,ramzzzay/GalleryMVC_With_Auth
GalleryMVC_With_Auth/Views/Account/Register.cshtml
GalleryMVC_With_Auth/Views/Account/Register.cshtml
@using Microsoft.AspNet.Identity.EntityFramework @model GalleryMVC_With_Auth.Models.RegisterViewModel @{ ViewBag.Title = "Register"; //List<IdentityRole> lst = ViewBag.tmp; //List<IdentityRole> lst2 = ViewBag.tmp2; //var db = lst2; } <h2>@ViewBag.Title.</h2> @using (Html.BeginForm("Register", "Account", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) { @Html.AntiForgeryToken() <h4>Create a new account.</h4> <hr /> @Html.ValidationSummary("", new { @class = "text-danger" }) <div class="form-group"> @Html.LabelFor(m => m.Email, new { @class = "col-md-2 control-label" }) <div class="col-md-10"> @Html.TextBoxFor(m => m.Email, new { @class = "form-control" }) </div> </div> <div class="form-group"> @Html.LabelFor(m => m.Password, new { @class = "col-md-2 control-label" }) <div class="col-md-10"> @Html.PasswordFor(m => m.Password, new { @class = "form-control" }) </div> </div> <div class="form-group"> @Html.LabelFor(m => m.ConfirmPassword, new { @class = "col-md-2 control-label" }) <div class="col-md-10"> @Html.PasswordFor(m => m.ConfirmPassword, new { @class = "form-control" }) </div> </div> <!--Select the Role Type for the User--> <div class="form-group"> @Html.Label("Select Your User Type", new { @class = "col-md-2 control-label" }) <div class="col-md-10"> @Html.DropDownList("Name") </div> </div> <!--Ends Here--> <div class="form-group"> <div class="col-md-offset-2 col-md-10"> <input type="submit" class="btn btn-default" value="Register" /> </div> </div> } @section Scripts { @Scripts.Render("~/bundles/jqueryval") }
@using Microsoft.AspNet.Identity.EntityFramework @model GalleryMVC_With_Auth.Models.RegisterViewModel @{ ViewBag.Title = "Register"; //List<IdentityRole> lst = ViewBag.tmp; //List<IdentityRole> lst2 = ViewBag.tmp2; //var db = lst2; } <h2>@ViewBag.Title.</h2> @using (Html.BeginForm("Register", "Account", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) { @Html.AntiForgeryToken() <h4>Create a new account.</h4> <hr /> @Html.ValidationSummary("", new { @class = "text-danger" }) <div class="form-group"> @Html.LabelFor(m => m.Email, new { @class = "col-md-2 control-label" }) <div class="col-md-10"> @Html.TextBoxFor(m => m.Email, new { @class = "form-control" }) </div> </div> <div class="form-group"> @Html.LabelFor(m => m.Password, new { @class = "col-md-2 control-label" }) <div class="col-md-10"> @Html.PasswordFor(m => m.Password, new { @class = "form-control" }) </div> </div> <div class="form-group"> @Html.LabelFor(m => m.ConfirmPassword, new { @class = "col-md-2 control-label" }) <div class="col-md-10"> @Html.PasswordFor(m => m.ConfirmPassword, new { @class = "form-control" }) </div> </div> <!--Select the Role Type for the User--> <div class="form-group"> @Html.Label("Select Your User Type", new { @class = "col-md-2 control-label" }) <div class="col-md-10"> @*@Html.DropDownListFor(r=>r.Name, new SelectList(db,"Name","Name"))*@ @Html.DropDownList("Name") </div> </div> <!--Ends Here--> <div class="form-group"> <div class="col-md-offset-2 col-md-10"> <input type="submit" class="btn btn-default" value="Register" /> </div> </div> } @section Scripts { @Scripts.Render("~/bundles/jqueryval") }
apache-2.0
C#
1fada0e3c2deae67565cf00615367f8b8594b73f
update styles
lAnubisl/PostTrack,lAnubisl/PostTrack,lAnubisl/PostTrack
Posttrack.BLL/Models/EmailModels/BaseEmailModel.cs
Posttrack.BLL/Models/EmailModels/BaseEmailModel.cs
using Posttrack.Data.Interfaces.DTO; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Globalization; using System.Text.RegularExpressions; namespace Posttrack.BLL.Models.EmailModels { internal abstract class BaseEmailModel { internal BaseEmailModel(string recipient) { Recipient = recipient; } internal string Year => DateTime.Now.Year.ToString(); internal string Recipient { get; } protected static string LoadHistoryTemplate( ICollection<PackageHistoryItemDTO> oldHistory, IEnumerable<PackageHistoryItemDTO> newHistory) { var itemTemplate = @"<tr><td valign=""top"" style=""width: 50px; {Style}"">{Date}</td><td style = ""{Style}"">{Action} {Place}</td></tr>"; var renderedItems = new Collection<string>(); if (newHistory != null) { foreach (var item in newHistory) { var greenItem = oldHistory == null || !oldHistory.Contains(item); renderedItems.Add(itemTemplate .Replace("{Date}", item.Date.ToString("dd.MM", CultureInfo.CurrentCulture)) .Replace("{Action}", CleanActionRegex.Replace(item.Action, string.Empty)) .Replace("{Place}", item.Place) .Replace("{Style}", greenItem ? "color:green;font-weight:bold;" : string.Empty)); } } return string.Format("<table>{0}</table>", string.Join(string.Empty, renderedItems)); } private static readonly Regex CleanActionRegex = new Regex("\\d{2}\\. ", RegexOptions.Compiled); } }
using Posttrack.Data.Interfaces.DTO; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Globalization; using System.Text.RegularExpressions; namespace Posttrack.BLL.Models.EmailModels { internal abstract class BaseEmailModel { internal BaseEmailModel(string recipient) { Recipient = recipient; } internal string Year => DateTime.Now.Year.ToString(); internal string Recipient { get; } protected static string LoadHistoryTemplate( ICollection<PackageHistoryItemDTO> oldHistory, IEnumerable<PackageHistoryItemDTO> newHistory) { var itemTemplate = @"<tr><td valign=""top"" style=""width: 140px; {Style}"">{Date}</td><td style = ""{Style}"">{Action} {Place}</td></tr>"; var renderedItems = new Collection<string>(); if (newHistory != null) { foreach (var item in newHistory) { var greenItem = oldHistory == null || !oldHistory.Contains(item); renderedItems.Add(itemTemplate .Replace("{Date}", item.Date.ToString("dd.MM", CultureInfo.CurrentCulture)) .Replace("{Action}", CleanActionRegex.Replace(item.Action, string.Empty)) .Replace("{Place}", item.Place) .Replace("{Style}", greenItem ? "color:green;font-weight:bold;" : string.Empty)); } } return string.Format("<table>{0}</table>", string.Join(string.Empty, renderedItems)); } private static readonly Regex CleanActionRegex = new Regex("\\d{2}\\. ", RegexOptions.Compiled); } }
apache-2.0
C#
5587abc0c30e60890393896970332a81eea518ef
Adjust starting point just slightly - move Display Initial Grid to just before operation occurs. This allows it to be included if we loop around the naive solution.
bsstahl/DPDemo
ShortestPath/Program.cs
ShortestPath/Program.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ShortestPath { class Program { const int _gridSize = 6; static void Main(string[] args) { Optimization.Entities.Grid grid = ConstructGrid(); var startPoint = new Optimization.Entities.GridLocation(0, 2); var endPoint = new Optimization.Entities.GridLocation(3, 1); // Construct the appropriate path engine Optimization.Interfaces.IPathProvider engine = new ShortestPath.Optimization.Naive.Engine(); // Optimization.Interfaces.IPathProvider engine = new ShortestPath.Optimization.DP.Engine(); Console.WriteLine(grid.ToString()); // Display initial grid var path = engine.FindPath(grid, startPoint, endPoint); Console.WriteLine(grid.ToString()); // Display final grid // Display results Console.WriteLine(path.ToString()); Console.WriteLine("Path length: {0}", path.Length); } private static Optimization.Entities.Grid ConstructGrid() { var roadblocks = new List<Optimization.Entities.GridLocation>(); roadblocks.Add(new Optimization.Entities.GridLocation(1, 1, true)); roadblocks.Add(new Optimization.Entities.GridLocation(1, 2, true)); roadblocks.Add(new Optimization.Entities.GridLocation(1, 3, true)); roadblocks.Add(new Optimization.Entities.GridLocation(2, 0, true)); roadblocks.Add(new Optimization.Entities.GridLocation(2, 1, true)); return new Optimization.Entities.Grid(_gridSize, _gridSize, roadblocks); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ShortestPath { class Program { const int _gridSize = 6; static void Main(string[] args) { Optimization.Entities.Grid grid = ConstructGrid(); Console.WriteLine(grid.ToString()); // Display initial grid var startPoint = new Optimization.Entities.GridLocation(0, 2); var endPoint = new Optimization.Entities.GridLocation(3, 1); // Construct the appropriate path engine Optimization.Interfaces.IPathProvider engine = new ShortestPath.Optimization.Naive.Engine(); // Optimization.Interfaces.IPathProvider engine = new ShortestPath.Optimization.DP.Engine(); var path = engine.FindPath(grid, startPoint, endPoint); Console.WriteLine(grid.ToString()); // Display final grid Console.WriteLine(path.ToString()); Console.WriteLine("Path length: {0}", path.Length); } private static Optimization.Entities.Grid ConstructGrid() { var roadblocks = new List<Optimization.Entities.GridLocation>(); roadblocks.Add(new Optimization.Entities.GridLocation(1, 1, true)); roadblocks.Add(new Optimization.Entities.GridLocation(1, 2, true)); roadblocks.Add(new Optimization.Entities.GridLocation(1, 3, true)); roadblocks.Add(new Optimization.Entities.GridLocation(2, 0, true)); roadblocks.Add(new Optimization.Entities.GridLocation(2, 1, true)); return new Optimization.Entities.Grid(_gridSize, _gridSize, roadblocks); } } }
mit
C#
2cab6e15bf97e1c7e8b8d04c37084cc21041ac9b
Fix build with VS
markmeeus/MarcelloDB
Marcello/Properties/AssemblyInfo.cs
Marcello/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 ("Marcello")] [assembly: AssemblyDescription ("")] [assembly: AssemblyConfiguration ("")] [assembly: AssemblyCompany ("")] [assembly: AssemblyProduct ("")] [assembly: AssemblyCopyright ("markm_000")] [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("")] [assembly :InternalsVisibleTo("Marcello.Test")]
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 ("Marcello")] [assembly: AssemblyDescription ("")] [assembly: AssemblyConfiguration ("")] [assembly: AssemblyCompany ("")] [assembly: AssemblyProduct ("")] [assembly: AssemblyCopyright ("markm_000")] [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("")] [InternalsVisibleTo("Marcello.Test")]
mit
C#
0a4b1fcf4d14ab50b2b6b8597e4003cf2ccc4613
Update AssemblyInfo.cs
NLog/NLog.Web
NLog.Web/Properties/AssemblyInfo.cs
NLog.Web/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("NLog.Web")] [assembly: AssemblyProduct("NLog.Web")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyCopyright("Copyright © NLog 2015-2019")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: AssemblyVersion("4.0.0.0")] //fixed [assembly: AssemblyFileVersion("1.0.0.0")] // 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("74d5915b-bea9-404c-b4d0-b663164def37")]
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("NLog.Web")] [assembly: AssemblyProduct("NLog.Web")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyCopyright("Copyright © NLog 2015-2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: AssemblyVersion("4.0.0.0")] //fixed [assembly: AssemblyFileVersion("1.0.0.0")] // 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("74d5915b-bea9-404c-b4d0-b663164def37")]
bsd-3-clause
C#
dddf1f98354fb929d80236650ce5ae672568f2ec
Update CameraMovement.cs
highnet/Java-101,highnet/Java-101
Unity/CameraMovement.cs
Unity/CameraMovement.cs
using UnityEngine; using System.Collections; public class CameraMovement : MonoBehaviour { public GameObject player; //Public variable to store a reference to the player game object private Vector3 offset; //Private variable to store the offset distance between the player and camera // Use this for initialization void Start() { //Calculate and store the offset value by getting the distance between the player's position and camera's position. offset = this.transform.position - player.transform.position; } // LateUpdate is called after Update each frame void LateUpdate() { // Set the position of the camera's transform to be the same as the player's, but offset by the calculated offset distance. this.transform.position = player.transform.position + offset; } }
mit
C#
f555e3f1f7cf48ccfb8aa5dc0d097db9e796c9d3
Bump version to 1.3.1
kendallb/PreMailer.Net,rohk/PreMailer.Net,CarterTsai/PreMailer.Net,milkshakesoftware/PreMailer.Net,CodeAnimal/PreMailer.Net,tobio/PreMailer.Net
PreMailer.Net/GlobalAssemblyInfo.cs
PreMailer.Net/GlobalAssemblyInfo.cs
using System; using System.Reflection; using System.Runtime.InteropServices; [assembly: ComVisible(false)] [assembly: CLSCompliant(true)] [assembly: AssemblyProduct("PreMailer.Net")] [assembly: AssemblyCompany("Milkshake Software")] [assembly: AssemblyCopyright("Copyright © Milkshake Software 2015")] [assembly: AssemblyVersion("1.3.1.0")] [assembly: AssemblyFileVersion("1.3.1.0")] #if DEBUG [assembly: AssemblyConfiguration("Debug")] #else [assembly: AssemblyConfiguration("Release")] #endif
using System; using System.Reflection; using System.Runtime.InteropServices; [assembly: ComVisible(false)] [assembly: CLSCompliant(true)] [assembly: AssemblyProduct("PreMailer.Net")] [assembly: AssemblyCompany("Milkshake Software")] [assembly: AssemblyCopyright("Copyright © Milkshake Software 2015")] [assembly: AssemblyVersion("1.3.0.0")] [assembly: AssemblyFileVersion("1.3.0.0")] #if DEBUG [assembly: AssemblyConfiguration("Debug")] #else [assembly: AssemblyConfiguration("Release")] #endif
mit
C#
fa31b3ffd36419e59b4a9df5b1510d8c45a27bad
handle a null SHA when showing a build
half-ogre/qed,Haacked/qed
RequestHandlers/GetBuild.cs
RequestHandlers/GetBuild.cs
using System; using System.Collections.Generic; using System.Threading.Tasks; using fn = qed.Functions; namespace qed { public static partial class Handlers { public static async Task GetBuild( IDictionary<string, object> environment, dynamic @params, Func<IDictionary<string, object>, Task> next) { var owner = @params.owner as string; var name = @params.name as string; var id = int.Parse(@params.id as string); var buildConfiguration = fn.GetBuildConfiguration(owner, name); if (buildConfiguration == null) { environment.SetStatusCode(400); return; } var build = fn.GetBuild(id); var sha = (string)null; if (build.Revision != null) sha = build.Revision.Substring(0, 7); await environment.Render("build", new { id = build.Id, description = fn.GetBuildDescription(build, includeRefDescription: true), name = build.RepositoryName, owner = build.RepositoryOwner, @ref = build.Ref, refDescription = fn.GetRefDescription(build), revision = build.Revision, sha, failed = !build.Succeeded, output = fn.Redact(build.Ouput), status = GetBuildStatus(build) }); } } }
using System; using System.Collections.Generic; using System.Threading.Tasks; using fn = qed.Functions; namespace qed { public static partial class Handlers { public static async Task GetBuild( IDictionary<string, object> environment, dynamic @params, Func<IDictionary<string, object>, Task> next) { var owner = @params.owner as string; var name = @params.name as string; var id = int.Parse(@params.id as string); var buildConfiguration = fn.GetBuildConfiguration(owner, name); if (buildConfiguration == null) { environment.SetStatusCode(400); return; } var build = fn.GetBuild(id); await environment.Render("build", new { id = build.Id, description = fn.GetBuildDescription(build, includeRefDescription: true), name = build.RepositoryName, owner = build.RepositoryOwner, @ref = build.Ref, refDescription = fn.GetRefDescription(build), revision = build.Revision, sha = build.Revision.Substring(0, 7), failed = !build.Succeeded, output = fn.Redact(build.Ouput), status = GetBuildStatus(build) }); } } }
mit
C#
df5d23242146ea0b205a89253a2cf7c6e662931c
Update StrictFakeSpecs to Given/When/Then language
thomaslevesque/FakeItEasy,FakeItEasy/FakeItEasy,blairconrad/FakeItEasy,FakeItEasy/FakeItEasy,thomaslevesque/FakeItEasy,blairconrad/FakeItEasy,adamralph/FakeItEasy,adamralph/FakeItEasy
tests/FakeItEasy.Specs/StrictFakeSpecs.cs
tests/FakeItEasy.Specs/StrictFakeSpecs.cs
namespace FakeItEasy.Specs { using System; using FakeItEasy.Tests.TestHelpers; using FluentAssertions; using Xbehave; using Xunit; public static class StrictFakeSpecs { public interface IMyInterface { void DoIt(Guid id); } [Scenario] public static void RepeatedAssertion( IMyInterface fake, Exception exception) { "Given a strict fake" .x(() => fake = A.Fake<IMyInterface>(o => o.Strict())); "And I configure the fake to do nothing when a method is called with certain arguments" .x(() => A.CallTo(() => fake.DoIt(Guid.Empty)).DoesNothing()); "And I call the method with matching arguments" .x(() => fake.DoIt(Guid.Empty)); "And I call the method with matching arguments again" .x(() => fake.DoIt(Guid.Empty)); "When I assert that the method must have been called exactly once" .x(() => exception = Record.Exception(() => A.CallTo(() => fake.DoIt(Guid.Empty)).MustHaveHappened(Repeated.Exactly.Once))); "Then the assertion throws an expectation exception" .x(() => exception.Should().BeAnExceptionOfType<ExpectationException>()); "And the exception message names the method" .x(() => exception.Message.Should().Contain("DoIt")); } } }
namespace FakeItEasy.Specs { using System; using FakeItEasy.Tests.TestHelpers; using FluentAssertions; using Xbehave; using Xunit; public interface IMyInterface { void DoIt(Guid id); } public static class StrictFakeSpecs { [Scenario] public static void RepeatedAssertion( IMyInterface fake, Exception exception) { "establish" .x(() => { fake = A.Fake<IMyInterface>(o => o.Strict()); ////fake = A.Fake<IMyInterface>(); A.CallTo(() => fake.DoIt(Guid.Empty)).Invokes(() => { }); fake.DoIt(Guid.Empty); fake.DoIt(Guid.Empty); }); "when asserting must have happened when did not happen" .x(() => exception = Record.Exception(() => A.CallTo(() => fake.DoIt(Guid.Empty)).MustHaveHappened(Repeated.Exactly.Once))); "it should throw an expectation exception" .x(() => exception.Should().BeAnExceptionOfType<ExpectationException>()); "it should have an exception message containing the name of the method" .x(() => exception.Message.Should().Contain("DoIt")); } } }
mit
C#
f2ea5228d2549cb9e8aca84008c12810340128c5
Add documentation
killerantz/HoloToolkit-Unity,killerantz/HoloToolkit-Unity,killerantz/HoloToolkit-Unity,DDReaper/MixedRealityToolkit-Unity,killerantz/HoloToolkit-Unity
Assets/MixedRealityToolkit.Tools/ReserializeAssetsUtility/ReserializeAssetsUtility.cs
Assets/MixedRealityToolkit.Tools/ReserializeAssetsUtility/ReserializeAssetsUtility.cs
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using System.Collections.Generic; using UnityEditor; namespace Microsoft.MixedReality.Toolkit.Utilities.Editor { /// <summary> /// Adds menu items to automate reserializing specific files in Unity. /// </summary> /// <remarks> /// Reserialization can be needed between Unity versions or when the /// underlying script or asset definitions are changed. /// </remarks> public class ReserializeUtility { [MenuItem("Mixed Reality Toolkit/Utilities/Reserialize/Prefabs, Scenes, and ScriptableObjects")] private static void ReserializePrefabsAndScenes() { var array = GetAssets("t:Prefab t:Scene t:ScriptableObject"); AssetDatabase.ForceReserializeAssets(array); } [MenuItem("Mixed Reality Toolkit/Utilities/Reserialize/Materials and Textures")] private static void ReserializeMaterials() { var array = GetAssets("t:Material t:Texture"); AssetDatabase.ForceReserializeAssets(array); } private static string[] GetAssets(string filter) { string[] allPrefabsGUID = AssetDatabase.FindAssets($"{filter}"); List<string> allPrefabs = new List<string>(); foreach (string guid in allPrefabsGUID) { allPrefabs.Add(AssetDatabase.GUIDToAssetPath(guid)); } return allPrefabs.ToArray(); } } }
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using System.Collections.Generic; using UnityEditor; using UnityEngine; namespace Microsoft.MixedReality.Toolkit.Utilities.Editor { public class ReserializeUtility { [MenuItem("Mixed Reality Toolkit/Utilities/Reserialize/Prefabs, Scenes, and ScriptableObjects")] private static void ReserializePrefabsAndScenes() { var array = GetAssets("t:Prefab t:Scene t:ScriptableObject"); AssetDatabase.ForceReserializeAssets(array); } [MenuItem("Mixed Reality Toolkit/Utilities/Reserialize/Materials and Textures")] private static void ReserializeMaterials() { var array = GetAssets("t:Material t:Texture"); AssetDatabase.ForceReserializeAssets(array); } private static string[] GetAssets(string filter) { string[] allPrefabsGUID = AssetDatabase.FindAssets($"{filter}"); List<string> allPrefabs = new List<string>(); foreach (string guid in allPrefabsGUID) { allPrefabs.Add(AssetDatabase.GUIDToAssetPath(guid)); } return allPrefabs.ToArray(); } } }
mit
C#
f99099c016158e1ad78874b814ec4a81737d7330
Check for an exact match of item name
PhannGor/unity3d-rainbow-folders
Assets/RainbowItems/Editor/Settings/CustomBrowserIconSettings.cs
Assets/RainbowItems/Editor/Settings/CustomBrowserIconSettings.cs
/* * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ using UnityEngine; using System.Collections.Generic; using System.Linq; namespace Borodar.RainbowItems.Editor.Settings { public class CustomBrowserIconSettings : ScriptableObject { public List<Folder> Folders; public Sprite GetSprite(string folderName, bool small = true) { var folder = Folders.FirstOrDefault(x => x.FolderName.Equals(folderName)); if (folder == null) { return null; } return small ? folder.SmallIcon : folder.LargeIcon; } } }
/* * 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.Collections.Generic; using System.Linq; namespace Borodar.RainbowItems.Editor.Settings { public class CustomBrowserIconSettings : ScriptableObject { public List<Folder> Folders; public Sprite GetSprite(string folderName, bool small = true) { var folder = Folders.FirstOrDefault(x => x.FolderName.Contains(folderName)); if (folder == null) { return null; } return small ? folder.SmallIcon : folder.LargeIcon; } } }
apache-2.0
C#
537b9d181adf5f009ab7dad834b35ef21adac747
change interface alert
Appleseed/base,Appleseed/base
Applications/Appleseed.Base.Alerts.Console/Appleseed.Base.Alerts/Model/IAlert.cs
Applications/Appleseed.Base.Alerts.Console/Appleseed.Base.Alerts/Model/IAlert.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Appleseed.Base.Alerts.Model { interface IAlert { List<UserAlert> GetUserAlerts(); JSONRootObject GetAlert(string query); Task SendAlert(UserAlert uAlert, string link, JSONRootObject results, object mailResponse); bool UpdateUserSendDate(Guid userID, DateTime date); bool Run(); } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Appleseed.Base.Alerts.Model { interface IAlert { List<UserAlert> GetUserAlerts(); JSONRootObject GetAlert(string query); Task SendAlert(string email, string link, JSONRootObject results, object mailResponse); bool UpdateUserSendDate(Guid userID, DateTime date); bool Run(); } }
apache-2.0
C#
787e5d861941c4fd04d147ffba697a02be3918f3
update help
Lone-Coder/letsencrypt-win-simple
src/main/Plugins/InstallationPlugins/Script/ScriptOptionsFactory.cs
src/main/Plugins/InstallationPlugins/Script/ScriptOptionsFactory.cs
using PKISharp.WACS.DomainObjects; using PKISharp.WACS.Extensions; using PKISharp.WACS.Plugins.Base.Factories; using PKISharp.WACS.Services; using System; namespace PKISharp.WACS.Plugins.InstallationPlugins { internal class ScriptOptionsFactory : InstallationPluginFactory<Script, ScriptOptions> { public ScriptOptionsFactory(ILogService log) : base(log) { } public override ScriptOptions Aquire(Target target, IArgumentsService arguments, IInputService inputService, RunLevel runLevel) { var ret = new ScriptOptions(); var args = arguments.GetArguments<ScriptArguments>(); inputService.Show("Full instructions", "https://github.com/PKISharp/win-acme/wiki/Install-Script"); do { ret.Script = arguments.TryGetArgument(args.Script, inputService, "Enter the path to the script that you want to run after renewal"); } while (!ret.Script.ValidFile(_log)); inputService.Show("{0}", "Common name (primary domain name)"); inputService.Show("{1}", ".pfx password"); inputService.Show("{2}", ".pfx full path"); inputService.Show("{3}", "Certificate Store name"); inputService.Show("{4}", "Certificate friendly name"); inputService.Show("{5}", "Certificate thumbprint"); inputService.Show("{6}", ".pfx directory"); inputService.Show("{7}", "Renewal identifier"); ret.ScriptParameters = arguments.TryGetArgument(args.ScriptParameters, inputService, "Enter the parameter format string for the script, e.g. \"--hostname {0}\""); return ret; } public override ScriptOptions Default(Target target, IArgumentsService arguments) { var args = arguments.GetArguments<ScriptArguments>(); var ret = new ScriptOptions { Script = arguments.TryGetRequiredArgument(nameof(args.Script), args.Script) }; if (!ret.Script.ValidFile(_log)) { throw new ArgumentException(nameof(args.Script)); } ret.ScriptParameters = args.ScriptParameters; return ret; } } }
using PKISharp.WACS.DomainObjects; using PKISharp.WACS.Extensions; using PKISharp.WACS.Plugins.Base.Factories; using PKISharp.WACS.Services; using System; namespace PKISharp.WACS.Plugins.InstallationPlugins { internal class ScriptOptionsFactory : InstallationPluginFactory<Script, ScriptOptions> { public ScriptOptionsFactory(ILogService log) : base(log) { } public override ScriptOptions Aquire(Target target, IArgumentsService arguments, IInputService inputService, RunLevel runLevel) { var ret = new ScriptOptions(); var args = arguments.GetArguments<ScriptArguments>(); inputService.Show("Full instructions", "https://github.com/PKISharp/win-acme/wiki/Install-Script"); do { ret.Script = arguments.TryGetArgument(args.Script, inputService, "Enter the path to the script that you want to run after renewal"); } while (!ret.Script.ValidFile(_log)); inputService.Show("{0}", "Common name"); inputService.Show("{1}", ".pfx password"); inputService.Show("{2}", ".pfx path"); inputService.Show("{3}", "Store name"); inputService.Show("{4}", "Friendly name"); inputService.Show("{5}", "Certificate thumbprint"); ret.ScriptParameters = arguments.TryGetArgument(args.ScriptParameters, inputService, "Enter the parameter format string for the script, e.g. \"--hostname {0}\""); return ret; } public override ScriptOptions Default(Target target, IArgumentsService arguments) { var args = arguments.GetArguments<ScriptArguments>(); var ret = new ScriptOptions { Script = arguments.TryGetRequiredArgument(nameof(args.Script), args.Script) }; if (!ret.Script.ValidFile(_log)) { throw new ArgumentException(nameof(args.Script)); } ret.ScriptParameters = args.ScriptParameters; return ret; } } }
apache-2.0
C#
921f17c3da17e0f71262885cf8a4c6691daad8cd
update packages
hahoyer/reni.cs,hahoyer/reni.cs,hahoyer/reni.cs
src/reni2/ReniObjectExtender.cs
src/reni2/ReniObjectExtender.cs
using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using hw.DebugFormatter; using Reni.Formatting; using Reni.TokenClasses; namespace Reni { static class Extension { // will throw an exception if not a ReniObject internal static int GetObjectId(this object reniObject) => ((DumpableObject) reniObject).ObjectId; // will throw an exception if not a ReniObject internal static int? GetObjectId<T>(this object reniObject) { if(reniObject is T) return ((DumpableObject) reniObject).ObjectId; return null; } internal static string NodeDump(this object o) { var r = o as DumpableObject; if(r != null) return r.NodeDump; return o.ToString(); } internal static bool IsBelongingTo(this IBelongingsMatcher current, ITokenClass other) { var otherMatcher = other as IBelongingsMatcher; return otherMatcher != null && current.IsBelongingTo(otherMatcher); } internal static bool IsBelongingTo(this ITokenClass current, ITokenClass other) => (current as IBelongingsMatcher)?.IsBelongingTo(other) ?? false; internal static IEnumerable<SourceSyntax> CheckedItemsAsLongAs (this SourceSyntax target, Func<SourceSyntax, bool> condition) { if(target == null || !condition(target)) yield break; foreach(var result in target.ItemsAsLongAs(condition)) yield return result; } } }
using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using hw.DebugFormatter; using Reni.Formatting; using Reni.TokenClasses; namespace Reni { static class Extension { [DebuggerHidden] public static void StopByObjectId(this object t, int objectId) { var reniObject = t as DumpableObject; if(reniObject == null) return; reniObject.StopByObjectId(1, objectId); } // will throw an exception if not a ReniObject internal static int GetObjectId(this object reniObject) => ((DumpableObject) reniObject).ObjectId; // will throw an exception if not a ReniObject internal static int? GetObjectId<T>(this object reniObject) { if(reniObject is T) return ((DumpableObject) reniObject).ObjectId; return null; } internal static string NodeDump(this object o) { var r = o as DumpableObject; if(r != null) return r.NodeDump; return o.ToString(); } internal static bool IsBelongingTo(this IBelongingsMatcher current, ITokenClass other) { var otherMatcher = other as IBelongingsMatcher; return otherMatcher != null && current.IsBelongingTo(otherMatcher); } internal static bool IsBelongingTo(this ITokenClass current, ITokenClass other) => (current as IBelongingsMatcher)?.IsBelongingTo(other) ?? false; internal static IEnumerable<SourceSyntax> CheckedItemsAsLongAs (this SourceSyntax target, Func<SourceSyntax, bool> condition) { if(target == null || !condition(target)) yield break; foreach(var result in target.ItemsAsLongAs(condition)) yield return result; } } }
mit
C#
b0b514a85e89867359f19fa1cc321ed427973d6d
Remove extra line break
TwilioDevEd/api-snippets,teoreteetik/api-snippets,TwilioDevEd/api-snippets,teoreteetik/api-snippets,teoreteetik/api-snippets,TwilioDevEd/api-snippets,teoreteetik/api-snippets,TwilioDevEd/api-snippets,teoreteetik/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,teoreteetik/api-snippets,teoreteetik/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,teoreteetik/api-snippets,teoreteetik/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets
lookups/lookup-get-addon-payfone-example-1/lookup-get-addon-payfone-1.cs
lookups/lookup-get-addon-payfone-example-1/lookup-get-addon-payfone-1.cs
using Newtonsoft.Json; using RestSharp; using RestSharp.Authenticators; using Newtonsoft.Json.Serialization; // Download the twilio-csharp library from twilio.com/docs/csharp/install using System; class Example { static void Main(string[] args) { // The C# helper library will support Add-ons in June 2016, for now we'll use a simple RestSharp HTTP client var client = new RestClient("https://lookups.twilio.com/v1/PhoneNumbers/+16502530000/?AddOns=payfone_tcpa_compliance&AddOns.payfone_tcpa_compliance.RightPartyContactedDate=20160101"); // Find your Account Sid and Auth Token at twilio.com/user/account client.Authenticator = new HttpBasicAuthenticator("ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "{{ auth_token }}"); var request = new RestRequest(Method.GET); request.AddHeader("content-type", "application/json"); request.AddHeader("accept", "application/json"); IRestResponse response = client.Execute(request); dynamic result = JsonConvert.DeserializeObject(response.Content, new JsonSerializerSettings { ContractResolver = new SnakeCaseContractResolver() }); Console.WriteLine(result.add_ons.results.payfone_tcpa_compliance.result.Description); Console.WriteLine(result.add_ons.results.payfone_tcpa_compliance.result.Response.NumberMatch); } public class SnakeCaseContractResolver : DefaultContractResolver { protected override string ResolvePropertyName(string propertyName) { return GetSnakeCase(propertyName); } private string GetSnakeCase(string input) { if (string.IsNullOrEmpty(input)) return input; var buffer = ""; for (var i = 0; i < input.Length; i++) { var isLast = (i == input.Length - 1); var isSecondFromLast = (i == input.Length - 2); var curr = input[i]; var next = !isLast ? input[i + 1] : '\0'; var afterNext = !isSecondFromLast && !isLast ? input[i + 2] : '\0'; buffer += char.ToLower(curr); if (!char.IsDigit(curr) && char.IsUpper(next)) { if (char.IsUpper(curr)) { if (!isLast && !isSecondFromLast && !char.IsUpper(afterNext)) buffer += "_"; } else buffer += "_"; } if (!char.IsDigit(curr) && char.IsDigit(next)) buffer += "_"; if (char.IsDigit(curr) && !char.IsDigit(next) && !isLast) buffer += "_"; } return buffer; } } }
using Newtonsoft.Json; using RestSharp; using RestSharp.Authenticators; using Newtonsoft.Json.Serialization; // Download the twilio-csharp library from twilio.com/docs/csharp/install using System; class Example { static void Main(string[] args) { // The C# helper library will support Add-ons in June 2016, for now we'll use a simple RestSharp HTTP client var client = new RestClient("https://lookups.twilio.com/v1/PhoneNumbers/+16502530000/?AddOns=payfone_tcpa_compliance&AddOns.payfone_tcpa_compliance.RightPartyContactedDate=20160101"); // Find your Account Sid and Auth Token at twilio.com/user/account client.Authenticator = new HttpBasicAuthenticator("ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "{{ auth_token }}"); var request = new RestRequest(Method.GET); request.AddHeader("content-type", "application/json"); request.AddHeader("accept", "application/json"); IRestResponse response = client.Execute(request); dynamic result = JsonConvert.DeserializeObject(response.Content, new JsonSerializerSettings { ContractResolver = new SnakeCaseContractResolver() }); Console.WriteLine(result.add_ons.results.payfone_tcpa_compliance.result.Description); Console.WriteLine(result.add_ons.results.payfone_tcpa_compliance.result.Response.NumberMatch); } public class SnakeCaseContractResolver : DefaultContractResolver { protected override string ResolvePropertyName(string propertyName) { return GetSnakeCase(propertyName); } private string GetSnakeCase(string input) { if (string.IsNullOrEmpty(input)) return input; var buffer = ""; for (var i = 0; i < input.Length; i++) { var isLast = (i == input.Length - 1); var isSecondFromLast = (i == input.Length - 2); var curr = input[i]; var next = !isLast ? input[i + 1] : '\0'; var afterNext = !isSecondFromLast && !isLast ? input[i + 2] : '\0'; buffer += char.ToLower(curr); if (!char.IsDigit(curr) && char.IsUpper(next)) { if (char.IsUpper(curr)) { if (!isLast && !isSecondFromLast && !char.IsUpper(afterNext)) buffer += "_"; } else buffer += "_"; } if (!char.IsDigit(curr) && char.IsDigit(next)) buffer += "_"; if (char.IsDigit(curr) && !char.IsDigit(next) && !isLast) buffer += "_"; } return buffer; } } }
mit
C#
1b6021a8a88942d3a7cbf8f65b765ba6670d1aed
Fix #142: Sorting in UI is not culture aware
tom-englert/ResXResourceManager
ResXManager.View/Visuals/ShellView.xaml.cs
ResXManager.View/Visuals/ShellView.xaml.cs
namespace tomenglertde.ResXManager.View.Visuals { using System; using System.ComponentModel.Composition; using System.ComponentModel.Composition.Hosting; using System.Diagnostics.Contracts; using System.Globalization; using System.Windows.Markup; using JetBrains.Annotations; using tomenglertde.ResXManager.Infrastructure; using TomsToolbox.Wpf.Composition; /// <summary> /// Interaction logic for ShellView.xaml /// </summary> [Export] [DataTemplate(typeof(ShellViewModel))] [PartCreationPolicy(CreationPolicy.NonShared)] public partial class ShellView { [ImportingConstructor] public ShellView([NotNull] ExportProvider exportProvider) { Contract.Requires(exportProvider != null); try { this.SetExportProvider(exportProvider); InitializeComponent(); Language = XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag); } catch (Exception ex) { exportProvider.TraceXamlLoaderError(ex); } } } }
namespace tomenglertde.ResXManager.View.Visuals { using System; using System.ComponentModel.Composition; using System.ComponentModel.Composition.Hosting; using System.Diagnostics.Contracts; using JetBrains.Annotations; using tomenglertde.ResXManager.Infrastructure; using TomsToolbox.Wpf.Composition; /// <summary> /// Interaction logic for ShellView.xaml /// </summary> [Export] [DataTemplate(typeof(ShellViewModel))] [PartCreationPolicy(CreationPolicy.NonShared)] public partial class ShellView { [ImportingConstructor] public ShellView([NotNull] ExportProvider exportProvider) { Contract.Requires(exportProvider != null); try { this.SetExportProvider(exportProvider); InitializeComponent(); } catch (Exception ex) { exportProvider.TraceXamlLoaderError(ex); } } } }
mit
C#
1658549ab6d8bd4f3288f08c8a82d7e18e10882d
Update ConvertingColumnChartToImage.cs
aspose-cells/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,maria-shahid-aspose/Aspose.Cells-for-.NET,aspose-cells/Aspose.Cells-for-.NET,maria-shahid-aspose/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,aspose-cells/Aspose.Cells-for-.NET,maria-shahid-aspose/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,maria-shahid-aspose/Aspose.Cells-for-.NET,aspose-cells/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET
Examples/CSharp/Articles/ConvertExcelChartToImage/ConvertingColumnChartToImage.cs
Examples/CSharp/Articles/ConvertExcelChartToImage/ConvertingColumnChartToImage.cs
using System.IO; using Aspose.Cells; namespace Aspose.Cells.Examples.Articles.ConvertExcelChartToImage { public class ConvertingColumnChartToImage { public static void Main(string[] args) { //ExStart:1 // The path to the documents directory. string dataDir = Aspose.Cells.Examples.Utils.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); //Create a new workbook. //Open the existing excel file which contains the column chart. Workbook workbook = new Workbook(dataDir+ "ColumnChart.xlsx"); //Get the designer chart (first chart) in the first worksheet. //of the workbook. Aspose.Cells.Charts.Chart chart = workbook.Worksheets[0].Charts[0]; //Convert the chart to an image file. chart.ToImage(dataDir+ "ColumnChart.out.jpeg", System.Drawing.Imaging.ImageFormat.Jpeg); //ExEnd:1 } } }
using System.IO; using Aspose.Cells; namespace Aspose.Cells.Examples.Articles.ConvertExcelChartToImage { public class ConvertingColumnChartToImage { public static void Main(string[] args) { // The path to the documents directory. string dataDir = Aspose.Cells.Examples.Utils.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); //Create a new workbook. //Open the existing excel file which contains the column chart. Workbook workbook = new Workbook(dataDir+ "ColumnChart.xlsx"); //Get the designer chart (first chart) in the first worksheet. //of the workbook. Aspose.Cells.Charts.Chart chart = workbook.Worksheets[0].Charts[0]; //Convert the chart to an image file. chart.ToImage(dataDir+ "ColumnChart.out.jpeg", System.Drawing.Imaging.ImageFormat.Jpeg); } } }
mit
C#
6188c4087e7608590ee7fa5fbd33c2826b91ce13
Add comment
charlenni/Mapsui,charlenni/Mapsui
Samples/Mapsui.Samples.Maui/MauiProgram.cs
Samples/Mapsui.Samples.Maui/MauiProgram.cs
using SkiaSharp.Views.Maui.Controls.Hosting; namespace Mapsui.Samples.Maui { public static class MauiProgram { public static MauiApp CreateMauiApp() { var builder = MauiApp.CreateBuilder(); builder .UseMauiApp<App>() // Without the line below the app will crash with this exception: "Catastrophic failure (0x8000FFFF (E_UNEXPECTED))". .UseSkiaSharp() .ConfigureFonts(fonts => { fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold"); }); return builder.Build(); } } }
using SkiaSharp.Views.Maui.Controls.Hosting; namespace Mapsui.Samples.Maui { public static class MauiProgram { public static MauiApp CreateMauiApp() { var builder = MauiApp.CreateBuilder(); builder .UseMauiApp<App>() .UseSkiaSharp() .ConfigureFonts(fonts => { fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold"); }); return builder.Build(); } } }
mit
C#
b30d2462c38ce79e275564db7cbd21afe779141a
Fix bug in test which made it look like it failed
csf-dev/CSF.Screenplay,csf-dev/CSF.Screenplay,csf-dev/CSF.Screenplay
Tests/CSF.Screenplay.SpecFlow.Tests/ResolvingATestRunnerSteps.cs
Tests/CSF.Screenplay.SpecFlow.Tests/ResolvingATestRunnerSteps.cs
using System; using TechTalk.SpecFlow; using NUnit.Framework; namespace CSF.Screenplay.SpecFlow.Tests { [Binding] public class ResolvingATestRunnerSteps { readonly Lazy<ITestRunner> testRunner; readonly Lazy<BindingWhichDerivesFromSteps> stepsBinding; readonly ScenarioContext context; [Given("I have an instance of a SpecFlow binding class which includes a Lazy ITestRunner")] public void GivenIHaveASpecFlowBindingWhichIncludesALazyITestRunner() { // Intentional no-op, this very step instantiates the class } [Given(@"I have an instance of a SpecFlow binding class which derives from the Steps class")] public void GivenAnInstanceOfBindingWhichDerivesFromSteps() { #pragma warning disable RECS0156 // Local variable is never used var val = stepsBinding.Value; #pragma warning restore RECS0156 // Local variable is never used } [When(@"I resolve that test runner instance")] public void WhenIResolveTheTestRunner() { #pragma warning disable RECS0156 // Local variable is never used var val = testRunner.Value; #pragma warning restore RECS0156 // Local variable is never used } [When(@"I make use of a sample method from that binding class which returns the string '([^']+)'")] public void WhenIMakeUseOfAMethodFromTheBindingClass(string parameter) { var result = stepsBinding.Value.SampleMethod(parameter); context.Set(result, nameof(BindingWhichDerivesFromSteps.SampleMethod)); } [Then(@"the test runner instance should not be null")] public void ThenTheTestRunnerShouldNotBeNull() { Assert.That(testRunner.Value, Is.Not.Null); } [Then(@"the returned value should be '([^']+)'")] public void ThenTheSampleMethodValueShouldBe(string expected) { var result = context.Get<string>(nameof(BindingWhichDerivesFromSteps.SampleMethod)); Assert.That(result, Is.EqualTo(expected)); } [Then(@"if nothing crashed then the test passes")] public void ThenPassTheTest() { // No-op: The test passed } public ResolvingATestRunnerSteps(Lazy<ITestRunner> testRunner, Lazy<BindingWhichDerivesFromSteps> stepsBinding, ScenarioContext context) { if(context == null) throw new ArgumentNullException(nameof(context)); if(stepsBinding == null) throw new ArgumentNullException(nameof(stepsBinding)); if(testRunner == null) throw new ArgumentNullException(nameof(testRunner)); this.context = context; this.stepsBinding = stepsBinding; this.testRunner = testRunner; } } }
using System; using TechTalk.SpecFlow; using NUnit.Framework; namespace CSF.Screenplay.SpecFlow.Tests { [Binding] public class ResolvingATestRunnerSteps { readonly Lazy<ITestRunner> testRunner; readonly Lazy<BindingWhichDerivesFromSteps> stepsBinding; readonly ScenarioContext context; [Given("I have an instance of a SpecFlow binding class which includes a Lazy ITestRunner")] public void GivenIHaveASpecFlowBindingWhichIncludesALazyITestRunner() { // Intentional no-op, this very step instantiates the class } [Given(@"I have an instance of a SpecFlow binding class which derives from the Steps class")] public void GivenAnInstanceOfBindingWhichDerivesFromSteps() { #pragma warning disable RECS0156 // Local variable is never used var val = stepsBinding.Value; #pragma warning restore RECS0156 // Local variable is never used } [When(@"I resolve that test runner instance")] public void WhenIResolveTheTestRunner() { #pragma warning disable RECS0156 // Local variable is never used var val = testRunner.Value; #pragma warning restore RECS0156 // Local variable is never used } [When(@"I make use of a sample method from that binding class which returns the string '([^']+)'")] public void WhenIMakeUseOfAMethodFromTheBindingClass(string parameter) { var result = stepsBinding.Value.SampleMethod(parameter); context.Set(result, nameof(BindingWhichDerivesFromSteps.SampleMethod)); } [Then(@"the test runner instance should not be null")] public void ThenTheTestRunnerShouldNotBeNull() { Assert.That(testRunner.Value, Is.Not.Null); } [Then(@"the returned value should be '([^']+)'")] public void ThenTheSampleMethodValueShouldBe(string expected) { var result = context.Get<string>(nameof(BindingWhichDerivesFromSteps.SampleMethod)); Assert.That(result, Is.EqualTo(expected)); } [Then(@"if nothing crashed then the test passes")] public void ThenPassTheTest() { Assert.Pass("The test passed"); } public ResolvingATestRunnerSteps(Lazy<ITestRunner> testRunner, Lazy<BindingWhichDerivesFromSteps> stepsBinding, ScenarioContext context) { if(context == null) throw new ArgumentNullException(nameof(context)); if(stepsBinding == null) throw new ArgumentNullException(nameof(stepsBinding)); if(testRunner == null) throw new ArgumentNullException(nameof(testRunner)); this.context = context; this.stepsBinding = stepsBinding; this.testRunner = testRunner; } } }
mit
C#
f292872f6c45972b1d10b88e98b277183a140f64
Add xmldoc and TODO comment
smoogipooo/osu-framework,peppy/osu-framework,peppy/osu-framework,smoogipooo/osu-framework,peppy/osu-framework,ppy/osu-framework,ppy/osu-framework,ppy/osu-framework,ZLima12/osu-framework,ZLima12/osu-framework
osu.Framework/Utils/ThrowHelper.cs
osu.Framework/Utils/ThrowHelper.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. #nullable enable using System; namespace osu.Framework.Utils { /// <summary> /// Helper class for throwing exceptions in isolated methods, for cases where method inlining is beneficial. /// As throwing directly in that case causes JIT to disable inlining on the surrounding method. /// </summary> // todo: continue implementation and use where required, see https://github.com/ppy/osu-framework/issues/3470. public static class ThrowHelper { public static void ThrowInvalidOperationException(string? message) => throw new InvalidOperationException(message); } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. #nullable enable using System; namespace osu.Framework.Utils { public static class ThrowHelper { public static void ThrowInvalidOperationException(string? message) => throw new InvalidOperationException(message); } }
mit
C#
3d59e6fee926d487c7c2f11e187291aff1f829d4
Fix indexing bug in MonthViewModel.
jakubfijalkowski/studentscalendar
StudentsCalendar.UI/Main/MonthViewModel.cs
StudentsCalendar.UI/Main/MonthViewModel.cs
using System; using System.Collections.Generic; using System.Linq; using Caliburn.Micro; using NodaTime; using StudentsCalendar.Core; using StudentsCalendar.UI.Services; namespace StudentsCalendar.UI.Main { /// <summary> /// Widok miesiąca podzielonego na tygodnie. Pozwala na wyświetlenie aktualnego tygodnia i kilku poprzednich/następnych. /// </summary> public sealed class MonthViewModel : Screen, IViewModel { private const int MaxWeeks = 2; private readonly ICurrentCalendar CurrentCalendar; private readonly ILayoutArranger LayoutArranger; /// <summary> /// Wskazuje, czy aktualnie wybrany kalendarz jest prawidłowy i da się wyświetlić zawartość tego ViewModelu. /// </summary> public bool IsDataValid { get; private set; } /// <summary> /// Pobiera listę tygodni załadowanych do ViewModelu. /// </summary> public IReadOnlyList<ArrangedWeek> Weeks { get; private set; } /// <summary> /// Pobiera aktualny tydzień. /// </summary> public ArrangedWeek CurrentWeek { get; private set; } /// <summary> /// Inicjalizuje obiekt niezbędnymi zależnościami. /// </summary> /// <param name="calendar"></param> /// <param name="layoutArranger"></param> public MonthViewModel(ICurrentCalendar calendar, ILayoutArranger layoutArranger) { this.DisplayName = "Widok miesiąca"; this.CurrentCalendar = calendar; this.LayoutArranger = layoutArranger; } protected override void OnInitialize() { base.OnInitialize(); this.IsDataValid = true; do { if (this.CurrentCalendar.Calendar == null) { this.IsDataValid = false; break; } var generated = this.CurrentCalendar.Calendar; var today = DateHelper.Today; var thisWeek = today.IsoDayOfWeek != IsoDayOfWeek.Monday ? today.Previous(IsoDayOfWeek.Monday) : today; var currentWeek = generated.Weeks .Select((w, i) => new { Week = w, Index = i }) .FirstOrDefault(w => w.Week.Date == thisWeek); if (currentWeek == null) { this.IsDataValid = false; break; } var weekIndex = currentWeek.Index; int startWeekIndex = Math.Max(weekIndex - MaxWeeks, 0); int endWeekIndex = Math.Min(weekIndex + MaxWeeks + 1, generated.Weeks.Count); this.Weeks = generated.Weeks .Skip(startWeekIndex) .Take(endWeekIndex - startWeekIndex) .Select(this.LayoutArranger.Arrange) .ToArray(); this.CurrentWeek = this.Weeks[weekIndex - startWeekIndex]; } while (false); this.Refresh(); } } }
using System; using System.Collections.Generic; using System.Linq; using Caliburn.Micro; using NodaTime; using StudentsCalendar.Core; using StudentsCalendar.UI.Services; namespace StudentsCalendar.UI.Main { /// <summary> /// Widok miesiąca podzielonego na tygodnie. Pozwala na wyświetlenie aktualnego tygodnia i kilku poprzednich/następnych. /// </summary> public sealed class MonthViewModel : Screen, IViewModel { private const int MaxWeeks = 2; private readonly ICurrentCalendar CurrentCalendar; private readonly ILayoutArranger LayoutArranger; /// <summary> /// Wskazuje, czy aktualnie wybrany kalendarz jest prawidłowy i da się wyświetlić zawartość tego ViewModelu. /// </summary> public bool IsDataValid { get; private set; } /// <summary> /// Pobiera listę tygodni załadowanych do ViewModelu. /// </summary> public IReadOnlyList<ArrangedWeek> Weeks { get; private set; } /// <summary> /// Pobiera aktualny tydzień. /// </summary> public ArrangedWeek CurrentWeek { get; private set; } /// <summary> /// Inicjalizuje obiekt niezbędnymi zależnościami. /// </summary> /// <param name="calendar"></param> /// <param name="layoutArranger"></param> public MonthViewModel(ICurrentCalendar calendar, ILayoutArranger layoutArranger) { this.DisplayName = "Widok miesiąca"; this.CurrentCalendar = calendar; this.LayoutArranger = layoutArranger; } protected override void OnInitialize() { base.OnInitialize(); this.IsDataValid = true; do { if (this.CurrentCalendar.Calendar == null) { this.IsDataValid = false; break; } var generated = this.CurrentCalendar.Calendar; var today = DateHelper.Today; var thisWeek = today.IsoDayOfWeek != IsoDayOfWeek.Monday ? today.Previous(IsoDayOfWeek.Monday) : today; var currentWeek = generated.Weeks .Select((w, i) => new { Week = w, Index = i }) .FirstOrDefault(w => w.Week.Date == thisWeek); if (currentWeek == null) { this.IsDataValid = false; break; } var weekIndex = currentWeek.Index; int startWeekIndex = Math.Max(weekIndex - MaxWeeks, 0); int endWeekIndex = Math.Min(weekIndex + MaxWeeks + 1, generated.Weeks.Count - 1); this.Weeks = generated.Weeks .Skip(startWeekIndex) .Take(endWeekIndex - startWeekIndex) .Select(this.LayoutArranger.Arrange) .ToArray(); this.CurrentWeek = this.Weeks[weekIndex - startWeekIndex]; } while (false); this.Refresh(); } } }
mit
C#
9489f5c1bb9ffee11793028641a1b254a928e071
Fix simple syntax
erlingsjostrom/TESS-V2,erlingsjostrom/TESS-V2,erlingsjostrom/TESS-V2,erlingsjostrom/TESS-V2,erlingsjostrom/TESS-V2
TestRestfulAPI/App_Start/EntityMappings.cs
TestRestfulAPI/App_Start/EntityMappings.cs
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Http; using AutoMapper; using TestRestfulAPI.Entities.TESS; namespace TestRestfulAPI { public class EntityMappings { public static void Register(HttpConfiguration config) { Mapper.Initialize(cfg => { cfg.CreateMap<Article, ArticleDto>(); cfg.CreateMap<Customer, CustomerDto>(); } ); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Http; using AutoMapper; using TestRestfulAPI.Entities.TESS; namespace TestRestfulAPI { public class EntityMappings { public static void Register(HttpConfiguration config) { Mapper.Initialize(cfg => cfg.CreateMap<Article, ArticleDto>() ); Mapper.Initialize(cfg => cfg.CreateMap<Customer, CustomerDto>() ); } } }
mit
C#
016684b52d65db6e1e94723f134a4d03dc16549a
Remove unreachable code
peppy/osu,ppy/osu,NeoAdonis/osu,smoogipoo/osu,peppy/osu,smoogipooo/osu,peppy/osu,ppy/osu,smoogipoo/osu,NeoAdonis/osu,ppy/osu,smoogipoo/osu,NeoAdonis/osu
osu.Game/Skinning/LegacySkinResourceStore.cs
osu.Game/Skinning/LegacySkinResourceStore.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using System.Collections.Generic; using System.Linq; using osu.Framework.Extensions; using osu.Framework.IO.Stores; using osu.Game.Database; using osu.Game.Extensions; namespace osu.Game.Skinning { public class LegacySkinResourceStore<T> : ResourceStore<byte[]> where T : INamedFileInfo { private readonly IHasFiles<T> source; public LegacySkinResourceStore(IHasFiles<T> source, IResourceStore<byte[]> underlyingStore) : base(underlyingStore) { this.source = source; } protected override IEnumerable<string> GetFilenames(string name) { foreach (string filename in base.GetFilenames(name)) { string path = getPathForFile(filename.ToStandardisedPath()); if (path != null) yield return path; } } private string getPathForFile(string filename) => source.Files.Find(f => string.Equals(f.Filename, filename, StringComparison.OrdinalIgnoreCase))?.FileInfo.GetStoragePath(); public override IEnumerable<string> GetAvailableResources() => source.Files.Select(f => f.Filename); } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using System.Collections.Generic; using System.Linq; using osu.Framework.Extensions; using osu.Framework.IO.Stores; using osu.Game.Database; using osu.Game.Extensions; namespace osu.Game.Skinning { public class LegacySkinResourceStore<T> : ResourceStore<byte[]> where T : INamedFileInfo { private readonly IHasFiles<T> source; public LegacySkinResourceStore(IHasFiles<T> source, IResourceStore<byte[]> underlyingStore) : base(underlyingStore) { this.source = source; } protected override IEnumerable<string> GetFilenames(string name) { if (source.Files == null) yield break; foreach (string filename in base.GetFilenames(name)) { string path = getPathForFile(filename.ToStandardisedPath()); if (path != null) yield return path; } } private string getPathForFile(string filename) => source.Files.Find(f => string.Equals(f.Filename, filename, StringComparison.OrdinalIgnoreCase))?.FileInfo.GetStoragePath(); public override IEnumerable<string> GetAvailableResources() => source.Files.Select(f => f.Filename); } }
mit
C#
cf68cd48bacc89f38cec72c29b5a4f0a22d94177
remove array
Appleseed/base,Appleseed/base
Applications/Appleseed.Base.Alerts.Console/Appleseed.Base.Alerts/Model/SolrResponseItem.cs
Applications/Appleseed.Base.Alerts.Console/Appleseed.Base.Alerts/Model/SolrResponseItem.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Appleseed.Base.Alerts.Model { class SolrResponseItem { public string id { get; set; } public string item_type { get; set; } public string address_1 { get; set; } public string city { get; set; } public string state { get; set; } public string classification { get; set; } public string country { get; set; } public string postal_code { get; set; } public string product_description { get; set; } public string product_quantity { get; set; } public string product_type { get; set; } public string code_info { get; set; } public string reason_for_recall { get; set; } public DateTime recall_initiation_date { get; set; } public string[] recall_number { get; set; } public string recalling_firm { get; set; } public string[] voluntary_mandated { get; set; } public DateTime report_date { get; set; } public string[] status { get; set; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Appleseed.Base.Alerts.Model { class SolrResponseItem { public string id { get; set; } public string item_type { get; set; } public string address_1 { get; set; } public string city { get; set; } public string state { get; set; } public string classification { get; set; } public string country { get; set; } public string postal_code { get; set; } public string product_description { get; set; } public string product_quantity { get; set; } public string product_type { get; set; } public string code_info { get; set; } public string[] reason_for_recall { get; set; } public DateTime recall_initiation_date { get; set; } public string[] recall_number { get; set; } public string recalling_firm { get; set; } public string[] voluntary_mandated { get; set; } public DateTime report_date { get; set; } public string[] status { get; set; } } }
apache-2.0
C#
051fd0e957552a9444c488fc095805d064967d65
Add xml documentation
naoey/osu-framework,Nabile-Rahmani/osu-framework,smoogipooo/osu-framework,paparony03/osu-framework,default0/osu-framework,peppy/osu-framework,Nabile-Rahmani/osu-framework,default0/osu-framework,DrabWeb/osu-framework,naoey/osu-framework,ppy/osu-framework,ZLima12/osu-framework,ZLima12/osu-framework,EVAST9919/osu-framework,EVAST9919/osu-framework,Tom94/osu-framework,DrabWeb/osu-framework,DrabWeb/osu-framework,peppy/osu-framework,ppy/osu-framework,EVAST9919/osu-framework,peppy/osu-framework,EVAST9919/osu-framework,smoogipooo/osu-framework,paparony03/osu-framework,Tom94/osu-framework,ppy/osu-framework
osu.Framework/MathUtils/Precision.cs
osu.Framework/MathUtils/Precision.cs
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE using OpenTK; using System; namespace osu.Framework.MathUtils { public static class Precision { public const float FLOAT_EPSILON = 1e-3f; public const double DOUBLE_EPSILON = 1e-7; public static bool DefinitelyBigger(float value1, float value2, float acceptableDifference = FLOAT_EPSILON) { return value1 - acceptableDifference > value2; } public static bool DefinitelyBigger(double value1, double value2, double acceptableDifference = DOUBLE_EPSILON) { return value1 - acceptableDifference > value2; } public static bool AlmostBigger(float value1, float value2, float acceptableDifference = FLOAT_EPSILON) { return value1 > value2 - acceptableDifference; } public static bool AlmostBigger(double value1, double value2, double acceptableDifference = DOUBLE_EPSILON) { return value1 > value2 - acceptableDifference; } public static bool AlmostEquals(float value1, float value2, float acceptableDifference = FLOAT_EPSILON) { return Math.Abs(value1 - value2) <= acceptableDifference; } public static bool AlmostEquals(Vector2 value1, Vector2 value2, float acceptableDifference = FLOAT_EPSILON) { return AlmostEquals(value1.X, value2.X, acceptableDifference) && AlmostEquals(value1.Y, value2.Y, acceptableDifference); } public static bool AlmostEquals(double value1, double value2, double acceptableDifference = DOUBLE_EPSILON) { return Math.Abs(value1 - value2) <= acceptableDifference; } /// <summary> /// Rounds the specified value to the number of digits. /// Default number of digits is 7. /// </summary> public static double Round(double value, int numOfDigits = 7) { return Math.Round(value, numOfDigits); } /// <summary> /// Rounds the specified value to the number of digits. /// Default number of digits is 3. /// </summary> public static float Round(float value, int numOfDigits = 3) { return (float)Math.Round(value, numOfDigits); } } }
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE using OpenTK; using System; namespace osu.Framework.MathUtils { public static class Precision { public const float FLOAT_EPSILON = 1e-3f; public const double DOUBLE_EPSILON = 1e-7; public static bool DefinitelyBigger(float value1, float value2, float acceptableDifference = FLOAT_EPSILON) { return value1 - acceptableDifference > value2; } public static bool DefinitelyBigger(double value1, double value2, double acceptableDifference = DOUBLE_EPSILON) { return value1 - acceptableDifference > value2; } public static bool AlmostBigger(float value1, float value2, float acceptableDifference = FLOAT_EPSILON) { return value1 > value2 - acceptableDifference; } public static bool AlmostBigger(double value1, double value2, double acceptableDifference = DOUBLE_EPSILON) { return value1 > value2 - acceptableDifference; } public static bool AlmostEquals(float value1, float value2, float acceptableDifference = FLOAT_EPSILON) { return Math.Abs(value1 - value2) <= acceptableDifference; } public static bool AlmostEquals(Vector2 value1, Vector2 value2, float acceptableDifference = FLOAT_EPSILON) { return AlmostEquals(value1.X, value2.X, acceptableDifference) && AlmostEquals(value1.Y, value2.Y, acceptableDifference); } public static bool AlmostEquals(double value1, double value2, double acceptableDifference = DOUBLE_EPSILON) { return Math.Abs(value1 - value2) <= acceptableDifference; } public static double Round(double value, int numOfDigits = 7) { return Math.Round(value, numOfDigits); } public static float Round(float value, int numOfDigits = 3) { return (float)Math.Round(value, numOfDigits); } } }
mit
C#
b3ac544d655e6846a94b6bf2d31332b471d90de4
Revert "Consider `UnknownMod` to be "playable in multiplayer""
ppy/osu,peppy/osu,ppy/osu,peppy/osu,ppy/osu,NeoAdonis/osu,NeoAdonis/osu,NeoAdonis/osu,peppy/osu
osu.Game/Rulesets/Mods/UnknownMod.cs
osu.Game/Rulesets/Mods/UnknownMod.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. namespace osu.Game.Rulesets.Mods { public class UnknownMod : Mod { /// <summary> /// The acronym of the mod which could not be resolved. /// </summary> public readonly string OriginalAcronym; public override string Name => $"Unknown mod ({OriginalAcronym})"; public override string Acronym => $"{OriginalAcronym}??"; public override string Description => "This mod could not be resolved by the game."; public override double ScoreMultiplier => 0; public override bool UserPlayable => false; public override ModType Type => ModType.System; public UnknownMod(string acronym) { OriginalAcronym = acronym; } public override Mod DeepClone() => new UnknownMod(OriginalAcronym); } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. namespace osu.Game.Rulesets.Mods { public class UnknownMod : Mod { /// <summary> /// The acronym of the mod which could not be resolved. /// </summary> public readonly string OriginalAcronym; public override string Name => $"Unknown mod ({OriginalAcronym})"; public override string Acronym => $"{OriginalAcronym}??"; public override string Description => "This mod could not be resolved by the game."; public override double ScoreMultiplier => 0; public override bool UserPlayable => false; public override bool PlayableInMultiplayer => true; public override ModType Type => ModType.System; public UnknownMod(string acronym) { OriginalAcronym = acronym; } public override Mod DeepClone() => new UnknownMod(OriginalAcronym); } }
mit
C#
ae1c6fa617407bda0f67855806dba1c72448ddc2
Update QuickFind.cs
qdimka/Algorithms,qdimka/Algorithms,Oscarbralo/Algorithms,qdimka/Algorithms,Oscarbralo/Algorithms,Oscarbralo/Algorithms
CSharpQuickFind/QuickFind.cs
CSharpQuickFind/QuickFind.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace QuickFind { public class QuickFindAlgorithm { private int[] id; //Initialize the quick find data structure public QuickFind(int n) { int count = -1; id = new int[n].Select(x => x = ++count).ToArray<int>(); } //Join two components public void Union(int p, int q) { id = (id[p] != id[q]) ? id.Select(x => (x == id[p]) ? x = id[q] : x).ToArray<int>() : id; } //CHeck if two components are connected public bool AreConnected(int p, int q) { return (id[p] == id[q]) ? true : false; } //Count the number of connected components public int CountComponents() { return id.Distinct().Count(); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace QuickFind { public class QuickFind { private int[] id; //Initialize the quick find data structure public QuickFind(int n) { int count = -1; id = new int[n].Select(x => x = ++count).ToArray<int>(); } //Join two components public void Union(int p, int q) { id = (id[p] != id[q]) ? id.Select(x => (x == id[p]) ? x = id[q] : x).ToArray<int>() : id; } //CHeck if two components are connected public bool AreConnected(int p, int q) { return (id[p] == id[q]) ? true : false; } //Count the number of connected components public int CountComponents() { return id.Distinct().Count(); } } }
mit
C#
a128e1a43a225878898b2553d7db582645b1565a
Update to Abp.Zero 0.7.0.0
Jerome2606/module-zero,lemestrez/module-zero,lemestrez/module-zero,volkd/module-zero,AndHuang/module-zero,ilyhacker/module-zero,chilin/module-zero,asauriol/module-zero,abdllhbyrktr/module-zero,AndHuang/module-zero,daywrite/module-zero,volkd/module-zero,CooperLiu/module-zero,aspnetboilerplate/module-zero,Jerome2606/module-zero,asauriol/module-zero,andmattia/module-zero
sample/ModuleZeroSampleProject.Core/Authorization/RoleManager.cs
sample/ModuleZeroSampleProject.Core/Authorization/RoleManager.cs
using Abp.Authorization; using Abp.Authorization.Roles; using Abp.Domain.Uow; using Abp.Zero.Configuration; using ModuleZeroSampleProject.MultiTenancy; using ModuleZeroSampleProject.Users; namespace ModuleZeroSampleProject.Authorization { public class RoleManager : AbpRoleManager<Tenant, Role, User> { public RoleManager( RoleStore roleStore, IPermissionManager permissionManager, IRoleManagementConfig roleManagementConfig, ICacheManager cacheManager) : base( roleStore, permissionManager, roleManagementConfig, cacheManager) { } } }
using Abp.Authorization; using Abp.Authorization.Roles; using Abp.Domain.Uow; using Abp.Zero.Configuration; using ModuleZeroSampleProject.MultiTenancy; using ModuleZeroSampleProject.Users; namespace ModuleZeroSampleProject.Authorization { public class RoleManager : AbpRoleManager<Tenant, Role, User> { public RoleManager( RoleStore store, IPermissionManager permissionManager, IRoleManagementConfig roleManagementConfig, IUnitOfWorkManager unitOfWorkManager) : base( store, permissionManager, roleManagementConfig, unitOfWorkManager) { } } }
mit
C#
75a2beb044a82fec18f7f7f0504f6530c6bd01fc
Update KieranJacobsen.cs
planetpowershell/planetpowershell,planetpowershell/planetpowershell,planetpowershell/planetpowershell,planetpowershell/planetpowershell
src/Firehose.Web/Authors/KieranJacobsen.cs
src/Firehose.Web/Authors/KieranJacobsen.cs
using System; using System.Collections.Generic; using System.Linq; using System.ServiceModel.Syndication; using System.Web; using Firehose.Web.Infrastructure; namespace Firehose.Web.Authors { public class KieranJacobsen : IAmAMicrosoftMVP, IFilterMyBlogPosts { public string FirstName => "Kieran"; public string LastName => "Jacobsen"; public string ShortBioOrTagLine => "Readifarian, works with PowerShell"; public string StateOrRegion => "Melbourne, Australia"; public string EmailAddress => "code@poshsecurity.com"; public string TwitterHandle => "kjacobsen"; public string GravatarHash => ""; public Uri WebSite => new Uri("https://poshsecurity.com/"); public IEnumerable<Uri> FeedUris { get { yield return new Uri("http://poshsecurity.com/blog/?format=rss"); } } public string GitHubHandle => "kjacobsen"; public bool Filter(SyndicationItem item) { return item.Categories.Where(i => i.Name.Equals("powershell", StringComparison.OrdinalIgnoreCase)).Any(); } public GeoPosition Position => new GeoPosition(-37.816667, 144.966667); } }
using System; using System.Collections.Generic; using System.Linq; using System.ServiceModel.Syndication; using System.Web; using Firehose.Web.Infrastructure; namespace Firehose.Web.Authors { public class KieranJacobsen : IAmACommunityMember, IFilterMyBlogPosts { public string FirstName => "Kieran"; public string LastName => "Jacobsen"; public string ShortBioOrTagLine => "Readifarian, works with PowerShell"; public string StateOrRegion => "Melbourne, Australia"; public string EmailAddress => "code@poshsecurity.com"; public string TwitterHandle => "kjacobsen"; public string GravatarHash => ""; public Uri WebSite => new Uri("https://poshsecurity.com/"); public IEnumerable<Uri> FeedUris { get { yield return new Uri("http://poshsecurity.com/blog/?format=rss"); } } public string GitHubHandle => "kjacobsen"; public bool Filter(SyndicationItem item) { return item.Categories.Where(i => i.Name.Equals("powershell", StringComparison.OrdinalIgnoreCase)).Any(); } public GeoPosition Position => new GeoPosition(-37.816667, 144.966667); } }
mit
C#
c64ea0686dd7eb265403a7093575e1adc0931ce6
Remove already included mvp status (#483)
planetxamarin/planetxamarin,planetxamarin/planetxamarin,planetxamarin/planetxamarin,planetxamarin/planetxamarin
src/Firehose.Web/Authors/MartijnVanDijk.cs
src/Firehose.Web/Authors/MartijnVanDijk.cs
using System; using System.Collections.Generic; using Firehose.Web.Infrastructure; namespace Firehose.Web.Authors { public class MartijnVanDijk : IAmAMicrosoftMVP, IAmAXamarinMVP { public string FirstName => "Martijn"; public string LastName => "van Dijk"; public string StateOrRegion => "Amsterdam, Netherlands"; public string EmailAddress => "mhvdijk@gmail.com"; public string ShortBioOrTagLine => "is working at Baseflow.com on Apps and MvvmCross"; public Uri WebSite => new Uri("https://medium.com/@martijn00"); public IEnumerable<Uri> FeedUris { get { yield return new Uri("https://medium.com/feed/@martijn00"); } } public string TwitterHandle => "mhvdijk"; public string GravatarHash => "22155f520ab611cf04f76762556ca3f5"; public string GitHubHandle => "martijn00"; public GeoPosition Position => new GeoPosition(52.3702160, 4.8951680); public string FeedLanguageCode => "en"; } }
using System; using System.Collections.Generic; using Firehose.Web.Infrastructure; namespace Firehose.Web.Authors { public class MartijnVanDijk : IAmAMicrosoftMVP, IAmAXamarinMVP { public string FirstName => "Martijn"; public string LastName => "van Dijk"; public string StateOrRegion => "Amsterdam, Netherlands"; public string EmailAddress => "mhvdijk@gmail.com"; public string ShortBioOrTagLine => "is working at Baseflow.com on Apps and MvvmCross. Microsoft & Xamarin MVP!"; public Uri WebSite => new Uri("https://medium.com/@martijn00"); public IEnumerable<Uri> FeedUris { get { yield return new Uri("https://medium.com/feed/@martijn00"); } } public string TwitterHandle => "mhvdijk"; public string GravatarHash => "22155f520ab611cf04f76762556ca3f5"; public string GitHubHandle => "martijn00"; public GeoPosition Position => new GeoPosition(52.3702160, 4.8951680); public string FeedLanguageCode => "en"; } }
mit
C#
56fb4c4e69b175ed3e27953098cd9f97e96f65fc
Update to 1.2
PowerOfCode/Eto,l8s/Eto,PowerOfCode/Eto,l8s/Eto,bbqchickenrobot/Eto-1,PowerOfCode/Eto,bbqchickenrobot/Eto-1,l8s/Eto,bbqchickenrobot/Eto-1
Source/GlobalAssemblyInfo.cs
Source/GlobalAssemblyInfo.cs
using System.Reflection; using System.Runtime.CompilerServices; [assembly: AssemblyCompany("Picoe Software Solutions Inc.")] [assembly: AssemblyProduct("")] [assembly: AssemblyCopyright("(c) 2010-2013 by Curtis Wensley aka Eto")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: AssemblyVersion("1.2.0.*")]
using System.Reflection; using System.Runtime.CompilerServices; [assembly: AssemblyCompany("Picoe Software Solutions Inc.")] [assembly: AssemblyProduct("")] [assembly: AssemblyCopyright("(c) 2010-2013 by Curtis Wensley aka Eto")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: AssemblyVersion("1.1.0.*")]
bsd-3-clause
C#
2c05642a74989200ccb88febbe326e1b694cccb7
Make IProjection interface public
huysentruitw/projecto
src/Projecto/Infrastructure/IProjection.cs
src/Projecto/Infrastructure/IProjection.cs
/* * Copyright 2017 Wouter Huysentruit * * 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; using System.Threading; using System.Threading.Tasks; namespace Projecto.Infrastructure { /// <summary> /// Interface for Projections. /// </summary> /// <typeparam name="TProjectContext">The type of the project context (used to pass custom information to the handler).</typeparam> public interface IProjection<in TProjectContext> { /// <summary> /// Gets the next event sequence number needed by this projection. /// </summary> int NextSequenceNumber { get; } /// <summary> /// Passes a message to a matching handler and increments <see cref="NextSequenceNumber"/>. /// </summary> /// <param name="connectionResolver">The connection resolver.</param> /// <param name="context">The project context (used to pass custom information to the handler).</param> /// <param name="message">The message.</param> /// <param name="cancellationToken">A cancellation token.</param> /// <returns>A <see cref="Task"/> for async execution.</returns> Task Handle(Func<Type, object> connectionResolver, TProjectContext context, object message, CancellationToken cancellationToken); } }
/* * Copyright 2017 Wouter Huysentruit * * 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; using System.Threading; using System.Threading.Tasks; namespace Projecto.Infrastructure { internal interface IProjection<in TProjectContext> { /// <summary> /// Gets the next event sequence number needed by this projection. /// </summary> int NextSequenceNumber { get; } /// <summary> /// Passes a message to a matching handler and increments <see cref="NextSequenceNumber"/>. /// </summary> /// <param name="connectionResolver">The connection resolver.</param> /// <param name="context">The project context (used to pass custom information to the handler).</param> /// <param name="message">The message.</param> /// <param name="cancellationToken">A cancellation token.</param> /// <returns>A <see cref="Task"/> for async execution.</returns> Task Handle(Func<Type, object> connectionResolver, TProjectContext context, object message, CancellationToken cancellationToken); } }
apache-2.0
C#
78d19bd572765601fa4bfa30a136d3b6f6dc8b5d
Add External Access!
seyedk/Staffing
Staffing/Staffing/Program.cs
Staffing/Staffing/Program.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Staffing { class Program { static void Main(string[] args) { } static void DoSomthing() { Console.WriteLine("I'm doing something now!"); } static void Feature() { Console.WriteLine("Feature 01 has been implemented!"); } static void ExternalAccess() { //added by external user. Console.Write("Please enter your key:"); var keyedin = Console.ReadLine(); Console.WriteLine("You keyed in: {0}", keyedin); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Staffing { class Program { static void Main(string[] args) { } static void DoSomthing() { Console.WriteLine("I'm doing something now!"); } static void Feature() { Console.WriteLine("Feature 01 has been implemented!"); } } }
mit
C#
73b082b1d3e5bc783447835d163349140e4669da
Remove unused using directives
aliencube/Aliencube.WebApi.Hal,aliencube/Aliencube.WebApi.Hal
src/Aliencube.WebApi.App/App_Start/WebApiConfig.cs
src/Aliencube.WebApi.App/App_Start/WebApiConfig.cs
using System; using System.Web.Http; using Aliencube.WebApi.Hal.Configs; using Autofac; using Autofac.Integration.WebApi; using Owin; namespace Aliencube.WebApi.App { /// <summary> /// This represents the config entity for Web API. /// </summary> public static class WebApiConfig { /// <summary> /// Configures the Web API. /// </summary> /// <param name="builder"> /// The <see cref="IAppBuilder" /> instance. /// </param> /// <param name="container"> /// The <see cref="IContainer" /> instance. /// </param> /// <exception cref="ArgumentNullException"> /// Throws when either <c>builder</c> or <c>container</c> is null. /// </exception> public static void Configure(IAppBuilder builder, IContainer container) { if (builder == null) { throw new ArgumentNullException("builder"); } if (container == null) { throw new ArgumentNullException("container"); } var config = new HttpConfiguration() { DependencyResolver = new AutofacWebApiDependencyResolver(container), }; // Routes config.MapHttpAttributeRoutes(); // Formatters config.ConfigHalFormatter(); builder.UseWebApi(config); } } }
using System; using System.Web.Http; using Aliencube.WebApi.Hal.Configs; using Aliencube.WebApi.Hal.Formatters; using Autofac; using Autofac.Integration.WebApi; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using Owin; namespace Aliencube.WebApi.App { /// <summary> /// This represents the config entity for Web API. /// </summary> public static class WebApiConfig { /// <summary> /// Configures the Web API. /// </summary> /// <param name="builder"> /// The <see cref="IAppBuilder" /> instance. /// </param> /// <param name="container"> /// The <see cref="IContainer" /> instance. /// </param> /// <exception cref="ArgumentNullException"> /// Throws when either <c>builder</c> or <c>container</c> is null. /// </exception> public static void Configure(IAppBuilder builder, IContainer container) { if (builder == null) { throw new ArgumentNullException("builder"); } if (container == null) { throw new ArgumentNullException("container"); } var config = new HttpConfiguration() { DependencyResolver = new AutofacWebApiDependencyResolver(container), }; // Routes config.MapHttpAttributeRoutes(); // Formatters config.ConfigHalFormatter(); builder.UseWebApi(config); } } }
mit
C#
e80e413cf001bd77bec30688ae2c56c1c5aa2d6b
Add sumary and remark to class header
wieslawsoltes/Perspex,Perspex/Perspex,jkoritzinsky/Perspex,jkoritzinsky/Avalonia,SuperJMN/Avalonia,jkoritzinsky/Avalonia,SuperJMN/Avalonia,AvaloniaUI/Avalonia,AvaloniaUI/Avalonia,jkoritzinsky/Avalonia,SuperJMN/Avalonia,AvaloniaUI/Avalonia,wieslawsoltes/Perspex,SuperJMN/Avalonia,jkoritzinsky/Avalonia,SuperJMN/Avalonia,wieslawsoltes/Perspex,akrisiun/Perspex,AvaloniaUI/Avalonia,AvaloniaUI/Avalonia,grokys/Perspex,AvaloniaUI/Avalonia,SuperJMN/Avalonia,AvaloniaUI/Avalonia,jkoritzinsky/Avalonia,wieslawsoltes/Perspex,jkoritzinsky/Avalonia,Perspex/Perspex,wieslawsoltes/Perspex,jkoritzinsky/Avalonia,wieslawsoltes/Perspex,SuperJMN/Avalonia,grokys/Perspex,wieslawsoltes/Perspex
src/Avalonia.Base/Metadata/XmlnsPrefixAttribute.cs
src/Avalonia.Base/Metadata/XmlnsPrefixAttribute.cs
using System; namespace Avalonia.Metadata { /// <summary> /// Use to predefine the prefix associated to an xml namespace in a xaml file /// </summary> /// <remarks> /// example: /// [assembly: XmlnsPrefix("https://github.com/avaloniaui", "av")] /// xaml: /// xmlns:av="https://github.com/avaloniaui" /// </remarks> [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] public sealed class XmlnsPrefixAttribute : Attribute { /// <summary> /// Constructor /// </summary> /// <param name="xmlNamespace">XML namespce</param> /// <param name="prefix">recommended prefix</param> public XmlnsPrefixAttribute(string xmlNamespace, string prefix) { XmlNamespace = xmlNamespace ?? throw new ArgumentNullException(nameof(xmlNamespace)); Prefix = prefix ?? throw new ArgumentNullException(nameof(prefix)); } /// <summary> /// XML Namespace /// </summary> public string XmlNamespace { get; } /// <summary> /// New Xml Namespace /// </summary> public string Prefix { get; } } }
using System; namespace Avalonia.Metadata { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] public sealed class XmlnsPrefixAttribute : Attribute { /// <summary> /// Constructor /// </summary> /// <param name="xmlNamespace">XML namespce</param> /// <param name="prefix">recommended prefix</param> public XmlnsPrefixAttribute(string xmlNamespace, string prefix) { XmlNamespace = xmlNamespace ?? throw new ArgumentNullException(nameof(xmlNamespace)); Prefix = prefix ?? throw new ArgumentNullException(nameof(prefix)); } /// <summary> /// XML Namespace /// </summary> public string XmlNamespace { get; } /// <summary> /// New Xml Namespace /// </summary> public string Prefix { get; } } }
mit
C#
b9a9685f3ff842896b1a407f09332c2749b35a3e
Bump version
canton7/SyncTrayzor,canton7/SyncTrayzor,canton7/SyncTrayzor
src/SyncTrayzor/Properties/AssemblyInfo.cs
src/SyncTrayzor/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("SyncTrayzor")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("SyncTrayzor")] [assembly: AssemblyCopyright("Copyright © Antony Male 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("1.0.2.0")] [assembly: AssemblyFileVersion("1.0.2.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("SyncTrayzor")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("SyncTrayzor")] [assembly: AssemblyCopyright("Copyright © Antony Male 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("1.0.1.0")] [assembly: AssemblyFileVersion("1.0.1.0")]
mit
C#
48a6ee61e9fbddf798c280753b3b23be4151423c
Add 'Open Gmail' to file menu.
joeyespo/google-apps-client
GoogleAppsClient/MainForm.cs
GoogleAppsClient/MainForm.cs
using System; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Drawing; using System.Windows.Forms; namespace GoogleAppsClient { public partial class MainForm : Form { const string BASE_URL = "https://mail.google.com/"; const string DOMAIN_SEPARATOR = "a/"; bool exiting = false; public MainForm() { InitializeComponent(); } #region Event Handlers protected override void OnClosing(CancelEventArgs e) { if (!exiting) { Hide(); e.Cancel = true; } base.OnClosing(e); } protected override bool ProcessDialogKey(Keys keyData) { if (keyData == Keys.Escape) Close(); return base.ProcessDialogKey(keyData); } void closeButton_Click(object sender, EventArgs e) { Close(); } void fileOpenGmailToolStripMenuItem_Click(object sender, EventArgs e) { OpenGmail(); } void fileExitToolStripMenuItem_Click(object sender, EventArgs e) { Exit(); } void notifyIcon_DoubleClick(object sender, EventArgs e) { OpenGmail(); } void openGmailToolStripMenuItem_Click(object sender, EventArgs e) { OpenGmail(); } void settingsToolStripMenuItem_Click(object sender, EventArgs e) { ShowSettings(); } void exitToolStripMenuItem_Click(object sender, EventArgs e) { Exit(); } #endregion #region Actions void Exit() { exiting = true; Close(); } void OpenGmail() { var url = BASE_URL; if (!string.IsNullOrWhiteSpace(domainTextBox.Text)) url += DOMAIN_SEPARATOR + domainTextBox.Text; Process.Start(url); } void ShowSettings() { Show(); } #endregion } }
using System; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Drawing; using System.Windows.Forms; namespace GoogleAppsClient { public partial class MainForm : Form { const string BASE_URL = "https://mail.google.com/"; const string DOMAIN_SEPARATOR = "a/"; bool exiting = false; public MainForm() { InitializeComponent(); } #region Event Handlers protected override void OnClosing(CancelEventArgs e) { if (!exiting) { Hide(); e.Cancel = true; } base.OnClosing(e); } protected override bool ProcessDialogKey(Keys keyData) { if (keyData == Keys.Escape) Close(); return base.ProcessDialogKey(keyData); } void closeButton_Click(object sender, EventArgs e) { Close(); } void fileExitToolStripMenuItem_Click(object sender, EventArgs e) { Exit(); } void notifyIcon_DoubleClick(object sender, EventArgs e) { OpenGmail(); } void openGmailToolStripMenuItem_Click(object sender, EventArgs e) { OpenGmail(); } void settingsToolStripMenuItem_Click(object sender, EventArgs e) { ShowSettings(); } void exitToolStripMenuItem_Click(object sender, EventArgs e) { Exit(); } #endregion #region Actions void Exit() { exiting = true; Close(); } void OpenGmail() { var url = BASE_URL; if (!string.IsNullOrWhiteSpace(domainTextBox.Text)) url += DOMAIN_SEPARATOR + domainTextBox.Text; Process.Start(url); } void ShowSettings() { Show(); } #endregion } }
mit
C#
a09552fc0a8e719dd26dfb4097bb07db1f6044c2
remove unused attribute
petrhaus/RedCapped,AppSpaceIT/RedCapped
src/RedCapped.Core/Header.cs
src/RedCapped.Core/Header.cs
using System; using MongoDB.Bson.Serialization.Attributes; namespace RedCapped.Core { public class Header<T> { [BsonElement("v")] public string Version => "1"; [BsonElement("t")] public string Type => typeof(T).FullName; [BsonElement("q")] public QoS QoS { get; set; } [BsonElement("s")] public DateTime SentAt { get; set; } [BsonElement("a")] public DateTime AcknowledgedAt { get; set; } [BsonElement("l")] public int RetryLimit { get; set; } [BsonElement("c")] public int RetryCount { get; set; } } }
using System; using MongoDB.Bson.Serialization.Attributes; namespace RedCapped.Core { public class Header<T> { [BsonElement("v")] public string Version => "1"; [BsonElement("t")] public string Type => typeof(T).FullName; [BsonElement("q")] public QoS QoS { get; set; } [BsonElement("s")] public DateTime SentAt { get; set; } [BsonElement("a")] public DateTime AcknowledgedAt { get; set; } [BsonElement("l")] [BsonIgnoreIfDefault] public int RetryLimit { get; set; } [BsonElement("c")] public int RetryCount { get; set; } } }
apache-2.0
C#
ffdae4ee002bc9d94c37769620abe289bcf8645b
update link
ucdavis/Badges,ucdavis/Badges
Badges/Views/Shared/_ExperienceWork.cshtml
Badges/Views/Shared/_ExperienceWork.cshtml
@model Badges.Models.Shared.ExperienceViewModel <div id="work-container" class="container work"> <div class="row"> @foreach (var work in @Model.SupportingWorks) { @* <div class="col-md-4"> *@ <div class="@work.Type work-item-box"> @Html.Partial("_ViewWork", work) <p class="work-desc">@work.Description<br /> <a href="@Url.Action("DeleteWorkFile", "Experience", new { experienceId = Model.Experience.Id, fileId = work.Id})" > <i class="icon-remove"></i> </a> </p> </div> @* </div> *@ } </div> </div>
@model Badges.Models.Shared.ExperienceViewModel <div id="work-container" class="container work"> <div class="row"> @foreach (var work in @Model.SupportingWorks) { @* <div class="col-md-4"> *@ <div class="@work.Type work-item-box"> @Html.Partial("_ViewWork", work) <p class="work-desc">@work.Description<br /> <a href="@Url.Action("DeleteSupportingWork", "Experience", new { experienceId = Model.Experience.Id, fileId = work.Id})" > <i class="icon-remove"></i> </a> </p> </div> @* </div> *@ } </div> </div>
mpl-2.0
C#
75433726478b98326c8eefb594b15f458a66b982
Set Variable explorer tool window icon (issue #308)
MikhailArkhipov/RTVS,MikhailArkhipov/RTVS,AlexanderSher/RTVS,karthiknadig/RTVS,karthiknadig/RTVS,AlexanderSher/RTVS,karthiknadig/RTVS,MikhailArkhipov/RTVS,AlexanderSher/RTVS,karthiknadig/RTVS,karthiknadig/RTVS,AlexanderSher/RTVS,karthiknadig/RTVS,MikhailArkhipov/RTVS,MikhailArkhipov/RTVS,AlexanderSher/RTVS,MikhailArkhipov/RTVS,AlexanderSher/RTVS,karthiknadig/RTVS,MikhailArkhipov/RTVS,AlexanderSher/RTVS
src/Package/Impl/DataInspect/VariableWindowPane.cs
src/Package/Impl/DataInspect/VariableWindowPane.cs
using System.Runtime.InteropServices; using Microsoft.VisualStudio.Imaging; using Microsoft.VisualStudio.Shell; namespace Microsoft.VisualStudio.R.Package.DataInspect { [Guid("99d2ea62-72f2-33be-afc8-b8ce6e43b5d0")] public class VariableWindowPane : ToolWindowPane { public VariableWindowPane() { Caption = Resources.VariableWindowCaption; Content = new VariableView(); BitmapImageMoniker = KnownMonikers.VariableProperty; } } }
using System.Runtime.InteropServices; using Microsoft.VisualStudio.Shell; namespace Microsoft.VisualStudio.R.Package.DataInspect { [Guid("99d2ea62-72f2-33be-afc8-b8ce6e43b5d0")] public class VariableWindowPane : ToolWindowPane { public VariableWindowPane() { Caption = Resources.VariableWindowCaption; Content = new VariableView(); } } }
mit
C#
51ad0f1ce0d5d2f9a55d943504136042469a3bb5
make save data string[]
chitoku-k/CoreTweet,azyobuzin/LibAzyotter
misc/coretweet_for_shell.cs
misc/coretweet_for_shell.cs
// CoreTweet for Mono C# Shell // // Required Files: // CoreTweet.dll Newtonsoft.Json.dll // // * Place this script and required dlls into $HOME/.scripts/csharp . // * You need an internet connection to use this (at least the first time). // * You also need a consumer key and a consumer secret key. // * Your data will be saved to $HOME/.twtokens (on *nix) or $(Environment.SpecialFolder.ApplicationData)\csharp\twtokens.xml (on Windows). // * Your tokens will be appear as an variable 'tokens' and 'apponly'. using CoreTweet; using CoreTweet.Core; using CoreTweet.Streaming; LoadAssembly("System.Runtime.Serialization"); using System.Xml; using System.Runtime.Serialization; using System.IO; Tokens tokens; OAuth2Token apponly; { var ds = new DataContractSerializer(typeof(string[])); var unix = (Environment.OSVersion.Platform == PlatformID.Unix || Environment.OSVersion.Platform == PlatformID.MacOSX); var tf = unix ? ".twtokens" : "twtokens.xml"; var home = unix ? Environment.GetEnvironmentVariable("HOME") : Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "csharp"); var tpath = Path.Combine(home, tf); if(!File.Exists(tpath)) { Console.WriteLine (@"== CoreTweet for Mono C# Shell == == Setup Wizard == * You need a consumer key and a consumer secret key. * Your data will be saved to {0} . * Your tokens will be appear as an variable 'tokens' and 'apponly'. ", tpath); Console.Write("consumer key>"); var ck = Console.ReadLine(); Console.Write("consumer secret>"); var cs = Console.ReadLine(); var a = OAuth.Authorize(ck, cs); Console.WriteLine(a.AuthorizeUri); Console.Write("pin>"); tokens = a.GetTokens(Console.ReadLine()); apponly = OAuth2.GetToken(ck, cs); using(var f = File.OpenWrite(tpath)) ds.WriteObject(f, new []{tokens.ConsumerKey, tokens.ConsumerSecret, tokens.AccessToken, tokens.AccessTokenSecret, apponly.BearerToken}); Console.WriteLine("Saved to {0} . Don't forget to do chmod 600.", tpath); } else using (var f = File.OpenRead(Path.Combine(home, tf))) { var t = (string[])ds.ReadObject(f); tokens = Tokens.Create(t[0], t[1], t[2], t[3]); apponly = OAuth2Token.Create(t[0], t[1], t[4]); } } Console.WriteLine("* CoreTweet for Mono C# Shell is enabled.");
// CoreTweet for Mono C# Shell // // Required Files: // CoreTweet.dll Newtonsoft.Json.dll // // * Place this script and required dlls into $HOME/.scripts/csharp . // * You need an internet connection to use this (at least the first time). // * You also need a consumer key and a consumer secret key. // * Your data will be saved to $HOME/.twtokens (on *nix) or $(Environment.SpecialFolder.ApplicationData)\csharp\twtokens.xml (on Windows). // * Your tokens will be appear as an variable 'tokens' and 'apponly'. using CoreTweet; using CoreTweet.Core; using CoreTweet.Streaming; LoadAssembly("System.Runtime.Serialization"); using System.Xml; using System.Runtime.Serialization; using System.IO; Tokens tokens; OAuth2Token apponly; { var ds = new DataContractSerializer(typeof(TokensBase[])); var unix = (Environment.OSVersion.Platform == PlatformID.Unix || Environment.OSVersion.Platform == PlatformID.MacOSX); var tf = unix ? ".twtokens" : "twtokens.xml"; var home = unix ? Environment.GetEnvironmentVariable("HOME") : Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "csharp"); var tpath = Path.Combine(home, tf); if(!File.Exists(tpath)) { Console.WriteLine (@"== CoreTweet for Mono C# Shell == == Setup Wizard == * You need a consumer key and a consumer secret key. * Your data will be saved to {0} . * Your tokens will be appear as an variable 'tokens' and 'apponly'. ", tpath); Console.Write("consumer key>"); var ck = Console.ReadLine(); Console.Write("consumer secret>"); var cs = Console.ReadLine(); var a = OAuth.Authorize(ck, cs); Console.WriteLine(a.AuthorizeUri); Console.Write("pin>"); tokens = a.GetTokens(Console.ReadLine()); apponly = OAuth2.GetToken(ck, cs); using(var f = File.OpenWrite(tpath)) ds.WriteObject(f, new TokensBase[]{tokens, apponly}); Console.WriteLine("Saved to {0} . Don't forget to do chmod 600.", tpath); } else using (var f = File.OpenRead(Path.Combine(home, tf))) { var t = (TokensBase[])ds.ReadObject(f); tokens = (Tokens)t[0]; apponly = (OAuth2Token)t[1]; } } Console.WriteLine("* CoreTweet for Mono C# Shell is enabled.");
mit
C#
bca5e7f18e2877120d82f71b187a809ca980127f
add Size field to Screen (#575)
prime31/Nez,prime31/Nez,prime31/Nez,ericmbernier/Nez
Nez.Portable/Utils/Screen.cs
Nez.Portable/Utils/Screen.cs
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; namespace Nez { public static class Screen { static internal GraphicsDeviceManager _graphicsManager; internal static void Initialize(GraphicsDeviceManager graphicsManager) => _graphicsManager = graphicsManager; /// <summary> /// width of the GraphicsDevice back buffer /// </summary> /// <value>The width.</value> public static int Width { get => _graphicsManager.GraphicsDevice.PresentationParameters.BackBufferWidth; set => _graphicsManager.GraphicsDevice.PresentationParameters.BackBufferWidth = value; } /// <summary> /// height of the GraphicsDevice back buffer /// </summary> /// <value>The height.</value> public static int Height { get => _graphicsManager.GraphicsDevice.PresentationParameters.BackBufferHeight; set => _graphicsManager.GraphicsDevice.PresentationParameters.BackBufferHeight = value; } /// <summary> /// gets the Screen's size as a Vector2 /// </summary> /// <value>The screen size.</value> public static Vector2 Size => new Vector2(Width, Height); /// <summary> /// gets the Screen's center.null Note that this is the center of the backbuffer! If you are rendering to a smaller RenderTarget /// you will need to scale this value appropriately. /// </summary> /// <value>The center.</value> public static Vector2 Center => new Vector2(Width / 2, Height / 2); public static int PreferredBackBufferWidth { get => _graphicsManager.PreferredBackBufferWidth; set => _graphicsManager.PreferredBackBufferWidth = value; } public static int PreferredBackBufferHeight { get => _graphicsManager.PreferredBackBufferHeight; set => _graphicsManager.PreferredBackBufferHeight = value; } public static int MonitorWidth => GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width; public static int MonitorHeight => GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height; public static SurfaceFormat BackBufferFormat => _graphicsManager.GraphicsDevice.PresentationParameters.BackBufferFormat; public static SurfaceFormat PreferredBackBufferFormat { get => _graphicsManager.PreferredBackBufferFormat; set => _graphicsManager.PreferredBackBufferFormat = value; } public static bool SynchronizeWithVerticalRetrace { get => _graphicsManager.SynchronizeWithVerticalRetrace; set => _graphicsManager.SynchronizeWithVerticalRetrace = value; } // defaults to Depth24Stencil8 public static DepthFormat PreferredDepthStencilFormat { get => _graphicsManager.PreferredDepthStencilFormat; set => _graphicsManager.PreferredDepthStencilFormat = value; } public static bool IsFullscreen { get => _graphicsManager.IsFullScreen; set => _graphicsManager.IsFullScreen = value; } public static DisplayOrientation SupportedOrientations { get => _graphicsManager.SupportedOrientations; set => _graphicsManager.SupportedOrientations = value; } public static void ApplyChanges() => _graphicsManager.ApplyChanges(); /// <summary> /// sets the preferredBackBuffer then applies the changes /// </summary> /// <param name="width">Width.</param> /// <param name="height">Height.</param> public static void SetSize(int width, int height) { PreferredBackBufferWidth = width; PreferredBackBufferHeight = height; ApplyChanges(); } } }
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; namespace Nez { public static class Screen { static internal GraphicsDeviceManager _graphicsManager; internal static void Initialize(GraphicsDeviceManager graphicsManager) => _graphicsManager = graphicsManager; /// <summary> /// width of the GraphicsDevice back buffer /// </summary> /// <value>The width.</value> public static int Width { get => _graphicsManager.GraphicsDevice.PresentationParameters.BackBufferWidth; set => _graphicsManager.GraphicsDevice.PresentationParameters.BackBufferWidth = value; } /// <summary> /// height of the GraphicsDevice back buffer /// </summary> /// <value>The height.</value> public static int Height { get => _graphicsManager.GraphicsDevice.PresentationParameters.BackBufferHeight; set => _graphicsManager.GraphicsDevice.PresentationParameters.BackBufferHeight = value; } /// <summary> /// gets the Screen's center.null Note that this is the center of the backbuffer! If you are rendering to a smaller RenderTarget /// you will need to scale this value appropriately. /// </summary> /// <value>The center.</value> public static Vector2 Center => new Vector2(Width / 2, Height / 2); public static int PreferredBackBufferWidth { get => _graphicsManager.PreferredBackBufferWidth; set => _graphicsManager.PreferredBackBufferWidth = value; } public static int PreferredBackBufferHeight { get => _graphicsManager.PreferredBackBufferHeight; set => _graphicsManager.PreferredBackBufferHeight = value; } public static int MonitorWidth => GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width; public static int MonitorHeight => GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height; public static SurfaceFormat BackBufferFormat => _graphicsManager.GraphicsDevice.PresentationParameters.BackBufferFormat; public static SurfaceFormat PreferredBackBufferFormat { get => _graphicsManager.PreferredBackBufferFormat; set => _graphicsManager.PreferredBackBufferFormat = value; } public static bool SynchronizeWithVerticalRetrace { get => _graphicsManager.SynchronizeWithVerticalRetrace; set => _graphicsManager.SynchronizeWithVerticalRetrace = value; } // defaults to Depth24Stencil8 public static DepthFormat PreferredDepthStencilFormat { get => _graphicsManager.PreferredDepthStencilFormat; set => _graphicsManager.PreferredDepthStencilFormat = value; } public static bool IsFullscreen { get => _graphicsManager.IsFullScreen; set => _graphicsManager.IsFullScreen = value; } public static DisplayOrientation SupportedOrientations { get => _graphicsManager.SupportedOrientations; set => _graphicsManager.SupportedOrientations = value; } public static void ApplyChanges() => _graphicsManager.ApplyChanges(); /// <summary> /// sets the preferredBackBuffer then applies the changes /// </summary> /// <param name="width">Width.</param> /// <param name="height">Height.</param> public static void SetSize(int width, int height) { PreferredBackBufferWidth = width; PreferredBackBufferHeight = height; ApplyChanges(); } } }
mit
C#
1997dc8ca09c136134efe592020126da13897a08
make readonly settings
hienng/NyaaDB,hienng/NyaaDB
NyaaDB/UI/MainWindow.xaml.cs
NyaaDB/UI/MainWindow.xaml.cs
using NyaaDB.Impl.DBIntegration; using NyaaDB.Impl.Settings; using NyaaDB.UI.Api.Settings; using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace NyaaDB.UI { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { private readonly DefaultDBSettings _dbSettings; public MainWindow(DefaultDBSettings aDefaultDBSettings) { InitializeComponent(); _dbSettings = aDefaultDBSettings; var res = new DefaultDBManager(_dbSettings).SearchAnime("one piece"); //try //{ // Process.Start("magnet:?xt=urn:btih:" + res.First().TorrentHash); //} //catch (Exception) //{ // MessageBox.Show("No Torrent Client detected", "Local Torrent Client Error", MessageBoxButton.OK, MessageBoxImage.Error); //} } } }
using NyaaDB.Impl.DBIntegration; using NyaaDB.Impl.Settings; using NyaaDB.UI.Api.Settings; using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace NyaaDB.UI { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { private DefaultDBSettings _dbSettings; public MainWindow(DefaultDBSettings aDefaultDBSettings) { InitializeComponent(); _dbSettings = aDefaultDBSettings; var res = new DefaultDBManager(_dbSettings).SearchAnime("one piece"); //try //{ // Process.Start("magnet:?xt=urn:btih:" + res.First().TorrentHash); //} //catch (Exception) //{ // MessageBox.Show("No Torrent Client detected", "Local Torrent Client Error", MessageBoxButton.OK, MessageBoxImage.Error); //} } } }
mit
C#
37798424947367cba14ea79443942d0fd9ecf8a1
Update AssemblyInfo.cs
nathannfan/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,btasdoven/azure-sdk-for-net,yugangw-msft/azure-sdk-for-net,samtoubia/azure-sdk-for-net,r22016/azure-sdk-for-net,peshen/azure-sdk-for-net,ahosnyms/azure-sdk-for-net,yaakoviyun/azure-sdk-for-net,atpham256/azure-sdk-for-net,MichaelCommo/azure-sdk-for-net,olydis/azure-sdk-for-net,JasonYang-MSFT/azure-sdk-for-net,shahabhijeet/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,mihymel/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,ScottHolden/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,peshen/azure-sdk-for-net,SiddharthChatrolaMs/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,AzureAutomationTeam/azure-sdk-for-net,DheerendraRathor/azure-sdk-for-net,begoldsm/azure-sdk-for-net,jamestao/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,hyonholee/azure-sdk-for-net,SiddharthChatrolaMs/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,shahabhijeet/azure-sdk-for-net,MichaelCommo/azure-sdk-for-net,shutchings/azure-sdk-for-net,hyonholee/azure-sdk-for-net,mihymel/azure-sdk-for-net,AzCiS/azure-sdk-for-net,r22016/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,samtoubia/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,SiddharthChatrolaMs/azure-sdk-for-net,MichaelCommo/azure-sdk-for-net,AzureAutomationTeam/azure-sdk-for-net,nathannfan/azure-sdk-for-net,yoavrubin/azure-sdk-for-net,ahosnyms/azure-sdk-for-net,yoavrubin/azure-sdk-for-net,samtoubia/azure-sdk-for-net,jhendrixMSFT/azure-sdk-for-net,olydis/azure-sdk-for-net,begoldsm/azure-sdk-for-net,pilor/azure-sdk-for-net,JasonYang-MSFT/azure-sdk-for-net,smithab/azure-sdk-for-net,ahosnyms/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,AzCiS/azure-sdk-for-net,Yahnoosh/azure-sdk-for-net,begoldsm/azure-sdk-for-net,yaakoviyun/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,stankovski/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,btasdoven/azure-sdk-for-net,pankajsn/azure-sdk-for-net,jamestao/azure-sdk-for-net,r22016/azure-sdk-for-net,mihymel/azure-sdk-for-net,djyou/azure-sdk-for-net,AzCiS/azure-sdk-for-net,hyonholee/azure-sdk-for-net,nathannfan/azure-sdk-for-net,olydis/azure-sdk-for-net,hyonholee/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,jamestao/azure-sdk-for-net,ScottHolden/azure-sdk-for-net,stankovski/azure-sdk-for-net,smithab/azure-sdk-for-net,pilor/azure-sdk-for-net,atpham256/azure-sdk-for-net,shutchings/azure-sdk-for-net,yoavrubin/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,atpham256/azure-sdk-for-net,shutchings/azure-sdk-for-net,yugangw-msft/azure-sdk-for-net,ScottHolden/azure-sdk-for-net,pilor/azure-sdk-for-net,pankajsn/azure-sdk-for-net,jhendrixMSFT/azure-sdk-for-net,markcowl/azure-sdk-for-net,djyou/azure-sdk-for-net,AzureAutomationTeam/azure-sdk-for-net,shahabhijeet/azure-sdk-for-net,Yahnoosh/azure-sdk-for-net,yaakoviyun/azure-sdk-for-net,pankajsn/azure-sdk-for-net,peshen/azure-sdk-for-net,DheerendraRathor/azure-sdk-for-net,DheerendraRathor/azure-sdk-for-net,JasonYang-MSFT/azure-sdk-for-net,samtoubia/azure-sdk-for-net,yugangw-msft/azure-sdk-for-net,jhendrixMSFT/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,smithab/azure-sdk-for-net,djyou/azure-sdk-for-net,btasdoven/azure-sdk-for-net,hyonholee/azure-sdk-for-net,Yahnoosh/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,shahabhijeet/azure-sdk-for-net,jamestao/azure-sdk-for-net
src/ResourceManagement/RedisCache/Microsoft.Azure.Management.Redis/Properties/AssemblyInfo.cs
src/ResourceManagement/RedisCache/Microsoft.Azure.Management.Redis/Properties/AssemblyInfo.cs
// // Copyright (c) Microsoft. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // using System.Reflection; using System.Resources; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Microsoft Azure Redis Cache Management Library")] [assembly: AssemblyDescription("Provides Microsoft Azure redis cache management operations.")] [assembly: AssemblyVersion("3.1.0.0")] [assembly: AssemblyFileVersion("3.1.0.0")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("Microsoft Azure .NET SDK")] [assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguage("en")]
// // Copyright (c) Microsoft. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // using System.Reflection; using System.Resources; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Microsoft Azure Redis Cache Management Library")] [assembly: AssemblyDescription("Provides Microsoft Azure redis cache management operations.")] [assembly: AssemblyVersion("3.0.1.0")] [assembly: AssemblyFileVersion("3.0.1.0")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("Microsoft Azure .NET SDK")] [assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguage("en")]
mit
C#
fac0e67cf772c05ba092ad5515628335c556f220
Update assembly version to 4.0.0 (+semver: major)
ZEISS-PiWeb/PiWeb-Api
src/Properties/AssemblyInfo.cs
src/Properties/AssemblyInfo.cs
using System.Reflection; using System.Resources; [assembly: AssemblyCompany( "Carl Zeiss Innovationszentrum für Messtechnik GmbH" )] [assembly: AssemblyProduct( "ZEISS PiWeb Api" )] [assembly: AssemblyCopyright( "Copyright © 2019 Carl Zeiss Innovationszentrum für Messtechnik GmbH" )] [assembly: AssemblyTrademark( "PiWeb" )] [assembly: NeutralResourcesLanguage( "en" )] [assembly: AssemblyVersion( "4.0.0" )] [assembly: AssemblyInformationalVersion("4.0.0")] [assembly: AssemblyFileVersion( "4.0.0" )]
using System.Reflection; using System.Resources; [assembly: AssemblyCompany( "Carl Zeiss Innovationszentrum für Messtechnik GmbH" )] [assembly: AssemblyProduct( "ZEISS PiWeb Api" )] [assembly: AssemblyCopyright( "Copyright © 2019 Carl Zeiss Innovationszentrum für Messtechnik GmbH" )] [assembly: AssemblyTrademark( "PiWeb" )] [assembly: NeutralResourcesLanguage( "en" )] [assembly: AssemblyVersion( "3.0.0" )] [assembly: AssemblyInformationalVersion("3.0.0")] [assembly: AssemblyFileVersion( "3.0.0" )]
bsd-3-clause
C#
496eba25937e67f585ac9551b154a26a176c9a7b
Update version info for 2016.1.0-beta1.
miniter/SSH.NET,sshnet/SSH.NET,Bloomcredit/SSH.NET
src/Renci.SshNet/Properties/CommonAssemblyInfo.cs
src/Renci.SshNet/Properties/CommonAssemblyInfo.cs
using System; using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyDescription("SSH.NET is a Secure Shell (SSH) library for .NET, optimized for parallelism.")] [assembly: AssemblyCompany("Renci")] [assembly: AssemblyProduct("SSH.NET")] [assembly: AssemblyCopyright("Copyright Renci 2010-2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: AssemblyVersion("2016.1.0")] [assembly: AssemblyFileVersion("2016.1.0")] [assembly: AssemblyInformationalVersion("2016.1.0-beta1")] [assembly: CLSCompliant(false)] // 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)] #if DEBUG [assembly: AssemblyConfiguration("Debug")] #else [assembly: AssemblyConfiguration("Release")] #endif
using System; using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyDescription("SSH.NET is a Secure Shell (SSH) library for .NET, optimized for parallelism.")] [assembly: AssemblyCompany("Renci")] [assembly: AssemblyProduct("SSH.NET")] [assembly: AssemblyCopyright("Copyright Renci 2010-2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: AssemblyVersion("2016.1.9999")] [assembly: AssemblyFileVersion("2016.1.9999")] [assembly: AssemblyInformationalVersion("2016.1.9999-dev")] [assembly: CLSCompliant(false)] // 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)] #if DEBUG [assembly: AssemblyConfiguration("Debug")] #else [assembly: AssemblyConfiguration("Release")] #endif
mit
C#
bdee855a8038529fccb7b89127c67aa6c23f73d8
Clarify event type for DNSLookup example.
zacbrown/hiddentreasure-etw-demo
hiddentreasure-etw-demo/DNSLookup.cs
hiddentreasure-etw-demo/DNSLookup.cs
using System; using O365.Security.ETW; namespace hiddentreasure_etw_demo { public static class DNSLookup { public static UserTrace CreateTrace() { var filter = new EventFilter(Filter .EventIdIs(3018) // cached lookup .Or(Filter.EventIdIs(3020))); // live lookup filter.OnEvent += (IEventRecord r) => { var query = r.GetUnicodeString("QueryName"); var result = r.GetUnicodeString("QueryResults"); Console.WriteLine($"DNS query ({r.Id}): {query} - {result}"); }; var provider = new Provider("Microsoft-Windows-DNS-Client"); provider.AddFilter(filter); var trace = new UserTrace(); trace.Enable(provider); return trace; } } }
using System; using O365.Security.ETW; namespace hiddentreasure_etw_demo { public static class DNSLookup { public static UserTrace CreateTrace() { var filter = new EventFilter(Filter .EventIdIs(3018) .Or(Filter.EventIdIs(3020))); filter.OnEvent += (IEventRecord r) => { var query = r.GetUnicodeString("QueryName"); var result = r.GetUnicodeString("QueryResults"); Console.WriteLine($"DNS query ({r.Id}): {query} - {result}"); }; var provider = new Provider("Microsoft-Windows-DNS-Client"); provider.AddFilter(filter); var trace = new UserTrace(); trace.Enable(provider); return trace; } } }
mit
C#
bebb47f5cfb0b549e4625b0d0a11ba05bdb1586a
Allow specifying metadata for skip reason.
mmitche/buildtools,stephentoub/buildtools,jthelin/dotnet-buildtools,AlexGhiondea/buildtools,roncain/buildtools,karajas/buildtools,MattGal/buildtools,JeremyKuhne/buildtools,ChadNedzlek/buildtools,AlexGhiondea/buildtools,crummel/dotnet_buildtools,MattGal/buildtools,ChadNedzlek/buildtools,joperezr/buildtools,nguerrera/buildtools,crummel/dotnet_buildtools,JeremyKuhne/buildtools,nguerrera/buildtools,ericstj/buildtools,JeremyKuhne/buildtools,jhendrixMSFT/buildtools,dotnet/buildtools,dotnet/buildtools,AlexGhiondea/buildtools,alexperovich/buildtools,ericstj/buildtools,MattGal/buildtools,joperezr/buildtools,nguerrera/buildtools,roncain/buildtools,alexperovich/buildtools,alexperovich/buildtools,tarekgh/buildtools,stephentoub/buildtools,nguerrera/buildtools,MattGal/buildtools,jhendrixMSFT/buildtools,jhendrixMSFT/buildtools,ianhays/buildtools,ChadNedzlek/buildtools,joperezr/buildtools,jthelin/dotnet-buildtools,karajas/buildtools,mmitche/buildtools,ianhays/buildtools,MattGal/buildtools,weshaggard/buildtools,ianhays/buildtools,chcosta/buildtools,mmitche/buildtools,stephentoub/buildtools,karajas/buildtools,mmitche/buildtools,weshaggard/buildtools,JeremyKuhne/buildtools,ChadNedzlek/buildtools,dotnet/buildtools,AlexGhiondea/buildtools,crummel/dotnet_buildtools,jthelin/dotnet-buildtools,alexperovich/buildtools,mmitche/buildtools,joperezr/buildtools,tarekgh/buildtools,joperezr/buildtools,alexperovich/buildtools,ericstj/buildtools,jthelin/dotnet-buildtools,ericstj/buildtools,tarekgh/buildtools,jhendrixMSFT/buildtools,tarekgh/buildtools,chcosta/buildtools,chcosta/buildtools,ianhays/buildtools,roncain/buildtools,tarekgh/buildtools,stephentoub/buildtools,roncain/buildtools,crummel/dotnet_buildtools,chcosta/buildtools,weshaggard/buildtools,weshaggard/buildtools,dotnet/buildtools,karajas/buildtools
src/xunit.netcore.extensions/Attributes/SkipOnTargetFrameworkAttribute.cs
src/xunit.netcore.extensions/Attributes/SkipOnTargetFrameworkAttribute.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; using Xunit.Sdk; namespace Xunit { /// <summary> /// Apply this attribute to your test method to specify this is a platform specific test. /// </summary> [TraitDiscoverer("Xunit.NetCore.Extensions.SkipOnTargetFrameworkDiscoverer", "Xunit.NetCore.Extensions")] [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, AllowMultiple = false)] public class SkipOnTargetFrameworkAttribute : Attribute, ITraitAttribute { public SkipOnTargetFrameworkAttribute(TargetFrameworkMonikers platform, string reason = null) { } } }
// 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; using Xunit.Sdk; namespace Xunit { /// <summary> /// Apply this attribute to your test method to specify this is a platform specific test. /// </summary> [TraitDiscoverer("Xunit.NetCore.Extensions.SkipOnTargetFrameworkDiscoverer", "Xunit.NetCore.Extensions")] [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, AllowMultiple = false)] public class SkipOnTargetFrameworkAttribute : Attribute, ITraitAttribute { public SkipOnTargetFrameworkAttribute(TargetFrameworkMonikers platform) { } } }
mit
C#
3a66c52e9d54eb3e1d3fe570e69e94e3ff9b4323
Update RebillySubscription.cs
dara123/rebilly-dotnet-client,Rebilly/rebilly-dotnet-client
Library/Rebilly/RebillySubscription.cs
Library/Rebilly/RebillySubscription.cs
using System; using System.Net; using System.IO; using System.Linq; using System.Text; using System.Collections.Generic; using System.Threading.Tasks; using Newtonsoft.Json; namespace Rebilly { public class RebillySubscription : RebillyRequest { public string subscriptionId = null; public string lookupSubscriptionId = null; public string websiteId = null; public string planId = null; public string switchWhen = null; public string cancelBehaviour = null; public string quantity = null; public RebillyAddressInfo deliveryAddress = null; public string rebillTime = null; public List<RebillyMeteredBilling> meteredBilling = null; public const string SWITCH_AT_NEXT_REBILL = "AT_NEXT_REBILL"; public const string SWITCH_NOW_WITH_PRORATA_REFUND = "NOW_WITH_PRORATA_REFUND"; public const string SWITCH_NOW_WITHOUT_REFUND = "NOW_WITHOUT_REFUND"; public const string CANCEL_AT_NEXT_REBILL = "AT_NEXT_REBILL"; public const string CANCEL_NOW = "NOW_WITHOUT_REFUND"; public const string CANCEL_NOW_WITH_PRORATA_REFUND = "NOW_WITH_PRORATA_REFUND"; public const string CANCEL_NOW_FULL_REFUND = "NOW_WITH_FULL_REFUND"; public RebillyResponse createMeteredBilling() { this.setApiController(RebillyMeteredBilling.METERED_BILLING_URL); string data = this.buildRequest(this); return this.sendPostRequest(data); } /// <summary> /// Helper function to convert from object to JSON ready to send to Rebilly /// </summary> /// <param name="dispute">Subscription object</param> /// <returns>data in JSON format</returns> private string buildRequest(RebillySubscription subscription) { string data = JsonConvert.SerializeObject(subscription, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore }); return data; } } }
using System; using System.Net; using System.IO; using System.Linq; using System.Text; using System.Collections.Generic; using System.Threading.Tasks; using Newtonsoft.Json; namespace Rebilly { public class RebillySubscription : RebillyRequest { public string subscriptionId = null; public string lookupSubscriptionId = null; public string websiteId = null; public string planId = null; public string switchWhen = null; public string cancelBehaviour = null; public string quantity = null; public RebillyAddressInfo deliveryAddress = null; public string rebillTime = null; public List<RebillyMeteredBilling> meteredBilling = null; public const string SWITCH_AT_NEXT_REBILL = "AT_NEXT_REBILL"; public const string SWITCH_NOW_WITH_PRORATA_REFUND = "NOW_WITH_PRORATA_REFUND"; public const string SWITCH_NOW_WITHOUT_REFUND = "NOW_WITHOUT_REFUND"; public const string CANCEL_AT_NEXT_REBILL = "AT_NEXT_REBILL"; public const string CANCEL_NOW = "NOW_WITHOUT_REFUND"; public const string CANCEL_NOW_WITH_PRORATA_REFUND = "NOW_WITH_PRORATA_REFUND"; public const string CANCEL_NOW_FULL_REFUND = "NOW_WITH_FULL_REFUND"; public const string CANCEL_NOW_ALL_REFUND = "NOW_WITH_ALL_CHARGES_REFUND"; public RebillyResponse createMeteredBilling() { this.setApiController(RebillyMeteredBilling.METERED_BILLING_URL); string data = this.buildRequest(this); return this.sendPostRequest(data); } /// <summary> /// Helper function to convert from object to JSON ready to send to Rebilly /// </summary> /// <param name="dispute">Subscription object</param> /// <returns>data in JSON format</returns> private string buildRequest(RebillySubscription subscription) { string data = JsonConvert.SerializeObject(subscription, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore }); return data; } } }
mit
C#
4fe4a3731ff9794a2d285e6c0266f79c1299f4cd
Revert changes outside of KnifeDodge
NitorInc/NitoriWare,NitorInc/NitoriWare,Barleytree/NitoriWare,Barleytree/NitoriWare
Assets/Resources/Microgames/_Finished/Spaceship/Scripts/SpaceshipRocket.cs
Assets/Resources/Microgames/_Finished/Spaceship/Scripts/SpaceshipRocket.cs
using UnityEngine; using System.Collections; public class SpaceshipRocket : MonoBehaviour { public Rigidbody2D[] spaceshipBodies; public Rigidbody2D leftBody, rightBody; public ParticleSystem explosionParticles, liftoffParticles; public SpaceshipBar bar; public Animator shipAnimator, sceneAnimator; public AudioClip liftoffClip, explosionClip; private AudioSource _audioSource; private State state = State.Default; private enum State { Default, Victory, Failure } void Awake() { _audioSource = GetComponent<AudioSource>(); } void Update() { if (!MicrogameController.instance.getVictoryDetermined() && Input.GetKeyDown(KeyCode.Space)) { if (bar.isWithinThreshold()) liftoff(); else explode(); bar.enabled = false; } } void liftoff() { state = State.Victory; MicrogameController.instance.setVictory(true, true); for (int i = 0; i < spaceshipBodies.Length; i++) { spaceshipBodies[i].GetComponent<Vibrate>().vibrateOn = true; spaceshipBodies[i].GetComponent<Collider2D>().enabled = false; } liftoffParticles.Play(); shipAnimator.SetInteger("state", (int)state); sceneAnimator.SetInteger("state", (int)state); _audioSource.pitch = Time.timeScale; _audioSource.PlayOneShot(liftoffClip); leftBody.bodyType = rightBody.bodyType = RigidbodyType2D.Kinematic; CameraShake.instance.xShake = .05f; CameraShake.instance.yShake = .025f; CameraShake.instance.shakeSpeed = 2f; CameraShake.instance.shakeCoolRate = .0f; } void explode() { state = State.Failure; MicrogameController.instance.setVictory(false, true); for (int i = 0; i < spaceshipBodies.Length; i++) { spaceshipBodies[i].isKinematic = false; spaceshipBodies[i].AddForce(MathHelper.getVector2FromAngle(Random.Range(30f, 150f), 600f)); spaceshipBodies[i].AddTorque(Random.Range(-1f, 1f) * 700f); //spaceshipBodies[i].AddForce(MathHelper.getVectorFromAngle2D(Random.Range(3f, 150f), 600f)); //spaceshipBodies[i].AddTorque(Random.Range(-1f, 1f) * 500f); } explosionParticles.Play(); CameraShake.instance.setScreenShake(.3f); CameraShake.instance.shakeSpeed = 15f; float force = 200f, torque = 20f; leftBody.AddForce((Vector3)MathHelper.getVector2FromAngle(120f, force)); leftBody.AddTorque(torque); rightBody.AddForce((Vector3)MathHelper.getVector2FromAngle(30f, force)); rightBody.AddTorque(torque * -1f); sceneAnimator.SetInteger("state", (int)state); _audioSource.pitch = Time.timeScale * .75f; _audioSource.PlayOneShot(explosionClip); } }
using UnityEngine; using System.Collections; public class SpaceshipRocket : MonoBehaviour { public Rigidbody2D[] spaceshipBodies; public Rigidbody2D leftBody, rightBody; public ParticleSystem explosionParticles, liftoffParticles; public SpaceshipBar bar; public Animator shipAnimator, sceneAnimator; public AudioClip liftoffClip, explosionClip; private AudioSource _audioSource; private State state = State.Default; private enum State { Default, Victory, Failure } void Awake() { _audioSource = GetComponent<AudioSource>(); } void Update() { } void liftoff() { state = State.Victory; MicrogameController.instance.setVictory(true, true); for (int i = 0; i < spaceshipBodies.Length; i++) { spaceshipBodies[i].GetComponent<Vibrate>().vibrateOn = true; spaceshipBodies[i].GetComponent<Collider2D>().enabled = false; } liftoffParticles.Play(); shipAnimator.SetInteger("state", (int)state); sceneAnimator.SetInteger("state", (int)state); _audioSource.pitch = Time.timeScale; _audioSource.PlayOneShot(liftoffClip); leftBody.bodyType = rightBody.bodyType = RigidbodyType2D.Kinematic; CameraShake.instance.xShake = .05f; CameraShake.instance.yShake = .025f; CameraShake.instance.shakeSpeed = 2f; CameraShake.instance.shakeCoolRate = .0f; } void explode() { state = State.Failure; MicrogameController.instance.setVictory(false, true); for (int i = 0; i < spaceshipBodies.Length; i++) { spaceshipBodies[i].isKinematic = false; spaceshipBodies[i].AddForce(MathHelper.getVector2FromAngle(Random.Range(30f, 150f), 600f)); spaceshipBodies[i].AddTorque(Random.Range(-1f, 1f) * 700f); //spaceshipBodies[i].AddForce(MathHelper.getVectorFromAngle2D(Random.Range(3f, 150f), 600f)); //spaceshipBodies[i].AddTorque(Random.Range(-1f, 1f) * 500f); } explosionParticles.Play(); CameraShake.instance.setScreenShake(.3f); CameraShake.instance.shakeSpeed = 15f; float force = 200f, torque = 20f; leftBody.AddForce((Vector3)MathHelper.getVector2FromAngle(120f, force)); leftBody.AddTorque(torque); rightBody.AddForce((Vector3)MathHelper.getVector2FromAngle(30f, force)); rightBody.AddTorque(torque * -1f); sceneAnimator.SetInteger("state", (int)state); _audioSource.pitch = Time.timeScale * .75f; _audioSource.PlayOneShot(explosionClip); } }
mit
C#
eac709f8095ca25f0fd3de7514c54db69ff2fdac
Fix .ConfigureAwait(false) -> .DefaultAwait() in HttpResponseMessageJsonExtensions
vkhorikov/CSharpFunctionalExtensions
CSharpFunctionalExtensions/Result/Dto/HttpResponseMessageJsonExtensions.cs
CSharpFunctionalExtensions/Result/Dto/HttpResponseMessageJsonExtensions.cs
#nullable enable using System.Text.Json; using System.Threading.Tasks; using CSharpFunctionalExtensions; namespace System.Net.Http.Json { public static class HttpResponseMessageJsonExtensions { public static async Task<Result> ReadResult(this HttpResponseMessage? response) { if (response is null) { return Result.Failure("HttpResponseMessage is null"); } var responseContent = await response.Content.ReadAsStringAsync().DefaultAwait(); if (!response.IsSuccessStatusCode) { return Result.Failure(responseContent); } return JsonSerializer.Deserialize<Result>(responseContent, CSharpFunctionalExtensionsJsonSerializerOptions.Options); } public static async Task<Result<T>> ReadResult<T>(this HttpResponseMessage? response) { if (response is null) return Result.Failure<T>("HttpResponseMessage is null"); var responseContent = await response.Content.ReadAsStringAsync().DefaultAwait(); if (!response.IsSuccessStatusCode) return Result.Failure<T>(responseContent); return JsonSerializer.Deserialize<Result<T>>(responseContent, CSharpFunctionalExtensionsJsonSerializerOptions.Options); } } }
#nullable enable using System.Text.Json; using System.Threading.Tasks; using CSharpFunctionalExtensions; namespace System.Net.Http.Json { public static class HttpResponseMessageJsonExtensions { public static async Task<Result> ReadResult(this HttpResponseMessage? response) { if (response is null) { return Result.Failure("HttpResponseMessage is null"); } var responseContent = await response.Content.ReadAsStringAsync().ConfigureAwait(false); if (!response.IsSuccessStatusCode) { return Result.Failure(responseContent); } return JsonSerializer.Deserialize<Result>(responseContent, CSharpFunctionalExtensionsJsonSerializerOptions.Options); } public static async Task<Result<T>> ReadResult<T>(this HttpResponseMessage? response) { if (response is null) return Result.Failure<T>("HttpResponseMessage is null"); var responseContent = await response.Content.ReadAsStringAsync().ConfigureAwait(false); if (!response.IsSuccessStatusCode) return Result.Failure<T>(responseContent); return JsonSerializer.Deserialize<Result<T>>(responseContent, CSharpFunctionalExtensionsJsonSerializerOptions.Options); } } }
mit
C#
7a76b6fcfd48ad392019fa62ca9e2c8ce7eb0d9a
Add new science types
Kerbas-ad-astra/Orbital-Science,DMagic1/Orbital-Science
Source/DMScienceContainer.cs
Source/DMScienceContainer.cs
#region license /* DMagic Orbital Science - DMScienceContainer * Object to store experiment properties * * Copyright (c) 2014, David Grandy <david.grandy@gmail.com> * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. Neither the name of the copyright holder nor the names of its contributors may be used * to endorse or promote products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ #endregion namespace DMagic { internal class DMScienceContainer { internal int sitMask, bioMask; internal DMScienceType type; internal ScienceExperiment exp; internal string sciPart, agent; internal DMScienceContainer(ScienceExperiment sciExp, int sciSitMask, int sciBioMask, DMScienceType Type, string sciPartID, string agentName) { sitMask = sciSitMask; bioMask = sciBioMask; exp = sciExp; sciPart = sciPartID; agent = agentName; type = Type; } } internal enum DMScienceType { Surface = 1, Aerial = 2, Space = 4, Biological = 8, } }
#region license /* DMagic Orbital Science - DMScienceContainer * Object to store experiment properties * * Copyright (c) 2014, David Grandy <david.grandy@gmail.com> * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. Neither the name of the copyright holder nor the names of its contributors may be used * to endorse or promote products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ #endregion namespace DMagic { internal class DMScienceContainer { internal int sitMask, bioMask; internal DMScienceType type; internal ScienceExperiment exp; internal string sciPart, agent; internal DMScienceContainer(ScienceExperiment sciExp, int sciSitMask, int sciBioMask, DMScienceType Type, string sciPartID, string agentName) { sitMask = sciSitMask; bioMask = sciBioMask; exp = sciExp; sciPart = sciPartID; agent = agentName; type = Type; } } internal enum DMScienceType { Surface = 1, Aerial = 2, Space = 4 } }
bsd-3-clause
C#
2b3e11fc804e8af0eef0bdaf4e1e1eefcdf533b8
Update PermissionHandler.cs (#5940)
xkproject/Orchard2,xkproject/Orchard2,stevetayloruk/Orchard2,stevetayloruk/Orchard2,petedavis/Orchard2,petedavis/Orchard2,OrchardCMS/Brochard,stevetayloruk/Orchard2,xkproject/Orchard2,xkproject/Orchard2,xkproject/Orchard2,OrchardCMS/Brochard,petedavis/Orchard2,OrchardCMS/Brochard,stevetayloruk/Orchard2,petedavis/Orchard2,stevetayloruk/Orchard2
src/OrchardCore/OrchardCore.Infrastructure/Security/AuthorizationHandlers/PermissionHandler.cs
src/OrchardCore/OrchardCore.Infrastructure/Security/AuthorizationHandlers/PermissionHandler.cs
using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using OrchardCore.Security.Permissions; namespace OrchardCore.Security.AuthorizationHandlers { /// <summary> /// This authorization handler ensures that the user has the required permission. /// </summary> public class PermissionHandler : AuthorizationHandler<PermissionRequirement> { protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, PermissionRequirement requirement) { if (!(context?.User?.Identity?.IsAuthenticated ?? false)) { return Task.CompletedTask; } else if (context.User.HasClaim(Permission.ClaimType, requirement.Permission.Name)) { context.Succeed(requirement); } return Task.CompletedTask; } } }
using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using OrchardCore.Security.Permissions; namespace OrchardCore.Security.AuthorizationHandlers { /// <summary> /// This authorization handler ensures that the user has the required permission. /// </summary> public class PermissionHandler : AuthorizationHandler<PermissionRequirement> { protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, PermissionRequirement requirement) { if (!(bool)context?.User?.Identity?.IsAuthenticated) { return Task.CompletedTask; } else if (context.User.HasClaim(Permission.ClaimType, requirement.Permission.Name)) { context.Succeed(requirement); } return Task.CompletedTask; } } }
bsd-3-clause
C#
02450493915678d0ccc497d3874c885aeda3fddf
Update Person_MenuFunctions.cs
NakedObjectsGroup/NakedObjectsFramework,NakedObjectsGroup/NakedObjectsFramework,NakedObjectsGroup/NakedObjectsFramework,NakedObjectsGroup/NakedObjectsFramework
Test/AdventureWorksFunctionalModel/Person/Person_MenuFunctions.cs
Test/AdventureWorksFunctionalModel/Person/Person_MenuFunctions.cs
// Copyright Naked Objects Group Ltd, 45 Station Road, Henley on Thames, UK, RG9 1AT // 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.Collections.Generic; using System.Linq; using NakedFunctions; using AW.Types; using static AW.Helpers; using System; using System.Collections.Immutable; namespace AW.Functions { [Named("Persons")] public static class Person_MenuFunctions { [TableView(true, nameof(Person.AdditionalContactInfo))] public static IQueryable<Person> FindContactByName( [Optionally] string firstName, string lastName, IContext context) => context.Instances<Person>().Where(p => (firstName == null || p.FirstName.ToUpper().StartsWith(firstName.ToUpper())) && p.LastName.ToUpper().StartsWith(lastName.ToUpper())).OrderBy(p => p.LastName).ThenBy(p => p.FirstName); public static Person RandomContact(IContext context) { return Random<Person>(context); } [TableView(true, nameof(Person.AdditionalContactInfo))] public static IList<Person> RandomContacts(IContext context) { var instances = context.Instances<Person>().OrderBy(n => ""); IRandom random1 = context.GetService<IRandomSeedGenerator>().Random; IRandom random2 = random1.Next(); Person p1 = instances.Skip(random1.ValueInRange(instances.Count())).FirstOrDefault(); Person p2 = instances.Skip(random2.ValueInRange(instances.Count())).FirstOrDefault(); return new[] { p1, p2 }; } //To demonstrate use of recursion to create & use multiple random numbers public static IList<Person> RandomPerson(int numberRequired, IContext context) => RandomPersons(numberRequired, context.Instances<Person>().OrderBy(p => ""), context.RandomSeed()); //Test if an immutablelist can be returned internal static ImmutableList<Person> RandomPersons( int num, IOrderedQueryable<Person> source, IRandom random) => num < 1 ? ImmutableList<Person>.Empty: ImmutableList.Create(RandomPerson(source, random)).AddRange(RandomPersons(num - 1, source, random.Next())); internal static Person RandomPerson(IOrderedQueryable<Person> source, IRandom random) => source.Skip(random.ValueInRange(source.Count())).First(); } }
// Copyright Naked Objects Group Ltd, 45 Station Road, Henley on Thames, UK, RG9 1AT // 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.Collections.Generic; using System.Linq; using NakedFunctions; using AW.Types; using static AW.Helpers; using System; using System.Collections.Immutable; namespace AW.Functions { [Named("Persons")] public static class Person_MenuFunctions { [TableView(true, nameof(Person.AdditionalContactInfo))] public static IQueryable<Person> FindContactByName( [Optionally] string firstName, string lastName, IContext context) => context.Instances<Person>().Where(p => (firstName == null || p.FirstName.ToUpper().StartsWith(firstName.ToUpper())) && p.LastName.ToUpper().StartsWith(lastName.ToUpper())).OrderBy(p => p.LastName).ThenBy(p => p.FirstName); public static Person RandomContact(IContext context) { return Random<Person>(context); } [TableView(true, nameof(Person.AdditionalContactInfo))] public static IList<Person> RandomContacts(IContext context) { var instances = context.Instances<Person>().OrderBy(n => ""); IRandom random1 = context.GetService<IRandomSeedGenerator>().Random; IRandom random2 = random1.Next(); Person p1 = instances.Skip(random1.ValueInRange(instances.Count())).FirstOrDefault(); Person p2 = instances.Skip(random2.ValueInRange(instances.Count())).FirstOrDefault(); return new[] { p1, p2 }; } //To demonstrate use of recursion to create & use multiple random numbers [TableView(true, nameof(Person.AdditionalContactInfo))] public static IList<Person> RandomContacts(int numberRequired, IContext context) => RandomPersons(numberRequired, context.Instances<Person>().OrderBy(p => ""), context.RandomSeed()); //Test if an immutablelist can be returned internal static ImmutableList<Person> RandomPersons( int num, IOrderedQueryable<Person> source, IRandom random) => num < 1 ? ImmutableList<Person>.Empty: ImmutableList.Create(RandomPerson(source, random)).AddRange(RandomPersons(num - 1, source, random.Next())); internal static Person RandomPerson(IOrderedQueryable<Person> source, IRandom random) => source.Skip(random.ValueInRange(source.Count())).First(); } }
apache-2.0
C#
f47f6aa267ad3771121af84420dd10293cb74c84
Fix link open in browsers
ZombieUnicornStudio/Arkapongout
Assets/Scripts/LinkButton.cs
Assets/Scripts/LinkButton.cs
using UnityEngine; public class LinkButton : MonoBehaviour { public void OpenUrl (string url) { if(Application.platform == RuntimePlatform.WebGLPlayer) { Application.ExternalEval("window.open(\"" + url + "\",\"_blank\")"); } else { Application.OpenURL(url); } } }
using UnityEngine; public class LinkButton : MonoBehaviour { public void OpenUrl (string url) { Application.OpenURL(url); } }
mit
C#
6483b5edc778e8fbeb1a0c29d55c150f9d60965e
Add Has method to IPseudoClasses
AvaloniaUI/Avalonia,SuperJMN/Avalonia,AvaloniaUI/Avalonia,AvaloniaUI/Avalonia,SuperJMN/Avalonia,AvaloniaUI/Avalonia,SuperJMN/Avalonia,SuperJMN/Avalonia,SuperJMN/Avalonia,AvaloniaUI/Avalonia,AvaloniaUI/Avalonia,SuperJMN/Avalonia,SuperJMN/Avalonia,AvaloniaUI/Avalonia
src/Avalonia.Base/Controls/IPseudoClasses.cs
src/Avalonia.Base/Controls/IPseudoClasses.cs
using Avalonia.Metadata; namespace Avalonia.Controls { /// <summary> /// Exposes an interface for setting pseudoclasses on a <see cref="Classes"/> collection. /// </summary> [NotClientImplementable] public interface IPseudoClasses { /// <summary> /// Adds a pseudoclass to the collection. /// </summary> /// <param name="name">The pseudoclass name.</param> void Add(string name); /// <summary> /// Removes a pseudoclass from the collection. /// </summary> /// <param name="name">The pseudoclass name.</param> bool Remove(string name); /// <summary> /// Returns whether a pseudoclass is present in the collection. /// </summary> /// <param name="name">The pseudoclass name.</param> /// <returns>Whether the pseudoclass is present.</returns> bool Has(string name); } }
using Avalonia.Metadata; namespace Avalonia.Controls { /// <summary> /// Exposes an interface for setting pseudoclasses on a <see cref="Classes"/> collection. /// </summary> [NotClientImplementable] public interface IPseudoClasses { /// <summary> /// Adds a pseudoclass to the collection. /// </summary> /// <param name="name">The pseudoclass name.</param> void Add(string name); /// <summary> /// Removes a pseudoclass from the collection. /// </summary> /// <param name="name">The pseudoclass name.</param> bool Remove(string name); } }
mit
C#
01c327d3bfb6538a1c08716471974d55c981a74e
Add pressed pseudo class to ListBoxItem.
SuperJMN/Avalonia,AvaloniaUI/Avalonia,wieslawsoltes/Perspex,AvaloniaUI/Avalonia,jkoritzinsky/Avalonia,SuperJMN/Avalonia,wieslawsoltes/Perspex,akrisiun/Perspex,Perspex/Perspex,jkoritzinsky/Perspex,wieslawsoltes/Perspex,AvaloniaUI/Avalonia,AvaloniaUI/Avalonia,wieslawsoltes/Perspex,wieslawsoltes/Perspex,jkoritzinsky/Avalonia,SuperJMN/Avalonia,wieslawsoltes/Perspex,jkoritzinsky/Avalonia,jkoritzinsky/Avalonia,jkoritzinsky/Avalonia,jkoritzinsky/Avalonia,Perspex/Perspex,AvaloniaUI/Avalonia,SuperJMN/Avalonia,grokys/Perspex,AvaloniaUI/Avalonia,SuperJMN/Avalonia,wieslawsoltes/Perspex,SuperJMN/Avalonia,grokys/Perspex,AvaloniaUI/Avalonia,jkoritzinsky/Avalonia,SuperJMN/Avalonia
src/Avalonia.Controls/ListBoxItem.cs
src/Avalonia.Controls/ListBoxItem.cs
using Avalonia.Controls.Mixins; using Avalonia.Input; namespace Avalonia.Controls { /// <summary> /// A selectable item in a <see cref="ListBox"/>. /// </summary> public class ListBoxItem : ContentControl, ISelectable { /// <summary> /// Defines the <see cref="IsSelected"/> property. /// </summary> public static readonly StyledProperty<bool> IsSelectedProperty = AvaloniaProperty.Register<ListBoxItem, bool>(nameof(IsSelected)); /// <summary> /// Initializes static members of the <see cref="ListBoxItem"/> class. /// </summary> static ListBoxItem() { SelectableMixin.Attach<ListBoxItem>(IsSelectedProperty); FocusableProperty.OverrideDefaultValue<ListBoxItem>(true); } /// <summary> /// Gets or sets the selection state of the item. /// </summary> public bool IsSelected { get { return GetValue(IsSelectedProperty); } set { SetValue(IsSelectedProperty, value); } } protected override void OnPointerPressed(PointerPressedEventArgs e) { base.OnPointerPressed(e); if (e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) { UpdatePseudoClasses(true); } } protected override void OnPointerReleased(PointerReleasedEventArgs e) { base.OnPointerReleased(e); UpdatePseudoClasses(false); } protected override void OnPointerCaptureLost(PointerCaptureLostEventArgs e) { base.OnPointerCaptureLost(e); UpdatePseudoClasses(false); } private void UpdatePseudoClasses(bool isPressed) { PseudoClasses.Set(":pressed", isPressed); } } }
using Avalonia.Controls.Mixins; namespace Avalonia.Controls { /// <summary> /// A selectable item in a <see cref="ListBox"/>. /// </summary> public class ListBoxItem : ContentControl, ISelectable { /// <summary> /// Defines the <see cref="IsSelected"/> property. /// </summary> public static readonly StyledProperty<bool> IsSelectedProperty = AvaloniaProperty.Register<ListBoxItem, bool>(nameof(IsSelected)); /// <summary> /// Initializes static members of the <see cref="ListBoxItem"/> class. /// </summary> static ListBoxItem() { SelectableMixin.Attach<ListBoxItem>(IsSelectedProperty); FocusableProperty.OverrideDefaultValue<ListBoxItem>(true); } /// <summary> /// Gets or sets the selection state of the item. /// </summary> public bool IsSelected { get { return GetValue(IsSelectedProperty); } set { SetValue(IsSelectedProperty, value); } } } }
mit
C#
d6f0c653ff42a6df4b46b191c8a9047af4b7959b
Fix underlying type.
gitsno/MySqlConnector,gitsno/MySqlConnector,mysql-net/MySqlConnector,mysql-net/MySqlConnector
src/MySql.Data/Serialization/ServerStatus.cs
src/MySql.Data/Serialization/ServerStatus.cs
using System; namespace MySql.Data.Serialization { [Flags] internal enum ServerStatus : ushort { /// <summary> /// A transaction is active. /// </summary> InTransaction = 1, /// <summary> /// Auto-commit is enabled /// </summary> AutoCommit = 2, MoreResultsExist = 8, NoGoodIndexUsed = 0x10, NoIndexUsed = 0x20, /// <summary> /// Used by Binary Protocol Resultset to signal that COM_STMT_FETCH must be used to fetch the row-data. /// </summary> CursorExists = 0x40, LastRowSent = 0x80, DatabaseDropped = 0x100, NoBackslashEscapes = 0x200, MetadataChanged = 0x400, QueryWasSlow = 0x800, PsOutParams = 0x1000, /// <summary> /// In a read-only transaction. /// </summary> InReadOnlyTransaction = 0x2000, /// <summary> /// Connection state information has changed. /// </summary> SessionStateChanged = 0x4000, } }
using System; namespace MySql.Data.Serialization { [Flags] internal enum ServerStatus : short { /// <summary> /// A transaction is active. /// </summary> InTransaction = 1, /// <summary> /// Auto-commit is enabled /// </summary> AutoCommit = 2, MoreResultsExist = 8, NoGoodIndexUsed = 0x10, NoIndexUsed = 0x20, /// <summary> /// Used by Binary Protocol Resultset to signal that COM_STMT_FETCH must be used to fetch the row-data. /// </summary> CursorExists = 0x40, LastRowSent = 0x80, DatabaseDropped = 0x100, NoBackslashEscapes = 0x200, MetadataChanged = 0x400, QueryWasSlow = 0x800, PsOutParams = 0x1000, /// <summary> /// In a read-only transaction. /// </summary> InReadOnlyTransaction = 0x2000, /// <summary> /// Connection state information has changed. /// </summary> SessionStateChanged = 0x4000, } }
mit
C#
fed69bc32eeddc05b687184697410075ebf15c15
Revert LocatorRegister sequence
Ullink/gradle-msbuild-plugin
src/main/dotnet/ProjectFileParser/Program.cs
src/main/dotnet/ProjectFileParser/Program.cs
using Microsoft.Build.Construction; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.IO; namespace ProjectFileParser { internal class Program { private static int Main(string[] args) { MSBuildCustomLocator.Register(); using (new MonoHack()) { try { var customPropertiesText = Console.In.ReadToEnd(); var obj = JObject.Parse(customPropertiesText); var result = Parse(args[0], obj); Console.WriteLine(result); } catch (Exception e) { Console.Error.WriteLine("Error during project file parsing: {0}", e); return -1; } } return 0; } private static JObject Parse(string file, JObject args) { var isSolution = Path.GetExtension(file).Equals(".sln", StringComparison.InvariantCultureIgnoreCase); return isSolution ? ParseSolution(file, args) : ParseProject(file, args); } private static JObject ParseSolution(string file, JObject args) { var projects = ProjectHelpers.GetProjects(SolutionFile.Parse(file), ParamsToDic(args)); return Jsonify.ToJson(projects); } private static JObject ParseProject(string file, JObject args) { var project = ProjectHelpers.LoadProject(file, ParamsToDic(args)); return Jsonify.ToJson(project); } private static IDictionary<string, string> ParamsToDic(JObject args) { var dic = new Dictionary<string, string>(); foreach (var kvp in args) { dic[kvp.Key] = kvp.Value.Value<String>(); } return dic; } } }
using Microsoft.Build.Construction; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.IO; namespace ProjectFileParser { internal class Program { private static int Main(string[] args) { using (new MonoHack()) { MSBuildCustomLocator.Register(); try { var customPropertiesText = Console.In.ReadToEnd(); var obj = JObject.Parse(customPropertiesText); var result = Parse(args[0], obj); Console.WriteLine(result); } catch (Exception e) { Console.Error.WriteLine("Error during project file parsing: {0}", e); return -1; } } return 0; } private static JObject Parse(string file, JObject args) { var isSolution = Path.GetExtension(file).Equals(".sln", StringComparison.InvariantCultureIgnoreCase); return isSolution ? ParseSolution(file, args) : ParseProject(file, args); } private static JObject ParseSolution(string file, JObject args) { var projects = ProjectHelpers.GetProjects(SolutionFile.Parse(file), ParamsToDic(args)); return Jsonify.ToJson(projects); } private static JObject ParseProject(string file, JObject args) { var project = ProjectHelpers.LoadProject(file, ParamsToDic(args)); return Jsonify.ToJson(project); } private static IDictionary<string, string> ParamsToDic(JObject args) { var dic = new Dictionary<string, string>(); foreach (var kvp in args) { dic[kvp.Key] = kvp.Value.Value<String>(); } return dic; } } }
apache-2.0
C#
357268ff2f13eeead1aa4a78b8daf7712df59ebc
Add ActionItemSubMenu.ID property
l8s/Eto,PowerOfCode/Eto,PowerOfCode/Eto,bbqchickenrobot/Eto-1,bbqchickenrobot/Eto-1,PowerOfCode/Eto,l8s/Eto,l8s/Eto,bbqchickenrobot/Eto-1
Source/Eto/Forms/Actions/ActionItem.cs
Source/Eto/Forms/Actions/ActionItem.cs
using System; using System.Collections; namespace Eto.Forms { public partial interface IActionItem { void Generate(ToolBar toolBar); int Order { get; } } public abstract partial class ActionItemBase : IActionItem { int order = 500; public abstract void Generate(ToolBar toolBar); public int Order { get { return order; } set { order = value; } } public string ToolBarItemStyle { get; set; } public string MenuItemStyle { get; set; } } public partial class ActionItemSeparator : ActionItemBase { public SeparatorToolBarItemType ToolBarType { get; set; } public override void Generate(ToolBar toolBar) { var tbb = new SeparatorToolBarItem(toolBar.Generator) { Type = this.ToolBarType }; if (!string.IsNullOrEmpty (ToolBarItemStyle)) tbb.Style = ToolBarItemStyle; toolBar.Items.Add(tbb); } } public partial class ActionItemSubMenu : ActionItemBase { public ActionItemSubMenu(ActionCollection actions, string subMenuText) { this.Actions = new ActionItemCollection(actions); this.SubMenuText = subMenuText; } public string Icon { get; set; } public string ID { get; set; } public string SubMenuText { get; set; } public ActionItemCollection Actions { get; private set; } public override void Generate(ToolBar toolBar) { } } public partial class ActionItem : ActionItemBase { public ActionItem(BaseAction action) : this(action, false) { } public ActionItem(BaseAction action, bool showLabel) { if (action == null) throw new ArgumentNullException("action", "Action cannot be null for an action item"); this.Action = action; this.ShowLabel = showLabel; } public BaseAction Action { get; set; } public bool ShowLabel { get; set; } public override void Generate(ToolBar toolBar) { var item = Action.Generate(this, toolBar); if (item != null) { if (!string.IsNullOrEmpty (ToolBarItemStyle)) item.Style = ToolBarItemStyle; toolBar.Items.Add (item); } } } }
using System; using System.Collections; namespace Eto.Forms { public partial interface IActionItem { void Generate(ToolBar toolBar); int Order { get; } } public abstract partial class ActionItemBase : IActionItem { int order = 500; public abstract void Generate(ToolBar toolBar); public int Order { get { return order; } set { order = value; } } public string ToolBarItemStyle { get; set; } public string MenuItemStyle { get; set; } } public partial class ActionItemSeparator : ActionItemBase { public SeparatorToolBarItemType ToolBarType { get; set; } public override void Generate(ToolBar toolBar) { var tbb = new SeparatorToolBarItem(toolBar.Generator) { Type = this.ToolBarType }; if (!string.IsNullOrEmpty (ToolBarItemStyle)) tbb.Style = ToolBarItemStyle; toolBar.Items.Add(tbb); } } public partial class ActionItemSubMenu : ActionItemBase { public ActionItemSubMenu(ActionCollection actions, string subMenuText) { this.Actions = new ActionItemCollection(actions); this.SubMenuText = subMenuText; } public string Icon { get; set; } public string SubMenuText { get; set; } public ActionItemCollection Actions { get; private set; } public override void Generate(ToolBar toolBar) { } } public partial class ActionItem : ActionItemBase { public ActionItem(BaseAction action) : this(action, false) { } public ActionItem(BaseAction action, bool showLabel) { if (action == null) throw new ArgumentNullException("action", "Action cannot be null for an action item"); this.Action = action; this.ShowLabel = showLabel; } public BaseAction Action { get; set; } public bool ShowLabel { get; set; } public override void Generate(ToolBar toolBar) { var item = Action.Generate(this, toolBar); if (item != null) { if (!string.IsNullOrEmpty (ToolBarItemStyle)) item.Style = ToolBarItemStyle; toolBar.Items.Add (item); } } } }
bsd-3-clause
C#
3cce340e3d88f2603d858477a407d2fa71009d71
Add some random shit
wajeehnaeem/TCFPROJECT,wajeehnaeem/TCFPROJECT,wajeehnaeem/TCFPROJECT
TCFPROJECT/Controllers/RandomController.cs
TCFPROJECT/Controllers/RandomController.cs
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace TCFPROJECT.Controllers { public class RandomController : Controller { public ActionResult Index() { ViewBag.Message = "This is some random shit"; return View(); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace TCFPROJECT.Controllers { public class RandomController : Controller { public ActionResult Index() { return View(); } } }
apache-2.0
C#
db8371d3afcdc76756078efe915df22e0d66dc6d
Fix crash issue when user didn't install python.
Launchify/Launchify,Launchify/Launchify,gnowxilef/Wox,danisein/Wox,kayone/Wox,qianlifeng/Wox,18098924759/Wox,vebin/Wox,Rovak/Wox,dstiert/Wox,orzFly/Wox,AlexCaranha/Wox,qianlifeng/Wox,kdar/Wox,EmuxEvans/Wox,apprentice3d/Wox,yozora-hitagi/Saber,renzhn/Wox,sanbinabu/Wox,sanbinabu/Wox,Rovak/Wox,qianlifeng/Wox,apprentice3d/Wox,kdar/Wox,vebin/Wox,medoni/Wox,Megasware128/Wox,derekforeman/Wox,jondaniels/Wox,18098924759/Wox,zlphoenix/Wox,shangvven/Wox,JohnTheGr8/Wox,mika76/Wox,derekforeman/Wox,kayone/Wox,EmuxEvans/Wox,Rovak/Wox,orzFly/Wox,orzFly/Wox,AlexCaranha/Wox,lances101/Wox,Wox-launcher/Wox,kayone/Wox,lances101/Wox,shangvven/Wox,EmuxEvans/Wox,JohnTheGr8/Wox,orzFly/Wox,yozora-hitagi/Saber,mika76/Wox,Wox-launcher/Wox,danisein/Wox,renzhn/Wox,jondaniels/Wox,dstiert/Wox,orzFly/Wox,Rovak/Wox,Rovak/Wox,gnowxilef/Wox,shangvven/Wox,zlphoenix/Wox,vebin/Wox,Megasware128/Wox,sanbinabu/Wox,derekforeman/Wox,medoni/Wox,kdar/Wox,gnowxilef/Wox,dstiert/Wox,18098924759/Wox,mika76/Wox,apprentice3d/Wox,AlexCaranha/Wox
Wox/PluginLoader/PythonPluginLoader.cs
Wox/PluginLoader/PythonPluginLoader.cs
using System; using System.Collections.Generic; using System.Linq; using System.Threading; using Python.Runtime; using Wox.Plugin; using Wox.Helper; namespace Wox.PluginLoader { public class PythonPluginLoader : BasePluginLoader { public override List<PluginPair> LoadPlugin() { if (!CheckPythonEnvironmentInstalled()) return new List<PluginPair>(); List<PluginPair> plugins = new List<PluginPair>(); List<PluginMetadata> metadatas = pluginMetadatas.Where(o => o.Language.ToUpper() == AllowedLanguage.Python.ToUpper()).ToList(); foreach (PluginMetadata metadata in metadatas) { PythonPluginWrapper python = new PythonPluginWrapper(metadata); PluginPair pair = new PluginPair() { Plugin = python, Metadata = metadata }; plugins.Add(pair); } return plugins; } private bool CheckPythonEnvironmentInstalled() { try { PythonEngine.Initialize(); PythonEngine.Shutdown(); } catch { Log.Error("Could't find python environment, all python plugins disabled."); return false; } return true; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Threading; using Python.Runtime; using Wox.Plugin; namespace Wox.PluginLoader { public class PythonPluginLoader : BasePluginLoader { public override List<PluginPair> LoadPlugin() { List<PluginPair> plugins = new List<PluginPair>(); List<PluginMetadata> metadatas = pluginMetadatas.Where(o => o.Language.ToUpper() == AllowedLanguage.Python.ToUpper()).ToList(); foreach (PluginMetadata metadata in metadatas) { PythonPluginWrapper python = new PythonPluginWrapper(metadata); PluginPair pair = new PluginPair() { Plugin = python, Metadata = metadata }; plugins.Add(pair); } return plugins; } } }
mit
C#
f7e7c0606f37d3c2622bafd1083ce5c38ac2a8b3
Update documentation comment
tgstation/tgstation-server,tgstation/tgstation-server
src/Tgstation.Server.Host/Components/Repository/IGitRemoteAdditionalInformation.cs
src/Tgstation.Server.Host/Components/Repository/IGitRemoteAdditionalInformation.cs
using System.Threading; using System.Threading.Tasks; using Tgstation.Server.Api.Models; using Tgstation.Server.Api.Models.Internal; namespace Tgstation.Server.Host.Components.Repository { /// <summary> /// Additional information from git remotes. /// </summary> public interface IGitRemoteAdditionalInformation : IGitRemoteInformation { /// <summary> /// Retrieve the <see cref="Models.TestMerge"/> representation of given test merge <paramref name="parameters"/>. /// </summary> /// <param name="parameters">The <see cref="TestMergeParameters"/>.</param> /// <param name="repositorySettings">The <see cref="RepositorySettings"/>.</param> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the operation.</param> /// <returns>A <see cref="Task{TResult}"/> resulting in the <see cref="Models.TestMerge"/> of the <paramref name="parameters"/>.</returns> /// <remarks><see cref="TestMergeApiBase.MergedAt"/> and <see cref="Models.TestMerge.MergedBy"/> will be unset.</remarks> Task<Models.TestMerge> GetTestMerge( TestMergeParameters parameters, RepositorySettings repositorySettings, CancellationToken cancellationToken); } }
using System.Threading; using System.Threading.Tasks; using Tgstation.Server.Api.Models; using Tgstation.Server.Api.Models.Internal; namespace Tgstation.Server.Host.Components.Repository { /// <summary> /// Additional information from git remotes. /// </summary> public interface IGitRemoteAdditionalInformation : IGitRemoteInformation { /// <summary> /// Retrieve the <see cref="Models.TestMerge"/> representation of given test merge <paramref name="parameters"/>. /// </summary> /// <param name="parameters">The <see cref="TestMergeParameters"/>.</param> /// <param name="repositorySettings">The <see cref="RepositorySettings"/>.</param> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the operation.</param> /// <returns>A <see cref="Task{TResult}"/> resulting in the <see cref="Models.TestMerge"/> of the <paramref name="parameters"/>.</returns> Task<Models.TestMerge> GetTestMerge( TestMergeParameters parameters, RepositorySettings repositorySettings, CancellationToken cancellationToken); } }
agpl-3.0
C#
5a2b55bbab1d47bc3b30b26811462fb85c258422
Update MvxFormsDroidPagePresenter.cs
Cheesebaron/Cheesebaron.MvxPlugins,Cheesebaron/Cheesebaron.MvxPlugins,Ideine/Cheesebaron.MvxPlugins,Ideine/Cheesebaron.MvxPlugins
FormsPresenters/Droid/MvxFormsDroidPagePresenter.cs
FormsPresenters/Droid/MvxFormsDroidPagePresenter.cs
// MvxFormsDroidPagePresenter.cs // 2015 (c) Copyright Cheesebaron. http://ostebaronen.dk // Cheesebaron.MvxPlugins.FormsPresenters is licensed using Microsoft Public License (Ms-PL) // Contributions and inspirations noted in readme.md and license.txt // // Project Lead - Tomasz Cielecki, @cheesebaron, mvxplugins@ostebaronen.dk using Cheesebaron.MvxPlugins.FormsPresenters.Core; using Cirrious.CrossCore; using Cirrious.MvvmCross.Droid.Views; using Cirrious.MvvmCross.ViewModels; using Cirrious.MvvmCross.Views; using System.Threading.Tasks; using Xamarin.Forms; namespace Cheesebaron.MvxPlugins.FormsPresenters.Droid { public class MvxFormsDroidPagePresenter : MvxFormsPagePresenter , IMvxAndroidViewPresenter { public MvxFormsDroidPagePresenter() { } public MvxFormsDroidPagePresenter(MvxFormsApp mvxFormsApp) : base(mvxFormsApp) { } } }
using Cheesebaron.MvxPlugins.FormsPresenters.Core; using Cirrious.CrossCore; using Cirrious.MvvmCross.Droid.Views; using Cirrious.MvvmCross.ViewModels; using Cirrious.MvvmCross.Views; using System.Threading.Tasks; using Xamarin.Forms; namespace Cheesebaron.MvxPlugins.FormsPresenters.Droid { public class MvxFormsDroidPagePresenter : MvxFormsPagePresenter , IMvxAndroidViewPresenter { public MvxFormsDroidPagePresenter() { } public MvxFormsDroidPagePresenter(MvxFormsApp mvxFormsApp) : base(mvxFormsApp) { } } }
apache-2.0
C#
eec69df674d92f90f5d5a8c13cf81179836ffc30
Fix test failure After consulting with search team, we can get results needed for this test by searching for "rock,pop" not "rock,pop,2000s"
danhaller/SevenDigital.Api.Wrapper,emashliles/SevenDigital.Api.Wrapper,luiseduardohdbackup/SevenDigital.Api.Wrapper,AnthonySteele/SevenDigital.Api.Wrapper,mattgray/SevenDigital.Api.Wrapper,danbadge/SevenDigital.Api.Wrapper,bnathyuw/SevenDigital.Api.Wrapper,actionshrimp/SevenDigital.Api.Wrapper,raoulmillais/SevenDigital.Api.Wrapper,gregsochanik/SevenDigital.Api.Wrapper,minkaotic/SevenDigital.Api.Wrapper,bettiolo/SevenDigital.Api.Wrapper
src/SevenDigital.Api.Wrapper.Integration.Tests/EndpointTests/TagsEndpoint/ArtistByTagTopTests.cs
src/SevenDigital.Api.Wrapper.Integration.Tests/EndpointTests/TagsEndpoint/ArtistByTagTopTests.cs
using System.Linq; using NUnit.Framework; using SevenDigital.Api.Schema; using SevenDigital.Api.Schema.Tags; namespace SevenDigital.Api.Wrapper.Integration.Tests.EndpointTests.TagsEndpoint { [TestFixture] public class ArtistByTagTopTests { private const string Tags = "rock,pop"; [Test] public void Can_hit_endpoint() { ArtistByTagTop tags = Api<ArtistByTagTop>.Create .WithParameter("tags", Tags) .Please(); Assert.That(tags, Is.Not.Null); Assert.That(tags.TaggedArtists.Count, Is.GreaterThan(0)); Assert.That(tags.Type, Is.EqualTo(ItemType.artist)); Assert.That(tags.TaggedArtists.FirstOrDefault().Artist.Name, Is.Not.Empty); } [Test] public void Can_hit_endpoint_with_paging() { ArtistByTagTop artistBrowse = Api<ArtistByTagTop>.Create .WithParameter("tags", Tags) .WithParameter("page", "2") .WithParameter("pageSize", "20") .Please(); Assert.That(artistBrowse, Is.Not.Null); Assert.That(artistBrowse.Page, Is.EqualTo(2)); Assert.That(artistBrowse.PageSize, Is.EqualTo(20)); } } }
using System.Linq; using NUnit.Framework; using SevenDigital.Api.Schema; using SevenDigital.Api.Schema.Tags; namespace SevenDigital.Api.Wrapper.Integration.Tests.EndpointTests.TagsEndpoint { [TestFixture] public class ArtistByTagTopTests { [Test] public void Can_hit_endpoint() { ArtistByTagTop tags = Api<ArtistByTagTop>.Create .WithParameter("tags", "rock,pop,2000s") .Please(); Assert.That(tags, Is.Not.Null); Assert.That(tags.TaggedArtists.Count, Is.GreaterThan(0)); Assert.That(tags.Type, Is.EqualTo(ItemType.artist)); Assert.That(tags.TaggedArtists.FirstOrDefault().Artist.Name, Is.Not.Empty); } [Test] public void Can_hit_endpoint_with_paging() { ArtistByTagTop artistBrowse = Api<ArtistByTagTop>.Create .WithParameter("tags", "rock,pop,2000s") .WithParameter("page", "2") .WithParameter("pageSize", "20") .Please(); Assert.That(artistBrowse, Is.Not.Null); Assert.That(artistBrowse.Page, Is.EqualTo(2)); Assert.That(artistBrowse.PageSize, Is.EqualTo(20)); } } }
mit
C#
6cdfbeb0a35ac7d7fc5ff0689e763b1ef3d2743b
Add filter property to most anticipated movies request.
henrikfroehling/TraktApiSharp
Source/Lib/TraktApiSharp/Requests/WithoutOAuth/Movies/Common/TraktMoviesMostAnticipatedRequest.cs
Source/Lib/TraktApiSharp/Requests/WithoutOAuth/Movies/Common/TraktMoviesMostAnticipatedRequest.cs
namespace TraktApiSharp.Requests.WithoutOAuth.Movies.Common { using Base; using Base.Get; using Objects.Basic; using Objects.Get.Movies.Common; internal class TraktMoviesMostAnticipatedRequest : TraktGetRequest<TraktPaginationListResult<TraktMostAnticipatedMovie>, TraktMostAnticipatedMovie> { internal TraktMoviesMostAnticipatedRequest(TraktClient client) : base(client) { } protected override string UriTemplate => "movies/anticipated{?extended,page,limit,query,years,genres,languages,countries,runtimes,ratings,certifications}"; protected override TraktAuthorizationRequirement AuthorizationRequirement => TraktAuthorizationRequirement.NotRequired; internal TraktMovieFilter Filter { get; set; } protected override bool SupportsPagination => true; protected override bool IsListResult => true; } }
namespace TraktApiSharp.Requests.WithoutOAuth.Movies.Common { using Base.Get; using Objects.Basic; using Objects.Get.Movies.Common; internal class TraktMoviesMostAnticipatedRequest : TraktGetRequest<TraktPaginationListResult<TraktMostAnticipatedMovie>, TraktMostAnticipatedMovie> { internal TraktMoviesMostAnticipatedRequest(TraktClient client) : base(client) { } protected override string UriTemplate => "movies/anticipated{?extended,page,limit}"; protected override TraktAuthorizationRequirement AuthorizationRequirement => TraktAuthorizationRequirement.NotRequired; protected override bool SupportsPagination => true; protected override bool IsListResult => true; } }
mit
C#
c01c0647efae7d21a706583e93f0dc228fcc4c7e
Add ID property to OverwriteParameters
BundledSticksInkorperated/Discore
src/Discore/Http/OverwriteParameters.cs
src/Discore/Http/OverwriteParameters.cs
namespace Discore.Http { /// <summary> /// A set of parameters defining a permission overwrite. /// </summary> public class OverwriteParameters { /// <summary> /// Gets the ID of the role or user that this overwrites. /// </summary> public Snowflake Id { get; } /// <summary> /// Gets the type the overwrite affects. /// </summary> public DiscordOverwriteType Type { get; } /// <summary> /// Gets or sets the allowed permissions to overwrite. /// </summary> public DiscordPermission Allow { get; set; } /// <summary> /// Gets or sets the denied permissions to overwrite. /// </summary> public DiscordPermission Deny { get; set; } public OverwriteParameters(Snowflake roleOrUserId, DiscordOverwriteType type) { Id = roleOrUserId; Type = type; } /// <summary> /// Sets the allowed permissions to overwrite. /// </summary> public OverwriteParameters SetAllowedPermissions(DiscordPermission allow) { Allow = allow; return this; } /// <summary> /// Sets the denied permissions to overwrite. /// </summary> public OverwriteParameters SetDeniedPermissions(DiscordPermission deny) { Deny = deny; return this; } internal DiscordApiData Build() { DiscordApiData data = new DiscordApiData(DiscordApiDataType.Container); data.Set("id", Id); data.Set("type", Type.ToString().ToLower()); data.Set("allow", (int)Allow); data.Set("deny", (int)Deny); return data; } } }
namespace Discore.Http { /// <summary> /// A set of parameters defining a permission overwrite. /// </summary> public class OverwriteParameters { /// <summary> /// Gets or sets the type the overwrite affects. /// </summary> public DiscordOverwriteType Type { get; set; } /// <summary> /// Gets or sets the allowed permissions to overwrite. /// </summary> public DiscordPermission Allow { get; set; } /// <summary> /// Gets or sets the denied permissions to overwrite. /// </summary> public DiscordPermission Deny { get; set; } /// <summary> /// Sets the type the overwrite affects. /// </summary> public OverwriteParameters SetType(DiscordOverwriteType type) { Type = type; return this; } /// <summary> /// Sets the allowed permissions to overwrite. /// </summary> public OverwriteParameters SetAllowedPermissions(DiscordPermission allow) { Allow = allow; return this; } /// <summary> /// Sets the denied permissions to overwrite. /// </summary> public OverwriteParameters SetDeniedPermissions(DiscordPermission deny) { Deny = deny; return this; } internal DiscordApiData Build() { DiscordApiData data = new DiscordApiData(DiscordApiDataType.Container); data.Set("type", Type.ToString().ToLower()); data.Set("allow", (int)Allow); data.Set("deny", (int)Deny); return data; } } }
mit
C#
670f99c31aebd917e573db82db7900b4164420b2
Update the output messages
BigEggTools/JsonComparer
JsonComparer.Console/Parameters/CompareParameter.cs
JsonComparer.Console/Parameters/CompareParameter.cs
namespace BigEgg.Tools.JsonComparer.Parameters { using BigEgg.Tools.ConsoleExtension.Parameters; [Command("compare", "Compare the JSON files in two folder.")] public class CompareParameter { [StringProperty("path1", "p1", "The folder name of JSON files to compare.", Required = true)] public string Path1 { get; set; } [StringProperty("path2", "p2", "The another folder name of JSON files to compare.", Required = true)] public string Path2 { get; set; } [StringProperty("config", "c", "The configuration file for compare action.", Required = true)] public string ConfigFile { get; set; } [StringProperty("output", "o", "The output folder Name of the Compare Results.", DefaultValue = "output")] public string OutputPath { get; set; } } }
namespace BigEgg.Tools.JsonComparer.Parameters { using BigEgg.Tools.ConsoleExtension.Parameters; [Command("compare", "Compare the JSON files in two folder.")] public class CompareParameter { [StringProperty("path1", "p1", "The folder name of JSON files to compare.", Required = true)] public string Path1 { get; set; } [StringProperty("path2", "p2", "The another folder name of JSON files to compare.", Required = true)] public string Path2 { get; set; } [StringProperty("config", "c", "The configuration file for compare action.", Required = true)] public string ConfigFile { get; set; } [StringProperty("output", "o", "The File Name of the Compare Result.")] public string OutputPath { get; set; } } }
mit
C#