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
0607ef40f7a6fc8a5592fed1abcc880630b42d21
add property for the name of the category
SoftwareFans/AstroPhotoGallery,SoftwareFans/AstroPhotoGallery,SoftwareFans/AstroPhotoGallery
AstroPhotoGallery/AstroPhotoGallery/Models/Picture.cs
AstroPhotoGallery/AstroPhotoGallery/Models/Picture.cs
using System; using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Web; namespace AstroPhotoGallery.Models { public class Picture { [Key] public int Id { get; set; } [Required] [StringLength(50)] [DisplayName("Title")] public string PicTitle { get; set; } [Required] [DisplayName("Description")] public string PicDescription { get; set; } [ForeignKey("PicUploader")] public string PicUploaderId { get; set; } public string ImagePath { get; set; } public virtual ApplicationUser PicUploader { get; set; } [ForeignKey("Category")] [DisplayName("Category")] public int CategoryId { get; set; } public virtual Category Category { get; set; } public ICollection<Category> Categories { get; set; } public string CategoryName { get; set; } public bool IsUploader(string name) { return this.PicUploader.UserName.EndsWith(name); } } }
using System; using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Web; namespace AstroPhotoGallery.Models { public class Picture { [Key] public int Id { get; set; } [Required] [StringLength(50)] [DisplayName("Title")] public string PicTitle { get; set; } [Required] [DisplayName("Description")] public string PicDescription { get; set; } [ForeignKey("PicUploader")] public string PicUploaderId { get; set; } public string ImagePath { get; set; } public virtual ApplicationUser PicUploader { get; set; } [ForeignKey("Category")] [DisplayName("Category")] public int CategoryId { get; set; } public virtual Category Category { get; set; } public ICollection<Category> Categories { get; set; } public bool IsUploader(string name) { return this.PicUploader.UserName.EndsWith(name); } } }
mit
C#
db12eff96b85ae62ee4637420c567c62a7a6bbdf
Reduce unit test logger verbosity
LukeForder/rethinkdb-net,kangkot/rethinkdb-net,nkreipke/rethinkdb-net,Ernesto99/rethinkdb-net,bbqchickenrobot/rethinkdb-net,LukeForder/rethinkdb-net,kangkot/rethinkdb-net,Ernesto99/rethinkdb-net,bbqchickenrobot/rethinkdb-net,nkreipke/rethinkdb-net
rethinkdb-net-test/TestBase.cs
rethinkdb-net-test/TestBase.cs
using System; using NUnit.Framework; using RethinkDb; using System.Net; using System.Linq; using System.Threading.Tasks; using RethinkDb.Configuration; namespace RethinkDb.Test { public class TestBase { protected IConnection connection; [TestFixtureSetUp] public virtual void TestFixtureSetUp() { try { DoTestFixtureSetUp().Wait(); } catch (Exception e) { Console.WriteLine("TestFixtureSetUp failed: {0}", e); throw; } } private async Task DoTestFixtureSetUp() { connection = ConfigConnectionFactory.Instance.Get("testCluster"); connection.Logger = new DefaultLogger(LoggingCategory.Warning, Console.Out); await connection.ConnectAsync(); try { var dbList = await connection.RunAsync(Query.DbList()); if (dbList.Contains("test")) await connection.RunAsync(Query.DbDrop("test")); } catch (Exception) { } } } }
using System; using NUnit.Framework; using RethinkDb; using System.Net; using System.Linq; using System.Threading.Tasks; using RethinkDb.Configuration; namespace RethinkDb.Test { public class TestBase { protected IConnection connection; [TestFixtureSetUp] public virtual void TestFixtureSetUp() { try { DoTestFixtureSetUp().Wait(); } catch (Exception e) { Console.WriteLine("TestFixtureSetUp failed: {0}", e); throw; } } private async Task DoTestFixtureSetUp() { connection = ConfigConnectionFactory.Instance.Get("testCluster"); connection.Logger = new DefaultLogger(LoggingCategory.Debug, Console.Out); await connection.ConnectAsync(); try { var dbList = await connection.RunAsync(Query.DbList()); if (dbList.Contains("test")) await connection.RunAsync(Query.DbDrop("test")); } catch (Exception) { } } } }
apache-2.0
C#
bdf791ab0ab6e1a58eedee502efedd1e7cba27ce
Add attributes to Package View-Model
grenade/NuGetGallery_download-count-patch,JetBrains/ReSharperGallery,ScottShingler/NuGetGallery,skbkontur/NuGetGallery,skbkontur/NuGetGallery,projectkudu/SiteExtensionGallery,JetBrains/ReSharperGallery,skbkontur/NuGetGallery,ScottShingler/NuGetGallery,projectkudu/SiteExtensionGallery,grenade/NuGetGallery_download-count-patch,mtian/SiteExtensionGallery,JetBrains/ReSharperGallery,mtian/SiteExtensionGallery,grenade/NuGetGallery_download-count-patch,ScottShingler/NuGetGallery,projectkudu/SiteExtensionGallery,mtian/SiteExtensionGallery
src/NuGetGallery/ViewModels/PackageViewModel.cs
src/NuGetGallery/ViewModels/PackageViewModel.cs
using System; using System.Collections.Generic; namespace NuGetGallery { public class PackageViewModel : IPackageVersionModel { private readonly Package _package; private string _pendingTitle; public PackageViewModel(Package package) { _package = package; Version = package.Version; Description = package.Description; ReleaseNotes = package.ReleaseNotes; IconUrl = package.IconUrl; ProjectUrl = package.ProjectUrl; LicenseUrl = package.LicenseUrl; SonatypeReportUrl = package.SonatypeReportUrl; LatestVersion = package.IsLatest; LatestStableVersion = package.IsLatestStable; LastUpdated = package.Published; Listed = package.Listed; DownloadCount = package.DownloadCount; Prerelease = package.IsPrerelease; LicensesNames = package.LicensesNames != null ? package.LicensesNames.Trim().Split(',') : null; } public string Description { get; set; } public string ReleaseNotes { get; set; } public string IconUrl { get; set; } public string ProjectUrl { get; set; } public string LicenseUrl { get; set; } public IEnumerable<string> LicensesNames { get; set; } public string SonatypeReportUrl { get; set; } public DateTime LastUpdated { get; set; } public bool LatestVersion { get; set; } public bool LatestStableVersion { get; set; } public bool Prerelease { get; set; } public int DownloadCount { get; set; } public bool Listed { get; set; } public int TotalDownloadCount { get { return _package.PackageRegistration.DownloadCount; } } public string Id { get { return _package.PackageRegistration.Id; } } public string Version { get; set; } public string Title { get { return _pendingTitle ?? (String.IsNullOrEmpty(_package.Title) ? _package.PackageRegistration.Id : _package.Title); } set { _pendingTitle = value; } } public bool IsCurrent(IPackageVersionModel current) { return current.Version == Version && current.Id == Id; } } }
using System; namespace NuGetGallery { public class PackageViewModel : IPackageVersionModel { private readonly Package _package; private string _pendingTitle; public PackageViewModel(Package package) { _package = package; Version = package.Version; Description = package.Description; ReleaseNotes = package.ReleaseNotes; IconUrl = package.IconUrl; ProjectUrl = package.ProjectUrl; LicenseUrl = package.LicenseUrl; LatestVersion = package.IsLatest; LatestStableVersion = package.IsLatestStable; LastUpdated = package.Published; Listed = package.Listed; DownloadCount = package.DownloadCount; Prerelease = package.IsPrerelease; } public string Description { get; set; } public string ReleaseNotes { get; set; } public string IconUrl { get; set; } public string ProjectUrl { get; set; } public string LicenseUrl { get; set; } public DateTime LastUpdated { get; set; } public bool LatestVersion { get; set; } public bool LatestStableVersion { get; set; } public bool Prerelease { get; set; } public int DownloadCount { get; set; } public bool Listed { get; set; } public int TotalDownloadCount { get { return _package.PackageRegistration.DownloadCount; } } public string Id { get { return _package.PackageRegistration.Id; } } public string Version { get; set; } public string Title { get { return _pendingTitle ?? (String.IsNullOrEmpty(_package.Title) ? _package.PackageRegistration.Id : _package.Title); } set { _pendingTitle = value; } } public bool IsCurrent(IPackageVersionModel current) { return current.Version == Version && current.Id == Id; } } }
apache-2.0
C#
eba903ab83b28c5e668517259514829fd0658dd9
change registration in database seeder to be all singleton
zmira/abremir.AllMyBricks
abremir.AllMyBricks.DatabaseSeeder/Configuration/IoC.cs
abremir.AllMyBricks.DatabaseSeeder/Configuration/IoC.cs
using abremir.AllMyBricks.DatabaseSeeder.Loggers; using abremir.AllMyBricks.DatabaseSeeder.Services; using abremir.AllMyBricks.Device.Interfaces; using Easy.MessageHub; using SimpleInjector; using System.Reflection; namespace abremir.AllMyBricks.DatabaseSeeder.Configuration { public static class IoC { public static Container IoCContainer { get; private set; } public static void Configure() { IoCContainer = new Container(); DataSynchronizer.Configuration.IoC.Configure(IoCContainer); ThirdParty.Brickset.Configuration.IoC.Configure(IoCContainer); Data.Configuration.IoC.Configure(IoCContainer); AssetManagement.Configuration.IoC.Configure(IoCContainer); UserManagement.Configuration.IoC.Configure(IoCContainer); IoCContainer.Register<IPreferencesService, PreferencesService>(Lifestyle.Singleton); IoCContainer.Register<ISecureStorageService, SecureStorageService>(Lifestyle.Singleton); IoCContainer.Register<IDeviceInformationService, DeviceInformationService>(Lifestyle.Singleton); IoCContainer.Register<IFileSystemService, FileSystemService>(Lifestyle.Singleton); IoCContainer.Register<IAssetManagementService, AssetManagementService>(Lifestyle.Singleton); IoCContainer.Register<IMessageHub, MessageHub>(Lifestyle.Singleton); IoCContainer.Register(() => Logging.Factory, Lifestyle.Singleton); IoCContainer.Collection.Register<IDatabaseSeederLogger>(Assembly.GetExecutingAssembly()); Onboarding.Configuration.FlurlConfiguration.Configure(); } public static void ConfigureOnboarding(string allMyBricksOnboardingUrl) { Onboarding.Configuration.IoC.Configure(allMyBricksOnboardingUrl, IoCContainer); } public static void ReplaceOnboarding(string allMyBricksOnboardingUrl) { IoCContainer.Options.AllowOverridingRegistrations = true; ConfigureOnboarding(allMyBricksOnboardingUrl); IoCContainer.Options.AllowOverridingRegistrations = false; } } }
using abremir.AllMyBricks.DatabaseSeeder.Loggers; using abremir.AllMyBricks.DatabaseSeeder.Services; using abremir.AllMyBricks.Device.Interfaces; using Easy.MessageHub; using SimpleInjector; using System.Reflection; namespace abremir.AllMyBricks.DatabaseSeeder.Configuration { public static class IoC { public static Container IoCContainer { get; private set; } public static void Configure() { IoCContainer = new Container(); DataSynchronizer.Configuration.IoC.Configure(IoCContainer); ThirdParty.Brickset.Configuration.IoC.Configure(IoCContainer); Data.Configuration.IoC.Configure(IoCContainer); AssetManagement.Configuration.IoC.Configure(IoCContainer); UserManagement.Configuration.IoC.Configure(IoCContainer); IoCContainer.Register<IPreferencesService, PreferencesService>(Lifestyle.Transient); IoCContainer.Register<ISecureStorageService, SecureStorageService>(Lifestyle.Transient); IoCContainer.Register<IDeviceInformationService, DeviceInformationService>(Lifestyle.Transient); IoCContainer.Register<IFileSystemService, FileSystemService>(Lifestyle.Transient); IoCContainer.Register<IAssetManagementService, AssetManagementService>(Lifestyle.Transient); IoCContainer.Register<IMessageHub, MessageHub>(Lifestyle.Singleton); IoCContainer.Register(() => Logging.Factory, Lifestyle.Singleton); IoCContainer.Collection.Register<IDatabaseSeederLogger>(Assembly.GetExecutingAssembly()); Onboarding.Configuration.FlurlConfiguration.Configure(); } public static void ConfigureOnboarding(string allMyBricksOnboardingUrl) { Onboarding.Configuration.IoC.Configure(allMyBricksOnboardingUrl, IoCContainer); } public static void ReplaceOnboarding(string allMyBricksOnboardingUrl) { IoCContainer.Options.AllowOverridingRegistrations = true; ConfigureOnboarding(allMyBricksOnboardingUrl); IoCContainer.Options.AllowOverridingRegistrations = false; } } }
mit
C#
75c1e5fa755f3d95b3f0484f9de99c0c839a8897
Add @ flag for I18n String
Deliay/osuSync,Deliay/Sync
OtherPlugins/RecentlyUserQuery/DefaultLanguage.cs
OtherPlugins/RecentlyUserQuery/DefaultLanguage.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Sync.Tools; namespace RecentlyUserQuery { public class DefaultLanguage:I18nProvider { public static LanguageElement LANG_HELP = @"\n以下指令cmd端和osu!irc端规则通用(在osu!irc端用请在开头加""?"")\nrecently --status |获取当前消息记录器的状态信息(osu!irc不可用)\nrecently --u <userName> |获取用户<userName>的历史消息(不建议在osu!irc用)\nrecently --i <userId> |获取用户<userId>的历史消息(不建议在osu!irc用)\nrecently |获取近期用户的名字和id,id可以用来执行""?ban --i""等指令(osu!irc适用)\nrecently --disable |关闭记录器所有功能并清除数据(osu!irc适用)\nrecently --start |重新开始记录(osu!irc适用)\nrecently --realloc <count> |重新分配记录器储存记录的容量(osu!irc适用)\nrecently --recently |获取近期用户和id\n"; public static LanguageElement LANG_MSG_STATUS = "MessageRecord status: {0} | recordCount/Capacity : {1}/{2}"; public static LanguageElement LANG_RUNNING = "running"; public static LanguageElement LANG_STOP = "stopped"; public static LanguageElement LANG_MSG_DISABLE = "消息记录器已禁用,数据已清除"; public static LanguageElement LANG_MSG_START = "消息记录器开启"; public static LanguageElement LANG_MSG_REALLOC_ERR = "MessageRecord: 错误的指令"; public static LanguageElement LANG_MSG_REALLOC = "消息记录器现在可记录 {0} 条历史记录"; public static LanguageElement LANG_MSG_NOTIMPLENT = "咕咕咕~"; public static LanguageElement LANG_MSG_UNKNOWNCOMMAND = "未知命令"; } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Sync.Tools; namespace RecentlyUserQuery { public class DefaultLanguage:I18nProvider { public static LanguageElement LANG_HELP = "\n以下指令cmd端和osu!irc端规则通用(在osu!irc端用请在开头加\"?\")\nrecently --status |获取当前消息记录器的状态信息(osu!irc不可用)\nrecently --u <userName> |获取用户<userName>的历史消息(不建议在osu!irc用)\nrecently --i <userId> |获取用户<userId>的历史消息(不建议在osu!irc用)\nrecently |获取近期用户的名字和id,id可以用来执行\"?ban --i\"等指令(osu!irc适用)\nrecently --disable |关闭记录器所有功能并清除数据(osu!irc适用)\nrecently --start |重新开始记录(osu!irc适用)\nrecently --realloc <count> |重新分配记录器储存记录的容量(osu!irc适用)\nrecently --recently |获取近期用户和id\n"; public static LanguageElement LANG_MSG_STATUS = "MessageRecord status: {0} | recordCount/Capacity : {1}/{2}"; public static LanguageElement LANG_RUNNING = "running"; public static LanguageElement LANG_STOP = "stopped"; public static LanguageElement LANG_MSG_DISABLE = "消息记录器已禁用,数据已清除"; public static LanguageElement LANG_MSG_START = "消息记录器开启"; public static LanguageElement LANG_MSG_REALLOC_ERR = "MessageRecord: 错误的指令"; public static LanguageElement LANG_MSG_REALLOC = "消息记录器现在可记录 {0} 条历史记录"; public static LanguageElement LANG_MSG_NOTIMPLENT = "咕咕咕~"; public static LanguageElement LANG_MSG_UNKNOWNCOMMAND = "未知命令"; } }
mit
C#
d8c51e555d4ee9525ee74e285ebc6eb0f463d754
Remove unused timer
mmoening/MatterControl,unlimitedbacon/MatterControl,unlimitedbacon/MatterControl,mmoening/MatterControl,jlewin/MatterControl,jlewin/MatterControl,jlewin/MatterControl,larsbrubaker/MatterControl,jlewin/MatterControl,larsbrubaker/MatterControl,larsbrubaker/MatterControl,larsbrubaker/MatterControl,mmoening/MatterControl,unlimitedbacon/MatterControl,unlimitedbacon/MatterControl
PartPreviewWindow/View3D/SliceProgressReporter.cs
PartPreviewWindow/View3D/SliceProgressReporter.cs
/* Copyright (c) 2017, Lars Brubaker, John Lewin 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. 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 OWNER 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. The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of the FreeBSD Project. */ using System; using System.Diagnostics; using MatterHackers.GCodeVisualizer; using MatterHackers.Agg; namespace MatterHackers.MatterControl.PartPreviewWindow { public class SliceProgressReporter : IProgress<ProgressStatus> { private double currentValue = 0; private double destValue = 10; private IProgress<ProgressStatus> parentProgress; private PrinterConfig printer; public SliceProgressReporter(IProgress<ProgressStatus> progressStatus, PrinterConfig printer) { this.parentProgress = progressStatus; this.printer = printer; } public void Report(ProgressStatus progressStatus) { string statusText = progressStatus.Status; if (GCodeFile.GetFirstNumberAfter("", statusText, ref currentValue) && GCodeFile.GetFirstNumberAfter("/", statusText, ref destValue)) { if (destValue == 0) { destValue = 1; } progressStatus.Status = progressStatus.Status.TrimEnd('.'); progressStatus.Progress0To1 = currentValue / destValue; } else { printer.Connection.TerminalLog.WriteLine(statusText); } parentProgress.Report(progressStatus); } } }
/* Copyright (c) 2017, Lars Brubaker, John Lewin 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. 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 OWNER 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. The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of the FreeBSD Project. */ using System; using System.Diagnostics; using MatterHackers.GCodeVisualizer; using MatterHackers.Agg; namespace MatterHackers.MatterControl.PartPreviewWindow { public class SliceProgressReporter : IProgress<ProgressStatus> { private double currentValue = 0; private double destValue = 10; private IProgress<ProgressStatus> parentProgress; private PrinterConfig printer; private Stopwatch timer = Stopwatch.StartNew(); public SliceProgressReporter(IProgress<ProgressStatus> progressStatus, PrinterConfig printer) { this.parentProgress = progressStatus; this.printer = printer; } public void Report(ProgressStatus progressStatus) { string statusText = progressStatus.Status; if (GCodeFile.GetFirstNumberAfter("", statusText, ref currentValue) && GCodeFile.GetFirstNumberAfter("/", statusText, ref destValue)) { if (destValue == 0) { destValue = 1; } timer.Restart(); progressStatus.Status = progressStatus.Status.TrimEnd('.'); progressStatus.Progress0To1 = currentValue / destValue; } else { printer.Connection.TerminalLog.WriteLine(statusText); } parentProgress.Report(progressStatus); } } }
bsd-2-clause
C#
b0e80f84b82fb2357ca96d015620ae174540877d
Update LevelGrading.cs
afroraydude/First_Unity_Game,afroraydude/First_Unity_Game,afroraydude/First_Unity_Game
Real_Game/Assets/Scripts/LevelGrading.cs
Real_Game/Assets/Scripts/LevelGrading.cs
using UnityEngine; using System.Collections; public class LevelGrading : MonoBehaviour { public float finalScore; // This is the final score you recieve public string finalScoreLetter; // public float[] timeGrading = new float[5]; // 5 for the 5 grades (A, B, C D, F) public int[] deathGrading = new int[5]; // 5 for the 5 grades (A, B, C D, F) public string timeGradingLetter; public string deathGradingLetter; void Start() { } void Update() { //Probably would be empty } void OnGUI() { // I might want to do the GUI } void GradeTime() { } void GradeDeaths() { } void GradeFinal () { } }
using UnityEngine; using System.Collections; public class LevelGrading : MonoBehaviour { public float finalScore; // This is the final score you recieve public string finalScoreLetter; // public float[] timeGrading = new float[5]; // 5 for the 5 grades (A, B, C D, F) public int[] deathGrading = new int[5]; // 5 for the 5 grades (A, B, C D, F) void Start() { } void Update() { //Probably would be empty } void OnGUI() { // I might want to do the GUI } }
mit
C#
0379323dbcc985ad7f993d6d72edb712611dcd00
Fix switched TCP/UDP values.
ZigMeowNyan/RuleOfFirewall
RuleOfFirewall/Enums/ProtocolTypeEnum.cs
RuleOfFirewall/Enums/ProtocolTypeEnum.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace RuleOfFirewall.Enums { public enum ProtocolTypeEnum { TCP = 6, UDP = 17, Any = 256, } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace RuleOfFirewall.Enums { public enum ProtocolTypeEnum { UDP = 6, TCP = 17, Any = 256, } }
mit
C#
3d1507a7b3949f58e89e5c9f0f891c8a178263f0
Fix multiple dispose check problem
YoshihiroIto/Anne
Anne.Foundation/Mvvm/ViewModelBase.cs
Anne.Foundation/Mvvm/ViewModelBase.cs
using Livet; namespace Anne.Foundation.Mvvm { public class ViewModelBase : ViewModel { public ViewModelBase() { DisposableChecker.Add(this); } protected override void Dispose(bool disposing) { if (disposing) DisposableChecker.Remove(this); base.Dispose(disposing); } } }
using Livet; namespace Anne.Foundation.Mvvm { public class ViewModelBase : ViewModel { public ViewModelBase() { DisposableChecker.Add(this); } protected override void Dispose(bool disposing) { DisposableChecker.Remove(this); base.Dispose(disposing); } } }
mit
C#
b6860d81f16ab39723c0132db9c8a7afaa9310b0
Fix CF.
nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet
WalletWasabi/CoinJoin/Client/Clients/BobClient.cs
WalletWasabi/CoinJoin/Client/Clients/BobClient.cs
using System.Net; using System.Net.Http; using System.Threading.Tasks; using WalletWasabi.CoinJoin.Common.Models; using WalletWasabi.Helpers; using WalletWasabi.Tor.Http; using WalletWasabi.Tor.Http.Extensions; using WalletWasabi.WebClients.Wasabi; namespace WalletWasabi.CoinJoin.Client.Clients { public class BobClient { public BobClient(IHttpClient httpClient) { HttpClient = httpClient; } private IHttpClient HttpClient { get; } /// <returns>If the phase is still in OutputRegistration.</returns> public async Task<bool> PostOutputAsync(long roundId, ActiveOutput activeOutput) { Guard.MinimumAndNotNull(nameof(roundId), roundId, 0); Guard.NotNull(nameof(activeOutput), activeOutput); var request = new OutputRequest { OutputAddress = activeOutput.Address, UnblindedSignature = activeOutput.Signature, Level = activeOutput.MixingLevel }; using var response = await HttpClient.SendAsync(HttpMethod.Post, $"/api/v{WasabiClient.ApiVersion}/btc/chaumiancoinjoin/output?roundId={roundId}", request.ToHttpStringContent()).ConfigureAwait(false); if (response.StatusCode == HttpStatusCode.Conflict) { return false; } else if (response.StatusCode != HttpStatusCode.NoContent) { await response.ThrowRequestExceptionFromContentAsync().ConfigureAwait(false); } return true; } } }
using System.Net; using System.Net.Http; using System.Threading.Tasks; using WalletWasabi.CoinJoin.Common.Models; using WalletWasabi.Helpers; using WalletWasabi.Tor.Http; using WalletWasabi.Tor.Http.Extensions; using WalletWasabi.WebClients.Wasabi; namespace WalletWasabi.CoinJoin.Client.Clients { public class BobClient { /// <inheritdoc/> public BobClient(IHttpClient httpClient) { HttpClient = httpClient; } private IHttpClient HttpClient { get; } /// <returns>If the phase is still in OutputRegistration.</returns> public async Task<bool> PostOutputAsync(long roundId, ActiveOutput activeOutput) { Guard.MinimumAndNotNull(nameof(roundId), roundId, 0); Guard.NotNull(nameof(activeOutput), activeOutput); var request = new OutputRequest { OutputAddress = activeOutput.Address, UnblindedSignature = activeOutput.Signature, Level = activeOutput.MixingLevel }; using var response = await HttpClient.SendAsync(HttpMethod.Post, $"/api/v{WasabiClient.ApiVersion}/btc/chaumiancoinjoin/output?roundId={roundId}", request.ToHttpStringContent()).ConfigureAwait(false); if (response.StatusCode == HttpStatusCode.Conflict) { return false; } else if (response.StatusCode != HttpStatusCode.NoContent) { await response.ThrowRequestExceptionFromContentAsync().ConfigureAwait(false); } return true; } } }
mit
C#
db2ef487b1103d6fed03ba838f867558ae6fa385
Set access for SimpleTypesPredicate
llewelynrex/UsefulDataTools
src/DataOutputExtensions/DataOutputExtensions.cs
src/DataOutputExtensions/DataOutputExtensions.cs
using System; using System.Reflection; namespace UsefulDataTools { public static class DataOutputExtensions { private static readonly Func<Type, bool> SimpleTypesPredicate; static DataOutputExtensions() { SimpleTypesPredicate = t => t == typeof (byte) || t == typeof (sbyte) || t == typeof (int) || t == typeof (uint) || t == typeof (short) || t == typeof (ushort) || t == typeof (long) || t == typeof (ulong) || t == typeof (float) || t == typeof (double) || t == typeof (decimal) || t == typeof (bool) || t == typeof (char) || t == typeof (DateTime) || t == typeof (string) || t.GetTypeInfo().BaseType == typeof (Enum); } public static bool IsSimpleType<T>(this T type) where T : Type { if (type.Name == "Nullable`1") return SimpleTypesPredicate(Nullable.GetUnderlyingType(type)); return SimpleTypesPredicate(type); } public static bool IsSimpleType(Type type) { return type.IsSimpleType(); } } }
using System; using System.Reflection; namespace UsefulDataTools { public static class DataOutputExtensions { internal static readonly Func<Type, bool> SimpleTypesPredicate; static DataOutputExtensions() { SimpleTypesPredicate = t => t == typeof (byte) || t == typeof (sbyte) || t == typeof (int) || t == typeof (uint) || t == typeof (short) || t == typeof (ushort) || t == typeof (long) || t == typeof (ulong) || t == typeof (float) || t == typeof (double) || t == typeof (decimal) || t == typeof (bool) || t == typeof (char) || t == typeof (DateTime) || t == typeof (string) || t.GetTypeInfo().BaseType == typeof (Enum); } public static bool IsSimpleType<T>(this T type) where T : Type { if (type.Name == "Nullable`1") return SimpleTypesPredicate(Nullable.GetUnderlyingType(type)); return SimpleTypesPredicate(type); } public static bool IsSimpleType(Type type) { return type.IsSimpleType(); } } }
mit
C#
eb1fc0efb147df3b13aa4f68b18d4603c6d0fd35
Fix offset samples for GetData
setchi/NoteEditor,setchi/NotesEditor
Assets/Scripts/UI/WaveformRenderer.cs
Assets/Scripts/UI/WaveformRenderer.cs
using System.Linq; using UniRx; using UniRx.Triggers; using UnityEngine; public class WaveformRenderer : MonoBehaviour { [SerializeField] Color color; void Awake() { var model = NotesEditorModel.Instance; var waveData = new float[500000]; var skipSamples = 50; var lines = Enumerable.Range(0, waveData.Length / skipSamples) .Select(_ => new Line(Vector3.zero, Vector3.zero, color)) .ToArray(); this.LateUpdateAsObservable() .Where(_ => model.WaveformDisplayEnabled.Value) .SkipWhile(_ => model.Audio.clip == null) .Subscribe(_ => { var timeSamples = Mathf.Min(model.Audio.timeSamples, model.Audio.clip.samples - 1); model.Audio.clip.GetData(waveData, timeSamples); var x = (model.CanvasWidth.Value / model.Audio.clip.samples) / 2f; var offsetX = model.CanvasOffsetX.Value; var offsetY = 200; for (int li = 0, wi = skipSamples / 2, l = waveData.Length; wi < l; li++, wi += skipSamples) { lines[li].start.x = lines[li].end.x = wi * x + offsetX; lines[li].end.y = waveData[wi] * 45 - offsetY; lines[li].start.y = waveData[wi - skipSamples / 2] * 45 - offsetY; } GLLineRenderer.RenderLines("waveform", lines); }); } }
using System.Linq; using UniRx; using UniRx.Triggers; using UnityEngine; public class WaveformRenderer : MonoBehaviour { [SerializeField] Color color; void Awake() { var model = NotesEditorModel.Instance; var waveData = new float[500000]; var skipSamples = 50; var lines = Enumerable.Range(0, waveData.Length / skipSamples) .Select(_ => new Line(Vector3.zero, Vector3.zero, color)) .ToArray(); this.LateUpdateAsObservable() .Where(_ => model.WaveformDisplayEnabled.Value) .SkipWhile(_ => model.Audio.clip == null) .Subscribe(_ => { model.Audio.clip.GetData(waveData, model.Audio.timeSamples); var x = (model.CanvasWidth.Value / model.Audio.clip.samples) / 2f; var offsetX = model.CanvasOffsetX.Value; var offsetY = 200; for (int li = 0, wi = skipSamples / 2, l = waveData.Length; wi < l; li++, wi += skipSamples) { lines[li].start.x = lines[li].end.x = wi * x + offsetX; lines[li].end.y = waveData[wi] * 45 - offsetY; lines[li].start.y = waveData[wi - skipSamples / 2] * 45 - offsetY; } GLLineRenderer.RenderLines("waveform", lines); }); } }
mit
C#
dc75629506b0881f58dcb15b5cef212608408724
Fix UI scale; add Canvas property
DMagic1/KSP_Contract_Window
Source/ContractsWindow.Unity/Interfaces/ICW_Window.cs
Source/ContractsWindow.Unity/Interfaces/ICW_Window.cs
using System; using System.Collections.Generic; using ContractsWindow.Unity.Unity; using UnityEngine; using UnityEngine.UI; namespace ContractsWindow.Unity.Interfaces { public interface ICW_Window { bool HideTooltips { get; set; } bool BlizzyAvailable { get; } bool StockToolbar { get; set; } bool ReplaceToolbar { get; set; } bool LargeFont { get; set; } bool IgnoreScale { get; set; } float Scale { get; set; } float MasterScale { get; } string Version { get; } Canvas MainCanvas { get; } IList<IMissionSection> GetMissions { get; } IMissionSection GetCurrentMission { get; } void Rebuild(); void NewMission(string title, Guid id); void SetWindowPosition(Rect r); } }
using System; using System.Collections.Generic; using ContractsWindow.Unity.Unity; using UnityEngine; using UnityEngine.UI; namespace ContractsWindow.Unity.Interfaces { public interface ICW_Window { bool HideTooltips { get; set; } bool BlizzyAvailable { get; } bool StockToolbar { get; set; } bool ReplaceToolbar { get; set; } bool LargeFont { get; set; } bool IgnoreScale { get; set; } float Scale { get; set; } float MasterScale { get; set; } string Version { get; } IList<IMissionSection> GetMissions { get; } IMissionSection GetCurrentMission { get; } void Rebuild(); void NewMission(string title, Guid id); void SetWindowPosition(Rect r); } }
mit
C#
2703bd1f631f1b419fb8c43c6e373a7a79f899ec
Fix entity type enumeration to be complete and have the right values.
bleroy/minecraft.client,Petermarcu/minecraft.client
Decent.Minecraft.Client/EntityType.cs
Decent.Minecraft.Client/EntityType.cs
namespace Decent.Minecraft.Client { /// <summary> /// Minecraft entity types. /// The byte values correspond to actual Minecraft entity IDs. /// <a href="http://minecraft.gamepedia.com/Data_values/Entity_IDs">Gamepedia link</a>. /// </summary> public enum EntityType : byte { Item = 1, XPOrb, AreaEffectCloud, ElderGuardian, WitherSkeleton, Stray, Egg, LeashKnot, Painting, Arrow, Snowball, Fireball, SmallFireball, EnderPearl, EyeOfEnder, Potion, XPBottle, ItemFrame, WitherSkull, PrimedTnt, FallingBlock, FireworksRocket, Husk, SpectralArrow, ShulkerBullet, DragonFireball, ZombieVillager, SkeletonHorse, ZombieHorse, ArmorStand, Donkey, Mule, EvocationFangs, Evoker, Vex, Vindicator, MinecartWithCommandBlock = 40, Boat, Minecart, MinecartWithChest, MinecartWithFurnace, MinecartWithTNT, MinecartWithHopper, MinecartWithSpawner, Human = 49, Creeper, Skeleton, Spider, Giant, Zombie, Slime, Ghast, ZombiePigman, Enderman, CaveSpider, Silverfish, Blaze, MagmaCube, EnderDragon, Wither, Bat, Witch, Endermite, Guardian, Shulker, Pig = 90, Sheep, Cow, Chicken, Squid, Wolf, Mooshroom, SnowGolem, Ocelot, IronGolem, Horse, Rabbit, PolarBear, Llama, Villager = 120, EnderCrystal = 200, ThePlayer = 255 // This one actually isn't defined on the Minecraft side. } }
namespace Decent.Minecraft.Client { public enum EntityType : byte { Item, XPOrb, LeashKnot, Painting, Arrow, Snowball, Fireball, SmallFireball, ThrownEnderpearl, EyeOfEnderSignal, ThrownPotion, ThrownExpBottle, ItemFrame, WitherSkull, PrimedTnt, FallingSand, FireworksRocketEntity, ArmorStand, Boat, MinecartRideable, MinecartChest, MinecartFurnace, MinecartTNT, MinecartHopper, MinecartSpawner, MinecartCommandBlock, Mob, Monster, Creeper, Skeleton, Spider, Giant, Zombie, Slime, Ghast, PigZombie, Enderman, CaveSpider, Silverfish, Blaze, LavaSlime, EnderDragon, WitherBoss, Bat, Witch, Endermite, Guardian, Pig, Sheep, Cow, Chicken, Squid, Wolf, MushroomCow, SnowMan, Ozelot, VillagerGolem, EntityHorse, Rabbit, Villager, EnderCrystal, ThePlayer } }
mit
C#
1ab5cc9d862c3893ccb5daf92425e6ca08239147
Apply CR
r22016/azure-sdk-for-net,DheerendraRathor/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,pomortaz/azure-sdk-for-net,mihymel/azure-sdk-for-net,yugangw-msft/azure-sdk-for-net,zaevans/azure-sdk-for-net,avijitgupta/azure-sdk-for-net,Nilambari/azure-sdk-for-net,samtoubia/azure-sdk-for-net,Nilambari/azure-sdk-for-net,rohmano/azure-sdk-for-net,alextolp/azure-sdk-for-net,samtoubia/azure-sdk-for-net,mabsimms/azure-sdk-for-net,JasonYang-MSFT/azure-sdk-for-net,vivsriaus/azure-sdk-for-net,kagamsft/azure-sdk-for-net,marcoippel/azure-sdk-for-net,nemanja88/azure-sdk-for-net,yadavbdev/azure-sdk-for-net,nemanja88/azure-sdk-for-net,pinwang81/azure-sdk-for-net,gubookgu/azure-sdk-for-net,avijitgupta/azure-sdk-for-net,ailn/azure-sdk-for-net,relmer/azure-sdk-for-net,oburlacu/azure-sdk-for-net,Yahnoosh/azure-sdk-for-net,AzCiS/azure-sdk-for-net,dasha91/azure-sdk-for-net,tpeplow/azure-sdk-for-net,kagamsft/azure-sdk-for-net,bgold09/azure-sdk-for-net,jasper-schneider/azure-sdk-for-net,dominiqa/azure-sdk-for-net,makhdumi/azure-sdk-for-net,oaastest/azure-sdk-for-net,tonytang-microsoft-com/azure-sdk-for-net,MabOneSdk/azure-sdk-for-net,AuxMon/azure-sdk-for-net,relmer/azure-sdk-for-net,divyakgupta/azure-sdk-for-net,jtlibing/azure-sdk-for-net,pinwang81/azure-sdk-for-net,ogail/azure-sdk-for-net,zaevans/azure-sdk-for-net,akromm/azure-sdk-for-net,felixcho-msft/azure-sdk-for-net,djyou/azure-sdk-for-net,AuxMon/azure-sdk-for-net,shuainie/azure-sdk-for-net,yoavrubin/azure-sdk-for-net,yoavrubin/azure-sdk-for-net,yoavrubin/azure-sdk-for-net,ahosnyms/azure-sdk-for-net,naveedaz/azure-sdk-for-net,naveedaz/azure-sdk-for-net,olydis/azure-sdk-for-net,mabsimms/azure-sdk-for-net,jamestao/azure-sdk-for-net,dominiqa/azure-sdk-for-net,shuainie/azure-sdk-for-net,hyonholee/azure-sdk-for-net,shahabhijeet/azure-sdk-for-net,atpham256/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,makhdumi/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,jhendrixMSFT/azure-sdk-for-net,oaastest/azure-sdk-for-net,ahosnyms/azure-sdk-for-net,MichaelCommo/azure-sdk-for-net,atpham256/azure-sdk-for-net,dasha91/azure-sdk-for-net,MichaelCommo/azure-sdk-for-net,yoreddy/azure-sdk-for-net,pilor/azure-sdk-for-net,nathannfan/azure-sdk-for-net,tpeplow/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,begoldsm/azure-sdk-for-net,olydis/azure-sdk-for-net,peshen/azure-sdk-for-net,smithab/azure-sdk-for-net,shutchings/azure-sdk-for-net,yaakoviyun/azure-sdk-for-net,SiddharthChatrolaMs/azure-sdk-for-net,hovsepm/azure-sdk-for-net,xindzhan/azure-sdk-for-net,hyonholee/azure-sdk-for-net,pilor/azure-sdk-for-net,nemanja88/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,yaakoviyun/azure-sdk-for-net,msfcolombo/azure-sdk-for-net,lygasch/azure-sdk-for-net,arijitt/azure-sdk-for-net,hovsepm/azure-sdk-for-net,xindzhan/azure-sdk-for-net,oaastest/azure-sdk-for-net,SpotLabsNET/azure-sdk-for-net,Matt-Westphal/azure-sdk-for-net,Matt-Westphal/azure-sdk-for-net,nathannfan/azure-sdk-for-net,nathannfan/azure-sdk-for-net,shuagarw/azure-sdk-for-net,peshen/azure-sdk-for-net,lygasch/azure-sdk-for-net,shipram/azure-sdk-for-net,yugangw-msft/azure-sdk-for-net,shutchings/azure-sdk-for-net,shahabhijeet/azure-sdk-for-net,enavro/azure-sdk-for-net,ScottHolden/azure-sdk-for-net,r22016/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,ScottHolden/azure-sdk-for-net,MabOneSdk/azure-sdk-for-net,akromm/azure-sdk-for-net,SiddharthChatrolaMs/azure-sdk-for-net,olydis/azure-sdk-for-net,robertla/azure-sdk-for-net,shipram/azure-sdk-for-net,Yahnoosh/azure-sdk-for-net,vladca/azure-sdk-for-net,yitao-zhang/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,Yahnoosh/azure-sdk-for-net,felixcho-msft/azure-sdk-for-net,smithab/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,relmer/azure-sdk-for-net,divyakgupta/azure-sdk-for-net,naveedaz/azure-sdk-for-net,arijitt/azure-sdk-for-net,stankovski/azure-sdk-for-net,namratab/azure-sdk-for-net,vivsriaus/azure-sdk-for-net,samtoubia/azure-sdk-for-net,smithab/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,hallihan/azure-sdk-for-net,nacaspi/azure-sdk-for-net,rohmano/azure-sdk-for-net,AzCiS/azure-sdk-for-net,pattipaka/azure-sdk-for-net,vhamine/azure-sdk-for-net,djyou/azure-sdk-for-net,herveyw/azure-sdk-for-net,marcoippel/azure-sdk-for-net,travismc1/azure-sdk-for-net,pilor/azure-sdk-for-net,lygasch/azure-sdk-for-net,abhing/azure-sdk-for-net,robertla/azure-sdk-for-net,namratab/azure-sdk-for-net,xindzhan/azure-sdk-for-net,juvchan/azure-sdk-for-net,begoldsm/azure-sdk-for-net,msfcolombo/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,DheerendraRathor/azure-sdk-for-net,jhendrixMSFT/azure-sdk-for-net,Nilambari/azure-sdk-for-net,cwickham3/azure-sdk-for-net,kagamsft/azure-sdk-for-net,jianghaolu/azure-sdk-for-net,pinwang81/azure-sdk-for-net,mihymel/azure-sdk-for-net,jtlibing/azure-sdk-for-net,guiling/azure-sdk-for-net,jhendrixMSFT/azure-sdk-for-net,amarzavery/azure-sdk-for-net,hovsepm/azure-sdk-for-net,jtlibing/azure-sdk-for-net,enavro/azure-sdk-for-net,AzureAutomationTeam/azure-sdk-for-net,SpotLabsNET/azure-sdk-for-net,mabsimms/azure-sdk-for-net,oburlacu/azure-sdk-for-net,yoreddy/azure-sdk-for-net,pankajsn/azure-sdk-for-net,JasonYang-MSFT/azure-sdk-for-net,amarzavery/azure-sdk-for-net,JasonYang-MSFT/azure-sdk-for-net,scottrille/azure-sdk-for-net,ailn/azure-sdk-for-net,cwickham3/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,gubookgu/azure-sdk-for-net,yadavbdev/azure-sdk-for-net,guiling/azure-sdk-for-net,yugangw-msft/azure-sdk-for-net,shutchings/azure-sdk-for-net,pattipaka/azure-sdk-for-net,markcowl/azure-sdk-for-net,ailn/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,hyonholee/azure-sdk-for-net,guiling/azure-sdk-for-net,felixcho-msft/azure-sdk-for-net,DeepakRajendranMsft/azure-sdk-for-net,namratab/azure-sdk-for-net,shipram/azure-sdk-for-net,btasdoven/azure-sdk-for-net,hyonholee/azure-sdk-for-net,marcoippel/azure-sdk-for-net,AuxMon/azure-sdk-for-net,tonytang-microsoft-com/azure-sdk-for-net,djoelz/azure-sdk-for-net,bgold09/azure-sdk-for-net,SpotLabsNET/azure-sdk-for-net,vladca/azure-sdk-for-net,herveyw/azure-sdk-for-net,pankajsn/azure-sdk-for-net,DheerendraRathor/azure-sdk-for-net,jasper-schneider/azure-sdk-for-net,tpeplow/azure-sdk-for-net,ogail/azure-sdk-for-net,stankovski/azure-sdk-for-net,r22016/azure-sdk-for-net,djoelz/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,ogail/azure-sdk-for-net,yadavbdev/azure-sdk-for-net,juvchan/azure-sdk-for-net,atpham256/azure-sdk-for-net,abhing/azure-sdk-for-net,pattipaka/azure-sdk-for-net,scottrille/azure-sdk-for-net,amarzavery/azure-sdk-for-net,DeepakRajendranMsft/azure-sdk-for-net,SiddharthChatrolaMs/azure-sdk-for-net,mihymel/azure-sdk-for-net,jamestao/azure-sdk-for-net,akromm/azure-sdk-for-net,peshen/azure-sdk-for-net,enavro/azure-sdk-for-net,shahabhijeet/azure-sdk-for-net,scottrille/azure-sdk-for-net,rohmano/azure-sdk-for-net,mumou/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,gubookgu/azure-sdk-for-net,pomortaz/azure-sdk-for-net,robertla/azure-sdk-for-net,btasdoven/azure-sdk-for-net,MichaelCommo/azure-sdk-for-net,jasper-schneider/azure-sdk-for-net,vivsriaus/azure-sdk-for-net,shixiaoyu/azure-sdk-for-net,tonytang-microsoft-com/azure-sdk-for-net,dominiqa/azure-sdk-for-net,pankajsn/azure-sdk-for-net,shuagarw/azure-sdk-for-net,cwickham3/azure-sdk-for-net,yoreddy/azure-sdk-for-net,jamestao/azure-sdk-for-net,btasdoven/azure-sdk-for-net,yitao-zhang/azure-sdk-for-net,shahabhijeet/azure-sdk-for-net,oburlacu/azure-sdk-for-net,AzCiS/azure-sdk-for-net,alextolp/azure-sdk-for-net,MabOneSdk/azure-sdk-for-net,samtoubia/azure-sdk-for-net,pomortaz/azure-sdk-for-net,juvchan/azure-sdk-for-net,dasha91/azure-sdk-for-net,msfcolombo/azure-sdk-for-net,DeepakRajendranMsft/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,Matt-Westphal/azure-sdk-for-net,avijitgupta/azure-sdk-for-net,vladca/azure-sdk-for-net,abhing/azure-sdk-for-net,bgold09/azure-sdk-for-net,yitao-zhang/azure-sdk-for-net,AzureAutomationTeam/azure-sdk-for-net,mumou/azure-sdk-for-net,shuagarw/azure-sdk-for-net,yaakoviyun/azure-sdk-for-net,hallihan/azure-sdk-for-net,AzureAutomationTeam/azure-sdk-for-net,makhdumi/azure-sdk-for-net,vhamine/azure-sdk-for-net,djyou/azure-sdk-for-net,zaevans/azure-sdk-for-net,jamestao/azure-sdk-for-net,nacaspi/azure-sdk-for-net,shixiaoyu/azure-sdk-for-net,divyakgupta/azure-sdk-for-net,begoldsm/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,ahosnyms/azure-sdk-for-net,ScottHolden/azure-sdk-for-net,herveyw/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,hyonholee/azure-sdk-for-net,alextolp/azure-sdk-for-net
src/WebSiteManagement/Properties/AssemblyInfo.cs
src/WebSiteManagement/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("Windows Azure Web Sites Management Library")] [assembly: AssemblyDescription("Provides management functionality for Windows Azure Web Sites.")] [assembly: AssemblyVersion("0.9.0.0")] [assembly: AssemblyFileVersion("0.9.0.0")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("Windows Azure .NET SDK")] [assembly: AssemblyCopyright("Copyright © 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("Windows Azure Web Sites Management Library")] [assembly: AssemblyDescription("Provides management functionality for Windows Azure Web Sites.")] [assembly: AssemblyVersion("0.9.0.0")] [assembly: AssemblyFileVersion("0.9.0.20130")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("Windows Azure .NET SDK")] [assembly: AssemblyCopyright("Copyright © Microsoft Corporation")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguage("en")]
mit
C#
a80a89da87027a8653e25701085438bf65510182
Destroy factory items when moving them to stockpile
knexer/TimeLoopIncremental
Assets/Scripts/Grid/GridOutput.cs
Assets/Scripts/Grid/GridOutput.cs
using System.Collections; using System.Collections.Generic; using UnityEngine; [RequireComponent(typeof(GridPositionComponent))] [RequireComponent(typeof(ResourceSink))] public class GridOutput : MonoBehaviour { private ResourceStorage ItemDestination; private ResourceSink ItemSource; // Use this for initialization void Start () { ItemDestination = GetComponentInParent<ResourceStorage>(); ItemSource = GetComponent<ResourceSink>(); ItemSource.DeliverItem = (item) => { Debug.Log(new System.Diagnostics.StackTrace()); Debug.Log(ItemDestination); Debug.Log(item); ItemDestination.AddResource(item.ResourceType, 1); Destroy(item.gameObject); return true; }; } // Update is called once per frame void Update () { } }
using System.Collections; using System.Collections.Generic; using UnityEngine; [RequireComponent(typeof(GridPositionComponent))] [RequireComponent(typeof(ResourceSink))] public class GridOutput : MonoBehaviour { private ResourceStorage ItemDestination; private ResourceSink ItemSource; // Use this for initialization void Start () { ItemDestination = GetComponentInParent<ResourceStorage>(); ItemSource = GetComponent<ResourceSink>(); ItemSource.DeliverItem = (item) => { Debug.Log(new System.Diagnostics.StackTrace()); Debug.Log(ItemDestination); Debug.Log(item); ItemDestination.AddResource(item.ResourceType, 1); // TODO destroy the in-game item return true; }; } // Update is called once per frame void Update () { } }
mit
C#
d54a212c232d1165bf18f0daecdf9ca787473807
Fix bug where test mode wouldn't launch
ethanmoffat/EndlessClient
EndlessClient/TestModeLauncher.cs
EndlessClient/TestModeLauncher.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 using EndlessClient.GameExecution; using EndlessClient.Rendering.Factories; using EOLib.IO.Repositories; namespace EndlessClient { //todo: move this to a different namespace public class TestModeLauncher : ITestModeLauncher { private readonly IEndlessGameProvider _endlessGameProvider; private readonly ICharacterRendererFactory _characterRendererFactory; private readonly IEIFFileProvider _eifFileProvider; private readonly IGameStateProvider _gameStateProvider; public TestModeLauncher(IEndlessGameProvider endlessGameProvider, ICharacterRendererFactory characterRendererFactory, IEIFFileProvider eifFileProvider, IGameStateProvider gameStateProvider) { _endlessGameProvider = endlessGameProvider; _characterRendererFactory = characterRendererFactory; _eifFileProvider = eifFileProvider; _gameStateProvider = gameStateProvider; } public void LaunchTestMode() { if (_gameStateProvider.CurrentState != GameStates.None) return; var testMode = new CharacterStateTest( _endlessGameProvider.Game, _characterRendererFactory, _eifFileProvider); _endlessGameProvider.Game.Components.Clear(); _endlessGameProvider.Game.Components.Add(testMode); } } public interface ITestModeLauncher { void LaunchTestMode(); } }
// Original Work Copyright (c) Ethan Moffat 2014-2016 // This file is subject to the GPL v2 License // For additional details, see the LICENSE file using EndlessClient.GameExecution; using EndlessClient.Rendering.Factories; using EOLib.IO.Repositories; namespace EndlessClient { //todo: move this to a different namespace public class TestModeLauncher : ITestModeLauncher { private readonly IEndlessGameProvider _endlessGameProvider; private readonly ICharacterRendererFactory _characterRendererFactory; private readonly IEIFFileProvider _eifFileProvider; private readonly IGameStateProvider _gameStateProvider; public TestModeLauncher(IEndlessGameProvider endlessGameProvider, ICharacterRendererFactory characterRendererFactory, IEIFFileProvider eifFileProvider, IGameStateProvider gameStateProvider) { _endlessGameProvider = endlessGameProvider; _characterRendererFactory = characterRendererFactory; _eifFileProvider = eifFileProvider; _gameStateProvider = gameStateProvider; } public void LaunchTestMode() { if (_gameStateProvider.CurrentState != GameStates.Initial) return; var testMode = new CharacterStateTest( _endlessGameProvider.Game, _characterRendererFactory, _eifFileProvider); _endlessGameProvider.Game.Components.Clear(); _endlessGameProvider.Game.Components.Add(testMode); } } public interface ITestModeLauncher { void LaunchTestMode(); } }
mit
C#
dd7b0ca45b76c99d28c0bc523cb2e8c1db6aec66
Bump Version
Coding-Enthusiast/Watch-Only-Bitcoin-Wallet
WatchOnlyBitcoinWallet/Properties/AssemblyInfo.cs
WatchOnlyBitcoinWallet/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("WatchOnlyBitcoinWallet")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Coding Enthusiast Coders")] [assembly: AssemblyProduct("WatchOnlyBitcoinWallet")] [assembly: AssemblyCopyright("Copyright © C.E. 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] //In order to begin building localizable applications, set //<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file //inside a <PropertyGroup>. For example, if you are using US english //in your source files, set the <UICulture> to en-US. Then uncomment //the NeutralResourceLanguage attribute below. Update the "en-US" in //the line below to match the UICulture setting in the project file. //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] [assembly: ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located //(used if a resource is not found in the page, // or application resource dictionaries) ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located //(used if a resource is not found in the page, // app, or any theme specific resource dictionaries) )] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("2.2.1.*")] [assembly: AssemblyFileVersion("2.2.1.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("WatchOnlyBitcoinWallet")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Coding Enthusiast Coders")] [assembly: AssemblyProduct("WatchOnlyBitcoinWallet")] [assembly: AssemblyCopyright("Copyright © C.E. 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] //In order to begin building localizable applications, set //<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file //inside a <PropertyGroup>. For example, if you are using US english //in your source files, set the <UICulture> to en-US. Then uncomment //the NeutralResourceLanguage attribute below. Update the "en-US" in //the line below to match the UICulture setting in the project file. //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] [assembly: ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located //(used if a resource is not found in the page, // or application resource dictionaries) ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located //(used if a resource is not found in the page, // app, or any theme specific resource dictionaries) )] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("2.2.0.*")] [assembly: AssemblyFileVersion("2.2.0.0")]
mit
C#
79a60a48ee91b0419529a6a687bacc250c8550c1
Store in Json property.
PenguinF/sandra-three
Sandra.UI.WF/Storage/JsonTokenizer.cs
Sandra.UI.WF/Storage/JsonTokenizer.cs
#region License /********************************************************************************* * JsonTokenizer.cs * * Copyright (c) 2004-2018 Henk Nicolai * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * *********************************************************************************/ #endregion using System; namespace Sandra.UI.WF.Storage { /// <summary> /// Based on https://www.json.org/. /// </summary> public sealed class JsonTokenizer { /// <summary> /// Gets the JSON which is tokenized. /// </summary> public string Json { get; } /// <summary> /// Initializes a new instance of <see cref="JsonTokenizer"/>. /// </summary> /// <param name="json"> /// The JSON to tokenize. /// </param> public JsonTokenizer(string json) { if (json == null) throw new ArgumentNullException(nameof(json)); Json = json; } } }
#region License /********************************************************************************* * JsonTokenizer.cs * * Copyright (c) 2004-2018 Henk Nicolai * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * *********************************************************************************/ #endregion using System; namespace Sandra.UI.WF.Storage { /// <summary> /// Based on https://www.json.org/. /// </summary> public sealed class JsonTokenizer { /// <summary> /// Gets the JSON which is tokenized. /// </summary> public string Json { get; } /// <summary> /// Initializes a new instance of <see cref="JsonTokenizer"/>. /// </summary> /// <param name="json"> /// The JSON to tokenize. /// </param> public JsonTokenizer(string json) { if (json == null) throw new ArgumentNullException(nameof(json)); } } }
apache-2.0
C#
b1124fe9870b98e3f648e4a8c7d0578cca079f5d
fix lint.
GoogleCloudPlatform/dotnet-docs-samples,GoogleCloudPlatform/dotnet-docs-samples,GoogleCloudPlatform/dotnet-docs-samples,GoogleCloudPlatform/dotnet-docs-samples
asset/quickstart/ExportAssetsTest/ExportAssetsTest.cs
asset/quickstart/ExportAssetsTest/ExportAssetsTest.cs
/* * Copyright (c) 2018 Google LLC. * * 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 Google.Apis.Storage.v1.Data; using Google.Cloud.Storage.V1; using System; using Xunit; using Xunit.Abstractions; namespace GoogleCloudSamples { public class ExportAssetsTest : IClassFixture<RandomBucketFixture>, System.IDisposable { static readonly CommandLineRunner s_runner = new CommandLineRunner { Command = "ExportAssets", VoidMain = ExportAssets.Main, }; private readonly ITestOutputHelper _testOutput; private readonly StorageClient _storageClient = StorageClient.Create(); private readonly string _bucketName; readonly BucketCollector _bucketCollector; public ExportAssetsTest(ITestOutputHelper output, RandomBucketFixture bucketFixture) { _testOutput = output; _bucketName = bucketFixture.BucketName; _bucketCollector = new BucketCollector(_bucketName); } [Fact] public void TestExportAsests() { string projectId = Environment.GetEnvironmentVariable("GOOGLE_PROJECT_ID"); Environment.SetEnvironmentVariable("AssetBucketName", _bucketName); var output = s_runner.Run(); _testOutput.WriteLine(output.Stdout); string expectedOutput = String.Format("\"outputConfig\": {{ \"gcsDestination\": {{ \"uri\": \"gs://{0}/my-assets.txt\" }} }}", _bucketName); Assert.Contains(expectedOutput, output.Stdout); } public void Dispose() { ((IDisposable)_bucketCollector).Dispose(); } } }
/* * Copyright (c) 2018 Google LLC. * * 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 Google.Apis.Storage.v1.Data; using Google.Cloud.Storage.V1; using System; using Xunit; using Xunit.Abstractions; namespace GoogleCloudSamples { public class ExportAssetsTest : IClassFixture<RandomBucketFixture>, System.IDisposable { static readonly CommandLineRunner s_runner = new CommandLineRunner { Command = "ExportAssets", VoidMain = ExportAssets.Main, }; private readonly ITestOutputHelper _testOutput; private readonly StorageClient _storageClient = StorageClient.Create(); private readonly string _bucketName; readonly BucketCollector _bucketCollector; public ExportAssetsTest(ITestOutputHelper output, RandomBucketFixture bucketFixture) { _testOutput = output; _bucketName = bucketFixture.BucketName; _bucketCollector = new BucketCollector(_bucketName); } [Fact] public void TestExportAsests() { string projectId = Environment.GetEnvironmentVariable("GOOGLE_PROJECT_ID"); Environment.SetEnvironmentVariable("AssetBucketName", _bucketName); var output = s_runner.Run(); _testOutput.WriteLine(output.Stdout); string expectedOutput = String.Format("\"outputConfig\": {{ \"gcsDestination\": {{ \"uri\": \"gs://{0}/my-assets.txt\" }} }}", _bucketName); Assert.Contains(expectedOutput, output.Stdout); } public void Dispose() { ((IDisposable)_bucketCollector).Dispose(); } } }
apache-2.0
C#
f61d7419dd6b49d6091b4539b034902e2a8af1cd
Update version
Oceanswave/NiL.JS,nilproject/NiL.JS,nilproject/NiL.JS,Oceanswave/NiL.JS,nilproject/NiL.JS,Oceanswave/NiL.JS
NiL.JS/Properties/AssemblyInfo.cs
NiL.JS/Properties/AssemblyInfo.cs
using System; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("NiL.JS")] [assembly: AssemblyProduct("NiL.JS")] [assembly: AssemblyDescription("JavaScript engine for .NET")] [assembly: AssemblyCompany("NiLProject")] [assembly: AssemblyCopyright("Copyright © NiLProject 2015")] [assembly: AssemblyTrademark("NiL.JS")] [assembly: AssemblyVersion("2.3.934")] [assembly: AssemblyFileVersion("2.3.934")] [assembly: NeutralResourcesLanguage("en-US")] [assembly: ComVisible(false)] [assembly: CLSCompliant(true)] #if !PORTABLE [assembly: Guid("a70afe5a-2b29-49fd-afbf-28794042ea21")] #endif
using System; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("NiL.JS")] [assembly: AssemblyProduct("NiL.JS")] [assembly: AssemblyDescription("JavaScript engine for .NET")] [assembly: AssemblyCompany("NiLProject")] [assembly: AssemblyCopyright("Copyright © NiLProject 2015")] [assembly: AssemblyTrademark("NiL.JS")] [assembly: AssemblyVersion("2.3.927")] [assembly: AssemblyFileVersion("2.3.927")] [assembly: NeutralResourcesLanguage("en-US")] [assembly: ComVisible(false)] [assembly: CLSCompliant(true)] #if !PORTABLE [assembly: Guid("a70afe5a-2b29-49fd-afbf-28794042ea21")] #endif
bsd-3-clause
C#
49ff39874ea7ec382bde5068f5b96c743a89b2f4
Split WCF functionality out of Autofac.Extras.Multitenant into a separate assembly/package, Autofac.Extras.Multitenant.Wcf. Both packages are versioned 3.1.0.
autofac/Autofac.Extras.EnterpriseLibraryConfigurator
Properties/VersionAssemblyInfo.cs
Properties/VersionAssemblyInfo.cs
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.18051 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ using System; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyVersion("3.0.0.0")] [assembly: AssemblyFileVersion("3.0.0.0")] [assembly: AssemblyConfiguration("Release built on 2013-12-03 10:23")] [assembly: AssemblyCopyright("Copyright © 2013 Autofac Contributors")] [assembly: AssemblyDescription("Autofac.Extras.EnterpriseLibraryConfigurator 3.0.0")]
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.34003 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ using System; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyVersion("3.0.0.0")] [assembly: AssemblyFileVersion("3.0.0.0")] [assembly: AssemblyConfiguration("Release built on 2013-10-23 22:48")] [assembly: AssemblyCopyright("Copyright © 2013 Autofac Contributors")] [assembly: AssemblyDescription("Autofac.Extras.EnterpriseLibraryConfigurator 3.0.0")]
mit
C#
0030d6b7f9a0d90e27728f056eec7915927d2b35
Build script now creates individual zip file packages to align with the NuGet packages and semantic versioning.
autofac/Autofac.SignalR
Properties/VersionAssemblyInfo.cs
Properties/VersionAssemblyInfo.cs
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.18033 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ using System; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyVersion("3.0.0.0")] [assembly: AssemblyFileVersion("3.0.0.0")] [assembly: AssemblyConfiguration("Release built on 2013-02-28 02:03")] [assembly: AssemblyCopyright("Copyright © 2013 Autofac Contributors")]
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.18033 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ using System; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyVersion("3.0.0.0")] [assembly: AssemblyFileVersion("3.0.0.0")] [assembly: AssemblyConfiguration("Release built on 2013-02-22 14:39")] [assembly: AssemblyCopyright("Copyright © 2013 Autofac Contributors")]
mit
C#
874f0814c1820c70e6c89dfbe12576a3d2b8d14f
Make Range report invalid arguments when throwing
ygra/Diablo3ItemCollage,ygra/Diablo3ItemCollage
Helpers/Helper.cs
Helpers/Helper.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ItemCollage { public static class Helper { public static IEnumerable<int> Range(int start, int end, int step = 1) { if (start > end && step > 0 || start < end && step < 0 || step == 0) throw new ArgumentException(string.Format( "Impossible range: {0} to {1} with step {2}", start, end, step)); int steps = (end - start) / step; int i, s; for (i = start, s = 0; s <= steps; i += step, s++) { yield return i; } } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ItemCollage { public static class Helper { public static IEnumerable<int> Range(int start, int end, int step = 1) { if (start > end && step > 0 || start < end && step < 0 || step == 0) throw new ArgumentException("Impossible range"); int steps = (end - start) / step; int i, s; for (i = start, s = 0; s <= steps; i += step, s++) { yield return i; } } } }
mit
C#
d69322a88dab4467f8fa4c122b329677db3c242d
Fix module tests to use valid data
schlos/denver-schedules-api,codeforamerica/denver-schedules-api,codeforamerica/denver-schedules-api,schlos/denver-schedules-api
Schedules.API.Tests/Modules/StreetSweepingTests.cs
Schedules.API.Tests/Modules/StreetSweepingTests.cs
using NUnit.Framework; using Nancy.Testing; namespace Schedules.API.Tests.Modules { [TestFixture] public class StreetSweepingTests { const string longitude = "-104.952312"; const string latitude = "39.7211511226435"; const string url = "/schedules/streetsweeping"; Browser browser; BrowserResponse response; [TestFixtureSetUp] public void SetUp() { browser = new Browser(new CustomBootstrapper()); } public void SetUpOptions() { response = browser.Options(url, (with) => { with.HttpRequest(); with.Query("longitude", longitude); with.Query("latitude", latitude); with.Query("accuracy", "0.631"); }); } public void SetUpGet() { response = browser.Get(url, (with) => { with.HttpRequest(); with.Query("longitude", longitude); with.Query("latitude", latitude); with.Query("accuracy", "0.631"); }); } [Test] public void OptionsShouldAllowAllOrigins() { SetUpOptions(); Assert.That(response.Headers["Access-Control-Allow-Origin"], Is.EqualTo("*")); } [Test] public void OptionsShouldAllowGet() { SetUpOptions(); Assert.That(response.Headers["Access-Control-Allow-Methods"], Contains.Substring("GET")); } [Test] public void OptionsShouldAllowContentType() { SetUpOptions(); Assert.That(response.Headers["Access-Control-Allow-Headers"], Contains.Substring("Content-Type")); } [Test] public void ListIndexShouldAllowAllOrigins() { SetUpGet(); Assert.That(response.Headers["Access-Control-Allow-Origin"], Is.EqualTo("*")); } [Test] public void ListIndexShouldReturnOk() { SetUpGet(); Assert.AreEqual(Nancy.HttpStatusCode.OK, response.StatusCode); } [Test] public void ListIndexShouldReturnJson() { SetUpGet(); Assert.AreEqual ("application/json; charset=utf-8", response.ContentType); } [Test] public void ShouldThrowAnErrorWithoutLatAndLong() { SetUpGet(); browser = new Browser(new CustomBootstrapper()); response = browser.Get(url, (with) => with.HttpRequest()); Assert.AreEqual(Nancy.HttpStatusCode.BadRequest, response.StatusCode); } } }
using NUnit.Framework; using Nancy.Testing; namespace Schedules.API.Tests.Modules { [TestFixture] public class StreetSweepingTests { const string url = "/schedules/streetsweeping"; Browser browser; BrowserResponse response; [TestFixtureSetUp] public void SetUp() { browser = new Browser(new CustomBootstrapper()); } public void SetUpOptions() { response = browser.Options(url, (with) => { with.HttpRequest(); with.Query("longitude", "-104.95474457244"); with.Query("latitude", "39.7659901751922"); with.Query("accuracy", "0.631"); }); } public void SetUpGet() { response = browser.Get(url, (with) => { with.HttpRequest(); with.Query("longitude", "-104.95474457244"); with.Query("latitude", "39.7659901751922"); with.Query("accuracy", "0.631"); }); } [Test] public void OptionsShouldAllowAllOrigins() { SetUpOptions(); Assert.That(response.Headers["Access-Control-Allow-Origin"], Is.EqualTo("*")); } [Test] public void OptionsShouldAllowGet() { SetUpOptions(); Assert.That(response.Headers["Access-Control-Allow-Methods"], Contains.Substring("GET")); } [Test] public void OptionsShouldAllowContentType() { SetUpOptions(); Assert.That(response.Headers["Access-Control-Allow-Headers"], Contains.Substring("Content-Type")); } [Test] public void ListIndexShouldAllowAllOrigins() { SetUpGet(); Assert.That(response.Headers["Access-Control-Allow-Origin"], Is.EqualTo("*")); } [Test] public void ListIndexShouldReturnOk() { SetUpGet(); Assert.AreEqual(Nancy.HttpStatusCode.OK, response.StatusCode); } [Test] public void ListIndexShouldReturnJson() { SetUpGet(); Assert.AreEqual ("application/json; charset=utf-8", response.ContentType); } [Test] public void ShouldThrowAnErrorWithoutLatAndLong() { SetUpGet(); browser = new Browser(new CustomBootstrapper()); response = browser.Get(url, (with) => with.HttpRequest()); Assert.AreEqual(Nancy.HttpStatusCode.BadRequest, response.StatusCode); } } }
mit
C#
6d412dc5c7e728aaf60670b278f730563a7cabf7
Fix MEF composition error
PedroLamas/nuproj,AArnott/nuproj,nuproj/nuproj,kovalikp/nuproj,ericstj/nuproj,faustoscardovi/nuproj,NN---/nuproj,oliver-feng/nuproj,zbrad/nuproj
src/NuProj.Package/NuProjProjectTreeModifier.cs
src/NuProj.Package/NuProjProjectTreeModifier.cs
using System; using System.ComponentModel.Composition; using Microsoft.VisualStudio.ProjectSystem; using Microsoft.VisualStudio.ProjectSystem.Designers; using Microsoft.VisualStudio.ProjectSystem.Utilities; using Microsoft.VisualStudio.ProjectSystem.Utilities.Designers; namespace NuProj.ProjectSystem { [Export(typeof(IProjectTreeModifier))] [PartMetadata(ProjectCapabilities.Requires, NuProjCapabilities.NuProj)] internal sealed class NuProjProjectTreeModifier : IProjectTreeModifier { [Import] public UnconfiguredProject UnconfiguredProject { get; set; } public IProjectTree ApplyModifications(IProjectTree tree, IProjectTreeProvider projectTreeProvider) { if (tree.Capabilities.Contains(ProjectTreeCapabilities.ProjectRoot)) tree = tree.SetIcon(Resources.NuProj); return tree; } } }
using System; using System.ComponentModel.Composition; using Microsoft.VisualStudio.ProjectSystem.Designers; using Microsoft.VisualStudio.ProjectSystem.Utilities; using Microsoft.VisualStudio.ProjectSystem.Utilities.Designers; namespace NuProj.ProjectSystem { [Export(typeof(IProjectTreeModifier))] [PartMetadata(ProjectCapabilities.Requires, NuProjCapabilities.NuProj)] internal sealed class NuProjProjectTreeModifier : IProjectTreeModifier { public IProjectTree ApplyModifications(IProjectTree tree, IProjectTreeProvider projectTreeProvider) { if (tree.Capabilities.Contains(ProjectTreeCapabilities.ProjectRoot)) tree = tree.SetIcon(Resources.NuProj); return tree; } } }
mit
C#
13d2d3643e1979d090e0f3f0dd0e60fc4b99488b
Bump version to 1.3.0
PolarbearDK/Miracle.Settings
Source/Miracle.Settings/Properties/AssemblyInfo.cs
Source/Miracle.Settings/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("Miracle.Settings")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Miracle A/S")] [assembly: AssemblyProduct("Miracle.Settings")] [assembly: AssemblyCopyright("Copyright © Philip Hoppe 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] [assembly: InternalsVisibleTo("Miracle.Settings.Tests")] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("a1351fb7-62e7-4ac9-b3c0-1aa87e31dba8")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.3.0.0")] [assembly: AssemblyFileVersion("1.3.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("Miracle.Settings")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Miracle A/S")] [assembly: AssemblyProduct("Miracle.Settings")] [assembly: AssemblyCopyright("Copyright © Philip Hoppe 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] [assembly: InternalsVisibleTo("Miracle.Settings.Tests")] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("a1351fb7-62e7-4ac9-b3c0-1aa87e31dba8")] // 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.2.0.0")] [assembly: AssemblyFileVersion("1.2.0.0")]
mit
C#
fc43debd6e40b592af4c9b184f5a764bc9b5fce1
Add Respoke-SDK header to requests
ruffrey/dotnet-respoke-admin,respoke/dotnet-respoke-admin
respoke/RespokeClient.cs
respoke/RespokeClient.cs
using System; using System.Net; using System.IO; using System.Text; using System.Reflection; using System.Collections.Generic; using Newtonsoft.Json; using Respoke; namespace Respoke { public class RespokeClient { private string GetSDKHeader() { string version = Assembly.GetExecutingAssembly().GetName().Version.ToString(); string os = Environment.OSVersion.ToString(); string clrVersion = Environment.Version.ToString(); return "Respoke-.NET/" + version + " (" + os + ") .NET-CLR/" + clrVersion; } public string BaseUrl { get; set; } public RespokeClient () { BaseUrl = "https://api.respoke.io/v1"; } public RespokeResponse Request (RespokeRequestParams parms) { Stream dataStream = null; RespokeResponse resObject = new RespokeResponse(); HttpWebResponse response = null; WebRequest req = WebRequest.Create(BaseUrl + parms.Path); req.Method = parms.Method; req.ContentType = "application/json"; req.Headers.Add("Respoke-SDK: " + GetSDKHeader()); if (parms.AppSecret != null) { req.Headers.Add("App-Secret: " + parms.AppSecret); } if (parms.Body != null) { byte[] byteArray = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(parms.Body)); req.ContentLength = byteArray.Length; dataStream = req.GetRequestStream(); dataStream.Write(byteArray, 0, byteArray.Length); dataStream.Close(); } else { req.ContentLength = 0; } try { response = (HttpWebResponse)req.GetResponse(); } catch (WebException ex) { resObject.threwException = true; response = (HttpWebResponse)ex.Response; } // Get the stream containing content returned by the server. dataStream = response.GetResponseStream(); // Open the stream using a StreamReader for easy access. StreamReader reader = new StreamReader(dataStream); // Read the content. string responseFromServer = reader.ReadToEnd(); // Display the content. resObject.body = JsonConvert.DeserializeObject<RespokeResponseJson>(responseFromServer); resObject.statusCode = (int)response.StatusCode; // Clean up the streams. reader.Close(); dataStream.Close(); response.Close(); return resObject; } public RespokeResponse GetEndpointTokenId (RespokeEndpointTokenRequestBody parms) { Dictionary<string, object> body = new Dictionary<string, object>(); body.Add("appId", parms.appId); body.Add("endpointId", parms.endpointId); body.Add ("ttl", parms.ttl); if (parms.roleId != null) { body.Add ("roleId", parms.roleId); } if (parms.roleName != null) { body.Add ("roleName", parms.roleName); } return Request(new RespokeRequestParams() { Body = body, Method = "POST", Path = "/tokens", AppSecret = parms.appSecret }); } } }
using System; using System.Net; using System.IO; using System.Text; using System.Collections.Generic; using Newtonsoft.Json; using Respoke; namespace Respoke { public class RespokeClient { public string BaseUrl { get; set; } public RespokeClient () { BaseUrl = "https://api.respoke.io/v1"; } public RespokeResponse Request (RespokeRequestParams parms) { Stream dataStream = null; RespokeResponse resObject = new RespokeResponse(); HttpWebResponse response = null; WebRequest req = WebRequest.Create(BaseUrl + parms.Path); req.Method = parms.Method; req.ContentType = "application/json"; ((HttpWebRequest)req).UserAgent = "Respoke .NET Client"; if (parms.AppSecret != null) { req.Headers.Add("App-Secret: " + parms.AppSecret); } if (parms.Body != null) { byte[] byteArray = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(parms.Body)); req.ContentLength = byteArray.Length; dataStream = req.GetRequestStream(); dataStream.Write(byteArray, 0, byteArray.Length); dataStream.Close(); } else { req.ContentLength = 0; } try { response = (HttpWebResponse)req.GetResponse(); } catch (WebException ex) { resObject.threwException = true; response = (HttpWebResponse)ex.Response; } // Get the stream containing content returned by the server. dataStream = response.GetResponseStream(); // Open the stream using a StreamReader for easy access. StreamReader reader = new StreamReader(dataStream); // Read the content. string responseFromServer = reader.ReadToEnd(); // Display the content. resObject.body = JsonConvert.DeserializeObject<RespokeResponseJson>(responseFromServer); resObject.statusCode = (int)response.StatusCode; // Clean up the streams. reader.Close(); dataStream.Close(); response.Close(); return resObject; } public RespokeResponse GetEndpointTokenId (RespokeEndpointTokenRequestBody parms) { Dictionary<string, object> body = new Dictionary<string, object>(); body.Add("appId", parms.appId); body.Add("endpointId", parms.endpointId); body.Add ("ttl", parms.ttl); if (parms.roleId != null) { body.Add ("roleId", parms.roleId); } if (parms.roleName != null) { body.Add ("roleName", parms.roleName); } return Request(new RespokeRequestParams() { Body = body, Method = "POST", Path = "/tokens", AppSecret = parms.appSecret }); } } }
mit
C#
f8edf08da9b9ea7ad79fae175e93f4bb23a45c61
Update AssemblyInfo.cs
Raptura/WebformUtilities
WFUtilities/WFUtilities/Properties/AssemblyInfo.cs
WFUtilities/WFUtilities/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("WFUtilities")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("WFUtilities")] [assembly: AssemblyCopyright("Copyright © Armond Smith")] [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("e953fbc6-0359-43dd-a262-05b3ba23ef52")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
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("WFUtilities")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Temple University")] [assembly: AssemblyProduct("WFUtilities")] [assembly: AssemblyCopyright("Copyright © Temple University 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("e953fbc6-0359-43dd-a262-05b3ba23ef52")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
mit
C#
7e1f90fb3b8d1af89853a6d76da8f3b400f1dc16
Clear the content type "common" cache when deleting templates
JimBobSquarePants/Umbraco-CMS,marcemarc/Umbraco-CMS,NikRimington/Umbraco-CMS,bjarnef/Umbraco-CMS,madsoulswe/Umbraco-CMS,dawoe/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,marcemarc/Umbraco-CMS,marcemarc/Umbraco-CMS,tcmorris/Umbraco-CMS,dawoe/Umbraco-CMS,KevinJump/Umbraco-CMS,abryukhov/Umbraco-CMS,robertjf/Umbraco-CMS,dawoe/Umbraco-CMS,madsoulswe/Umbraco-CMS,arknu/Umbraco-CMS,robertjf/Umbraco-CMS,mattbrailsford/Umbraco-CMS,abjerner/Umbraco-CMS,leekelleher/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,robertjf/Umbraco-CMS,umbraco/Umbraco-CMS,leekelleher/Umbraco-CMS,abryukhov/Umbraco-CMS,umbraco/Umbraco-CMS,KevinJump/Umbraco-CMS,abjerner/Umbraco-CMS,rasmuseeg/Umbraco-CMS,mattbrailsford/Umbraco-CMS,KevinJump/Umbraco-CMS,dawoe/Umbraco-CMS,hfloyd/Umbraco-CMS,rasmuseeg/Umbraco-CMS,leekelleher/Umbraco-CMS,robertjf/Umbraco-CMS,leekelleher/Umbraco-CMS,arknu/Umbraco-CMS,hfloyd/Umbraco-CMS,marcemarc/Umbraco-CMS,leekelleher/Umbraco-CMS,NikRimington/Umbraco-CMS,umbraco/Umbraco-CMS,hfloyd/Umbraco-CMS,arknu/Umbraco-CMS,bjarnef/Umbraco-CMS,bjarnef/Umbraco-CMS,umbraco/Umbraco-CMS,hfloyd/Umbraco-CMS,NikRimington/Umbraco-CMS,abryukhov/Umbraco-CMS,madsoulswe/Umbraco-CMS,tcmorris/Umbraco-CMS,rasmuseeg/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,hfloyd/Umbraco-CMS,KevinJump/Umbraco-CMS,KevinJump/Umbraco-CMS,marcemarc/Umbraco-CMS,abryukhov/Umbraco-CMS,robertjf/Umbraco-CMS,arknu/Umbraco-CMS,tcmorris/Umbraco-CMS,mattbrailsford/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,bjarnef/Umbraco-CMS,dawoe/Umbraco-CMS,tcmorris/Umbraco-CMS,tcmorris/Umbraco-CMS,abjerner/Umbraco-CMS,tcmorris/Umbraco-CMS,mattbrailsford/Umbraco-CMS,abjerner/Umbraco-CMS
src/Umbraco.Web/Cache/TemplateCacheRefresher.cs
src/Umbraco.Web/Cache/TemplateCacheRefresher.cs
using System; using Umbraco.Core.Cache; using Umbraco.Core.Models; using Umbraco.Core.Persistence.Repositories; using Umbraco.Core.Services; namespace Umbraco.Web.Cache { public sealed class TemplateCacheRefresher : CacheRefresherBase<TemplateCacheRefresher> { private readonly IdkMap _idkMap; private readonly IContentTypeCommonRepository _contentTypeCommonRepository; public TemplateCacheRefresher(AppCaches appCaches, IdkMap idkMap, IContentTypeCommonRepository contentTypeCommonRepository) : base(appCaches) { _idkMap = idkMap; _contentTypeCommonRepository = contentTypeCommonRepository; } #region Define protected override TemplateCacheRefresher This => this; public static readonly Guid UniqueId = Guid.Parse("DD12B6A0-14B9-46e8-8800-C154F74047C8"); public override Guid RefresherUniqueId => UniqueId; public override string Name => "Template Cache Refresher"; #endregion #region Refresher public override void Refresh(int id) { RemoveFromCache(id); base.Refresh(id); } public override void Remove(int id) { RemoveFromCache(id); //During removal we need to clear the runtime cache for templates, content and content type instances!!! // all three of these types are referenced by templates, and the cache needs to be cleared on every server, // otherwise things like looking up content type's after a template is removed is still going to show that // it has an associated template. ClearAllIsolatedCacheByEntityType<IContent>(); ClearAllIsolatedCacheByEntityType<IContentType>(); _contentTypeCommonRepository.ClearCache(); base.Remove(id); } private void RemoveFromCache(int id) { _idkMap.ClearCache(id); AppCaches.RuntimeCache.Clear($"{CacheKeys.TemplateFrontEndCacheKey}{id}"); //need to clear the runtime cache for templates ClearAllIsolatedCacheByEntityType<ITemplate>(); } #endregion } }
using System; using Umbraco.Core.Cache; using Umbraco.Core.Models; using Umbraco.Core.Services; namespace Umbraco.Web.Cache { public sealed class TemplateCacheRefresher : CacheRefresherBase<TemplateCacheRefresher> { private readonly IdkMap _idkMap; public TemplateCacheRefresher(AppCaches appCaches, IdkMap idkMap) : base(appCaches) { _idkMap = idkMap; } #region Define protected override TemplateCacheRefresher This => this; public static readonly Guid UniqueId = Guid.Parse("DD12B6A0-14B9-46e8-8800-C154F74047C8"); public override Guid RefresherUniqueId => UniqueId; public override string Name => "Template Cache Refresher"; #endregion #region Refresher public override void Refresh(int id) { RemoveFromCache(id); base.Refresh(id); } public override void Remove(int id) { RemoveFromCache(id); //During removal we need to clear the runtime cache for templates, content and content type instances!!! // all three of these types are referenced by templates, and the cache needs to be cleared on every server, // otherwise things like looking up content type's after a template is removed is still going to show that // it has an associated template. ClearAllIsolatedCacheByEntityType<IContent>(); ClearAllIsolatedCacheByEntityType<IContentType>(); base.Remove(id); } private void RemoveFromCache(int id) { _idkMap.ClearCache(id); AppCaches.RuntimeCache.Clear($"{CacheKeys.TemplateFrontEndCacheKey}{id}"); //need to clear the runtime cache for templates ClearAllIsolatedCacheByEntityType<ITemplate>(); } #endregion } }
mit
C#
92f6458d4b4935762cb60afbc0750d2c9c1e5497
add Checked and Unchecked events
jpbruyere/Crow,jpbruyere/Crow
src/GraphicObjects/Checkbox.cs
src/GraphicObjects/Checkbox.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; //using OpenTK.Graphics.OpenGL; using Cairo; using winColors = System.Drawing.Color; using System.Diagnostics; using System.Xml.Serialization; using OpenTK.Input; using System.ComponentModel; namespace go { [DefaultTemplate("#go.Templates.Checkbox.goml")] public class Checkbox : TemplatedControl { string caption; string image; bool isChecked; #region CTOR public Checkbox() : base() { } #endregion public event EventHandler Checked; public event EventHandler Unchecked; #region GraphicObject overrides // [XmlAttributeAttribute()][DefaultValue(-1)] // public override int Height { // get { return base.Height; } // set { base.Height = value; } // } [XmlAttributeAttribute()][DefaultValue(true)]//overiden to get default to true public override bool Focusable { get { return base.Focusable; } set { base.Focusable = value; } } #endregion [XmlAttributeAttribute()][DefaultValue("Checkbox")] public string Caption { get { return caption; } set { if (caption == value) return; caption = value; NotifyValueChanged ("Caption", caption); } } [XmlAttributeAttribute()][DefaultValue("#go.Images.Icons.checkbox.svg")] public string Image { get { return image; } set { if (image == value) return; image = value; NotifyValueChanged ("Image", image); } } [XmlAttributeAttribute()][DefaultValue(false)] public bool IsChecked { get { return isChecked; } set { isChecked = value; NotifyValueChanged ("IsChecked", value); if (isChecked) { NotifyValueChanged ("SvgSub", "checked"); Checked.Raise (this, null); } else { NotifyValueChanged ("SvgSub", "unchecked"); Unchecked.Raise (this, null); } } } public override void onMouseClick (object sender, MouseButtonEventArgs e) { IsChecked = !IsChecked; base.onMouseClick (sender, e); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; //using OpenTK.Graphics.OpenGL; using Cairo; using winColors = System.Drawing.Color; using System.Diagnostics; using System.Xml.Serialization; using OpenTK.Input; using System.ComponentModel; namespace go { [DefaultTemplate("#go.Templates.Checkbox.goml")] public class Checkbox : TemplatedControl { string caption; string image; bool isChecked; #region CTOR public Checkbox() : base() { } #endregion #region GraphicObject overrides // [XmlAttributeAttribute()][DefaultValue(-1)] // public override int Height { // get { return base.Height; } // set { base.Height = value; } // } [XmlAttributeAttribute()][DefaultValue(true)]//overiden to get default to true public override bool Focusable { get { return base.Focusable; } set { base.Focusable = value; } } #endregion [XmlAttributeAttribute()][DefaultValue("Checkbox")] public string Caption { get { return caption; } set { if (caption == value) return; caption = value; NotifyValueChanged ("Caption", caption); } } [XmlAttributeAttribute()][DefaultValue("#go.Images.Icons.checkbox.svg")] public string Image { get { return image; } set { if (image == value) return; image = value; NotifyValueChanged ("Image", image); } } [XmlAttributeAttribute()][DefaultValue(false)] public bool IsChecked { get { return isChecked; } set { isChecked = value; NotifyValueChanged ("IsChecked", value); if (isChecked) NotifyValueChanged ("SvgSub", "checked"); else NotifyValueChanged ("SvgSub", "unchecked"); } } public override void onMouseClick (object sender, MouseButtonEventArgs e) { IsChecked = !IsChecked; base.onMouseClick (sender, e); } } }
mit
C#
cfa7b28fed2f015e611daf8a92898d631945e462
Update version
picrap/dnlib,0xd4d/dnlib,jorik041/dnlib,Arthur2e5/dnlib,yck1509/dnlib,kiootic/dnlib,modulexcite/dnlib,ilkerhalil/dnlib,ZixiangBoy/dnlib
src/Properties/AssemblyInfo.cs
src/Properties/AssemblyInfo.cs
// dnlib: See LICENSE.txt for more info using System.Reflection; using System.Runtime.InteropServices; #if THREAD_SAFE [assembly: AssemblyTitle("dnlib (thread safe)")] #else [assembly: AssemblyTitle("dnlib")] #endif [assembly: AssemblyDescription(".NET assembly reader/writer")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("dnlib")] [assembly: AssemblyCopyright("Copyright (C) 2012-2015 de4dot@gmail.com")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: AssemblyVersion("1.5.0.1500")] [assembly: AssemblyFileVersion("1.5.0.1500")]
// dnlib: See LICENSE.txt for more info using System.Reflection; using System.Runtime.InteropServices; #if THREAD_SAFE [assembly: AssemblyTitle("dnlib (thread safe)")] #else [assembly: AssemblyTitle("dnlib")] #endif [assembly: AssemblyDescription(".NET assembly reader/writer")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("dnlib")] [assembly: AssemblyCopyright("Copyright (C) 2012-2015 de4dot@gmail.com")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: AssemblyVersion("1.0.2.0")] [assembly: AssemblyFileVersion("1.0.2.0")]
mit
C#
38013907719b297e9a3aa4840a0ffbce76bdf0b4
bump assembly version
ssg/TurkishId
src/Properties/AssemblyInfo.cs
src/Properties/AssemblyInfo.cs
using System; using System.Reflection; using System.Runtime.InteropServices; [assembly: CLSCompliant(true)] [assembly: AssemblyTitle("TurkishId")] [assembly: AssemblyDescription("Turkish ID Number Validation Library")] [assembly: AssemblyCompany("Sedat Kapanoglu")] [assembly: AssemblyProduct("TurkishId")] [assembly: AssemblyCopyright("Copyright © Sedat Kapanoglu 2014-2016")] [assembly: ComVisible(false)] [assembly: Guid("fc77467b-3330-4cdd-bd11-75e9fcf3d6a6")] [assembly: AssemblyVersion("1.2.*")]
using System; using System.Reflection; using System.Runtime.InteropServices; [assembly: CLSCompliant(true)] [assembly: AssemblyTitle("TurkishId")] [assembly: AssemblyDescription("Turkish ID Number Validation Library")] [assembly: AssemblyCompany("Sedat Kapanoglu")] [assembly: AssemblyProduct("TurkishId")] [assembly: AssemblyCopyright("Copyright © Sedat Kapanoglu 2014")] [assembly: ComVisible(false)] [assembly: Guid("fc77467b-3330-4cdd-bd11-75e9fcf3d6a6")] [assembly: AssemblyVersion("1.1.*")]
apache-2.0
C#
2f26bea83a509f20c2ac4b282b5e505d0e19fb50
Update settings
dncuug/dot-net.in.ua,dncuug/dot-net.in.ua,dncuug/dot-net.in.ua
src/Core/Settings.cs
src/Core/Settings.cs
using System; using System.Net; using Microsoft.Extensions.Configuration; namespace Core { public class Settings { public string ConnectionString { get; private set; } public string WebSiteTitle { get; private set; } public string WebSiteUrl { get; private set; } public string DefaultDescription { get; private set; } public string DefaultKeywords { get; private set; } public string FacebookImage => $"{WebSiteUrl}images/fb_logo.png"; public string RssFeedUrl => $"{WebSiteUrl}rss"; public string SupportEmail { get; set; } #region Current public static Settings Current { get; private set; } public static void Initialize(IConfiguration configuration) { Current = new Settings { ConnectionString = configuration.GetConnectionString("DefaultConnection"), WebSiteUrl = configuration["WebSiteUrl"], WebSiteTitle = configuration["WebSiteTitle"], DefaultDescription = WebUtility.HtmlDecode(configuration["DefaultDescription"]), DefaultKeywords = WebUtility.HtmlDecode(configuration["DefaultKeywords"]), SupportEmail = "dncuug@agi.net.ua" }; } #endregion } }
using System; using System.Net; using Microsoft.Extensions.Configuration; namespace Core { public class Settings { public string ConnectionString { get; private set; } public string WebSiteTitle { get; private set; } public string WebSiteUrl { get; private set; } public string DefaultDescription { get; private set; } public string DefaultKeywords { get; private set; } public string FacebookImage => $"{WebSiteUrl}images/fb_logo.png"; public string RssFeedUrl => $"{WebSiteUrl}rss"; public Guid PublicationKey { get; set; } public string SupportEmail { get; set; } #region Current public static Settings Current { get; private set; } public static void Initialize(IConfiguration configuration) { Current = new Settings { ConnectionString = configuration.GetConnectionString("DefaultConnection"), WebSiteUrl = configuration["WebSiteUrl"], WebSiteTitle = configuration["WebSiteTitle"], DefaultDescription = WebUtility.HtmlDecode(configuration["DefaultDescription"]), DefaultKeywords = WebUtility.HtmlDecode(configuration["DefaultKeywords"]), PublicationKey = Guid.Parse(configuration["PublicationKey"]), SupportEmail = "dncuug@agi.net.ua" }; } #endregion } }
mit
C#
b0c8ef4effca42f522d6f3199fbadb6c989b127b
Fix for incorrect key class in Docs theme (#515)
Wyamio/Wyam,adamclifford/Wyam,adamclifford/Wyam,Wyamio/Wyam,Wyamio/Wyam,adamclifford/Wyam,adamclifford/Wyam,adamclifford/Wyam
themes/Docs/Samson/_Navbar.cshtml
themes/Docs/Samson/_Navbar.cshtml
@{ List<Tuple<string, string>> pages = Context .Documents[Docs.Pages] .Where(x => x.Bool(DocsKeys.ShowInNavbar, true)) .Where(x => x.FilePath(Keys.RelativeFilePath)?.FullPath?.StartsWith("index") == (bool?)false) .Select(x => Tuple.Create(x.WithoutSettings.String(Keys.Title), Context.GetLink(x))) .Where(x => !string.IsNullOrEmpty(x.Item1)) .OrderBy(x => x.Item1) .ToList(); if(Documents[Docs.BlogPosts].Any()) { pages.Add(Tuple.Create("Blog", Context.GetLink(Context.String(DocsKeys.BlogPath)))); } if(Documents[Docs.Api].Any()) { pages.Add(Tuple.Create("API", Context.GetLink("api"))); } foreach(Tuple<string, string> page in pages) { string active = Context.GetLink(Document).StartsWith(page.Item2) ? "active" : null; <li class="@active"><a href="@page.Item2">@page.Item1</a></li> } }
@{ List<Tuple<string, string>> pages = Context .Documents[Docs.Pages] .Where(x => x.Bool(DocsKeys.ShowInNavbar, true)) .Where(x => x.FilePath(Keys.RelativeFilePath)?.FullPath?.StartsWith("index") == (bool?)false) .Select(x => Tuple.Create(x.WithoutSettings.String(Keys.Title), Context.GetLink(x))) .Where(x => !string.IsNullOrEmpty(x.Item1)) .OrderBy(x => x.Item1) .ToList(); if(Documents[Docs.BlogPosts].Any()) { pages.Add(Tuple.Create("Blog", Context.GetLink(Context.String(BookSiteKeys.BlogPath)))); } if(Documents[Docs.Api].Any()) { pages.Add(Tuple.Create("API", Context.GetLink("api"))); } foreach(Tuple<string, string> page in pages) { string active = Context.GetLink(Document).StartsWith(page.Item2) ? "active" : null; <li class="@active"><a href="@page.Item2">@page.Item1</a></li> } }
mit
C#
35f38b6fcdaa1343f0a629a1db7fc09553d20d0c
Change assembly version for release
githubpermutation/ChangeLoadingImage
ChangeLoadingImage/AssemblyInfo.cs
ChangeLoadingImage/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("ChangeLoadingImage1.0")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("")] [assembly: AssemblyCopyright("")] [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("")]
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("ChangeLoadingImage_beta")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("")] [assembly: AssemblyCopyright("")] [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("")]
mit
C#
ba77c2513d5216fb834d6dba58f069752f0eaf87
Disable unit tests again
foxbot/Discord.Addons.EmojiTools,foxbot/Discord.Addons.EmojiTools
build.cake
build.cake
#addin nuget:?package=NuGet.Core&version=2.12.0 #addin "Cake.ExtendedNuGet" var MyGetKey = EnvironmentVariable("MYGET_KEY"); string BuildNumber = EnvironmentVariable("TRAVIS_BUILD_NUMBER"); string Branch = EnvironmentVariable("TRAVIS_BRANCH"); ReleaseNotes Notes = null; Task("Restore") .Does(() => { var settings = new DotNetCoreRestoreSettings { Sources = new[] { "https://www.myget.org/F/discord-net/api/v2", "https://www.nuget.org/api/v2" } }; DotNetCoreRestore(settings); }); Task("ReleaseNotes") .Does(() => { Notes = ParseReleaseNotes("./ReleaseNotes.md"); Information("Release Version: {0}", Notes.Version); }); Task("CodeGen") .Does(() => { using (var process = StartAndReturnProcess("luajit", new ProcessSettings { Arguments = "generate.lua" })) { process.WaitForExit(); var code = process.GetExitCode(); if (code != 0) { throw new Exception(string.Format("Code Generation script failed! Exited {0}", code)); } } }); Task("Build") .IsDependentOn("ReleaseNotes") .Does(() => { var suffix = BuildNumber != null ? BuildNumber.PadLeft(5,'0') : ""; var settings = new DotNetCorePackSettings { Configuration = "Release", OutputDirectory = "./artifacts/", EnvironmentVariables = new Dictionary<string, string> { { "BuildVersion", Notes.Version.ToString() }, { "BuildNumber", suffix }, { "ReleaseNotes", string.Join("\n", Notes.Notes) }, }, }; DotNetCorePack("./src/Discord.Addons.EmojiTools/", settings); }); Task("Test") .Does(() => { //DotNetCoreTest("./test/"); }); Task("Deploy") .WithCriteria(Branch == "master") .Does(() => { var settings = new NuGetPushSettings { Source = "https://www.myget.org/F/discord-net/api/v2/package", ApiKey = MyGetKey }; var packages = GetFiles("./artifacts/*.nupkg"); NuGetPush(packages, settings); }); Task("Default") .IsDependentOn("Restore") .IsDependentOn("CodeGen") .IsDependentOn("Build") .IsDependentOn("Test") .IsDependentOn("Deploy") .Does(() => { Information("Build Succeeded"); }); RunTarget("Default");
#addin nuget:?package=NuGet.Core&version=2.12.0 #addin "Cake.ExtendedNuGet" var MyGetKey = EnvironmentVariable("MYGET_KEY"); string BuildNumber = EnvironmentVariable("TRAVIS_BUILD_NUMBER"); string Branch = EnvironmentVariable("TRAVIS_BRANCH"); ReleaseNotes Notes = null; Task("Restore") .Does(() => { var settings = new DotNetCoreRestoreSettings { Sources = new[] { "https://www.myget.org/F/discord-net/api/v2", "https://www.nuget.org/api/v2" } }; DotNetCoreRestore(settings); }); Task("ReleaseNotes") .Does(() => { Notes = ParseReleaseNotes("./ReleaseNotes.md"); Information("Release Version: {0}", Notes.Version); }); Task("CodeGen") .Does(() => { using (var process = StartAndReturnProcess("luajit", new ProcessSettings { Arguments = "generate.lua" })) { process.WaitForExit(); var code = process.GetExitCode(); if (code != 0) { throw new Exception(string.Format("Code Generation script failed! Exited {0}", code)); } } }); Task("Build") .IsDependentOn("ReleaseNotes") .Does(() => { var suffix = BuildNumber != null ? BuildNumber.PadLeft(5,'0') : ""; var settings = new DotNetCorePackSettings { Configuration = "Release", OutputDirectory = "./artifacts/", EnvironmentVariables = new Dictionary<string, string> { { "BuildVersion", Notes.Version.ToString() }, { "BuildNumber", suffix }, { "ReleaseNotes", string.Join("\n", Notes.Notes) }, }, }; DotNetCorePack("./src/Discord.Addons.EmojiTools/", settings); }); Task("Test") .Does(() => { DotNetCoreTest("./test/"); }); Task("Deploy") .WithCriteria(Branch == "master") .Does(() => { var settings = new NuGetPushSettings { Source = "https://www.myget.org/F/discord-net/api/v2/package", ApiKey = MyGetKey }; var packages = GetFiles("./artifacts/*.nupkg"); NuGetPush(packages, settings); }); Task("Default") .IsDependentOn("Restore") .IsDependentOn("CodeGen") .IsDependentOn("Build") .IsDependentOn("Test") .IsDependentOn("Deploy") .Does(() => { Information("Build Succeeded"); }); RunTarget("Default");
isc
C#
502ab1396ce85171ce5e2efd568c98526e1dd6f1
Fix cake scripts
jamesmontemagno/InAppBillingPlugin
build.cake
build.cake
#addin "Cake.FileHelpers" var TARGET = Argument ("target", Argument ("t", "Default")); var version = EnvironmentVariable ("APPVEYOR_BUILD_VERSION") ?? Argument("version", "0.0.9999"); var libraries = new Dictionary<string, string> { { "./src/InAppBilling.sln", "Any" }, }; var BuildAction = new Action<Dictionary<string, string>> (solutions => { foreach (var sln in solutions) { // If the platform is Any build regardless // If the platform is Win and we are running on windows build // If the platform is Mac and we are running on Mac, build if ((sln.Value == "Any") || (sln.Value == "Win" && IsRunningOnWindows ()) || (sln.Value == "Mac" && IsRunningOnUnix ())) { // Bit of a hack to use nuget3 to restore packages for project.json if (IsRunningOnWindows ()) { Information ("RunningOn: {0}", "Windows"); NuGetRestore (sln.Key, new NuGetRestoreSettings { ToolPath = "./tools/nuget3.exe" }); // Windows Phone / Universal projects require not using the amd64 msbuild MSBuild (sln.Key, c => { c.Configuration = "Release"; c.MSBuildPlatform = Cake.Common.Tools.MSBuild.MSBuildPlatform.x86; }); } else { // Mac is easy ;) NuGetRestore (sln.Key); DotNetBuild (sln.Key, c => c.Configuration = "Release"); } } } }); Task("Libraries").Does(()=> { BuildAction(libraries); }); Task ("NuGet") .IsDependentOn ("Libraries") .Does (() => { if(!DirectoryExists("./Build/nuget/")) CreateDirectory("./Build/nuget"); NuGetPack ("./nuget/Plugin.nuspec", new NuGetPackSettings { Version = version, Verbosity = NuGetVerbosity.Detailed, OutputDirectory = "./Build/nuget/", BasePath = "./", ToolPath = "./tools/nuget3.exe" }); }); //Build the component, which build samples, nugets, and libraries Task ("Default").IsDependentOn("NuGet"); Task ("Clean").Does (() => { CleanDirectories ("./Build/"); CleanDirectories ("./**/bin"); CleanDirectories ("./**/obj"); }); RunTarget (TARGET);
#addin nuget:https://nuget.org/api/v2/?package=Cake.FileHelpers&version=1.0.3.2 #addin nuget:https://nuget.org/api/v2/?package=Cake.Xamarin&version=1.2.3 var TARGET = Argument ("target", Argument ("t", "Default")); var version = EnvironmentVariable ("APPVEYOR_BUILD_VERSION") ?? Argument("version", "0.0.9999"); var libraries = new Dictionary<string, string> { { "./src/InAppBilling.sln", "Any" }, }; var BuildAction = new Action<Dictionary<string, string>> (solutions => { foreach (var sln in solutions) { // If the platform is Any build regardless // If the platform is Win and we are running on windows build // If the platform is Mac and we are running on Mac, build if ((sln.Value == "Any") || (sln.Value == "Win" && IsRunningOnWindows ()) || (sln.Value == "Mac" && IsRunningOnUnix ())) { // Bit of a hack to use nuget3 to restore packages for project.json if (IsRunningOnWindows ()) { Information ("RunningOn: {0}", "Windows"); NuGetRestore (sln.Key, new NuGetRestoreSettings { ToolPath = "./tools/nuget3.exe" }); // Windows Phone / Universal projects require not using the amd64 msbuild MSBuild (sln.Key, c => { c.Configuration = "Release"; c.MSBuildPlatform = Cake.Common.Tools.MSBuild.MSBuildPlatform.x86; }); } else { // Mac is easy ;) NuGetRestore (sln.Key); DotNetBuild (sln.Key, c => c.Configuration = "Release"); } } } }); Task("Libraries").Does(()=> { BuildAction(libraries); }); Task ("NuGet") .IsDependentOn ("Libraries") .Does (() => { if(!DirectoryExists("./Build/nuget/")) CreateDirectory("./Build/nuget"); NuGetPack ("./nuget/Plugin.nuspec", new NuGetPackSettings { Version = version, Verbosity = NuGetVerbosity.Detailed, OutputDirectory = "./Build/nuget/", BasePath = "./", ToolPath = "./tools/nuget3.exe" }); }); //Build the component, which build samples, nugets, and libraries Task ("Default").IsDependentOn("NuGet"); Task ("Clean").Does (() => { CleanDirectories ("./Build/"); CleanDirectories ("./**/bin"); CleanDirectories ("./**/obj"); }); RunTarget (TARGET);
mit
C#
5ba7a759862e7cfeefc1d4a65713834f0df6f773
Fix incorrect version of Cake.Compression being specified
Zutatensuppe/DiabloInterface,Zutatensuppe/DiabloInterface
build.cake
build.cake
#addin nuget:?package=Cake.Compression&version=0.1.1 #addin nuget:?package=SharpZipLib&version=0.86.0 var target = Argument("target", "Default"); var configuration = Argument("configuration", "Release"); var buildNumber = Argument("buildNumber", "0"); var buildDir = Directory("./artifacts"); var binDir = buildDir + Directory("bin"); var solution = "./src/DiabloInterface.sln"; Task("Clean") .Does(() => { CleanDirectory(binDir); }); Task("RestorePackages") .IsDependentOn("Clean") .Does(() => { NuGetRestore(solution); }); Task("Build") .IsDependentOn("RestorePackages") .Does(() => { MSBuild(solution, settings => settings .SetConfiguration(configuration) .SetVerbosity(Verbosity.Minimal) ); }); Task("Package") .IsDependentOn("Build") .Does(() => { var path = "./src/DiabloInterface/bin/" + configuration + "/"; var allFiles = GetFiles(path + "*.dll") + GetFiles(path + "*.exe") + GetFiles(path + "*.config"); var files = allFiles.Where(x => !x.GetFilename().ToString().Contains(".vshost.exe")); Information("Copying from {0}", path); CopyFiles(files, binDir); var assemblyInfo = ParseAssemblyInfo("./src/DiabloInterface/Properties/AssemblyInfo.cs"); var fileName = string.Format("DiabloInterface-v{0}.zip", assemblyInfo.AssemblyInformationalVersion); ZipCompress(binDir, buildDir + File(fileName)); }); Task("Default") .IsDependentOn("Package"); RunTarget(target);
#addin nuget:?package=Cake.Compression&version=0.86.0 #addin nuget:?package=SharpZipLib&version=0.86.0 var target = Argument("target", "Default"); var configuration = Argument("configuration", "Release"); var buildNumber = Argument("buildNumber", "0"); var buildDir = Directory("./artifacts"); var binDir = buildDir + Directory("bin"); var solution = "./src/DiabloInterface.sln"; Task("Clean") .Does(() => { CleanDirectory(binDir); }); Task("RestorePackages") .IsDependentOn("Clean") .Does(() => { NuGetRestore(solution); }); Task("Build") .IsDependentOn("RestorePackages") .Does(() => { MSBuild(solution, settings => settings .SetConfiguration(configuration) .SetVerbosity(Verbosity.Minimal) ); }); Task("Package") .IsDependentOn("Build") .Does(() => { var path = "./src/DiabloInterface/bin/" + configuration + "/"; var allFiles = GetFiles(path + "*.dll") + GetFiles(path + "*.exe") + GetFiles(path + "*.config"); var files = allFiles.Where(x => !x.GetFilename().ToString().Contains(".vshost.exe")); Information("Copying from {0}", path); CopyFiles(files, binDir); var assemblyInfo = ParseAssemblyInfo("./src/DiabloInterface/Properties/AssemblyInfo.cs"); var fileName = string.Format("DiabloInterface-v{0}.zip", assemblyInfo.AssemblyInformationalVersion); ZipCompress(binDir, buildDir + File(fileName)); }); Task("Default") .IsDependentOn("Package"); RunTarget(target);
mit
C#
0491fd581a4516bf55a1d474de40e893351553cb
Reduce the verbosity of the Restore.
UselessToucan/osu,johnneijzen/osu,DrabWeb/osu,peppy/osu,EVAST9919/osu,DrabWeb/osu,DrabWeb/osu,peppy/osu-new,ZLima12/osu,ZLima12/osu,naoey/osu,NeoAdonis/osu,EVAST9919/osu,smoogipooo/osu,ppy/osu,NeoAdonis/osu,NeoAdonis/osu,naoey/osu,2yangk23/osu,naoey/osu,2yangk23/osu,UselessToucan/osu,smoogipoo/osu,peppy/osu,ppy/osu,smoogipoo/osu,johnneijzen/osu,UselessToucan/osu,smoogipoo/osu,ppy/osu,peppy/osu
build.cake
build.cake
#addin "nuget:?package=CodeFileSanity&version=0.0.21" #addin "nuget:?package=JetBrains.ReSharper.CommandLineTools&version=2018.2.2" #tool "nuget:?package=NVika.MSBuild&version=1.0.1" /////////////////////////////////////////////////////////////////////////////// // ARGUMENTS /////////////////////////////////////////////////////////////////////////////// var target = Argument("target", "Build"); var framework = Argument("framework", "netcoreapp2.1"); var configuration = Argument("configuration", "Release"); var osuDesktop = new FilePath("./osu.Desktop/osu.Desktop.csproj"); var osuSolution = new FilePath("./osu.sln"); /////////////////////////////////////////////////////////////////////////////// // TASKS /////////////////////////////////////////////////////////////////////////////// Task("Compile") .Does(() => { DotNetCoreBuild(osuDesktop.FullPath, new DotNetCoreBuildSettings { Framework = framework, Configuration = configuration }); }); Task("Test") .Does(() => { var testAssemblies = GetFiles("**/*.Tests/bin/**/*.Tests.dll"); DotNetCoreVSTest(testAssemblies, new DotNetCoreVSTestSettings { Logger = AppVeyor.IsRunningOnAppVeyor ? "Appveyor" : $"trx", Parallel = true, ToolTimeout = TimeSpan.FromMinutes(10), }); }); // windows only because both inspectcore and nvika depend on net45 Task("InspectCode") .WithCriteria(IsRunningOnWindows()) .IsDependentOn("Compile") .Does(() => { var nVikaToolPath = GetFiles("./tools/NVika.MSBuild.*/tools/NVika.exe").First(); DotNetCoreRestore(osuSolution.FullPath, new DotNetCoreRestoreSettings { Verbosity = DotNetCoreVerbosity.Quiet }); InspectCode(osuSolution, new InspectCodeSettings { CachesHome = "inspectcode", OutputFile = "inspectcodereport.xml", }); StartProcess(nVikaToolPath, @"parsereport ""inspectcodereport.xml"" --treatwarningsaserrors"); }); Task("CodeFileSanity") .Does(() => { ValidateCodeSanity(new ValidateCodeSanitySettings { RootDirectory = ".", IsAppveyorBuild = AppVeyor.IsRunningOnAppVeyor }); }); Task("Build") .IsDependentOn("CodeFileSanity") .IsDependentOn("InspectCode") .IsDependentOn("Test"); RunTarget(target);
#addin "nuget:?package=CodeFileSanity&version=0.0.21" #addin "nuget:?package=JetBrains.ReSharper.CommandLineTools&version=2018.2.2" #tool "nuget:?package=NVika.MSBuild&version=1.0.1" /////////////////////////////////////////////////////////////////////////////// // ARGUMENTS /////////////////////////////////////////////////////////////////////////////// var target = Argument("target", "Build"); var framework = Argument("framework", "netcoreapp2.1"); var configuration = Argument("configuration", "Release"); var osuDesktop = new FilePath("./osu.Desktop/osu.Desktop.csproj"); var osuSolution = new FilePath("./osu.sln"); /////////////////////////////////////////////////////////////////////////////// // TASKS /////////////////////////////////////////////////////////////////////////////// Task("Compile") .Does(() => { DotNetCoreBuild(osuDesktop.FullPath, new DotNetCoreBuildSettings { Framework = framework, Configuration = configuration }); }); Task("Test") .Does(() => { var testAssemblies = GetFiles("**/*.Tests/bin/**/*.Tests.dll"); DotNetCoreVSTest(testAssemblies, new DotNetCoreVSTestSettings { Logger = AppVeyor.IsRunningOnAppVeyor ? "Appveyor" : $"trx", Parallel = true, ToolTimeout = TimeSpan.FromMinutes(10), }); }); // windows only because both inspectcore and nvika depend on net45 Task("InspectCode") .WithCriteria(IsRunningOnWindows()) .IsDependentOn("Compile") .Does(() => { var nVikaToolPath = GetFiles("./tools/NVika.MSBuild.*/tools/NVika.exe").First(); DotNetCoreRestore(osuSolution.FullPath); InspectCode(osuSolution, new InspectCodeSettings { CachesHome = "inspectcode", OutputFile = "inspectcodereport.xml", }); StartProcess(nVikaToolPath, @"parsereport ""inspectcodereport.xml"" --treatwarningsaserrors"); }); Task("CodeFileSanity") .Does(() => { ValidateCodeSanity(new ValidateCodeSanitySettings { RootDirectory = ".", IsAppveyorBuild = AppVeyor.IsRunningOnAppVeyor }); }); Task("Build") .IsDependentOn("CodeFileSanity") .IsDependentOn("InspectCode") .IsDependentOn("Test"); RunTarget(target);
mit
C#
71deebfb32cf984ac4ed29d3f087b7f3df80ad80
Store sent date in UTC
IvionSauce/MeidoBot
Tell/TellEntry.cs
Tell/TellEntry.cs
using System; using System.Runtime.Serialization; [DataContract] class TellEntry { [DataMember] public readonly string From; [DataMember] public readonly string Message; [DataMember] public readonly DateTime SentDateUtc; public TimeSpan ElapsedTime { get { return DateTime.UtcNow - SentDateUtc; } } public TellEntry(string from, string message) { From = from; Message = message; SentDateUtc = DateTime.UtcNow; } }
using System; using System.Runtime.Serialization; [DataContract] class TellEntry { [DataMember] public readonly string From; [DataMember] public readonly string Message; [DataMember] public readonly DateTimeOffset SentDate; public TimeSpan ElapsedTime { get { return DateTimeOffset.Now - SentDate; } } public TellEntry(string from, string message) { From = from; Message = message; SentDate = DateTimeOffset.Now; } }
bsd-2-clause
C#
01d46a808388ffe58b854b08a2dc5af7930f3326
Update build.cake
geaz/coreDox,geaz/coreDox,geaz/coreDox
build.cake
build.cake
////////////////////////////////////////////////////////////////////// // ARGUMENTS ////////////////////////////////////////////////////////////////////// var target = Argument("target", "Default"); var configuration = Argument("configuration", "Release"); ////////////////////////////////////////////////////////////////////// // PREPARATION ////////////////////////////////////////////////////////////////////// var buildDir = Directory("./src/coreDox/bin") + Directory(configuration); //var distDir = Directory("./dist"); ////////////////////////////////////////////////////////////////////// // TASKS ////////////////////////////////////////////////////////////////////// Task("Clean") .Does(() => { CleanDirectory(buildDir); //CleanDirectory(distDir); }); Task("Restore-NuGet-Packages") .IsDependentOn("Clean") .Does(() => { DotNetCoreRestore("./src/coreDox.sln"); }); Task("Build") .IsDependentOn("Restore-NuGet-Packages") .Does(() => { DotNetCoreBuild("./src/coreDox.sln", new DotNetCoreBuildSettings() { Configuration = configuration, }); }); Task("Run-Unit-Tests") .IsDependentOn("Build") .Does(() => { DotNetCoreTest( "./tests/coreDox.Core.Tests/coreDox.Core.Tests.csproj", new DotNetCoreTestSettings() { Configuration = configuration, NoBuild = true, }); }); ////////////////////////////////////////////////////////////////////// // TASK TARGETS ////////////////////////////////////////////////////////////////////// Task("Default").IsDependentOn("Build"); ////////////////////////////////////////////////////////////////////// // EXECUTION ////////////////////////////////////////////////////////////////////// RunTarget(target);
////////////////////////////////////////////////////////////////////// // ARGUMENTS ////////////////////////////////////////////////////////////////////// var target = Argument("target", "Default"); var configuration = Argument("configuration", "Release"); ////////////////////////////////////////////////////////////////////// // PREPARATION ////////////////////////////////////////////////////////////////////// var buildDir = Directory("./src/coreDox/bin") + Directory(configuration); //var distDir = Directory("./dist"); ////////////////////////////////////////////////////////////////////// // TASKS ////////////////////////////////////////////////////////////////////// Task("Clean") .Does(() => { CleanDirectory(buildDir); //CleanDirectory(distDir); }); Task("Restore-NuGet-Packages") .IsDependentOn("Clean") .Does(() => { DotNetCoreRestore("./src/coreDox.sln"); }); Task("Build") .IsDependentOn("Restore-NuGet-Packages") .Does(() => { DotNetCoreBuild("./src/coreDox.sln", new DotNetCoreBuildSettings() { Configuration = configuration, }); }); Task("Run-Unit-Tests") .IsDependentOn("Build") .Does(() => { DotNetCoreTest( "./tests/coreDox.Core.Tests/coreDox.Core.Tests.csproj", new DotNetCoreTestSettings() { Configuration = configuration, NoBuild = true, }); }); ////////////////////////////////////////////////////////////////////// // TASK TARGETS ////////////////////////////////////////////////////////////////////// Task("Default").IsDependentOn("Run-Unit-Tests"); ////////////////////////////////////////////////////////////////////// // EXECUTION ////////////////////////////////////////////////////////////////////// RunTarget(target);
mit
C#
3dc044203c2abf9c56106801e21fd11a5653a464
Add 'side by side' support in Framework .NET 4.0 [SPRNET-1320]
spring-projects/spring-net,kvr000/spring-net,dreamofei/spring-net,likesea/spring-net,likesea/spring-net,spring-projects/spring-net,zi1jing/spring-net,djechelon/spring-net,kvr000/spring-net,dreamofei/spring-net,kvr000/spring-net,yonglehou/spring-net,spring-projects/spring-net,yonglehou/spring-net,likesea/spring-net,djechelon/spring-net,yonglehou/spring-net,zi1jing/spring-net
test/Spring/Spring.Core.Tests/AssemblyInfo.cs
test/Spring/Spring.Core.Tests/AssemblyInfo.cs
using System.Reflection; using System.Runtime.CompilerServices; #if NET_4_0 [assembly: System.Security.SecurityRules(System.Security.SecurityRuleSet.Level1)] #endif [assembly: AssemblyTitle("Spring.Core Tests")] [assembly: AssemblyDescription("Unit tests for Spring.Core assembly")]
using System.Reflection; using System.Runtime.CompilerServices; [assembly: AssemblyTitle("Spring.Core Tests")] [assembly: AssemblyDescription("Unit tests for Spring.Core assembly")]
apache-2.0
C#
f514a74df4655add45a7b4d287034670847f41ec
Update version number
Yonom/CupCake
CupCake/Properties/AssemblyInfo.cs
CupCake/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("CupCake")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("CupCake")] [assembly: AssemblyCopyright("Copyright © 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("45412037-53ac-4f20-97ce-4245dcc4c215")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.4.5")]
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("CupCake")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("CupCake")] [assembly: AssemblyCopyright("Copyright © 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("45412037-53ac-4f20-97ce-4245dcc4c215")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.4.0")]
mit
C#
67d5572da7be4a6f08f7b2ce9801bed7e0ec7f45
Update version number
Jericho/CakeMail.RestClient
CakeMail.RestClient/Properties/AssemblyInfo.cs
CakeMail.RestClient/Properties/AssemblyInfo.cs
using System.Reflection; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("CakeMail.RestClient")] [assembly: AssemblyDescription("CakeMail.RestClient is a .NET wrapper for the CakeMail API")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Jeremie Desautels")] [assembly: AssemblyProduct("CakeMail.RestClient")] [assembly: AssemblyCopyright("Copyright Jeremie Desautels © 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("3.0.0.0")] [assembly: AssemblyFileVersion("3.0.0.0")] [assembly: AssemblyInformationalVersion("3.0.0.0")]
using System.Reflection; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("CakeMail.RestClient")] [assembly: AssemblyDescription("CakeMail.RestClient is a .NET wrapper for the CakeMail API")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Jeremie Desautels")] [assembly: AssemblyProduct("CakeMail.RestClient")] [assembly: AssemblyCopyright("Copyright Jeremie Desautels © 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("2.0.0.0")] [assembly: AssemblyFileVersion("2.0.0.0")] [assembly: AssemblyInformationalVersion("2.0.0.0")]
mit
C#
7fd0aba4c08808ab3be790bfd9887a2ab7cac9c5
Make sure filename / href in document bundle are unique
digipost/signature-api-client-dotnet
Digipost.Signature.Api.Client.Core/Document.cs
Digipost.Signature.Api.Client.Core/Document.cs
using System; using System.IO; using Digipost.Signature.Api.Client.Core.Internal.Asice; using Digipost.Signature.Api.Client.Core.Internal.Extensions; namespace Digipost.Signature.Api.Client.Core { public class Document : IAsiceAttachable { public Document(string title, FileType fileType, string documentPath) : this(title, fileType, File.ReadAllBytes(documentPath)) { } public Document(string title, FileType fileType, byte[] documentBytes) { Title = title; FileName = $"{Guid.NewGuid()}{fileType.GetExtension()}"; MimeType = fileType.ToMimeType(); Bytes = documentBytes; Id = "Id_" + Guid.NewGuid(); } public string Title { get; } public string FileName { get; } public string Id { get; } public string MimeType { get; } public byte[] Bytes { get; } public override string ToString() { return $"Title: {Title}, Id: {Id}, MimeType: {MimeType}"; } } }
using System; using System.IO; using Digipost.Signature.Api.Client.Core.Internal.Asice; using Digipost.Signature.Api.Client.Core.Internal.Extensions; namespace Digipost.Signature.Api.Client.Core { public class Document : IAsiceAttachable { public Document(string title, FileType fileType, string documentPath) : this(title, fileType, File.ReadAllBytes(documentPath)) { } public Document(string title, FileType fileType, byte[] documentBytes) { Title = title; FileName = $"{title}{fileType.GetExtension()}"; MimeType = fileType.ToMimeType(); Bytes = documentBytes; Id = "Id_" + Guid.NewGuid(); } public string Title { get; } public string FileName { get; } public string Id { get; } public string MimeType { get; } public byte[] Bytes { get; } public override string ToString() { return $"Title: {Title}, Id: {Id}, MimeType: {MimeType}"; } } }
apache-2.0
C#
4cbd2c8d00c801bd395cc24ed230d242be3bd8f4
Add can delete property
CareerHub/.NET-CareerHub-API-Client,CareerHub/.NET-CareerHub-API-Client
Client/API/Trusted/Experiences/ExperienceModel.cs
Client/API/Trusted/Experiences/ExperienceModel.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace CareerHub.Client.API.Trusted.Experiences { public class ExperienceModel { public int ID { get; set; } public bool CanDelete { get; set; } public string Title { get; set; } public string Organisation { get; set; } public string Description { get; set; } public string ContactName { get; set; } public string ContactEmail { get; set; } public string ContactPhone { get; set; } public DateTime StartUtc { get; set; } public DateTime? EndUtc { get; set; } public DateTime Start { get; set; } public DateTime? End { get; set; } public int? TypeID { get; set; } public string Type { get; set; } public int? HoursID { get; set; } public string Hours { get; set; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace CareerHub.Client.API.Trusted.Experiences { public class ExperienceModel { public int ID { get; set; } public string Title { get; set; } public string Organisation { get; set; } public string Description { get; set; } public string ContactName { get; set; } public string ContactEmail { get; set; } public string ContactPhone { get; set; } public DateTime StartUtc { get; set; } public DateTime? EndUtc { get; set; } public DateTime Start { get; set; } public DateTime? End { get; set; } public int? TypeID { get; set; } public string Type { get; set; } public int? HoursID { get; set; } public string Hours { get; set; } } }
mit
C#
a74f7d19880941954424ad6c3c6236be44483586
Use version-independent LocalDB
DevExpress/DevExtreme.AspNet.Data,AlekseyMartynov/DevExtreme.AspNet.Data,DevExpress/DevExtreme.AspNet.Data,DevExpress/DevExtreme.AspNet.Data,AlekseyMartynov/DevExtreme.AspNet.Data,AlekseyMartynov/DevExtreme.AspNet.Data,DevExpress/DevExtreme.AspNet.Data,AlekseyMartynov/DevExtreme.AspNet.Data
net/DevExtreme.AspNet.Data.Tests.EF6/TestDbContext.cs
net/DevExtreme.AspNet.Data.Tests.EF6/TestDbContext.cs
using System; using System.Collections.Generic; using System.Data.Entity; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DevExtreme.AspNet.Data.Tests.EF6 { partial class TestDbContext : DbContext { static readonly object LOCK = new object(); static TestDbContext INSTANCE; private TestDbContext(params Type[] knownEntities) : base($"Data Source=(localdb)\\MSSQLLocalDB; Initial Catalog={typeof(TestDbContext).Assembly.GetName().Name}; Integrated Security=True") { } public static void Exec(Action<TestDbContext> action) { lock(LOCK) { if(INSTANCE == null) { INSTANCE = new TestDbContext(); INSTANCE.Database.Delete(); INSTANCE.Database.CreateIfNotExists(); } action(INSTANCE); } } } }
using System; using System.Collections.Generic; using System.Data.Entity; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DevExtreme.AspNet.Data.Tests.EF6 { partial class TestDbContext : DbContext { static readonly object LOCK = new object(); static TestDbContext INSTANCE; private TestDbContext(params Type[] knownEntities) : base($"Data Source=(localdb)\\v11.0; Initial Catalog={typeof(TestDbContext).Assembly.GetName().Name}; Integrated Security=True") { } public static void Exec(Action<TestDbContext> action) { lock(LOCK) { if(INSTANCE == null) { INSTANCE = new TestDbContext(); INSTANCE.Database.Delete(); INSTANCE.Database.CreateIfNotExists(); } action(INSTANCE); } } } }
mit
C#
835471ebe73c7764a960182192855bd9757f969a
Update example in light of #142 being fixed.
bbqchickenrobot/rethinkdb-net,nkreipke/rethinkdb-net,LukeForder/rethinkdb-net,Ernesto99/rethinkdb-net,nkreipke/rethinkdb-net,kangkot/rethinkdb-net,Ernesto99/rethinkdb-net,bbqchickenrobot/rethinkdb-net,LukeForder/rethinkdb-net,kangkot/rethinkdb-net
Examples/RethinkDb.Examples.ConsoleApp/Person.cs
Examples/RethinkDb.Examples.ConsoleApp/Person.cs
using System; using System.Runtime.Serialization; namespace RethinkDb.Examples.ConsoleApp { [DataContract] public class Person { public static IDatabaseQuery Db = Query.Db("test"); public static ITableQuery<Person> Table = Db.Table<Person>("people"); [DataMember(Name = "id", EmitDefaultValue = false)] public Guid Id; [DataMember] public string Name; } }
using System; using System.Runtime.Serialization; namespace RethinkDb.Examples.ConsoleApp { [DataContract] public class Person { public static IDatabaseQuery Db = Query.Db("test"); public static ITableQuery<Person> Table = Db.Table<Person>("people"); [DataMember(Name = "id", EmitDefaultValue = false)] public string Id; [DataMember] public string Name; } }
apache-2.0
C#
4f925224be6e0c378ba37422e8b8aa8ec894c68f
Add some phone controls
dirty-casuals/LD38-A-Small-World
Assets/Scripts/Core/PlayerController.cs
Assets/Scripts/Core/PlayerController.cs
using UnityEngine; public class PlayerController : MonoBehaviour { [SerializeField] private PaddleController _paddleController; private float halfScreenHeight; private void Start() { halfScreenHeight = Screen.height / 2; } private void Update() { float direction = 0.0f; if (Input.touchCount > 0) { Touch touch = Input.touches[0]; float posY = touch.position.y; if ( posY > halfScreenHeight ) { direction = 1.0f; } else if ( posY < halfScreenHeight ) { direction = -1.0f; } } else { direction = Input.GetAxis( "Vertical" ); } _paddleController.Direction = direction; } }
using UnityEngine; public class PlayerController : MonoBehaviour { [SerializeField] private PaddleController _paddleController; private void Update() { float direction = Input.GetAxis( "Vertical" ); _paddleController.Direction = direction; } }
mit
C#
22a556839bf9d8ccbcb7f2096c4098596ffeabae
add last name to short card representation
pashchuk/Hospital-MVVM-
Hospital/DesktopApp/ViewModel/CardViewModel.cs
Hospital/DesktopApp/ViewModel/CardViewModel.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Input; using DesktopApp.Commands; using DesktopApp.Model; namespace DesktopApp.ViewModel { public class CardViewModel : ViewModelBase { private Card _card; public string Name { get { return string.Format("{0} {1}", _card.Patient.FirstName, _card.Patient.LastName); } set { _card.Patient.FirstName = value; OnPropertyChanged("Name"); } } public int Age { get { return _card.Patient.Age; } set { _card.Patient.Age = value; OnPropertyChanged("Age"); } } public string Sex { get { return _card.Patient.Sex; } set { _card.Patient.Sex = value; OnPropertyChanged("Sex"); } } public CardViewModel(Card card) { _card = card; } public Card GetCard() { return _card; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Input; using DesktopApp.Commands; using DesktopApp.Model; namespace DesktopApp.ViewModel { public class CardViewModel : ViewModelBase { private Card _card; public string Name { get { return _card.Patient.FirstName; } set { _card.Patient.FirstName = value; OnPropertyChanged("Name"); } } public int Age { get { return _card.Patient.Age; } set { _card.Patient.Age = value; OnPropertyChanged("Age"); } } public string Sex { get { return _card.Patient.Sex; } set { _card.Patient.Sex = value; OnPropertyChanged("Sex"); } } public CardViewModel(Card card) { _card = card; } public Card GetCard() { return _card; } } }
mit
C#
85d7b54ebec61c1ecac86d48b284763b99f9d7df
add winforms project
urffin/MetaTagsChecker
MetaTagsChecker/MetaTagsChecker/Form1.Designer.cs
MetaTagsChecker/MetaTagsChecker/Form1.Designer.cs
namespace MetaTagsChecker { partial class MainForm { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.dataGridView1 = new System.Windows.Forms.DataGridView(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); this.SuspendLayout(); // // dataGridView1 // this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dataGridView1.Location = new System.Drawing.Point(22, 23); this.dataGridView1.Name = "dataGridView1"; this.dataGridView1.Size = new System.Drawing.Size(240, 150); this.dataGridView1.TabIndex = 0; // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(284, 261); this.Controls.Add(this.dataGridView1); this.Name = "MainForm"; this.Text = "MetaTags checker"; ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); this.ResumeLayout(false); } #endregion private System.Windows.Forms.DataGridView dataGridView1; } }
namespace MetaTagsChecker { partial class MainForm { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.SuspendLayout(); // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(284, 261); this.Name = "MainForm"; this.Text = "MetaTags checker"; this.ResumeLayout(false); } #endregion } }
mit
C#
359d13c1e33391f75bf0a126ad6b11199071007b
Enumerate once, make it readonly
AnthonySteele/NuKeeper,NuKeeperDotNet/NuKeeper,NuKeeperDotNet/NuKeeper,skolima/NuKeeper,skolima/NuKeeper,AnthonySteele/NuKeeper,skolima/NuKeeper,NuKeeperDotNet/NuKeeper,skolima/NuKeeper,NuKeeperDotNet/NuKeeper,AnthonySteele/NuKeeper,AnthonySteele/NuKeeper
NuKeeper/RepositoryInspection/PackageUpdateSet.cs
NuKeeper/RepositoryInspection/PackageUpdateSet.cs
using System; using System.Collections.Generic; using System.Linq; using NuGet.Packaging.Core; using NuGet.Versioning; namespace NuKeeper.RepositoryInspection { public class PackageUpdateSet { public PackageUpdateSet(PackageIdentity newPackage, IEnumerable<PackageInProject> currentPackages) { if (newPackage == null) { throw new ArgumentNullException(nameof(newPackage)); } if (currentPackages == null) { throw new ArgumentNullException(nameof(currentPackages)); } var currentPackagesList = currentPackages.ToList(); if (!currentPackagesList.Any()) { throw new ArgumentException($"{nameof(currentPackages)} is empty"); } if (currentPackagesList.Any(p => p.Id != newPackage.Id)) { throw new ArgumentException($"Updates must all be for package {newPackage.Id}"); } NewPackage = newPackage; CurrentPackages = currentPackagesList; } public PackageIdentity NewPackage { get; } public IReadOnlyCollection<PackageInProject> CurrentPackages { get; } public string PackageId => NewPackage.Id; public NuGetVersion NewVersion => NewPackage.Version; } }
using System; using System.Collections.Generic; using System.Linq; using NuGet.Packaging.Core; using NuGet.Versioning; namespace NuKeeper.RepositoryInspection { public class PackageUpdateSet { public PackageUpdateSet(PackageIdentity newPackage, IEnumerable<PackageInProject> currentPackages) { if (newPackage == null) { throw new ArgumentNullException(nameof(newPackage)); } if (currentPackages == null) { throw new ArgumentNullException(nameof(currentPackages)); } if (!currentPackages.Any()) { throw new ArgumentException($"{nameof(currentPackages)} is empty"); } if (currentPackages.Any(p => p.Id != newPackage.Id)) { throw new ArgumentException($"Updates must all be for package {newPackage.Id}"); } NewPackage = newPackage; CurrentPackages = currentPackages.ToList(); } public PackageIdentity NewPackage { get; } public List<PackageInProject> CurrentPackages { get; } public string PackageId => NewPackage.Id; public NuGetVersion NewVersion => NewPackage.Version; } }
apache-2.0
C#
f3a1f50ec4735d700b475842fd52a7ace1f5241c
Update View.cs
win120a/ACClassRoomUtil,win120a/ACClassRoomUtil
PowerOnLogger/PowerOnLoggerManagmentTool/View.cs
PowerOnLogger/PowerOnLoggerManagmentTool/View.cs
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.IO; using System.Collections; namespace PowerOnLoggerManagmentTool { public partial class View : Form { public View() { InitializeComponent(); } private void View_Load(object sender, EventArgs e) { listBox1.Hide(); String path = Environment.GetEnvironmentVariable("SystemRoot") + "\\System32\\AC-Engine\\PowerOnLogger"; IEnumerable enu0 = Directory.EnumerateFiles(path); listBox1.BeginUpdate(); foreach (string s in enu0) { string first = s.Replace(path + "\\", " "); string second = first.Replace("ACPOL_", " "); string third = second.Replace("_", " "); string forth = third.Replace("H ", ":").Replace("M ", ":"); string fifth = forth.Replace("S ", " "); string final = fifth.Replace(".aclog", " "); listBox1.Items.Add(final); } listBox1.EndUpdate(); listBox1.Show(); } private void button1_Click(object sender, EventArgs e) { this.Hide(); GC.Collect(); new Main().Show(); } } }
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.IO; using System.Collections; namespace PowerOnLoggerManagmentTool { public partial class View : Form { public View() { InitializeComponent(); } private void View_Load(object sender, EventArgs e) { listBox1.Hide(); String path = Environment.GetEnvironmentVariable("SystemRoot") + "\\System32\\AC-Engine\\PowerOnLogger"; IEnumerable enu0 = Directory.EnumerateFiles(path); listBox1.BeginUpdate(); foreach (string s in enu0) { string first = s.Replace(path + "\\", " "); string second = first.Replace("ACPOL_", " "); string third = second.Replace("_", " "); string forth = third.Replace("H ", ":").Replace("M ", ":"); string fifth = forth.Replace("S ", " "); string final = fifth.Replace(".aclog", " "); listBox1.Items.Add(final); } listBox1.EndUpdate(); listBox1.Show(); } private void button1_Click(object sender, EventArgs e) { this.Hide(); GC.Collect(); new Main().Show(); } } }
apache-2.0
C#
8b04b3c37d3a2fc38ef511d1ea3a4698415b65b7
bump version
raml-org/raml-dotnet-parser-2,raml-org/raml-dotnet-parser-2
source/Raml.Parser/Properties/AssemblyInfo.cs
source/Raml.Parser/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("RAML.Parser")] [assembly: AssemblyDescription("A RAML Parser implementation in .NET for all CLR languages. RESTful API Modeling Language (RAML) is a simple and succinct way of describing practically-RESTful APIs. It encourages reuse, enables discovery and pattern-sharing, and aims for merit-based emergence of best practices.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Mulesoft Inc")] [assembly: AssemblyProduct("Raml.Parser")] [assembly: AssemblyCopyright("Copyright © 2015 MuleSoft")] [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("d5f8e5f6-634a-4487-be70-591c4d8546f2")] // 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.6")]
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("RAML.Parser")] [assembly: AssemblyDescription("A RAML Parser implementation in .NET for all CLR languages. RESTful API Modeling Language (RAML) is a simple and succinct way of describing practically-RESTful APIs. It encourages reuse, enables discovery and pattern-sharing, and aims for merit-based emergence of best practices.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Mulesoft Inc")] [assembly: AssemblyProduct("Raml.Parser")] [assembly: AssemblyCopyright("Copyright © 2015 MuleSoft")] [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("d5f8e5f6-634a-4487-be70-591c4d8546f2")] // 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.5")]
apache-2.0
C#
1252c86245ed1c0b965caabf8a8a25f1458a88a1
Use a unique guid for the OptionsPage (#872)
Microsoft/dotnet-apiport,mjrousos/dotnet-apiport,Microsoft/dotnet-apiport,Microsoft/dotnet-apiport,mjrousos/dotnet-apiport
src/ApiPort/ApiPort.VisualStudio/Views/OptionsPage.cs
src/ApiPort/ApiPort.VisualStudio/Views/OptionsPage.cs
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Autofac.Features.OwnedInstances; using Microsoft.VisualStudio.Shell; using System; using System.Runtime.InteropServices; using System.Windows; namespace ApiPortVS.Views { [ClassInterface(ClassInterfaceType.AutoDual)] [Guid("6D5D3696-1D53-43B9-B848-67B23747A254")] // Every options page should have a unique one internal class OptionsPage : UIElementDialogPage { private readonly Owned<OptionsPageControl> _optionsPageControl; public OptionsPage() { #if !DEBUG // Debug builds don't trigger the WPF bug described below AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve; #endif _optionsPageControl = ApiPortVSPackage.LocalServiceProvider .GetService(typeof(Owned<OptionsPageControl>)) as Owned<OptionsPageControl>; } #if !DEBUG // A closed, won't-fix bug in WPF (http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems#id=202873&_a=edit) // results in a failed search for this assembly with no PublicKeyToken when this assembly is signed. // The below works around this bug by completing the search. private System.Reflection.Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args) { var assemblySimpleName = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name; if (args.Name.IndexOf(assemblySimpleName, StringComparison.OrdinalIgnoreCase) != -1) { AppDomain.CurrentDomain.AssemblyResolve -= CurrentDomain_AssemblyResolve; // only need to do this once return System.Reflection.Assembly.GetExecutingAssembly(); // assumes the project was il merged } return null; } #endif protected override UIElement Child { get { return _optionsPageControl.Value; } } protected override void Dispose(bool disposing) { if (_optionsPageControl != null) { _optionsPageControl.Dispose(); } base.Dispose(disposing); } } }
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Autofac.Features.OwnedInstances; using Microsoft.VisualStudio.Shell; using System; using System.Runtime.InteropServices; using System.Windows; namespace ApiPortVS.Views { [ClassInterface(ClassInterfaceType.AutoDual)] [Guid("1D9ECCF3-5D2F-4112-9B25-264596873DC9")] // identifies this as a custom dialog pane internal class OptionsPage : UIElementDialogPage { private readonly Owned<OptionsPageControl> _optionsPageControl; public OptionsPage() { #if !DEBUG // Debug builds don't trigger the WPF bug described below AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve; #endif _optionsPageControl = ApiPortVSPackage.LocalServiceProvider .GetService(typeof(Owned<OptionsPageControl>)) as Owned<OptionsPageControl>; } #if !DEBUG // A closed, won't-fix bug in WPF (http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems#id=202873&_a=edit) // results in a failed search for this assembly with no PublicKeyToken when this assembly is signed. // The below works around this bug by completing the search. private System.Reflection.Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args) { var assemblySimpleName = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name; if (args.Name.IndexOf(assemblySimpleName, StringComparison.OrdinalIgnoreCase) != -1) { AppDomain.CurrentDomain.AssemblyResolve -= CurrentDomain_AssemblyResolve; // only need to do this once return System.Reflection.Assembly.GetExecutingAssembly(); // assumes the project was il merged } return null; } #endif protected override UIElement Child { get { return _optionsPageControl.Value; } } protected override void Dispose(bool disposing) { if (_optionsPageControl != null) { _optionsPageControl.Dispose(); } base.Dispose(disposing); } } }
mit
C#
e721fce567772ef0c099fb01690b1ea8c280d312
Fix CA1060: Move P/Invokes to NativeMethods class
olegtarasov/oxyplot,lynxkor/oxyplot,Mitch-Connor/oxyplot,ze-pequeno/oxyplot,svendu/oxyplot,jeremyiverson/oxyplot,shoelzer/oxyplot,freudenthal/oxyplot,jeremyiverson/oxyplot,shoelzer/oxyplot,lynxkor/oxyplot,svendu/oxyplot,Sbosanquet/oxyplot,as-zhuravlev/oxyplot_wpf_fork,objorke/oxyplot,bbqchickenrobot/oxyplot,br111an/oxyplot,Mitch-Connor/oxyplot,Kaplas80/oxyplot,olegtarasov/oxyplot,Isolocis/oxyplot,Sbosanquet/oxyplot,freudenthal/oxyplot,br111an/oxyplot,TheAlmightyBob/oxyplot,Jofta/oxyplot,lynxkor/oxyplot,GeertvanHorrik/oxyplot,svendu/oxyplot,HermanEldering/oxyplot,br111an/oxyplot,Rustemt/oxyplot,GeertvanHorrik/oxyplot,Kaplas80/oxyplot,as-zhuravlev/oxyplot_wpf_fork,Rustemt/oxyplot,Sbosanquet/oxyplot,as-zhuravlev/oxyplot_wpf_fork,jeremyiverson/oxyplot,DotNetDoctor/oxyplot,HermanEldering/oxyplot,TheAlmightyBob/oxyplot,objorke/oxyplot,H2ONaCl/oxyplot,TheAlmightyBob/oxyplot,bbqchickenrobot/oxyplot,objorke/oxyplot,bbqchickenrobot/oxyplot,H2ONaCl/oxyplot,Mitch-Connor/oxyplot,DotNetDoctor/oxyplot,Jonarw/oxyplot,NilesDavis/oxyplot,GeertvanHorrik/oxyplot,H2ONaCl/oxyplot,oxyplot/oxyplot,freudenthal/oxyplot,zur003/oxyplot,shoelzer/oxyplot,Rustemt/oxyplot
Source/Examples/WPF/WpfExamples/ScreenCapture.cs
Source/Examples/WPF/WpfExamples/ScreenCapture.cs
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="ScreenCapture.cs" company="OxyPlot"> // Copyright (c) 2014 OxyPlot contributors // </copyright> // -------------------------------------------------------------------------------------------------------------------- namespace WpfExamples { using System; using System.Drawing; using System.Runtime.InteropServices; public static class ScreenCapture { public static Bitmap Capture(int left, int top, int width, int height) { var hDesk = NativeMethods.GetDesktopWindow(); var hSrce = NativeMethods.GetWindowDC(hDesk); var hDest = NativeMethods.CreateCompatibleDC(hSrce); var hBmp = NativeMethods.CreateCompatibleBitmap(hSrce, width, height); var hOldBmp = NativeMethods.SelectObject(hDest, hBmp); NativeMethods.BitBlt(hDest, 0, 0, width, height, hSrce, left, top, CopyPixelOperation.SourceCopy | CopyPixelOperation.CaptureBlt); var bmp = Image.FromHbitmap(hBmp); NativeMethods.SelectObject(hDest, hOldBmp); NativeMethods.DeleteObject(hBmp); NativeMethods.DeleteDC(hDest); NativeMethods.ReleaseDC(hDesk, hSrce); return bmp; } private static class NativeMethods { [DllImport("gdi32.dll")] public static extern bool BitBlt(IntPtr hdcDest, int xDest, int yDest, int wDest, int hDest, IntPtr hdcSource, int xSrc, int ySrc, CopyPixelOperation rop); [DllImport("user32.dll")] public static extern bool ReleaseDC(IntPtr hWnd, IntPtr hDc); [DllImport("gdi32.dll")] public static extern IntPtr DeleteDC(IntPtr hDc); [DllImport("gdi32.dll")] public static extern IntPtr DeleteObject(IntPtr hDc); [DllImport("gdi32.dll")] public static extern IntPtr CreateCompatibleBitmap(IntPtr hdc, int nWidth, int nHeight); [DllImport("gdi32.dll")] public static extern IntPtr CreateCompatibleDC(IntPtr hdc); [DllImport("gdi32.dll")] public static extern IntPtr SelectObject(IntPtr hdc, IntPtr bmp); [DllImport("user32.dll")] public static extern IntPtr GetDesktopWindow(); [DllImport("user32.dll")] public static extern IntPtr GetWindowDC(IntPtr ptr); } } }
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="ScreenCapture.cs" company="OxyPlot"> // Copyright (c) 2014 OxyPlot contributors // </copyright> // -------------------------------------------------------------------------------------------------------------------- namespace WpfExamples { using System; using System.Drawing; using System.Runtime.InteropServices; public static class ScreenCapture { [DllImport("gdi32.dll")] static extern bool BitBlt(IntPtr hdcDest, int xDest, int yDest, int wDest, int hDest, IntPtr hdcSource, int xSrc, int ySrc, CopyPixelOperation rop); [DllImport("user32.dll")] static extern bool ReleaseDC(IntPtr hWnd, IntPtr hDc); [DllImport("gdi32.dll")] static extern IntPtr DeleteDC(IntPtr hDc); [DllImport("gdi32.dll")] static extern IntPtr DeleteObject(IntPtr hDc); [DllImport("gdi32.dll")] static extern IntPtr CreateCompatibleBitmap(IntPtr hdc, int nWidth, int nHeight); [DllImport("gdi32.dll")] static extern IntPtr CreateCompatibleDC(IntPtr hdc); [DllImport("gdi32.dll")] static extern IntPtr SelectObject(IntPtr hdc, IntPtr bmp); [DllImport("user32.dll")] public static extern IntPtr GetDesktopWindow(); [DllImport("user32.dll")] static extern IntPtr GetWindowDC(IntPtr ptr); public static Bitmap Capture(int left, int top, int width, int height) { var hDesk = GetDesktopWindow(); var hSrce = GetWindowDC(hDesk); var hDest = CreateCompatibleDC(hSrce); var hBmp = CreateCompatibleBitmap(hSrce, width, height); var hOldBmp = SelectObject(hDest, hBmp); BitBlt(hDest, 0, 0, width, height, hSrce, left, top, CopyPixelOperation.SourceCopy | CopyPixelOperation.CaptureBlt); var bmp = Image.FromHbitmap(hBmp); SelectObject(hDest, hOldBmp); DeleteObject(hBmp); DeleteDC(hDest); ReleaseDC(hDesk, hSrce); return bmp; } } }
mit
C#
d137f3bbf8cb9c4e051294b2a3521651e8e3c4cb
Cover all value types in IsPrimitive
mrahhal/MR.Augmenter,mrahhal/MR.Augmenter
src/MR.Augmenter/Internal/ReflectionHelper.cs
src/MR.Augmenter/Internal/ReflectionHelper.cs
using System; using System.Collections; using System.Collections.Generic; using System.Reflection; namespace MR.Augmenter.Internal { internal static class ReflectionHelper { public static List<Type> IncludeBaseTypes(Type type, bool withSelf = false) { var list = new List<Type>(); if (withSelf) { list.Add(type); } TypeInfo pivot = type.GetTypeInfo(); while (true) { if (pivot.BaseType == null) { break; } pivot = pivot.BaseType.GetTypeInfo(); if (pivot.AsType() == typeof(object)) { break; } list.Add(pivot.AsType()); } list.Reverse(); return list; } public static bool IsPrimitive(Type type) { var typeInfo = type.GetTypeInfo(); return typeInfo.IsPrimitive || typeInfo.IsValueType || type == typeof(string); } public static bool IsEnumerableOrArrayType(Type type, out Type elementType) { var ti = type.GetTypeInfo(); elementType = ti.GetElementType(); if (elementType != null) { return true; } if (!ti.IsGenericType) { return false; } if (!typeof(IEnumerable).GetTypeInfo().IsAssignableFrom(ti)) { return false; } elementType = ti.GenericTypeArguments[0]; return true; } } }
using System; using System.Collections; using System.Collections.Generic; using System.Reflection; namespace MR.Augmenter.Internal { internal static class ReflectionHelper { public static List<Type> IncludeBaseTypes(Type type, bool withSelf = false) { var list = new List<Type>(); if (withSelf) { list.Add(type); } TypeInfo pivot = type.GetTypeInfo(); while (true) { if (pivot.BaseType == null) { break; } pivot = pivot.BaseType.GetTypeInfo(); if (pivot.AsType() == typeof(object)) { break; } list.Add(pivot.AsType()); } list.Reverse(); return list; } public static bool IsPrimitive(Type type) { return type.GetTypeInfo().IsPrimitive || type == typeof(string) || type == typeof(DateTime) || type == typeof(DateTimeOffset) || type.GetTypeInfo().IsEnum; } public static bool IsEnumerableOrArrayType(Type type, out Type elementType) { var ti = type.GetTypeInfo(); elementType = ti.GetElementType(); if (elementType != null) { return true; } if (!ti.IsGenericType) { return false; } if (!typeof(IEnumerable).GetTypeInfo().IsAssignableFrom(ti)) { return false; } elementType = ti.GenericTypeArguments[0]; return true; } } }
mit
C#
eeb3fcae070c840a92c846e614b641a6ea0155f5
Update Dev12 ProjectProperties file for new xaml2cs.exe tool
zbrad/nuproj,faustoscardovi/nuproj,kovalikp/nuproj,PedroLamas/nuproj,NN---/nuproj,oliver-feng/nuproj,nuproj/nuproj,AArnott/nuproj,ericstj/nuproj
src/NuProj.Package/NuProjProjectProperties.cs
src/NuProj.Package/NuProjProjectProperties.cs
using System.ComponentModel.Composition; using Microsoft.VisualStudio.ProjectSystem; using Microsoft.VisualStudio.ProjectSystem.Properties; using Microsoft.VisualStudio.ProjectSystem.Utilities; namespace NuProj.ProjectSystem { /// <summary> /// Provides rule-based property access. /// </summary> [Export] #if Dev12 [PartMetadata(ProjectCapabilities.Requires, NuProjCapabilities.NuProj)] #else [AppliesTo(NuProjCapabilities.NuProj)] #endif internal partial class NuProjProjectProperties : StronglyTypedPropertyAccess { /// <summary> /// Initializes a new instance of the <see cref="ProjectProperties"/> class. /// </summary> [ImportingConstructor] public NuProjProjectProperties([Import] ConfiguredProject configuredProject) : base(configuredProject) { } /// <summary> /// Initializes a new instance of the <see cref="ProjectProperties"/> class. /// </summary> public NuProjProjectProperties(ConfiguredProject configuredProject, string file, string itemType, string itemName) : base(configuredProject, file, itemType, itemName) { } /// <summary> /// Initializes a new instance of the <see cref="ProjectProperties"/> class. /// </summary> public NuProjProjectProperties(ConfiguredProject configuredProject, IProjectPropertiesContext projectPropertiesContext) : base(configuredProject, projectPropertiesContext) { } /// <summary> /// Initializes a new instance of the <see cref="ProjectProperties"/> class. /// </summary> public NuProjProjectProperties(ConfiguredProject configuredProject, UnconfiguredProject unconfiguredProject) : base(configuredProject, unconfiguredProject) { } } }
using System.ComponentModel.Composition; using Microsoft.VisualStudio.ProjectSystem; using Microsoft.VisualStudio.ProjectSystem.Properties; using Microsoft.VisualStudio.ProjectSystem.Utilities; namespace NuProj.ProjectSystem { /// <summary> /// Provides rule-based property access. /// </summary> [Export] #if Dev12 [PartMetadata(ProjectCapabilities.Requires, NuProjCapabilities.NuProj)] internal sealed partial class NuProjProjectProperties { /// <summary> /// The configured project. /// </summary> [Import] private ConfiguredProject ConfiguredProject { get; set; } /// <summary> /// The file context for the properties. /// </summary> private string File { get; set; } /// <summary> /// The item type context for the properties. /// </summary> private string ItemType { get; set; } /// <summary> /// The item name context for the properties. /// </summary> private string ItemName { get; set; } } #else [AppliesTo(NuProjCapabilities.NuProj)] internal partial class NuProjProjectProperties : StronglyTypedPropertyAccess { /// <summary> /// Initializes a new instance of the <see cref="ProjectProperties"/> class. /// </summary> [ImportingConstructor] public NuProjProjectProperties([Import] ConfiguredProject configuredProject) : base(configuredProject) { } /// <summary> /// Initializes a new instance of the <see cref="ProjectProperties"/> class. /// </summary> public NuProjProjectProperties(ConfiguredProject configuredProject, string file, string itemType, string itemName) : base(configuredProject, file, itemType, itemName) { } /// <summary> /// Initializes a new instance of the <see cref="ProjectProperties"/> class. /// </summary> public NuProjProjectProperties(ConfiguredProject configuredProject, IProjectPropertiesContext projectPropertiesContext) : base(configuredProject, projectPropertiesContext) { } /// <summary> /// Initializes a new instance of the <see cref="ProjectProperties"/> class. /// </summary> public NuProjProjectProperties(ConfiguredProject configuredProject, UnconfiguredProject unconfiguredProject) : base(configuredProject, unconfiguredProject) { } } #endif }
mit
C#
9d1a4d2780340681ad795533e41b7a82e1b5a1ea
Replace Console Write with Log.Info
genius394/PogoLocationFeeder,5andr0/PogoLocationFeeder,5andr0/PogoLocationFeeder
PogoLocationFeeder/Readers/DiscordWebReader.cs
PogoLocationFeeder/Readers/DiscordWebReader.cs
using PogoLocationFeeder.Helper; using System; using System.IO; using System.Net; using System.Threading; namespace PogoLocationFeeder { public class DiscordWebReader { WebClient wc { get; set; } public Stream stream = null; public DiscordWebReader() { InitializeWebClient(); } public void InitializeWebClient() { var request = WebRequest.Create(new Uri("http://pogo-feed.mmoex.com/messages")); ((HttpWebRequest)request).AllowReadStreamBuffering = false; try { var response = request.GetResponse(); Log.Info($"Connection established. Waiting for data..."); stream = response.GetResponseStream(); } catch (WebException e) { Log.Warn($"Experiencing connection issues. Throttling..."); Thread.Sleep(30 * 1000); } catch (Exception e) { Log.Warn($"Exception: {e.ToString()}\n\n\n"); } } public class AuthorStruct { public string username; public string id; public string discriminator; public string avatar; } public class DiscordMessage { public string id = ""; public string channel_id = ""; //public List<AuthorStruct> author; public string content = ""; public string timestamp = ""; //public string edited_timestamp = null; public bool tts = false; //public bool mention_everyone = false; //public bool pinned = false; //public bool deleted = false; //public string nonce = ""; //public string mentions = ""; //public string mention_roles = ""; //public xxx attachments = ""; //public xxx embeds = ""; } } }
using PogoLocationFeeder.Helper; using System; using System.IO; using System.Net; using System.Threading; namespace PogoLocationFeeder { public class DiscordWebReader { WebClient wc { get; set; } public Stream stream = null; public DiscordWebReader() { InitializeWebClient(); } public void InitializeWebClient() { var request = WebRequest.Create(new Uri("http://pogo-feed.mmoex.com/messages")); ((HttpWebRequest)request).AllowReadStreamBuffering = false; try { var response = request.GetResponse(); Console.WriteLine($"Connection established. Waiting for data..."); stream = response.GetResponseStream(); } catch (WebException e) { Log.Warn($"Experiencing connection issues. Throttling..."); Thread.Sleep(30 * 1000); } catch (Exception e) { Log.Warn($"Exception: {e.ToString()}\n\n\n"); } } public class AuthorStruct { public string username; public string id; public string discriminator; public string avatar; } public class DiscordMessage { public string id = ""; public string channel_id = ""; //public List<AuthorStruct> author; public string content = ""; public string timestamp = ""; //public string edited_timestamp = null; public bool tts = false; //public bool mention_everyone = false; //public bool pinned = false; //public bool deleted = false; //public string nonce = ""; //public string mentions = ""; //public string mention_roles = ""; //public xxx attachments = ""; //public xxx embeds = ""; } } }
agpl-3.0
C#
5d0e8f1d65adafb83e99bc140371263c317cdbbf
Change class access level
yamachu/Mastodot
Mastodot/Utils/MastodonJsonConverter.cs
Mastodot/Utils/MastodonJsonConverter.cs
using System; using System.Reflection; using Mastodot.Entities; using Mastodot.Utils.JsonConverters; using Newtonsoft.Json; namespace Mastodot.Utils { internal class MastodonJsonConverter { public static T TryDeserialize<T>(string body) { var deserialized = JsonConvert.DeserializeObject<T>(body, new ErrorThrowJsonConverter<T>()); if (deserialized is IBaseMastodonEntity) { ((IBaseMastodonEntity)deserialized).RawJson = body; } return deserialized; } public static string TrySerialize<T>(T obj) { PropertyInfo _info = null; foreach (var info in typeof(T).GetRuntimeProperties()) { if (info.Name.Equals("ForceSerializeForDump")) { _info = info; info.SetValue(null, true); break; } } var serialized = JsonConvert.SerializeObject(obj); if (_info != null) { _info.SetValue(null, false); } return serialized; } } }
using System; using System.Reflection; using Mastodot.Entities; using Mastodot.Utils.JsonConverters; using Newtonsoft.Json; namespace Mastodot.Utils { public class MastodonJsonConverter { public static T TryDeserialize<T>(string body) { var deserialized = JsonConvert.DeserializeObject<T>(body, new ErrorThrowJsonConverter<T>()); if (deserialized is IBaseMastodonEntity) { ((IBaseMastodonEntity)deserialized).RawJson = body; } return deserialized; } public static string TrySerialize<T>(T obj) { PropertyInfo _info = null; foreach (var info in typeof(T).GetRuntimeProperties()) { if (info.Name.Equals("ForceSerializeForDump")) { _info = info; info.SetValue(null, true); break; } } var serialized = JsonConvert.SerializeObject(obj); if (_info != null) { _info.SetValue(null, false); } return serialized; } } }
mit
C#
37e7e6d5851b0d819cf069b4d370312cea04e8bd
Add missing VTexFormat IA88
SteamDatabase/ValveResourceFormat
ValveResourceFormat/Resource/Enums/VTexFormat.cs
ValveResourceFormat/Resource/Enums/VTexFormat.cs
using System; namespace ValveResourceFormat { public enum VTexFormat { #pragma warning disable 1591 UNKNOWN = 0, DXT1 = 1, DXT5 = 2, I8 = 3, RGBA8888 = 4, R16 = 5, RG1616 = 6, RGBA16161616 = 7, R16F = 8, RG1616F = 9, RGBA16161616F = 10, R32F = 11, RG3232F = 12, RGB323232F = 13, RGBA32323232F = 14, IA88 = 15, PNG = 16, // TODO: resourceinfo doesn't know about this JPG = 17, PNG2 = 18, // TODO: Why is there PNG twice? #pragma warning restore 1591 } }
using System; namespace ValveResourceFormat { public enum VTexFormat { #pragma warning disable 1591 UNKNOWN = 0, DXT1 = 1, DXT5 = 2, I8 = 3, RGBA8888 = 4, R16 = 5, RG1616 = 6, RGBA16161616 = 7, R16F = 8, RG1616F = 9, RGBA16161616F = 10, R32F = 11, RG3232F = 12, RGB323232F = 13, RGBA32323232F = 14, PNG = 16, // TODO: resourceinfo doesn't know about this JPG = 17, PNG2 = 18, // TODO: Why is there PNG twice? #pragma warning restore 1591 } }
mit
C#
5f09fa49d2916e704061a921379d988d7bdc828d
Resolve another rebasing error
Xeeynamo/KingdomHearts
OpenKh.Tools.CtdEditor/App.xaml.cs
OpenKh.Tools.CtdEditor/App.xaml.cs
using System.Windows; namespace OpenKh.Tools.CtdEditor { /// <summary> /// Interaction logic for App.xaml /// </summary> public partial class App : Application { } }
using System; using System.Collections.Generic; using System.Configuration; using System.Data; using System.Linq; using System.Threading.Tasks; using System.Windows; <<<<<<< HEAD:OpenKh.Tools.CtdEditor/App.xaml.cs namespace OpenKh.Tools.CtdEditor ======= namespace OpenKh.Tools.Kh2BattleEditor >>>>>>> 1dafc52c7e4bcd9acdd7f44d13b9926d871a7598:OpenKh.Tools.Kh2BattleEditor/App.xaml.cs { /// <summary> /// Interaction logic for App.xaml /// </summary> public partial class App : Application { } }
mit
C#
289446b412b6a45e1c8820bccb6e6b8478b8b1af
stop response
kheiakiyama/pomodoro-bot,kheiakiyama/pomodoro-bot,kheiakiyama/pomodoro-bot
PomodoroBot/Command/StopCommand.cs
PomodoroBot/Command/StopCommand.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.Bot.Connector; using Microsoft.Bot.Builder.Dialogs; using Microsoft.Bot.Builder.FormFlow; using PomodoroBot.Models; using Microsoft.WindowsAzure.Storage.Queue; using Newtonsoft.Json; using System.Text.RegularExpressions; namespace PomodoroBot.Command { public class StopCommand : ICommand { private Regex m_Regex = new Regex(@"stop ([0-9a-f]{32})"); public bool DoHandle(Message message) { return m_Regex.IsMatch(message.Text.ToLower()); } public async Task<Message> Reply(Message message) { var id = m_Regex.Match(message.Text.ToLower()).Groups[1].Value; PomodoroTimerBackend timer = new PomodoroTimerBackend(); var entity = await CommandTool.Instance.Repository.Find(id); if (entity != null && await timer.Stop(entity.RowKey)) return message.CreateReplyMessage("timer is stopped"); else return message.CreateReplyMessage($"timer can't stop. id:{id}"); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.Bot.Connector; using Microsoft.Bot.Builder.Dialogs; using Microsoft.Bot.Builder.FormFlow; using PomodoroBot.Models; using Microsoft.WindowsAzure.Storage.Queue; using Newtonsoft.Json; using System.Text.RegularExpressions; namespace PomodoroBot.Command { public class StopCommand : ICommand { private Regex m_Regex = new Regex(@"stop ([0-9a-f]{32})"); public bool DoHandle(Message message) { return m_Regex.IsMatch(message.Text.ToLower()); } public async Task<Message> Reply(Message message) { var id = m_Regex.Match(message.Text.ToLower()).Groups[1].Value; PomodoroTimerBackend timer = new PomodoroTimerBackend(); var entity = await CommandTool.Instance.Repository.Find(id); if (entity != null && await timer.Stop(entity.RowKey)) return message.CreateReplyMessage(""); else return message.CreateReplyMessage($"timer can't stop. id:{id}"); } } }
mit
C#
ab14d4c7c82a1e8f8991e60134ce0f823815204e
Fix insufficient path buffer size for SymbolicLinkReparseData structure
michaelmelancon/symboliclinksupport
SymbolicLinkSupport/SymbolicLinkReparseData.cs
SymbolicLinkSupport/SymbolicLinkReparseData.cs
using System.Runtime.InteropServices; namespace SymbolicLinkSupport { /// <remarks> /// Refer to http://msdn.microsoft.com/en-us/library/windows/hardware/ff552012%28v=vs.85%29.aspx /// </remarks> [StructLayout(LayoutKind.Sequential)] internal struct SymbolicLinkReparseData { // Not certain about this! private const int maxUnicodePathLength = 260 * 2; public uint ReparseTag; public ushort ReparseDataLength; public ushort Reserved; public ushort SubstituteNameOffset; public ushort SubstituteNameLength; public ushort PrintNameOffset; public ushort PrintNameLength; public uint Flags; // PathBuffer needs to be able to contain both SubstituteName and PrintName, // so needs to be 2 * maximum of each [MarshalAs(UnmanagedType.ByValArray, SizeConst = maxUnicodePathLength * 2)] public byte[] PathBuffer; } }
using System.Runtime.InteropServices; namespace SymbolicLinkSupport { /// <remarks> /// Refer to http://msdn.microsoft.com/en-us/library/windows/hardware/ff552012%28v=vs.85%29.aspx /// </remarks> [StructLayout(LayoutKind.Sequential)] internal struct SymbolicLinkReparseData { // Not certain about this! private const int maxUnicodePathLength = 260 * 2; public uint ReparseTag; public ushort ReparseDataLength; public ushort Reserved; public ushort SubstituteNameOffset; public ushort SubstituteNameLength; public ushort PrintNameOffset; public ushort PrintNameLength; public uint Flags; [MarshalAs(UnmanagedType.ByValArray, SizeConst = maxUnicodePathLength)] public byte[] PathBuffer; } }
mit
C#
ae135eaeb7bfc93b9a9e5fa0cb66a4149e7c1502
bump to 1.12.5
Terradue/DotNetOpenSearch
Terradue.OpenSearch/Properties/AssemblyInfo.cs
Terradue.OpenSearch/Properties/AssemblyInfo.cs
/* * Copyright (C) 2010-2014 Terradue S.r.l. * * This file is part of Terradue.OpenSearch. * * Foobar is free software: you can redistribute it and/or modify it under the terms of the * GNU General Public License as published by the Free Software Foundation, * either version 3 of the License, or (at your option) any later version. * * Foobar is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with Terradue.OpenSearch. * If not, see http://www.gnu.org/licenses/. */ /*! \namespace Terradue.OpenSearch @{ Terradue.OpenSearch is a .Net library that provides an engine perform OpenSearch query from a class or an URL to multiple and custom types of results \xrefitem sw_version "Versions" "Software Package Version" 1.12.5 \xrefitem sw_link "Link" "Software Package Link" [DotNetOpenSearch](https://github.com/Terradue/DotNetOpenSearch) \xrefitem sw_license "License" "Software License" [AGPL](https://github.com/DotNetOpenSearch/Terradue.OpenSearch/blob/master/LICENSE) \xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.ServiceModel.Syndication \ingroup OpenSearch @} */ using System.Reflection; using System.Runtime.CompilerServices; using NuGet4Mono.Extensions; [assembly: AssemblyTitle("Terradue.OpenSearch")] [assembly: AssemblyDescription("Terradue.OpenSearch is a library targeting .NET 4.0 and above that provides an easy way to perform OpenSearch query from a class or an URL to multiple and custom types of results (Atom, Rdf...)")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Terradue")] [assembly: AssemblyProduct("Terradue.OpenSearch")] [assembly: AssemblyCopyright("Terradue")] [assembly: AssemblyAuthors("Emmanuel Mathot")] [assembly: AssemblyProjectUrl("https://github.com/Terradue/DotNetOpenSearch")] [assembly: AssemblyLicenseUrl("https://github.com/Terradue/DotNetOpenSearch/blob/master/LICENSE")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: AssemblyVersion("1.12.5.*")] [assembly: AssemblyInformationalVersion("1.12.5")] [assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config", Watch = true)]
/* * Copyright (C) 2010-2014 Terradue S.r.l. * * This file is part of Terradue.OpenSearch. * * Foobar is free software: you can redistribute it and/or modify it under the terms of the * GNU General Public License as published by the Free Software Foundation, * either version 3 of the License, or (at your option) any later version. * * Foobar is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with Terradue.OpenSearch. * If not, see http://www.gnu.org/licenses/. */ /*! \namespace Terradue.OpenSearch @{ Terradue.OpenSearch is a .Net library that provides an engine perform OpenSearch query from a class or an URL to multiple and custom types of results \xrefitem sw_version "Versions" "Software Package Version" 1.12.4 \xrefitem sw_link "Link" "Software Package Link" [DotNetOpenSearch](https://github.com/Terradue/DotNetOpenSearch) \xrefitem sw_license "License" "Software License" [AGPL](https://github.com/DotNetOpenSearch/Terradue.OpenSearch/blob/master/LICENSE) \xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.ServiceModel.Syndication \ingroup OpenSearch @} */ using System.Reflection; using System.Runtime.CompilerServices; using NuGet4Mono.Extensions; [assembly: AssemblyTitle("Terradue.OpenSearch")] [assembly: AssemblyDescription("Terradue.OpenSearch is a library targeting .NET 4.0 and above that provides an easy way to perform OpenSearch query from a class or an URL to multiple and custom types of results (Atom, Rdf...)")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Terradue")] [assembly: AssemblyProduct("Terradue.OpenSearch")] [assembly: AssemblyCopyright("Terradue")] [assembly: AssemblyAuthors("Emmanuel Mathot")] [assembly: AssemblyProjectUrl("https://github.com/Terradue/DotNetOpenSearch")] [assembly: AssemblyLicenseUrl("https://github.com/Terradue/DotNetOpenSearch/blob/master/LICENSE")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: AssemblyVersion("1.12.4.*")] [assembly: AssemblyInformationalVersion("1.12.4")] [assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config", Watch = true)]
agpl-3.0
C#
ddbd78bf5f3c4296c73e7e3ec967c314b1ad10e4
Edit using
bolorundurowb/vCardLib
vCardLib.Tests/ModelTests/PhoneNumberTests.cs
vCardLib.Tests/ModelTests/PhoneNumberTests.cs
// Created by Bolorunduro Winner-Timothy on 11/22/2016 at 5:38 AM using NUnit.Framework; using vCardLib.Enums; using vCardLib.Models; namespace vCardLib.Tests.ModelTests { [TestFixture] public class PhoneNumberTests { [Test] public void PhoneNumberIsStable() { Assert.DoesNotThrow(delegate { var phoneNumber = new PhoneNumber(); phoneNumber.Number = "089089893333"; phoneNumber.Type = PhoneNumberType.BBS; phoneNumber.Type = PhoneNumberType.Cell; phoneNumber.Type = PhoneNumberType.Car; phoneNumber.Type = PhoneNumberType.Fax; phoneNumber.Type = PhoneNumberType.Home; phoneNumber.Type = PhoneNumberType.ISDN; phoneNumber.Type = PhoneNumberType.MainNumber; phoneNumber.Type = PhoneNumberType.Modem; phoneNumber.Type = PhoneNumberType.None; phoneNumber.Type = PhoneNumberType.Pager; phoneNumber.Type = PhoneNumberType.Text; phoneNumber.Type = PhoneNumberType.TextPhone; phoneNumber.Type = PhoneNumberType.Video; phoneNumber.Type = PhoneNumberType.Voice; phoneNumber.Type = PhoneNumberType.Work; }); } } }
// Created by Bolorunduro Winner-Timothy on 11/22/2016 at 5:38 AM using NUnit.Framework; using vCardLib.Models; namespace vCardLib.Tests.ModelTests { [TestFixture] public class PhoneNumberTests { [Test] public void PhoneNumberIsStable() { Assert.DoesNotThrow(delegate { var phoneNumber = new PhoneNumber(); phoneNumber.Number = "089089893333"; phoneNumber.Type = PhoneNumberType.BBS; phoneNumber.Type = PhoneNumberType.Cell; phoneNumber.Type = PhoneNumberType.Car; phoneNumber.Type = PhoneNumberType.Fax; phoneNumber.Type = PhoneNumberType.Home; phoneNumber.Type = PhoneNumberType.ISDN; phoneNumber.Type = PhoneNumberType.MainNumber; phoneNumber.Type = PhoneNumberType.Modem; phoneNumber.Type = PhoneNumberType.None; phoneNumber.Type = PhoneNumberType.Pager; phoneNumber.Type = PhoneNumberType.Text; phoneNumber.Type = PhoneNumberType.TextPhone; phoneNumber.Type = PhoneNumberType.Video; phoneNumber.Type = PhoneNumberType.Voice; phoneNumber.Type = PhoneNumberType.Work; }); } } }
mit
C#
ce05f3227d0f42cb4deac505872c79b28c116d3a
Increment and Decrement with 0 does not send any data.
landaumedia/landaumedia-telemetry
Source/LandauMedia.Telemetry/Counter.cs
Source/LandauMedia.Telemetry/Counter.cs
using System; using LandauMedia.Telemetry.Internal; namespace LandauMedia.Telemetry { public class Counter : ITelemeter { readonly Lazy<string> _lazyName; Action<Lazy<string>, int> _decrement; Action<Lazy<string>> _decrementByOne; Action<Lazy<string>, int> _icnremnent; Action<Lazy<string>> _increamentByOne; internal Counter(LazyName lazyName) { _lazyName = lazyName.Get(this); } void ITelemeter.ChangeImplementation(ITelemeterImpl impl) { _increamentByOne = impl.GetCounterIncrementByOne(); _icnremnent = impl.GetCounterIncrement(); _decrement = impl.GetCounterDecrement(); _decrementByOne = impl.GetCounterDecrementByOne(); } public void Increment() { _increamentByOne(_lazyName); } public void Increment(int count) { if(count==0) return; _icnremnent(_lazyName, count); } public void Decrement() { _decrementByOne(_lazyName); } public void Decrement(int count) { if(count==0) return; _decrement(_lazyName, count); } } }
using System; using LandauMedia.Telemetry.Internal; namespace LandauMedia.Telemetry { public class Counter : ITelemeter { readonly Lazy<string> _lazyName; Action<Lazy<string>, int> _decrement; Action<Lazy<string>> _decrementByOne; Action<Lazy<string>, int> _icnremnent; Action<Lazy<string>> _increamentByOne; internal Counter(LazyName lazyName) { _lazyName = lazyName.Get(this); } void ITelemeter.ChangeImplementation(ITelemeterImpl impl) { _increamentByOne = impl.GetCounterIncrementByOne(); _icnremnent = impl.GetCounterIncrement(); _decrement = impl.GetCounterDecrement(); _decrementByOne = impl.GetCounterDecrementByOne(); } public void Increment() { _increamentByOne(_lazyName); } public void Increment(int count) { _icnremnent(_lazyName, count); } public void Decrement() { _decrementByOne(_lazyName); } public void Decrement(int count) { _decrement(_lazyName, count); } } }
mit
C#
2c35d33aab22313056089b20c08542efc646e02d
Change case of user id property
loicteixeira/gj-unity-api
Assets/Plugins/GameJolt/Scripts/Objects/Score.cs
Assets/Plugins/GameJolt/Scripts/Objects/Score.cs
using System; using GJAPI.External.SimpleJSON; namespace GJAPI.Objects { public class Score : Base { #region Fields & Properties public int Value { get; set; } public string Text { get; set; } public string Extra { get; set; } public string Time { get; set; } public int UserID { get; set; } public string UserName { get; set; } public string GuestName { get; set; } public string PlayerName { get { return UserName != null && UserName != string.Empty ? UserName : GuestName; } } #endregion Fields & Properties #region Constructors public Score(int value, string text, string guestName = "", string extra = "") { this.Value = value; this.Text = text; this.GuestName = guestName; this.Extra = extra; } public Score(JSONClass data) { this.PopulateFromJSON(data); } #endregion Constructors #region Update Attributes protected override void PopulateFromJSON(JSONClass data) { this.Value = data["sort"].AsInt; this.Text = data["score"].Value; this.Extra = data["extra_data"].Value; this.Time = data["stored"].Value; this.UserID = data["user_id"].AsInt; this.UserName = data["user"].Value; this.GuestName = data["guest"].Value; } #endregion Update Attributes #region Interface public void Add(int table = 0, Action<bool> callback = null) { Scores.Add(this, table, callback); } #endregion Interface public override string ToString() { return string.Format("GJAPI.Objects.Score: {0} - {1}", PlayerName, Value); } } }
using System; using GJAPI.External.SimpleJSON; namespace GJAPI.Objects { public class Score : Base { #region Fields & Properties public int Value { get; set; } public string Text { get; set; } public string Extra { get; set; } public string Time { get; set; } public int UserId { get; set; } public string UserName { get; set; } public string GuestName { get; set; } public string PlayerName { get { return UserName != null && UserName != string.Empty ? UserName : GuestName; } } #endregion Fields & Properties #region Constructors public Score(int value, string text, string guestName = "", string extra = "") { this.Value = value; this.Text = text; this.GuestName = guestName; this.Extra = extra; } public Score(JSONClass data) { this.PopulateFromJSON(data); } #endregion Constructors #region Update Attributes protected override void PopulateFromJSON(JSONClass data) { this.Value = data["sort"].AsInt; this.Text = data["score"].Value; this.Extra = data["extra_data"].Value; this.Time = data["stored"].Value; this.UserId = data["user_id"].AsInt; this.UserName = data["user"].Value; this.GuestName = data["guest"].Value; } #endregion Update Attributes #region Interface public void Add(int table = 0, Action<bool> callback = null) { Scores.Add(this, table, callback); } #endregion Interface public override string ToString() { return string.Format("GJAPI.Objects.Score: {0} - {1}", PlayerName, Value); } } }
mit
C#
e1f2e6a5a9c4c49536eff838a1e17b95ff8c3035
Add 'count' variable to PlayerController & increment on collision with 'Pick Up' objects
compumike08/Roll-a-Ball
Assets/Scripts/PlayerController.cs
Assets/Scripts/PlayerController.cs
using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerController : MonoBehaviour { public float speed; private Rigidbody rb; private int count; // Start is called during the first frame that this script is accessed during the game void Start () { rb = GetComponent<Rigidbody> (); count = 0; } // FixedUpdate is called just before performing any physics calculations void FixedUpdate () { float moveHorizontal = Input.GetAxis ("Horizontal"); float moveVertical = Input.GetAxis ("Vertical"); Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical); rb.AddForce (movement * speed); } void OnTriggerEnter(Collider other) { if (other.gameObject.CompareTag ("Pick Up")) { other.gameObject.SetActive (false); count++; } } }
using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerController : MonoBehaviour { public float speed; private Rigidbody rb; // Start is called during the first frame that this script is accessed during the game void Start () { rb = GetComponent<Rigidbody> (); } // FixedUpdate is called just before performing any physics calculations void FixedUpdate () { float moveHorizontal = Input.GetAxis ("Horizontal"); float moveVertical = Input.GetAxis ("Vertical"); Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical); rb.AddForce (movement * speed); } void OnTriggerEnter(Collider other) { if (other.gameObject.CompareTag ("Pick Up")) { other.gameObject.SetActive (false); } } }
mit
C#
7cd212b7d04ab09a4d74134a071f6d0de1d15de3
Remove code duplication from TorInstallator.
nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet
WalletWasabi/Tor/TorInstallator.cs
WalletWasabi/Tor/TorInstallator.cs
using System.IO; using System.Runtime.InteropServices; using System.Threading.Tasks; using WalletWasabi.Helpers; using WalletWasabi.Logging; namespace WalletWasabi.Tor { /// <summary> /// Installs Tor from <c>data-folder.zip</c> and <c>tor-PLATFORM.zip</c> files which are part of Wasabi Wallet distribution. /// </summary> public class TorInstallator { public static async Task InstallAsync(string torDir) { // Folder containing installation files. string distributionFolder = Path.Combine(EnvironmentHelpers.GetFullBaseDirectory(), "TorDaemons"); // Common for all platforms. await ExtractZipFileAsync(Path.Combine(distributionFolder, "data-folder.zip"), torDir).ConfigureAwait(false); // File differs per platform. await ExtractZipFileAsync(Path.Combine(distributionFolder, $"tor-{GetPlatformIdentifier()}.zip"), torDir).ConfigureAwait(false); if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { // Set sufficient file permission. string shellCommand = $"chmod -R 750 {torDir}"; await EnvironmentHelpers.ShellExecAsync(shellCommand, waitForExit: true).ConfigureAwait(false); Logger.LogInfo($"Shell command executed: '{shellCommand}'."); } } private static async Task ExtractZipFileAsync(string zipFilePath, string destinationPath) { await IoHelpers.BetterExtractZipToDirectoryAsync(zipFilePath, destinationPath).ConfigureAwait(false); Logger.LogInfo($"Extracted '{zipFilePath}' to '{destinationPath}'."); } private static string GetPlatformIdentifier() { if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { return "win64"; } else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) { return "linux64"; } else { return "osx64"; } } } }
using System.IO; using System.Runtime.InteropServices; using System.Threading.Tasks; using WalletWasabi.Helpers; using WalletWasabi.Logging; namespace WalletWasabi.Tor { /// <summary> /// Installs Tor from <c>data-folder.zip</c> and <c>tor-PLATFORM.zip</c> files which are part of Wasabi Wallet distribution. /// </summary> public class TorInstallator { public static async Task InstallAsync(string torDir) { string torDaemonsDir = Path.Combine(EnvironmentHelpers.GetFullBaseDirectory(), "TorDaemons"); string dataZip = Path.Combine(torDaemonsDir, "data-folder.zip"); await IoHelpers.BetterExtractZipToDirectoryAsync(dataZip, torDir).ConfigureAwait(false); Logger.LogInfo($"Extracted {dataZip} to {torDir}."); if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { string torWinZip = Path.Combine(torDaemonsDir, "tor-win64.zip"); await IoHelpers.BetterExtractZipToDirectoryAsync(torWinZip, torDir).ConfigureAwait(false); Logger.LogInfo($"Extracted {torWinZip} to {torDir}."); } else // Linux or OSX { if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) { string torLinuxZip = Path.Combine(torDaemonsDir, "tor-linux64.zip"); await IoHelpers.BetterExtractZipToDirectoryAsync(torLinuxZip, torDir).ConfigureAwait(false); Logger.LogInfo($"Extracted {torLinuxZip} to {torDir}."); } else // OSX { string torOsxZip = Path.Combine(torDaemonsDir, "tor-osx64.zip"); await IoHelpers.BetterExtractZipToDirectoryAsync(torOsxZip, torDir).ConfigureAwait(false); Logger.LogInfo($"Extracted {torOsxZip} to {torDir}."); } // Make sure there's sufficient permission. string chmodTorDirCmd = $"chmod -R 750 {torDir}"; await EnvironmentHelpers.ShellExecAsync(chmodTorDirCmd, waitForExit: true).ConfigureAwait(false); Logger.LogInfo($"Shell command executed: {chmodTorDirCmd}."); } } } }
mit
C#
b23e99f01a4e5530e173c5071c7a5c317b55196a
Add property to DevSettings
AVPolyakov/SharpLayout
Watcher/WatcherSettingsProvider.cs
Watcher/WatcherSettingsProvider.cs
using System.Runtime.CompilerServices; using SharpLayout; using SharpLayout.WatcherCore; namespace Watcher { public class WatcherSettingsProvider { private static DevSettings GetDevSettings() { return new DevSettings { SourceCodeFile = SourceCodeFiles.PaymentOrder, PageNumber = 1, Resolution = 120, //R1C1AreVisible = true, //CellsAreHighlighted = true, //ParagraphsAreHighlighted = true }; } public static WatcherSettings GetSettings(string settingsDirectory) { var devSettings = GetDevSettings(); return new WatcherSettings( sourceCodeFile: $@"..\Examples\{devSettings.SourceCodeFile}.cs", sourceCodeFiles2: new string[] {}, sourceCodeFiles1: new[] { @"..\Examples\Styles.cs", }, pageNumber: devSettings.PageNumber - 1, resolution: devSettings.Resolution, documentFunc: () => new Document { R1C1AreVisible = devSettings.R1C1AreVisible, CellsAreHighlighted = devSettings.CellsAreHighlighted, ParagraphsAreHighlighted = devSettings.ParagraphsAreHighlighted }); } public static string FilePath => GetFilePath(); private static string GetFilePath([CallerFilePath] string filePath = "") => filePath; } public enum SourceCodeFiles { PaymentOrder, ContractDealPassport, LoanAgreementDealPassport, Svo } public class DevSettings { public SourceCodeFiles SourceCodeFile { get; set; } public int PageNumber { get; set; } public int Resolution { get; set; } = 120; public bool CellsAreHighlighted { get; set; } public bool R1C1AreVisible { get; set; } public bool ParagraphsAreHighlighted { get; set; } } }
using System.Runtime.CompilerServices; using SharpLayout; using SharpLayout.WatcherCore; namespace Watcher { public class WatcherSettingsProvider { private static DevSettings GetDevSettings() { return new DevSettings { SourceCodeFile = SourceCodeFiles.PaymentOrder, PageNumber = 1, Resolution = 120, //CellsAreHighlighted = true, //ParagraphsAreHighlighted = true }; } public static WatcherSettings GetSettings(string settingsDirectory) { var devSettings = GetDevSettings(); return new WatcherSettings( sourceCodeFile: $@"..\Examples\{devSettings.SourceCodeFile}.cs", sourceCodeFiles2: new string[] {}, sourceCodeFiles1: new[] { @"..\Examples\Styles.cs", }, pageNumber: devSettings.PageNumber - 1, resolution: devSettings.Resolution, documentFunc: () => new Document { CellsAreHighlighted = devSettings.CellsAreHighlighted, R1C1AreVisible = devSettings.CellsAreHighlighted, ParagraphsAreHighlighted = devSettings.ParagraphsAreHighlighted }); } public static string FilePath => GetFilePath(); private static string GetFilePath([CallerFilePath] string filePath = "") => filePath; } public enum SourceCodeFiles { PaymentOrder, ContractDealPassport, LoanAgreementDealPassport, Svo } public class DevSettings { public SourceCodeFiles SourceCodeFile { get; set; } public int PageNumber { get; set; } public int Resolution { get; set; } = 120; public bool CellsAreHighlighted { get; set; } public bool ParagraphsAreHighlighted { get; set; } } }
mit
C#
b84aa63b4b159321ce7d64884caa9c46af885177
Change instance from Motor to Object in test case
budougumi0617/CSharpTraining
XUnitSample.Tests/MainClassTest.cs
XUnitSample.Tests/MainClassTest.cs
using System; using CSharpTraining; using MonoBrickFirmware.Movement; namespace XUnitSample.Tests { /// <summary> /// Sample test class /// </summary> /// <remarks> /// It was described below URL how to use XUnit /// https://xunit.github.io/docs/comparisons.html /// </remarks> public class MainClassTests { [Xunit.Fact(DisplayName = "We can describe test summary by this attribute."), Xunit.Trait("Category", "Sample")] public void MainTest() { Xunit.Assert.True(true); Xunit.Assert.Equal(10, MainClass.SampleMethod()); var foo = new Object(); var same = foo; Xunit.Assert.Same(foo, same); // Verify their variables are same object. } [Xunit.Fact(Skip="If you want to ignore test case, you set this attribute to the test case.")] public void IgnoreTest() { Xunit.Assert.True(false, "Expected this test case does not be executed."); MainClass.Main(new string[] { "" }); Motor dummy = new Motor(MotorPort.OutA); dummy.GetSpeed(); } } }
using System; using CSharpTraining; using MonoBrickFirmware.Movement; namespace XUnitSample.Tests { /// <summary> /// Sample test class /// </summary> /// <remarks> /// It was described below URL how to use XUnit /// https://xunit.github.io/docs/comparisons.html /// </remarks> public class MainClassTests { [Xunit.Fact(DisplayName = "We can describe test summary by this attribute."), Xunit.Trait("Category", "Sample")] public void MainTest() { Xunit.Assert.True(true); Xunit.Assert.Equal(10, MainClass.SampleMethod()); var foo = new Motor(MotorPort.OutA); var same = foo; Xunit.Assert.Same(foo, same); // Verify their variables are same object. } [Xunit.Fact(Skip="If you want to ignore test case, you set this attribute to the test case.")] public void IgnoreTest() { Xunit.Assert.True(false, "Expected this test case does not be executed."); MainClass.Main(new string[] { "" }); Motor dummy = new Motor(MotorPort.OutA); dummy.GetSpeed(); } } }
mit
C#
d13207e17d1eed867cd04b94f87543e89463724b
Add parameter to GetOriginalPosts method
DotNetRu/App,DotNetRu/App
DotNetRu.AzureService/Controllers/VkontakteController.cs
DotNetRu.AzureService/Controllers/VkontakteController.cs
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using DotNetRu.AzureService; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using Newtonsoft.Json; namespace DotNetRu.Azure { [Route("")] public class VkontakteController : ControllerBase { private readonly ILogger logger; private readonly VkontakteSettings vkontakteSettings; public VkontakteController( ILogger<DiagnosticsController> logger, VkontakteSettings vkontakteSettings) { this.logger = logger; this.vkontakteSettings = vkontakteSettings; } [HttpGet] [Route("VkontaktePosts")] public async Task<IActionResult> GetOriginalPosts( // key - имя комьюнти - "dotnetru" // value - число загружаемых постов (от 0 до 100) IDictionary<string, byte> communities = null ) { try { var cacheKey = "vkontaktePosts"; if (communities != null) cacheKey += string.Join(";", communities.Select(x => $"{x.Key}:{x.Value}").ToArray()); var posts = await CacheHelper.PostsCache.GetOrCreateAsync(cacheKey, async () => await VkontakteService.GetAsync(this.vkontakteSettings)); var json = JsonConvert.SerializeObject(posts); return new OkObjectResult(json); } catch (Exception e) { logger.LogCritical(e, "Unhandled error while getting original vkontakte posts"); return new ObjectResult(e) { StatusCode = StatusCodes.Status500InternalServerError }; } } } }
using System; using System.Threading.Tasks; using DotNetRu.AzureService; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using Newtonsoft.Json; namespace DotNetRu.Azure { [Route("")] public class VkontakteController : ControllerBase { private readonly ILogger logger; private readonly VkontakteSettings vkontakteSettings; public VkontakteController( ILogger<DiagnosticsController> logger, VkontakteSettings vkontakteSettings) { this.logger = logger; this.vkontakteSettings = vkontakteSettings; } [HttpGet] [Route("VkontaktePosts")] public async Task<IActionResult> GetOriginalPosts( //IDictionary<string, int> dict ) { try { //var cacheKey = string.Join(";", dict.Select(x => $"{x.Key}:{x.Value}").ToArray()); // в дальнейшем key будет выбираться, исходя из параметров запроса пользователя (на какие сообщества он подписан) var posts = await CacheHelper.PostsCache.GetOrCreateAsync("vkontaktePosts", async () => await VkontakteService.GetAsync(this.vkontakteSettings)); var json = JsonConvert.SerializeObject(posts); return new OkObjectResult(json); } catch (Exception e) { logger.LogCritical(e, "Unhandled error while getting original vkontakte posts"); return new ObjectResult(e) { StatusCode = StatusCodes.Status500InternalServerError }; } } } }
mit
C#
b1f39cd8251518162b48da32a09b1b349d2934d8
Remove unused import.
SonnevilleJ/Investing,SonnevilleJ/FidelityWebDriver,SonnevilleJ/Investing
FidelityWebDriver/Transactions/CSV/CsvDownloadService.cs
FidelityWebDriver/Transactions/CSV/CsvDownloadService.cs
using System.IO; using Sonneville.FidelityWebDriver.Configuration; using Sonneville.Utilities; namespace Sonneville.FidelityWebDriver.Transactions.CSV { public class CsvDownloadService : ICsvDownloadService { private readonly FidelityConfiguration _fidelityConfiguration; private readonly ISleepUtil _sleepUtil; public CsvDownloadService(FidelityConfiguration fidelityConfiguration, ISleepUtil sleepUtil) { _fidelityConfiguration = fidelityConfiguration; _sleepUtil = sleepUtil; } public string GetDownloadedContent() { _sleepUtil.Sleep(2000); return File.ReadAllText(_fidelityConfiguration.DownloadPath); } public void Cleanup() { _sleepUtil.Sleep(1000); if (File.Exists(_fidelityConfiguration.DownloadPath)) { File.Delete(_fidelityConfiguration.DownloadPath); } } } }
using System.IO; using System.Threading; using Sonneville.FidelityWebDriver.Configuration; using Sonneville.Utilities; namespace Sonneville.FidelityWebDriver.Transactions.CSV { public class CsvDownloadService : ICsvDownloadService { private readonly FidelityConfiguration _fidelityConfiguration; private readonly ISleepUtil _sleepUtil; public CsvDownloadService(FidelityConfiguration fidelityConfiguration, ISleepUtil sleepUtil) { _fidelityConfiguration = fidelityConfiguration; _sleepUtil = sleepUtil; } public string GetDownloadedContent() { _sleepUtil.Sleep(2000); return File.ReadAllText(_fidelityConfiguration.DownloadPath); } public void Cleanup() { _sleepUtil.Sleep(1000); if (File.Exists(_fidelityConfiguration.DownloadPath)) { File.Delete(_fidelityConfiguration.DownloadPath); } } } }
mit
C#
5baf93e8d33e405d414a51d37c76700ff90e1cc2
Put AggressiveInline attribute similar to ValueTask.
rsdn/CodeJam
CodeJam.Main/Threading/AwaitableNonDisposable.cs
CodeJam.Main/Threading/AwaitableNonDisposable.cs
// BASEDON: https://github.com/StephenCleary/AsyncEx AwaitableDisposable class. using System; using System.Threading.Tasks; using System.Runtime.CompilerServices; using JetBrains.Annotations; using static CodeJam.Targeting.MethodImplOptionsExt; namespace CodeJam.Threading { /// <summary> /// An awaitable wrapper around a task whose result is <see cref="IDisposable"/>. /// The wrapper itself is not <see cref="IDisposable"/>.!-- /// This prevents usage errors like <code>using (lock.AcquireAsync())</code> when the appropriate usage should be <code>using (await lock.AcquireAsync())</code>. /// </summary> /// <typeparam name="T">The type of the result of the underlying task.</typeparam> public struct AwaitableNonDisposable<T> where T : IDisposable { /// <summary> /// The underlying task. /// </summary> [NotNull] private readonly Task<T> _task; /// <summary> /// Initializes a new awaitable wrapper around the specified task. /// </summary> /// <param name="task">The underlying task to wrap. This may not be <c>null</c>.</param> [MethodImpl(AggressiveInlining)] public AwaitableNonDisposable([NotNull] Task<T> task) { Code.NotNull(task, nameof(task)); _task = task; } /// <summary> /// Returns the underlying task. /// </summary> /// <returns>Underlying task.</returns> [NotNull][MethodImpl(AggressiveInlining)] public Task<T> AsTask() { return _task; } /// <summary> /// Implicit conversion to the underlying task. /// </summary> /// <param name="source">The awaitable wrapper.</param> /// <returns>Underlying task</returns> [NotNull][MethodImpl(AggressiveInlining)] public static implicit operator Task<T>([NotNull] AwaitableNonDisposable<T> source) { return source.AsTask(); } /// <summary> /// Infrastructure. Returns the task awaiter for the underlying task. /// </summary> /// <returns>Task awaiter for the underlying task.</returns> [MethodImpl(AggressiveInlining)] public TaskAwaiter<T> GetAwaiter() { return _task.GetAwaiter(); } /// <summary> /// Infrastructure. Returns a configured task awaiter for the underlying task. /// </summary> /// <param name="continueOnCapturedContext">Whether to attempt to marshal the continuation back to the captured context.</param> /// <returns>A configured task awaiter for the underlying task.</returns> [MethodImpl(AggressiveInlining)] public ConfiguredTaskAwaitable<T> ConfigureAwait(bool continueOnCapturedContext) { return _task.ConfigureAwait(continueOnCapturedContext); } } }
// BASEDON: https://github.com/StephenCleary/AsyncEx AwaitableDisposable class. using System; using System.Threading.Tasks; using System.Runtime.CompilerServices; using JetBrains.Annotations; namespace CodeJam.Threading { /// <summary> /// An awaitable wrapper around a task whose result is <see cref="IDisposable"/>. /// The wrapper itself is not <see cref="IDisposable"/>.!-- /// This prevents usage errors like <code>using (lock.AcquireAsync())</code> when the appropriate usage should be <code>using (await lock.AcquireAsync())</code>. /// </summary> /// <typeparam name="T">The type of the result of the underlying task.</typeparam> public struct AwaitableNonDisposable<T> where T : IDisposable { /// <summary> /// The underlying task. /// </summary> [NotNull] private readonly Task<T> _task; /// <summary> /// Initializes a new awaitable wrapper around the specified task. /// </summary> /// <param name="task">The underlying task to wrap. This may not be <c>null</c>.</param> public AwaitableNonDisposable([NotNull] Task<T> task) { Code.NotNull(task, nameof(task)); _task = task; } /// <summary> /// Returns the underlying task. /// </summary> /// <returns>Underlying task.</returns> [NotNull] public Task<T> AsTask() { return _task; } /// <summary> /// Implicit conversion to the underlying task. /// </summary> /// <param name="source">The awaitable wrapper.</param> /// <returns>Underlying task</returns> [NotNull] public static implicit operator Task<T>([NotNull] AwaitableNonDisposable<T> source) { return source.AsTask(); } /// <summary> /// Infrastructure. Returns the task awaiter for the underlying task. /// </summary> /// <returns>Task awaiter for the underlying task.</returns> public TaskAwaiter<T> GetAwaiter() { return _task.GetAwaiter(); } /// <summary> /// Infrastructure. Returns a configured task awaiter for the underlying task. /// </summary> /// <param name="continueOnCapturedContext">Whether to attempt to marshal the continuation back to the captured context.</param> /// <returns>A configured task awaiter for the underlying task.</returns> public ConfiguredTaskAwaitable<T> ConfigureAwait(bool continueOnCapturedContext) { return _task.ConfigureAwait(continueOnCapturedContext); } } }
mit
C#
0356160f1d7611e314f1603808b7cf97ef020dbc
Make sure when we can't find an item to select we select none
MatterHackers/agg-sharp,larsbrubaker/agg-sharp
DataConverters3D/Object3D/SelectionMaintainer.cs
DataConverters3D/Object3D/SelectionMaintainer.cs
/* Copyright (c) 2018, John Lewin, Lars Brubaker 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. 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 OWNER 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. The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of the FreeBSD Project. */ using System; using System.Collections.Generic; using System.Linq; namespace MatterHackers.DataConverters3D { public class SelectionMaintainer : IDisposable { InteractiveScene scene; private IObject3D selectedItem; private List<IObject3D> childrenBeforUndo; public SelectionMaintainer(InteractiveScene scene) { this.scene = scene; selectedItem = scene.SelectedItem; scene.SelectedItem = null; childrenBeforUndo = scene.Children.ToList(); } public void Dispose() { if (selectedItem == null) { return; } // if the item we had selected is still in the scene, re-select it if (scene.Children.Contains(selectedItem)) { scene.SelectedItem = selectedItem; return; } // if the previously selected item is not in the scene if (!scene.Children.Contains(selectedItem)) { // and we have only added one new item to the scene var newItems = scene.Children.Where(c => !childrenBeforUndo.Contains(c)); // select it if (newItems.Count() == 1) { scene.SelectedItem = newItems.First(); return; } else { scene.SelectedItem = null; return; } } // set the root item to the selection and then to the new item var rootItem = selectedItem.Ancestors().Where(i => scene.Children.Contains(i)).FirstOrDefault(); if (rootItem != null) { scene.SelectedItem = rootItem; scene.SelectedItem = selectedItem; } } } }
/* Copyright (c) 2018, John Lewin, Lars Brubaker 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. 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 OWNER 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. The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of the FreeBSD Project. */ using System; using System.Collections.Generic; using System.Linq; namespace MatterHackers.DataConverters3D { public class SelectionMaintainer : IDisposable { InteractiveScene scene; private IObject3D selectedItem; private List<IObject3D> childrenBeforUndo; public SelectionMaintainer(InteractiveScene scene) { this.scene = scene; selectedItem = scene.SelectedItem; scene.SelectedItem = null; childrenBeforUndo = scene.Children.ToList(); } public void Dispose() { if(selectedItem == null) { return; } // if the item we had selected is still in the scene, re-select it if (scene.Children.Contains(selectedItem)) { scene.SelectedItem = selectedItem; return; } // if the previously selected item is not in the scene if (!scene.Children.Contains(selectedItem)) { // and we have only added one new item to the scene var newItems = scene.Children.Where(c => !childrenBeforUndo.Contains(c)); // select it if (newItems.Count() == 1) { scene.SelectedItem = newItems.First(); return; } } // set the root item to the selection and then to the new item var rootItem = selectedItem.Ancestors().Where(i => scene.Children.Contains(i)).FirstOrDefault(); if (rootItem != null) { scene.SelectedItem = rootItem; scene.SelectedItem = selectedItem; } } } }
bsd-2-clause
C#
1250588a8891a6265ea7d3c643088f09e715267e
remove use of USE_GENERICS in PersistentComparator.cs
ingted/volante,kjk/volante-obsolete,kjk/volante-obsolete,ingted/volante,kjk/volante-obsolete,ingted/volante,ingted/volante,kjk/volante-obsolete
csharp/src/PersistentComparator.cs
csharp/src/PersistentComparator.cs
namespace NachoDB { /// <summary> Base class for persistent comparator used in SortedCollection class /// </summary> public abstract class PersistentComparator<K,V> : Persistent where V:class,IPersistent { /// <summary> /// Compare two members of collection /// </summary> /// <param name="m1"> first members</param> /// <param name="m2"> second members</param> /// <returns>negative number if m1 &lt; m2, zero if m1 == m2 and positive number if m1 &gt; m2</returns> public abstract int CompareMembers(V m1, V m2); /// <summary> /// Compare member with specified search key /// </summary> /// <param name="mbr"> collection member</param> /// <param name="key"> search key</param> /// <returns>negative number if mbr &lt; key, zero if mbr == key and positive number if mbr &gt; key</returns> public abstract int CompareMemberWithKey(V mbr, K key); } }
namespace NachoDB { /// <summary> Base class for persistent comparator used in SortedCollection class /// </summary> #if USE_GENERICS public abstract class PersistentComparator<K,V> : Persistent where V:class,IPersistent #else public abstract class PersistentComparator : Persistent #endif { /// <summary> /// Compare two members of collection /// </summary> /// <param name="m1"> first members</param> /// <param name="m2"> second members</param> /// <returns>negative number if m1 &lt; m2, zero if m1 == m2 and positive number if m1 &gt; m2</returns> #if USE_GENERICS public abstract int CompareMembers(V m1, V m2); #else public abstract int CompareMembers(IPersistent m1, IPersistent m2); #endif /// <summary> /// Compare member with specified search key /// </summary> /// <param name="mbr"> collection member</param> /// <param name="key"> search key</param> /// <returns>negative number if mbr &lt; key, zero if mbr == key and positive number if mbr &gt; key</returns> #if USE_GENERICS public abstract int CompareMemberWithKey(V mbr, K key); #else public abstract int CompareMemberWithKey(IPersistent mbr, object key); #endif } }
mit
C#
a0e7623f945fbe205857de154a1bc1dd971359ac
Fix build
ArsenShnurkov/Eto.Parse,ArsenShnurkov/Eto.Parse,picoe/Eto.Parse,smbecker/Eto.Parse,picoe/Eto.Parse,smbecker/Eto.Parse
Eto.Parse/Parsers/SingleSurrogatePairTerminal.cs
Eto.Parse/Parsers/SingleSurrogatePairTerminal.cs
using System; namespace Eto.Parse.Parsers { public class SingleSurrogatePairTerminal : SurrogatePairTerminal { private const int MinCodePoint = 0x10000; private const int MaxCodePoint = 0x10FFFF; private readonly char _lowSurrogate; private readonly char _highSurrogate; public SingleSurrogatePairTerminal(int codePoint) { if (codePoint < MinCodePoint || codePoint > MaxCodePoint) { throw new ArgumentOutOfRangeException("codePoint", "Invalid UTF code point"); } var unicodeString = char.ConvertFromUtf32(codePoint); _highSurrogate = unicodeString[0]; _lowSurrogate = unicodeString[1]; } protected SingleSurrogatePairTerminal(SingleSurrogatePairTerminal other, ParserCloneArgs args) : base(other, args) { } public override Parser Clone(ParserCloneArgs args) { return new SingleSurrogatePairTerminal(this, args); } protected override bool TestLowSurrogate(int lowSurrogate) { return lowSurrogate == _lowSurrogate; } protected override bool TestHighSurrogate(int highSurrogate) { return highSurrogate == _highSurrogate; } } }
using System; namespace Eto.Parse.Parsers { public class SingleSurrogatePairTerminal : SurrogatePairTerminal { private const int MinCodePoint = 0x10000; private const int MaxCodePoint = 0x10FFFF; private readonly char _lowSurrogate; private readonly char _highSurrogate; public SingleSurrogatePairTerminal(int codePoint) { if (codePoint < MinCodePoint || codePoint > MaxCodePoint) { throw new ArgumentOutOfRangeException("codePoint", "Invalid UTF code point"); } var unicodeString = char.ConvertFromUtf32(codePoint); _highSurrogate = unicodeString[0]; _lowSurrogate = unicodeString[1]; } protected SingleSurrogatePairTerminal(Parser other, ParserCloneArgs args) : base(other, args) { } public override Parser Clone(ParserCloneArgs args) { return new SingleSurrogatePairTerminal(this, args); } protected override bool TestLowSurrogate(int lowSurrogate) { return lowSurrogate == _lowSurrogate; } protected override bool TestHighSurrogate(int highSurrogate) { return highSurrogate == _highSurrogate; } } }
mit
C#
02e8dd015440e204cecbe5c81c21e102184a3a50
add sound when jump dead and score using sound manager
endlessz/Flappy-Cube
Assets/Scripts/Player.cs
Assets/Scripts/Player.cs
using UnityEngine; using System.Collections; using UnityEngine.EventSystems; public class Player : MonoBehaviour { [Header("Movement of the player")] public float jumpHeight; public float forwardSpeed; [Header("Sound Effect")] public AudioClip deadSound; //Dead sound public AudioClip moveSound; //Jump sound public AudioClip scoreSound; //Score sound private Rigidbody2D mainRigidbody2D; void Start() { mainRigidbody2D = GetComponent<Rigidbody2D> (); mainRigidbody2D.isKinematic = true; //Player not fall when in PREGAME states } // Update is called once per frame void Update () { //If Player go out off screen if ((transform.position.y > getMaxWidth() || transform.position.y < -getMaxWidth() ) && GameManager.instance.currentState == GameStates.INGAME) { Dead(); } //When click or touch and in INGAME states if ((Input.GetMouseButtonDown(0) || Input.GetKeyDown(KeyCode.Space)) && GameManager.instance.currentState == GameStates.INGAME){ Jump(); } //When click or touch and in PREGAME states if ((Input.GetMouseButtonDown(0) || Input.GetKeyDown(KeyCode.Space)) && GameManager.instance.currentState == GameStates.PREGAME){ mainRigidbody2D.isKinematic = false; GameManager.instance.startGame(); } } private void Jump(){ SoundManager.instance.PlaySingleSoundEffect(moveSound); mainRigidbody2D.velocity = new Vector2(forwardSpeed,jumpHeight); } private void Dead(){ mainRigidbody2D.freezeRotation = false; SoundManager.instance.PlaySoundEffect(deadSound); GameManager.instance.gameOver (); } void OnCollisionEnter2D(Collision2D other) { if (other.transform.tag == "Obstacle" && GameManager.instance.currentState == GameStates.INGAME) { Dead (); } } void OnTriggerEnter2D(Collider2D other){ if (other.tag == "Score" && GameManager.instance.currentState == GameStates.INGAME) { SoundManager.instance.PlaySoundEffect(scoreSound); GameManager.instance.addScore(); ObstacleSpawner.instance.spawnObstacle(); Destroy(other.gameObject); } } private float getMaxWidth(){ Vector2 cameraWidth = Camera.main.ScreenToWorldPoint (new Vector2 (Screen.width, Screen.height)); float playerWidth = GetComponent<Renderer>().bounds.extents.y; return cameraWidth.y + playerWidth; } }
using UnityEngine; using System.Collections; using UnityEngine.EventSystems; public class Player : MonoBehaviour { [Header("Movement of the player")] public float jumpHeight; public float forwardSpeed; private Rigidbody2D mainRigidbody2D; void Start() { mainRigidbody2D = GetComponent<Rigidbody2D> (); mainRigidbody2D.isKinematic = true; //Player not fall when in PREGAME states } // Update is called once per frame void Update () { //If Player go out off screen if ((transform.position.y > getMaxWidth() || transform.position.y < -getMaxWidth() ) && GameManager.instance.currentState == GameStates.INGAME) { Dead(); } //When click or touch and in INGAME states if ((Input.GetMouseButtonDown(0) || Input.GetKeyDown(KeyCode.Space)) && GameManager.instance.currentState == GameStates.INGAME){ Jump(); } //When click or touch and in PREGAME states if ((Input.GetMouseButtonDown(0) || Input.GetKeyDown(KeyCode.Space)) && GameManager.instance.currentState == GameStates.PREGAME){ mainRigidbody2D.isKinematic = false; GameManager.instance.startGame(); } } private void Jump(){ mainRigidbody2D.velocity = new Vector2(forwardSpeed,jumpHeight); } private void Dead(){ mainRigidbody2D.freezeRotation = false; GameManager.instance.gameOver (); } void OnCollisionEnter2D(Collision2D other) { if (other.transform.tag == "Obstacle" && GameManager.instance.currentState == GameStates.INGAME) { Dead (); } } void OnTriggerEnter2D(Collider2D other){ if (other.tag == "Score" && GameManager.instance.currentState == GameStates.INGAME) { ObstacleSpawner.instance.spawnObstacle(); GameManager.instance.addScore(); Destroy(other.gameObject); } } private float getMaxWidth(){ Vector2 cameraWidth = Camera.main.ScreenToWorldPoint (new Vector2 (Screen.width, Screen.height)); float playerWidth = GetComponent<Renderer>().bounds.extents.y; return cameraWidth.y + playerWidth; } }
mit
C#
0e3259f35056433d5a148b8e8a69dd2a5c523eea
fix prefix detection
tmyt/Freesia
Freesia/Internal/CodeCompletion.cs
Freesia/Internal/CodeCompletion.cs
using System.Collections.Generic; using System.Linq; using System.Reflection; using Freesia.Internal.Extensions; using Freesia.Internal.Reflection; using Freesia.Types; namespace Freesia.Internal { internal class CodeCompletion<T> : CompilerConfig<T> { public static IEnumerable<string> Completion(string text, out string prefix) { var syntax = FilterCompiler<T>.SyntaxHighlight(text).ToArray(); var last = syntax.LastOrDefault(); prefix = ""; // 末尾がnullならtypeof(T)のプロパティ if (last == null) return typeof(T).GetRuntimeProperties() .Select(p => p.Name) .Concat(string.IsNullOrEmpty(UserFunctionNamespace) ? Enumerable.Empty<string>() : new[] { UserFunctionNamespace }) .Select(s => s.ToLowerInvariant()) .OrderBy(s => s); // 末尾がstring,(),indexerなら空 if (last.SubType == TokenType.String) return Enumerable.Empty<string>(); // プロパティ/メソッドを検索 var type = last.TypeInfo; var lookup = last.Value; if (last.SubType == TokenType.PropertyAccess) { lookup = ""; } if (last.Type == SyntaxType.Error) { type = syntax.Length == 1 ? typeof(T) : syntax.Reverse().Skip(1).First().TypeInfo; } if (type == null) return Enumerable.Empty<string>(); prefix = lookup; return type.GetRuntimeProperties() .Select(p => p.Name) .Concat(type == typeof(T) && !string.IsNullOrEmpty(UserFunctionNamespace) ? new[] { UserFunctionNamespace } : Enumerable.Empty<string>()) .Concat(type == typeof(UserFunctionTypePlaceholder) ? Functions.Keys : Enumerable.Empty<string>()) .Concat(type.IsEnumerable() ? Helper.GetEnumerableExtendedMethods() : Enumerable.Empty<string>()) .Select(s => s.ToLowerInvariant()) .Where(n => n.StartsWith(lookup)) .OrderBy(s => s); } } }
using System.Collections.Generic; using System.Linq; using System.Reflection; using Freesia.Internal.Extensions; using Freesia.Internal.Reflection; using Freesia.Types; namespace Freesia.Internal { internal class CodeCompletion<T> : CompilerConfig<T> { public static IEnumerable<string> Completion(string text, out string prefix) { var syntax = FilterCompiler<T>.SyntaxHighlight(text).ToArray(); var last = syntax.LastOrDefault(); prefix = ""; // 末尾がnullならtypeof(T)のプロパティ if (last == null) return typeof(T).GetRuntimeProperties() .Select(p => p.Name) .Concat(string.IsNullOrEmpty(UserFunctionNamespace) ? Enumerable.Empty<string>() : new[] { UserFunctionNamespace }) .Select(s => s.ToLowerInvariant()) .OrderBy(s => s); // 末尾がstring,(),indexerなら空 if (last.SubType == TokenType.String) return Enumerable.Empty<string>(); // プロパティ/メソッドを検索 var type = last.TypeInfo; var lookup = last.Value; if (last.SubType == TokenType.PropertyAccess) { lookup = ""; } if (last.Type == SyntaxType.Error) { type = syntax.Length == 1 ? typeof(T) : syntax.Reverse().Skip(1).First().TypeInfo; } if (type == null) return Enumerable.Empty<string>(); return type.GetRuntimeProperties() .Select(p => p.Name) .Concat(type == typeof(T) && !string.IsNullOrEmpty(UserFunctionNamespace) ? new[] { UserFunctionNamespace } : Enumerable.Empty<string>()) .Concat(type == typeof(UserFunctionTypePlaceholder) ? Functions.Keys : Enumerable.Empty<string>()) .Concat(type.IsEnumerable() ? Helper.GetEnumerableExtendedMethods() : Enumerable.Empty<string>()) .Select(s => s.ToLowerInvariant()) .Where(n => n.StartsWith(lookup)) .OrderBy(s => s); } } }
mit
C#
a6e69c34d34a37f95b64fb27b0fdc3d1b0e9e246
change assembly title
Lone-Coder/letsencrypt-win-simple
letsencrypt-win-simple/Properties/AssemblyInfo.cs
letsencrypt-win-simple/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("wacs.exe")] [assembly: AssemblyDescription("A simple ACME client for Windows")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("PKI#")] [assembly: AssemblyProduct("Windows ACME Simple (WACS)")] [assembly: AssemblyCopyright("Apache 2.0 license")] [assembly: AssemblyTrademark("Let's Encrypt is a trademark of ISRG")] [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("30cc3de8-aa52-4807-9b0d-eba08b539918")] // 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("1912.2.*")] [assembly: AssemblyVersion("2000.0.*")] [assembly: AssemblyFileVersion("2.0.0.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("letsencrypt.exe")] [assembly: AssemblyDescription("A simple ACME client for Windows")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("PKI#")] [assembly: AssemblyProduct("Windows ACME Simple (WACS)")] [assembly: AssemblyCopyright("Apache 2.0 license")] [assembly: AssemblyTrademark("Let's Encrypt is a trademark of ISRG")] [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("30cc3de8-aa52-4807-9b0d-eba08b539918")] // 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("1912.2.*")] [assembly: AssemblyVersion("2000.0.*")] [assembly: AssemblyFileVersion("2.0.0.0")]
apache-2.0
C#
80e97b90906862d9f37f080576c81d14668e8b4f
Fix binary exercise. Closes #71
ErikSchierboom/xcsharp,exercism/xcsharp,GKotfis/csharp,GKotfis/csharp,robkeim/xcsharp,robkeim/xcsharp,ErikSchierboom/xcsharp,exercism/xcsharp
exercises/binary/BinaryTest.cs
exercises/binary/BinaryTest.cs
using NUnit.Framework; [TestFixture] public class BinaryTest { // change Ignore to false to run test case or just remove 'Ignore = true' [TestCase("1", ExpectedResult = 1)] [TestCase("10", ExpectedResult = 2, Ignore = "Remove to run test case")] [TestCase("11", ExpectedResult = 3, Ignore = "Remove to run test case")] [TestCase("100", ExpectedResult = 4, Ignore = "Remove to run test case")] [TestCase("1001", ExpectedResult = 9, Ignore = "Remove to run test case")] [TestCase("11010", ExpectedResult = 26, Ignore = "Remove to run test case")] [TestCase("10001101000", ExpectedResult = 1128, Ignore = "Remove to run test case")] public int Binary_converts_to_decimal(string binary) { return Binary.ToDecimal(binary); } [TestCase("carrot", Ignore = "Remove to run test case")] [TestCase("2", Ignore = "Remove to run test case")] [TestCase("5", Ignore = "Remove to run test case")] [TestCase("9", Ignore = "Remove to run test case")] [TestCase("a10", Ignore = "Remove to run test case")] [TestCase("100b", Ignore = "Remove to run test case")] [TestCase("10c01", Ignore = "Remove to run test case")] [TestCase("134678", Ignore = "Remove to run test case")] [TestCase("abc10z", Ignore = "Remove to run test case")] public void Invalid_binary_is_decimal_0(string invalidValue) { Assert.That(Binary.ToDecimal(invalidValue), Is.EqualTo(0)); } [Ignore("Remove to run test")] [Test] public void Binary_can_convert_formatted_strings() { Assert.That(Binary.ToDecimal("011"), Is.EqualTo(3)); } }
using NUnit.Framework; [TestFixture] public class BinaryTest { // change Ignore to false to run test case or just remove 'Ignore = true' [TestCase("1", ExpectedResult = 1)] [TestCase("10", ExpectedResult = 2, Ignore = "Remove to run test case")] [TestCase("11", ExpectedResult = 3, Ignore = "Remove to run test case")] [TestCase("100", ExpectedResult = 4, Ignore = "Remove to run test case")] [TestCase("1001", ExpectedResult = 9, Ignore = "Remove to run test case")] [TestCase("11010", ExpectedResult = 26, Ignore = "Remove to run test case")] [TestCase("10001101000", ExpectedResult = 1128, Ignore = "Remove to run test case")] public int Binary_converts_to_decimal(string binary) { return Binary.ToDecimal(binary); } [TestCase("carrot", Ignore = "Remove to run test case")] [TestCase("2", Ignore = "Remove to run test case")] [TestCase("5", Ignore = "Remove to run test case")] [TestCase("9", Ignore = "Remove to run test case")] [TestCase("134678", Ignore = "Remove to run test case")] [TestCase("abc10z", Ignore = "Remove to run test case")] public void Invalid_binary_is_decimal_0(string invalidValue) { Assert.That(Binary.ToDecimal(invalidValue), Is.EqualTo(0)); } [Ignore("Remove to run test")] [Test] public void Binary_can_convert_formatted_strings() { Assert.That(Binary.ToDecimal("011"), Is.EqualTo(3)); } }
mit
C#
19c4fe54f061f911895d04c2212c4ae137031e99
Remove lokal test
secana/PeNet
test/PeNet.Test/PeFile_Test.cs
test/PeNet.Test/PeFile_Test.cs
using System.Linq; using Newtonsoft.Json.Linq; using Xunit; namespace PeNet.Test { public class PeFileTest { [Theory] [InlineData(@"Binaries/firefox_x64.exe", true)] [InlineData(@"Binaries/firefox_x86.exe", true)] [InlineData(@"Binaries/NetFrameworkConsole.exe", true)] [InlineData(@"Binaries/notPeFile.txt", false)] public void IsPEFile_DifferentFiles_TrueOrFalse(string file, bool expected) { Assert.Equal(expected, PeFile.IsPEFile(file)); } [Fact] public void ExportedFunctions_WithForwardedFunctions_ParsedFordwardedFunctions() { var peFile = new PeFile(@"Binaries/win_test.dll"); var forwardExports = peFile.ExportedFunctions.Where(e => e.HasForward).ToList(); Assert.Equal(180, forwardExports.Count); Assert.Equal("NTDLL.RtlEnterCriticalSection", forwardExports.First(e => e.Name == "EnterCriticalSection").ForwardName); } [Theory] [InlineData(@"Binaries/firefox_x64.exe", false)] [InlineData(@"Binaries/TLSCallback_x86.exe", false)] [InlineData(@"Binaries/NetCoreConsole.dll", false)] [InlineData(@"Binaries/win_test.dll", false)] [InlineData(@"Binaries/krnl_test.sys", true)] public void IsDriver_GivenAPeFile_ReturnsDriverOrNot(string file, bool isDriver) { var peFile = new PeFile(file); Assert.Equal(isDriver, peFile.IsDriver); } } }
using System.Linq; using Newtonsoft.Json.Linq; using Xunit; namespace PeNet.Test { public class PeFileTest { [Theory] [InlineData(@"Binaries/firefox_x64.exe", true)] [InlineData(@"Binaries/firefox_x86.exe", true)] [InlineData(@"Binaries/NetFrameworkConsole.exe", true)] [InlineData(@"Binaries/notPeFile.txt", false)] public void IsPEFile_DifferentFiles_TrueOrFalse(string file, bool expected) { Assert.Equal(expected, PeFile.IsPEFile(file)); } [Fact] public void ExportedFunctions_WithForwardedFunctions_ParsedFordwardedFunctions() { var peFile = new PeFile(@"Binaries/win_test.dll"); var forwardExports = peFile.ExportedFunctions.Where(e => e.HasForward).ToList(); Assert.Equal(180, forwardExports.Count); Assert.Equal("NTDLL.RtlEnterCriticalSection", forwardExports.First(e => e.Name == "EnterCriticalSection").ForwardName); } [Theory] [InlineData(@"Binaries/firefox_x64.exe", false)] [InlineData(@"Binaries/TLSCallback_x86.exe", false)] [InlineData(@"Binaries/NetCoreConsole.dll", false)] [InlineData(@"Binaries/win_test.dll", false)] [InlineData(@"Binaries/krnl_test.sys", true)] public void IsDriver_GivenAPeFile_ReturnsDriverOrNot(string file, bool isDriver) { var peFile = new PeFile(file); Assert.Equal(isDriver, peFile.IsDriver); } [Fact] public void TMP_MALWARE() { var peFile = new PeFile(@"C:\malware\9d5eb5ac899764d5ed30cc93df8d645e598e2cbce53ae7bb081ded2c38286d1e"); Assert.NotNull(peFile.ImageResourceDirectory); } } }
apache-2.0
C#
f9856dd3d1f8edc4828c84180c4812f9981544a0
Fix zip download to be non-blocking
atifaziz/WebLinq,weblinq/WebLinq,weblinq/WebLinq,atifaziz/WebLinq
src/Core/Zip/ZipQuery.cs
src/Core/Zip/ZipQuery.cs
#region Copyright (c) 2016 Atif Aziz. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // #endregion namespace WebLinq.Zip { using System; using System.IO; using System.Net.Http; using System.Reactive.Linq; using System.Threading.Tasks; public static class ZipQuery { public static IObservable<HttpFetch<Zip>> DownloadZip(this IObservable<HttpFetch<HttpContent>> query) => from fetch in query from path in DownloadZip(fetch.Content) select fetch.WithContent(new Zip(path)); static async Task<string> DownloadZip(HttpContent content) { var path = Path.GetTempFileName(); using (var output = File.Create(path)) await content.CopyToAsync(output); return path; } } }
#region Copyright (c) 2016 Atif Aziz. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // #endregion namespace WebLinq.Zip { using System.Collections.Generic; using System.IO; using System.Linq; using System.Net.Http; public static class ZipQuery { public static IEnumerable<HttpFetch<Zip>> DownloadZip(this IEnumerable<HttpFetch<HttpContent>> query) => from fetch in query select fetch.WithContent(new Zip(DownloadZip(fetch.Content))); static string DownloadZip(HttpContent content) { var path = Path.GetTempFileName(); using (var output = File.Create(path)) content.CopyToAsync(output).Wait(); return path; } } }
apache-2.0
C#
c63a644639d00557c04a0d4d560e302a85ce62ee
Use Checker helper class
solr-express/solr-express,ca0abinary/solr-express
src/SolrExpress.Solr4/Query/Result/StatisticResult.cs
src/SolrExpress.Solr4/Query/Result/StatisticResult.cs
using Newtonsoft.Json.Linq; using SolrExpress.Core; using SolrExpress.Core.Query.Result; using System; namespace SolrExpress.Solr4.Query.Result { /// <summary> /// Statistic data builder /// </summary> public sealed class StatisticResult<TDocument> : IStatisticResult<TDocument>, IConvertJsonObject where TDocument : IDocument { /// <summary> /// Execute the parse of the JSON object in statistic /// </summary> /// <param name="jsonObject">JSON object used in the parse</param> public void Execute(JObject jsonObject) { Checker.IsTrue<UnexpectedJsonFormatException>(jsonObject["response"]?["numFound"] == null || jsonObject["responseHeader"]?["QTime"] == null); var documentCount = jsonObject["response"]["numFound"].ToObject<long>(); var qTime = jsonObject["responseHeader"]["QTime"].ToObject<int>(); this.Data = new Statistic { DocumentCount = documentCount, ElapsedTime = new TimeSpan(0, 0, 0, 0, qTime) }; } public Statistic Data { get; set; } } }
using Newtonsoft.Json.Linq; using SolrExpress.Core; using SolrExpress.Core.Query.Result; using System; namespace SolrExpress.Solr4.Query.Result { /// <summary> /// Statistic data builder /// </summary> public sealed class StatisticResult<TDocument> : IStatisticResult<TDocument>, IConvertJsonObject where TDocument : IDocument { /// <summary> /// Execute the parse of the JSON object in statistic /// </summary> /// <param name="jsonObject">JSON object used in the parse</param> public void Execute(JObject jsonObject) { if (jsonObject["response"]?["numFound"] == null || jsonObject["responseHeader"]?["QTime"] == null) { throw new UnexpectedJsonFormatException(jsonObject.ToString()); } var documentCount = jsonObject["response"]["numFound"].ToObject<long>(); var qTime = jsonObject["responseHeader"]["QTime"].ToObject<int>(); this.Data = new Statistic { DocumentCount = documentCount, ElapsedTime = new TimeSpan(0, 0, 0, 0, qTime) }; } public Statistic Data { get; set; } } }
mit
C#
e55186d43e3a23021ef31a76fb822cffcc61a12a
Fix - accept HelloAckSyn for unknown bots (missing file)
lontivero/DreamBot,lontivero/vinchuca
Network/Protocol/Peers/PeerInfo.cs
Network/Protocol/Peers/PeerInfo.cs
using System; using System.Net; using Vinchuca.System; namespace Vinchuca.Network.Protocol.Peers { public class PeerInfo { public PeerInfo(BotIdentifier botId, IPEndPoint endpoint) { BotId = botId; EndPoint = endpoint; LastSeen = DateTimeProvider.UtcNow; } public BotIdentifier BotId { get; internal set; } public IPEndPoint EndPoint { get; set; } public DateTime LastSeen { get; set; } public int Reputation { get; private set; } public byte[] EncryptionKey { get; internal set; } public byte[] PublicKey { get; set; } public short BotVersion { get; set; } public short CfgVersion { get; set; } public bool Handshaked { get; set; } internal TimeSpan InactiveFor { get { return DateTimeProvider.UtcNow - LastSeen; } } public bool IsUnknownBot { get { return Reputation < -10; } } public bool IsLazyBot { get { return InactiveFor > TimeSpan.FromMinutes(30); } } internal void Touch() { LastSeen = DateTimeProvider.UtcNow; } public void DecreseReputation() { Reputation--; } public override string ToString() { return string.Format("{0}@{1}", BotId, EndPoint); } public static PeerInfo Parse(string line) { var parts = line.Split(new[] {'@', ':'}); var id = BotIdentifier.Parse(parts[0]); var ip = IPAddress.Parse(parts[1]); var port = int.Parse(parts[2]); return new PeerInfo(id, new IPEndPoint(ip, port)); } } }
using System; using System.Net; using Vinchuca.System; namespace Vinchuca.Network.Protocol.Peers { public class PeerInfo { public PeerInfo(BotIdentifier botId, IPEndPoint endpoint) { BotId = botId; EndPoint = endpoint; LastSeen = DateTimeProvider.UtcNow; } public BotIdentifier BotId { get; private set; } public IPEndPoint EndPoint { get; set; } public DateTime LastSeen { get; set; } public int Reputation { get; private set; } public byte[] EncryptionKey { get; internal set; } public byte[] PublicKey { get; set; } public short BotVersion { get; set; } public short CfgVersion { get; set; } public bool Handshaked { get; set; } internal TimeSpan InactiveFor { get { return DateTimeProvider.UtcNow - LastSeen; } } public bool IsUnknownBot { get { return Reputation < -10; } } public bool IsLazyBot { get { return InactiveFor > TimeSpan.FromMinutes(30); } } internal void Touch() { LastSeen = DateTimeProvider.UtcNow; } public void DecreseReputation() { Reputation--; } public override string ToString() { return string.Format("{0}@{1}", BotId, EndPoint); } public static PeerInfo Parse(string line) { var parts = line.Split(new[] {'@', ':'}); var id = BotIdentifier.Parse(parts[0]); var ip = IPAddress.Parse(parts[1]); var port = int.Parse(parts[2]); return new PeerInfo(id, new IPEndPoint(ip, port)); } } }
mit
C#
f88113c84e4373125caa0ee534243fc07655109f
Initialize ConnectionFactory.HostName (#1404)
micdenny/EasyNetQ,EasyNetQ/EasyNetQ
Source/EasyNetQ/DI/ConnectionFactoryFactory.cs
Source/EasyNetQ/DI/ConnectionFactoryFactory.cs
using RabbitMQ.Client; namespace EasyNetQ.DI; internal static class ConnectionFactoryFactory { public static IConnectionFactory CreateConnectionFactory(ConnectionConfiguration configuration) { Preconditions.CheckNotNull(configuration, nameof(configuration)); var connectionFactory = new ConnectionFactory { AutomaticRecoveryEnabled = true, TopologyRecoveryEnabled = false, VirtualHost = configuration.VirtualHost, UserName = configuration.UserName, Password = configuration.Password, Port = configuration.Port, RequestedHeartbeat = configuration.RequestedHeartbeat, ClientProperties = configuration.ClientProperties, AuthMechanisms = configuration.AuthMechanisms, ClientProvidedName = configuration.Name, NetworkRecoveryInterval = configuration.ConnectIntervalAttempt, ContinuationTimeout = configuration.Timeout, DispatchConsumersAsync = true, ConsumerDispatchConcurrency = configuration.PrefetchCount, RequestedChannelMax = configuration.RequestedChannelMax }; if (configuration.Hosts.Count > 0) connectionFactory.HostName = configuration.Hosts[0].Host; return connectionFactory; } }
using RabbitMQ.Client; namespace EasyNetQ.DI; internal static class ConnectionFactoryFactory { public static IConnectionFactory CreateConnectionFactory(ConnectionConfiguration configuration) { Preconditions.CheckNotNull(configuration, nameof(configuration)); var connectionFactory = new ConnectionFactory { AutomaticRecoveryEnabled = true, TopologyRecoveryEnabled = false, VirtualHost = configuration.VirtualHost, UserName = configuration.UserName, Password = configuration.Password, Port = configuration.Port, RequestedHeartbeat = configuration.RequestedHeartbeat, ClientProperties = configuration.ClientProperties, AuthMechanisms = configuration.AuthMechanisms, ClientProvidedName = configuration.Name, NetworkRecoveryInterval = configuration.ConnectIntervalAttempt, ContinuationTimeout = configuration.Timeout, DispatchConsumersAsync = true, ConsumerDispatchConcurrency = configuration.PrefetchCount, RequestedChannelMax = configuration.RequestedChannelMax }; return connectionFactory; } }
mit
C#
2f296c59c57253eba721250fd977bf3b478346ac
handle gzip encoding
DeonHeyns/Metrics.NET,huoxudong125/Metrics.NET,mnadel/Metrics.NET,alhardy/Metrics.NET,Recognos/Metrics.NET,etishor/Metrics.NET,DeonHeyns/Metrics.NET,Liwoj/Metrics.NET,etishor/Metrics.NET,alhardy/Metrics.NET,ntent-ad/Metrics.NET,cvent/Metrics.NET,ntent-ad/Metrics.NET,MetaG8/Metrics.NET,Liwoj/Metrics.NET,cvent/Metrics.NET,mnadel/Metrics.NET,huoxudong125/Metrics.NET,MetaG8/Metrics.NET,MetaG8/Metrics.NET,Recognos/Metrics.NET
Src/Metrics/RemoteMetrics/HttpRemoteMetrics.cs
Src/Metrics/RemoteMetrics/HttpRemoteMetrics.cs
using System; using System.Net; using System.Threading; using System.Threading.Tasks; using Metrics.Json; namespace Metrics.RemoteMetrics { public static class HttpRemoteMetrics { private class CustomClient : WebClient { protected override WebRequest GetWebRequest(Uri address) { HttpWebRequest request = base.GetWebRequest(address) as HttpWebRequest; request.AutomaticDecompression = DecompressionMethods.Deflate | DecompressionMethods.GZip; return request; } } public static async Task<JsonMetricsContext> FetchRemoteMetrics(Uri remoteUri, Func<string, JsonMetricsContext> deserializer, CancellationToken token) { using (CustomClient client = new CustomClient()) { client.Headers.Add("Accept-Encoding", "gizp"); var json = await client.DownloadStringTaskAsync(remoteUri).ConfigureAwait(false); return deserializer(json); } } } }
using System; using System.Net; using System.Threading; using System.Threading.Tasks; using Metrics.Json; namespace Metrics.RemoteMetrics { public static class HttpRemoteMetrics { public static async Task<JsonMetricsContext> FetchRemoteMetrics(Uri remoteUri, Func<string, JsonMetricsContext> deserializer, CancellationToken token) { using (WebClient client = new WebClient()) { //client.Headers.Add("Accept-Encoding", "gzip"); var json = await client.DownloadStringTaskAsync(remoteUri).ConfigureAwait(false); return deserializer(json); } } } }
apache-2.0
C#
50f981e5b4d3677df6c1848ed6747b4b78522c23
use unix style path for command line
etishor/Metrics.NET,alhardy/Metrics.NET,mnadel/Metrics.NET,etishor/Metrics.NET,ntent-ad/Metrics.NET,mnadel/Metrics.NET,huoxudong125/Metrics.NET,alhardy/Metrics.NET,huoxudong125/Metrics.NET,cvent/Metrics.NET,Recognos/Metrics.NET,MetaG8/Metrics.NET,DeonHeyns/Metrics.NET,cvent/Metrics.NET,Liwoj/Metrics.NET,MetaG8/Metrics.NET,DeonHeyns/Metrics.NET,Liwoj/Metrics.NET,Recognos/Metrics.NET,MetaG8/Metrics.NET,ntent-ad/Metrics.NET
Src/Metrics/PerfCounters/SystemInfo.cs
Src/Metrics/PerfCounters/SystemInfo.cs
 using System; namespace Metrics.PerfCounters { public class SystemInfo : BaseCounterRegristry { public SystemInfo(MetricsRegistry registry, string prefix) : base(registry, prefix) { } public void Register() { Register("MachineName", () => Environment.MachineName); Register("Processor Count", () => Environment.ProcessorCount.ToString()); Register("OperatingSystem", () => GetOSVersion()); Register("NETVersion", () => Environment.Version.ToString()); Register("CommandLine", () => Environment.CommandLine.Replace("\"",string.Empty).Replace("\\","/")); Register("AvailableRAM", () => new PerformanceCounterGauge("Memory", "Available MBytes"), Unit.Custom("Mb")); Register("CPU Usage", () => new PerformanceCounterGauge("Processor", "% Processor Time", TotalInstance), Unit.Custom("%")); Register("Disk Writes/sec", () => new PerformanceCounterGauge("PhysicalDisk", "Disk Reads/sec", TotalInstance, f => (f / 1000).ToString("F")), Unit.Custom("kb/s")); Register("Disk Reads/sec", () => new PerformanceCounterGauge("PhysicalDisk", "Disk Writes/sec", TotalInstance, f => (f / 1000).ToString("F")), Unit.Custom("kb/s")); } private static string GetOSVersion() { return string.Format("{0} {1}", Environment.OSVersion.VersionString, Environment.Is64BitOperatingSystem ? "64bit" : "32bit"); } } }
 using System; namespace Metrics.PerfCounters { public class SystemInfo : BaseCounterRegristry { public SystemInfo(MetricsRegistry registry, string prefix) : base(registry, prefix) { } public void Register() { Register("MachineName", () => Environment.MachineName); Register("Processor Count", () => Environment.ProcessorCount.ToString()); Register("OperatingSystem", () => GetOSVersion()); Register("NETVersion", () => Environment.Version.ToString()); Register("CommandLine", () => Environment.CommandLine); Register("AvailableRAM", () => new PerformanceCounterGauge("Memory", "Available MBytes"), Unit.Custom("Mb")); Register("CPU Usage", () => new PerformanceCounterGauge("Processor", "% Processor Time", TotalInstance), Unit.Custom("%")); Register("Disk Writes/sec", () => new PerformanceCounterGauge("PhysicalDisk", "Disk Reads/sec", TotalInstance, f => (f / 1000).ToString("F")), Unit.Custom("kb/s")); Register("Disk Reads/sec", () => new PerformanceCounterGauge("PhysicalDisk", "Disk Writes/sec", TotalInstance, f => (f / 1000).ToString("F")), Unit.Custom("kb/s")); } private static string GetOSVersion() { return string.Format("{0} {1}", Environment.OSVersion.VersionString, Environment.Is64BitOperatingSystem ? "64bit" : "32bit"); } } }
apache-2.0
C#
4f895f6fc2bc9bdb10e626cd399027b8b14f0ec5
Add another test
m-ender/retina,m-ender/retina,mbuettner/retina
Retina/RetinaTest/EvalStageTest.cs
Retina/RetinaTest/EvalStageTest.cs
using System; using Microsoft.VisualStudio.TestTools.UnitTesting; using System.Collections.Generic; namespace RetinaTest { [TestClass] public class EvalStageTest : RetinaTestBase { [TestMethod] public void TestEval() { AssertProgram(new TestSuite { Sources = { @"^", @"abc", @"""$-0""~`.+", @".+$n$$&$$&$n{$*`.+$n$$&$$&$n\`^$n$$.-0$$.-1$$.+2$$.+3$$.+4$n)`^.{0,7}$n$n^$$$n$$+0,$$+1,$$+2,$$+3,$$+4,$$+5,$$+6,$$+7", @"*\L`^..", }, TestCases = { { "", "12\n12612abcabc\n848114cabc\n636103abc\n42492bc\n00070\nabc,abcabc,,00070,,,," } } }); AssertProgram(new TestSuite { Sources = { @"^", @"abc", @"~`.+", @".+$n$$&$$&$n{$*`.+$n$$&$$&$n\`^$n$$.-0$$.-1$$.+2$$.+3$$.+4$n)`^.{0,7}$n$n^$$$n$$+0,$$+1,$$+2,$$+3,$$+4,$$+5,$$+6,$$+7", @"*\L`^..", }, TestCases = { { "", "12\n12612abcabc\n848114cabc\n636103abc\n42492bc\n00070\nabc,abcabc,,00070,,,," } } }); } } }
using System; using Microsoft.VisualStudio.TestTools.UnitTesting; using System.Collections.Generic; namespace RetinaTest { [TestClass] public class EvalStageTest : RetinaTestBase { [TestMethod] public void TestEval() { AssertProgram(new TestSuite { Sources = { @"^", @"abc", @"""$-0""~`.+", @".+$n$$&$$&$n{$*`.+$n$$&$$&$n\`^$n$$.-0$$.-1$$.+2$$.+3$$.+4$n)`^.{0,7}$n$n^$$$n$$+0,$$+1,$$+2,$$+3,$$+4,$$+5,$$+6,$$+7", @"*\L`^..", }, TestCases = { { "", "12\n12612abcabc\n848114cabc\n636103abc\n42492bc\n00070\nabc,abcabc,,00070,,,," } } }); } } }
mit
C#
88066c546d826b00f361e91df9f9591fce549a2c
Remove .NET limit on env var name and value length
wtgodbe/coreclr,mmitche/coreclr,wtgodbe/coreclr,ruben-ayrapetyan/coreclr,mmitche/coreclr,yizhang82/coreclr,cshung/coreclr,mmitche/coreclr,poizan42/coreclr,wtgodbe/coreclr,yizhang82/coreclr,cshung/coreclr,mmitche/coreclr,ruben-ayrapetyan/coreclr,ruben-ayrapetyan/coreclr,poizan42/coreclr,poizan42/coreclr,cshung/coreclr,poizan42/coreclr,mmitche/coreclr,wtgodbe/coreclr,yizhang82/coreclr,wtgodbe/coreclr,poizan42/coreclr,krk/coreclr,yizhang82/coreclr,yizhang82/coreclr,wtgodbe/coreclr,krk/coreclr,mmitche/coreclr,krk/coreclr,cshung/coreclr,krk/coreclr,poizan42/coreclr,yizhang82/coreclr,cshung/coreclr,ruben-ayrapetyan/coreclr,ruben-ayrapetyan/coreclr,krk/coreclr,ruben-ayrapetyan/coreclr,krk/coreclr,cshung/coreclr
src/mscorlib/shared/Interop/Windows/Interop.Errors.cs
src/mscorlib/shared/Interop/Windows/Interop.Errors.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. internal partial class Interop { // As defined in winerror.h and https://msdn.microsoft.com/en-us/library/windows/desktop/ms681382.aspx internal partial class Errors { internal const int ERROR_SUCCESS = 0x0; internal const int ERROR_FILE_NOT_FOUND = 0x2; internal const int ERROR_PATH_NOT_FOUND = 0x3; internal const int ERROR_ACCESS_DENIED = 0x5; internal const int ERROR_INVALID_HANDLE = 0x6; internal const int ERROR_NOT_ENOUGH_MEMORY = 0x8; internal const int ERROR_INVALID_DRIVE = 0xF; internal const int ERROR_NO_MORE_FILES = 0x12; internal const int ERROR_NOT_READY = 0x15; internal const int ERROR_SHARING_VIOLATION = 0x20; internal const int ERROR_HANDLE_EOF = 0x26; internal const int ERROR_FILE_EXISTS = 0x50; internal const int ERROR_INVALID_PARAMETER = 0x57; internal const int ERROR_BROKEN_PIPE = 0x6D; internal const int ERROR_INSUFFICIENT_BUFFER = 0x7A; internal const int ERROR_INVALID_NAME = 0x7B; internal const int ERROR_BAD_PATHNAME = 0xA1; internal const int ERROR_ALREADY_EXISTS = 0xB7; internal const int ERROR_ENVVAR_NOT_FOUND = 0xCB; internal const int ERROR_FILENAME_EXCED_RANGE = 0xCE; internal const int ERROR_NO_DATA = 0xE8; internal const int ERROR_MORE_DATA = 0xEA; internal const int ERROR_NO_MORE_ITEMS = 0x103; internal const int ERROR_NOT_OWNER = 0x120; internal const int ERROR_TOO_MANY_POSTS = 0x12A; internal const int ERROR_ARITHMETIC_OVERFLOW = 0x216; internal const int ERROR_MUTANT_LIMIT_EXCEEDED = 0x24B; internal const int ERROR_OPERATION_ABORTED = 0x3E3; internal const int ERROR_IO_PENDING = 0x3E5; internal const int ERROR_NO_UNICODE_TRANSLATION = 0x459; internal const int ERROR_NOT_FOUND = 0x490; internal const int ERROR_BAD_IMPERSONATION_LEVEL = 0x542; internal const int ERROR_NO_SYSTEM_RESOURCES = 0x5AA; internal const int E_FILENOTFOUND = unchecked((int)0x80070002); internal const int ERROR_TIMEOUT = 0x000005B4; } }
// 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. internal partial class Interop { // As defined in winerror.h and https://msdn.microsoft.com/en-us/library/windows/desktop/ms681382.aspx internal partial class Errors { internal const int ERROR_SUCCESS = 0x0; internal const int ERROR_FILE_NOT_FOUND = 0x2; internal const int ERROR_PATH_NOT_FOUND = 0x3; internal const int ERROR_ACCESS_DENIED = 0x5; internal const int ERROR_INVALID_HANDLE = 0x6; internal const int ERROR_NOT_ENOUGH_MEMORY = 0x8; internal const int ERROR_INVALID_DRIVE = 0xF; internal const int ERROR_NO_MORE_FILES = 0x12; internal const int ERROR_NOT_READY = 0x15; internal const int ERROR_SHARING_VIOLATION = 0x20; internal const int ERROR_HANDLE_EOF = 0x26; internal const int ERROR_FILE_EXISTS = 0x50; internal const int ERROR_INVALID_PARAMETER = 0x57; internal const int ERROR_BROKEN_PIPE = 0x6D; internal const int ERROR_INSUFFICIENT_BUFFER = 0x7A; internal const int ERROR_INVALID_NAME = 0x7B; internal const int ERROR_BAD_PATHNAME = 0xA1; internal const int ERROR_ALREADY_EXISTS = 0xB7; internal const int ERROR_ENVVAR_NOT_FOUND = 0xCB; internal const int ERROR_FILENAME_EXCED_RANGE = 0xCE; internal const int ERROR_NO_DATA = 0xE8; internal const int ERROR_MORE_DATA = 0xEA; internal const int ERROR_NO_MORE_ITEMS = 0x103; internal const int ERROR_NOT_OWNER = 0x120; internal const int ERROR_TOO_MANY_POSTS = 0x12A; internal const int ERROR_ARITHMETIC_OVERFLOW = 0x216; internal const int ERROR_MUTANT_LIMIT_EXCEEDED = 0x24B; internal const int ERROR_OPERATION_ABORTED = 0x3E3; internal const int ERROR_IO_PENDING = 0x3E5; internal const int ERROR_NO_UNICODE_TRANSLATION = 0x459; internal const int ERROR_NOT_FOUND = 0x490; internal const int ERROR_BAD_IMPERSONATION_LEVEL = 0x542; internal const int E_FILENOTFOUND = unchecked((int)0x80070002); internal const int ERROR_TIMEOUT = 0x000005B4; } }
mit
C#
0da950beac62018f4edaecf14b1996df40b75993
Fix KeyCounter M1 M2 display.
ZLima12/osu,peppy/osu,2yangk23/osu,tacchinotacchi/osu,smoogipooo/osu,nyaamara/osu,NeoAdonis/osu,EVAST9919/osu,DrabWeb/osu,ZLima12/osu,ppy/osu,UselessToucan/osu,DrabWeb/osu,johnneijzen/osu,ppy/osu,Damnae/osu,UselessToucan/osu,naoey/osu,osu-RP/osu-RP,Nabile-Rahmani/osu,Drezi126/osu,DrabWeb/osu,smoogipoo/osu,peppy/osu,naoey/osu,peppy/osu,smoogipoo/osu,ppy/osu,NeoAdonis/osu,NeoAdonis/osu,UselessToucan/osu,naoey/osu,smoogipoo/osu,EVAST9919/osu,2yangk23/osu,peppy/osu-new,RedNesto/osu,Frontear/osuKyzer,johnneijzen/osu
osu.Game/Screens/Play/KeyCounterMouse.cs
osu.Game/Screens/Play/KeyCounterMouse.cs
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Input; using OpenTK; using OpenTK.Input; namespace osu.Game.Screens.Play { public class KeyCounterMouse : KeyCounter { public MouseButton Button { get; } public KeyCounterMouse(MouseButton button) : base(getStringRepresentation(button)) { Button = button; } private static string getStringRepresentation(MouseButton button) { switch (button) { default: return button.ToString(); case MouseButton.Left: return @"M1"; case MouseButton.Right: return @"M2"; } } public override bool Contains(Vector2 screenSpacePos) => true; protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) { if (args.Button == Button) IsLit = true; return base.OnMouseDown(state, args); } protected override bool OnMouseUp(InputState state, MouseUpEventArgs args) { if (args.Button == Button) IsLit = false; return base.OnMouseUp(state, args); } } }
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Input; using OpenTK; using OpenTK.Input; namespace osu.Game.Screens.Play { public class KeyCounterMouse : KeyCounter { public MouseButton Button { get; } public KeyCounterMouse(MouseButton button) : base(button.ToString()) { Button = button; } public override bool Contains(Vector2 screenSpacePos) => true; protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) { if (args.Button == Button) IsLit = true; return base.OnMouseDown(state, args); } protected override bool OnMouseUp(InputState state, MouseUpEventArgs args) { if (args.Button == Button) IsLit = false; return base.OnMouseUp(state, args); } } }
mit
C#
c7ce08f76d7836b9c17bbf7d96de3eca73888223
Change CAT slide sounds.
fr1tz/rotc-ethernet-game,fr1tz/rotc-ethernet-game,fr1tz/rotc-ethernet-game,fr1tz/rotc-ethernet-game
game/server/base/cats.sfx.cs
game/server/base/cats.sfx.cs
//------------------------------------------------------------------------------ // Revenge Of The Cats: Ethernet // Copyright notices are in the file named COPYING. //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ // Revenge Of The Cats - cats.sfx.cs // Sounds for all CATs //------------------------------------------------------------------------------ datablock AudioProfile(CatSpawnSound) { filename = "share/sounds/rotc/deploy1.wav"; description = AudioDefault3D; preload = true; }; datablock AudioProfile(PlayerSlideSound) { filename = "share/sounds/rotc/slide3.wav"; description = AudioCloseLooping3D; preload = true; }; datablock AudioProfile(PlayerSlideContactSound) { filename = "share/sounds/rotc/slide3a.wav"; description = AudioCloseLooping3D; preload = true; }; datablock AudioProfile(PlayerSkidSound) { filename = "share/shapes/rotc/players/standardcat/slidecontact.wav"; description = AudioCloseLooping3D; preload = true; }; datablock AudioProfile(CatJumpExplosionSound) { filename = "share/sounds/rotc/explosion3.wav"; description = AudioFar3D; preload = true; }; //datablock AudioProfile(ExitingWaterLightSound) //{ // filename = "share/sounds/rotc/replaceme.wav"; // description = AudioClose3d; // preload = true; //}; //datablock AudioProfile(DeathCrySound) //{ // fileName = ""; // description = AudioClose3d; // preload = true; //}; //datablock AudioProfile(PainCrySound) //{ // fileName = ""; // description = AudioClose3d; // preload = true; //}; //datablock AudioProfile(PlayerSharedMoveBubblesSound) //{ // filename = "share/sounds/rotc/replaceme.wav"; // description = AudioCloseLooping3d; // preload = true; //}; //datablock AudioProfile(WaterBreathMaleSound) //{ // filename = "share/sounds/rotc/replaceme.wav"; // description = AudioClosestLooping3d; // preload = true; //};
//------------------------------------------------------------------------------ // Revenge Of The Cats: Ethernet // Copyright notices are in the file named COPYING. //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ // Revenge Of The Cats - cats.sfx.cs // Sounds for all CATs //------------------------------------------------------------------------------ datablock AudioProfile(CatSpawnSound) { filename = "share/sounds/rotc/deploy1.wav"; description = AudioDefault3D; preload = true; }; datablock AudioProfile(PlayerSlideSound) { filename = "share/sounds/rotc/slide2.wav"; description = AudioCloseLooping3D; preload = true; }; datablock AudioProfile(PlayerSlideContactSound) { filename = "share/sounds/rotc/slide1.wav"; description = AudioCloseLooping3D; preload = true; }; datablock AudioProfile(PlayerSkidSound) { filename = "share/shapes/rotc/players/standardcat/slidecontact.wav"; description = AudioCloseLooping3D; preload = true; }; datablock AudioProfile(CatJumpExplosionSound) { filename = "share/sounds/rotc/explosion3.wav"; description = AudioFar3D; preload = true; }; //datablock AudioProfile(ExitingWaterLightSound) //{ // filename = "share/sounds/rotc/replaceme.wav"; // description = AudioClose3d; // preload = true; //}; //datablock AudioProfile(DeathCrySound) //{ // fileName = ""; // description = AudioClose3d; // preload = true; //}; //datablock AudioProfile(PainCrySound) //{ // fileName = ""; // description = AudioClose3d; // preload = true; //}; //datablock AudioProfile(PlayerSharedMoveBubblesSound) //{ // filename = "share/sounds/rotc/replaceme.wav"; // description = AudioCloseLooping3d; // preload = true; //}; //datablock AudioProfile(WaterBreathMaleSound) //{ // filename = "share/sounds/rotc/replaceme.wav"; // description = AudioClosestLooping3d; // preload = true; //};
lgpl-2.1
C#
40b9040bea40d0731e65ce4dbeaa0f783fb60207
Update assembly version to match pom.xml
caseykramer/libphonenumber-csharp,caseykramer/libphonenumber-csharp,caseykramer/libphonenumber-csharp,caseykramer/libphonenumber-csharp,caseykramer/libphonenumber-csharp,caseykramer/libphonenumber-csharp,caseykramer/libphonenumber-csharp
csharp/PhoneNumbers/Properties/AssemblyInfo.cs
csharp/PhoneNumbers/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("PhoneNumbers")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("PhoneNumbers")] [assembly: AssemblyCopyright("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: InternalsVisibleTo("PhoneNumbers.Test,PublicKey=0024000004800000940000000602000000240000525341310004000001000100bde2afb5c7e52bae4645cd6f0a17da44b588ece28058a2597d0540627b977c0fbc358bd4a8c3629c498b2c04cf194149c452e6ffa465cb3dd83993326a15e4068f93e135b1c8269041e2e8e9b77c5f3d71709e2cd76e016ba87dd5ff3b1ba7448c0aa8f6367c4f6077a749731fc5fcbe8325161264b5017a13602982ec95fdc6")] // 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. // 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("2.12.0.74")] [assembly: AssemblyVersion("7.0.6.*")] [assembly: AssemblyFileVersion("7.0.6.*")]
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("PhoneNumbers")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("PhoneNumbers")] [assembly: AssemblyCopyright("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: InternalsVisibleTo("PhoneNumbers.Test,PublicKey=0024000004800000940000000602000000240000525341310004000001000100bde2afb5c7e52bae4645cd6f0a17da44b588ece28058a2597d0540627b977c0fbc358bd4a8c3629c498b2c04cf194149c452e6ffa465cb3dd83993326a15e4068f93e135b1c8269041e2e8e9b77c5f3d71709e2cd76e016ba87dd5ff3b1ba7448c0aa8f6367c4f6077a749731fc5fcbe8325161264b5017a13602982ec95fdc6")] // 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. // 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("2.12.0.74")] [assembly: AssemblyVersion("7.0.5.0")] [assembly: AssemblyFileVersion("7.0.5.0")]
apache-2.0
C#
7fc8df725353daeb7db8a6b07846a3d19f77ff7a
Fix NPE in ModPacket.Send when broadcasting
peteyus/tModLoader,peteyus/tModLoader,peteyus/tModLoader,peteyus/tModLoader
patches/tModLoader/Terraria.ModLoader/ModPacket.cs
patches/tModLoader/Terraria.ModLoader/ModPacket.cs
using System; using System.IO; namespace Terraria.ModLoader { public sealed class ModPacket : BinaryWriter { private byte[] buf; private ushort len; internal ModPacket(byte messageID, int capacity = 256) : base(new MemoryStream(capacity)) { Write((ushort)0); Write(messageID); } public void Send(int toClient = -1, int ignoreClient = -1) { Finish(); if (Main.netMode == 1) Netplay.Connection.Socket.AsyncSend(buf, 0, len, SendCallback); else if (toClient != -1) Netplay.Clients[toClient].Socket.AsyncSend(buf, 0, len, SendCallback); else for (int i = 0; i < 256; i++) if (i != ignoreClient && Netplay.Clients[i].IsConnected()) Netplay.Clients[i].Socket.AsyncSend(buf, 0, len, SendCallback); } private void SendCallback(object state) {} private void Finish() { if (buf != null) return; if (OutStream.Position > ushort.MaxValue) throw new Exception("Packet too large " + OutStream.Position + " > " + ushort.MaxValue); len = (ushort)OutStream.Position; Seek(0, SeekOrigin.Begin); Write(len); Close(); buf = ((MemoryStream) OutStream).GetBuffer(); } } }
using System; using System.IO; namespace Terraria.ModLoader { public sealed class ModPacket : BinaryWriter { private byte[] buf; private ushort len; internal ModPacket(byte messageID, int capacity = 256) : base(new MemoryStream(capacity)) { Write((ushort)0); Write(messageID); } public void Send(int toClient = -1, int ignoreClient = -1) { Finish(); if (Main.netMode == 1) Netplay.Connection.Socket.AsyncSend(buf, 0, len, SendCallback); else if (toClient != -1) Netplay.Clients[toClient].Socket.AsyncSend(buf, 0, len, SendCallback); else for (int i = 0; i < 256; i++) if (i != ignoreClient) Netplay.Clients[i].Socket.AsyncSend(buf, 0, len, SendCallback); } private void SendCallback(object state) {} private void Finish() { if (buf != null) return; if (OutStream.Position > ushort.MaxValue) throw new Exception("Packet too large " + OutStream.Position + " > " + ushort.MaxValue); len = (ushort)OutStream.Position; Seek(0, SeekOrigin.Begin); Write(len); Close(); buf = ((MemoryStream) OutStream).GetBuffer(); } } }
mit
C#
c35af93edd533301dc999a0fae0384ac2f65167f
clear register room
jona8690/Project-Exam
RoomReservationSystem/UI.GUI/View/RegisterRoom.xaml.cs
RoomReservationSystem/UI.GUI/View/RegisterRoom.xaml.cs
using System; using System.Collections.Generic; 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 UI.GUI.View { /// <summary> /// Interaction logic for RegisterRoom.xaml /// </summary> public partial class RegisterRoom : Page { public RegisterRoom() { InitializeComponent(); } private void RegisterRoomPageButtonClick(object sender, RoutedEventArgs e) { string building = BuildingTextBox.Text; string floor = FloorTextBox.Text; string nr = RoomNrTextBox.Text; string maxPeople = MaxPeopleNrTextBox.Text; ComboBoxItem minPermissionLevelSelected = (ComboBoxItem)MinPermissionLevelComboBox.SelectedItem; string minPermissionLevel = minPermissionLevelSelected.Tag.ToString(); if (building == "" || floor == "" || nr == "" || maxPeople == "" || minPermissionLevel == "") { string fillInFieldsMessage = "Please fill in all the fields !"; MessageBox.Show(fillInFieldsMessage); } else { ViewModel.RegisterRoomVM registerRoom = new ViewModel.RegisterRoomVM(); registerRoom.RegisterRoom(building,floor,nr,maxPeople,minPermissionLevel); string registerRoomMessage = "Your room has been successfully registered !"; MessageBox.Show(registerRoomMessage); } BuildingTextBox.Clear(); FloorTextBox.Clear(); RoomNrTextBox.Clear(); MaxPeopleNrTextBox.Clear(); } } }
using System; using System.Collections.Generic; 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 UI.GUI.View { /// <summary> /// Interaction logic for RegisterRoom.xaml /// </summary> public partial class RegisterRoom : Page { public RegisterRoom() { InitializeComponent(); } private void RegisterRoomPageButtonClick(object sender, RoutedEventArgs e) { string building = BuildingTextBox.Text; string floor = FloorTextBox.Text; string nr = RoomNrTextBox.Text; string maxPeople = MaxPeopleNrTextBox.Text; ComboBoxItem minPermissionLevelSelected = (ComboBoxItem)MinPermissionLevelComboBox.SelectedItem; string minPermissionLevel = minPermissionLevelSelected.Tag.ToString(); if (building == "" || floor == "" || nr == "" || maxPeople == "" || minPermissionLevel == "") { string fillInFieldsMessage = "Please fill in all the fields !"; MessageBox.Show(fillInFieldsMessage); } else { ViewModel.RegisterRoomVM registerRoom = new ViewModel.RegisterRoomVM(); registerRoom.RegisterRoom(building,floor,nr,maxPeople,minPermissionLevel); string registerRoomMessage = "Your room has been successfully registered !"; MessageBox.Show(registerRoomMessage); } } } }
mit
C#
203973d42004b810d8f5310e103c3e54b4b38c96
Add platform init calls for UWP
Redth/ZXing.Net.Mobile
Samples/Sample.Forms/Sample.Forms.UWP/MainPage.xaml.cs
Samples/Sample.Forms/Sample.Forms.UWP/MainPage.xaml.cs
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Runtime.InteropServices.WindowsRuntime; using Windows.Foundation; using Windows.Foundation.Collections; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Controls.Primitives; using Windows.UI.Xaml.Data; using Windows.UI.Xaml.Input; using Windows.UI.Xaml.Media; using Windows.UI.Xaml.Navigation; namespace Sample.Forms.UWP { public sealed partial class MainPage { public MainPage() { this.InitializeComponent(); LoadApplication(new Sample.Forms.App()); ZXing.Net.Mobile.Forms.WindowsUniversal.ZXingScannerViewRenderer.Init(); ZXing.Net.Mobile.Forms.WindowsUniversal.ZXingBarcodeImageViewRenderer.Init(); } } }
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Runtime.InteropServices.WindowsRuntime; using Windows.Foundation; using Windows.Foundation.Collections; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Controls.Primitives; using Windows.UI.Xaml.Data; using Windows.UI.Xaml.Input; using Windows.UI.Xaml.Media; using Windows.UI.Xaml.Navigation; namespace Sample.Forms.UWP { public sealed partial class MainPage { public MainPage() { this.InitializeComponent(); LoadApplication(new Sample.Forms.App()); } } }
apache-2.0
C#
a75306acbd85b66d797e76543e294aea97b4fd60
Remove warnings from MdProvider
github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql
csharp/extractor/Semmle.Extraction.CIL/PDB/MdProvider.cs
csharp/extractor/Semmle.Extraction.CIL/PDB/MdProvider.cs
using System; using Microsoft.DiaSymReader; using System.Reflection; #pragma warning disable IDE0060, CA1822 namespace Semmle.Extraction.PDB { /// <summary> /// This is not used but is seemingly needed in order to use DiaSymReader. /// </summary> internal class MdProvider : ISymReaderMetadataProvider { public MdProvider() { } public object? GetMetadataImport() => null; public unsafe bool TryGetStandaloneSignature(int standaloneSignatureToken, out byte* signature, out int length) => throw new NotImplementedException(); public bool TryGetTypeDefinitionInfo(int typeDefinitionToken, out string namespaceName, out string typeName, out TypeAttributes attributes, out int baseTypeToken) => throw new NotImplementedException(); public bool TryGetTypeDefinitionInfo(int typeDefinitionToken, out string namespaceName, out string typeName, out TypeAttributes attributes) => throw new NotImplementedException(); public bool TryGetTypeReferenceInfo(int typeReferenceToken, out string namespaceName, out string typeName, out int resolutionScopeToken) => throw new NotImplementedException(); public bool TryGetTypeReferenceInfo(int typeReferenceToken, out string namespaceName, out string typeName) => throw new NotImplementedException(); } } #pragma warning restore
using System; using Microsoft.DiaSymReader; using System.Reflection; namespace Semmle.Extraction.PDB { /// <summary> /// This is not used but is seemingly needed in order to use DiaSymReader. /// </summary> internal class MdProvider : ISymReaderMetadataProvider { public MdProvider() { } public object? GetMetadataImport() => null; public unsafe bool TryGetStandaloneSignature(int standaloneSignatureToken, out byte* signature, out int length) => throw new NotImplementedException(); public bool TryGetTypeDefinitionInfo(int typeDefinitionToken, out string namespaceName, out string typeName, out TypeAttributes attributes, out int baseTypeToken) => throw new NotImplementedException(); public bool TryGetTypeDefinitionInfo(int typeDefinitionToken, out string namespaceName, out string typeName, out TypeAttributes attributes) => throw new NotImplementedException(); public bool TryGetTypeReferenceInfo(int typeReferenceToken, out string namespaceName, out string typeName, out int resolutionScopeToken) => throw new NotImplementedException(); public bool TryGetTypeReferenceInfo(int typeReferenceToken, out string namespaceName, out string typeName) => throw new NotImplementedException(); } }
mit
C#
2bdc7123a767ee5e057d5e78a041e59dc96c9df5
Switch to version 1.2.10
Abc-Arbitrage/Zebus,Abc-Arbitrage/Zebus.Directory
src/SharedVersionInfo.cs
src/SharedVersionInfo.cs
using System.Reflection; [assembly: AssemblyVersion("1.2.10")] [assembly: AssemblyFileVersion("1.2.10")] [assembly: AssemblyInformationalVersion("1.2.10")]
using System.Reflection; [assembly: AssemblyVersion("1.2.9")] [assembly: AssemblyFileVersion("1.2.9")] [assembly: AssemblyInformationalVersion("1.2.9")]
mit
C#