commit
stringlengths 40
40
| old_file
stringlengths 4
237
| new_file
stringlengths 4
237
| old_contents
stringlengths 1
4.24k
| new_contents
stringlengths 1
4.87k
| subject
stringlengths 15
778
| message
stringlengths 15
8.75k
| lang
stringclasses 266
values | license
stringclasses 13
values | repos
stringlengths 5
127k
|
|---|---|---|---|---|---|---|---|---|---|
215547f59924683e378da334f0445e2697728e49
|
src/VisualStudio/Core/Def/ExternalAccess/VSTypeScript/Api/IVsTypeScriptRemoteLanguageServiceWorkspace.cs
|
src/VisualStudio/Core/Def/ExternalAccess/VSTypeScript/Api/IVsTypeScriptRemoteLanguageServiceWorkspace.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
namespace Microsoft.VisualStudio.LanguageServices.ExternalAccess.VSTypeScript.Api
{
interface IVsTypeScriptRemoteLanguageServiceWorkspace
{
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using Microsoft.CodeAnalysis;
namespace Microsoft.VisualStudio.LanguageServices.ExternalAccess.VSTypeScript.Api
{
/// <summary>
/// Used to acquire the RemoteLanguageServiceWorkspace. Its members should be accessed by casting to <see cref="Workspace"/>.
/// </summary>
interface IVsTypeScriptRemoteLanguageServiceWorkspace
{
}
}
|
Add usage comment to interface
|
Add usage comment to interface
|
C#
|
mit
|
heejaechang/roslyn,KevinRansom/roslyn,shyamnamboodiripad/roslyn,diryboy/roslyn,dotnet/roslyn,eriawan/roslyn,CyrusNajmabadi/roslyn,genlu/roslyn,panopticoncentral/roslyn,CyrusNajmabadi/roslyn,jmarolf/roslyn,tannergooding/roslyn,dotnet/roslyn,bartdesmet/roslyn,ErikSchierboom/roslyn,tmat/roslyn,CyrusNajmabadi/roslyn,mgoertz-msft/roslyn,dotnet/roslyn,weltkante/roslyn,AmadeusW/roslyn,tmat/roslyn,panopticoncentral/roslyn,tmat/roslyn,mavasani/roslyn,aelij/roslyn,AmadeusW/roslyn,eriawan/roslyn,physhi/roslyn,AlekseyTs/roslyn,heejaechang/roslyn,jasonmalinowski/roslyn,genlu/roslyn,KirillOsenkov/roslyn,tannergooding/roslyn,jmarolf/roslyn,aelij/roslyn,jasonmalinowski/roslyn,stephentoub/roslyn,sharwell/roslyn,brettfo/roslyn,mgoertz-msft/roslyn,stephentoub/roslyn,AlekseyTs/roslyn,brettfo/roslyn,sharwell/roslyn,sharwell/roslyn,diryboy/roslyn,heejaechang/roslyn,genlu/roslyn,physhi/roslyn,eriawan/roslyn,panopticoncentral/roslyn,wvdd007/roslyn,shyamnamboodiripad/roslyn,ErikSchierboom/roslyn,wvdd007/roslyn,bartdesmet/roslyn,mgoertz-msft/roslyn,tannergooding/roslyn,diryboy/roslyn,weltkante/roslyn,AlekseyTs/roslyn,weltkante/roslyn,brettfo/roslyn,KirillOsenkov/roslyn,aelij/roslyn,KirillOsenkov/roslyn,shyamnamboodiripad/roslyn,jasonmalinowski/roslyn,ErikSchierboom/roslyn,wvdd007/roslyn,stephentoub/roslyn,bartdesmet/roslyn,physhi/roslyn,jmarolf/roslyn,AmadeusW/roslyn,KevinRansom/roslyn,gafter/roslyn,KevinRansom/roslyn,mavasani/roslyn,gafter/roslyn,gafter/roslyn,mavasani/roslyn
|
a9f06a179dbf97d90d18909668ba6064c0957e29
|
resharper/resharper-unity/src/Rider/UnityRiderUnitTestCoverageAvailabilityChecker.cs
|
resharper/resharper-unity/src/Rider/UnityRiderUnitTestCoverageAvailabilityChecker.cs
|
using JetBrains.Application;
using JetBrains.Application.Components;
using JetBrains.Collections.Viewable;
using JetBrains.ProjectModel;
using JetBrains.ReSharper.Host.Features;
using JetBrains.ReSharper.Host.Features.UnitTesting;
using JetBrains.ReSharper.Plugins.Unity.ProjectModel;
using JetBrains.ReSharper.UnitTestFramework;
using JetBrains.Rider.Model;
namespace JetBrains.ReSharper.Plugins.Unity.Rider
{
[ShellComponent]
public class UnityRiderUnitTestCoverageAvailabilityChecker : IRiderUnitTestCoverageAvailabilityChecker, IHideImplementation<DefaultRiderUnitTestCoverageAvailabilityChecker>
{
// this method should be very fast as it gets called a lot
public HostProviderAvailability GetAvailability(IUnitTestElement element)
{
var solution = element.Id.Project.GetSolution();
var tracker = solution.GetComponent<UnitySolutionTracker>();
if (tracker.IsUnityProject.HasValue() && !tracker.IsUnityProject.Value)
return HostProviderAvailability.Available;
var rdUnityModel = solution.GetProtocolSolution().GetRdUnityModel();
if (rdUnityModel.UnitTestPreference.Value != UnitTestLaunchPreference.PlayMode)
return HostProviderAvailability.Available;
return HostProviderAvailability.Nonexistent;
}
}
}
|
using System;
using JetBrains.Application;
using JetBrains.Application.Components;
using JetBrains.Collections.Viewable;
using JetBrains.ProjectModel;
using JetBrains.ReSharper.Host.Features;
using JetBrains.ReSharper.Host.Features.UnitTesting;
using JetBrains.ReSharper.Plugins.Unity.ProjectModel;
using JetBrains.ReSharper.UnitTestFramework;
using JetBrains.Rider.Model;
namespace JetBrains.ReSharper.Plugins.Unity.Rider
{
[ShellComponent]
public class UnityRiderUnitTestCoverageAvailabilityChecker : IRiderUnitTestCoverageAvailabilityChecker, IHideImplementation<DefaultRiderUnitTestCoverageAvailabilityChecker>
{
private static readonly Version ourMinSupportedUnityVersion = new Version(2018, 3);
// this method should be very fast as it gets called a lot
public HostProviderAvailability GetAvailability(IUnitTestElement element)
{
var solution = element.Id.Project.GetSolution();
var tracker = solution.GetComponent<UnitySolutionTracker>();
if (tracker.IsUnityProject.HasValue() && !tracker.IsUnityProject.Value)
return HostProviderAvailability.Available;
var rdUnityModel = solution.GetProtocolSolution().GetRdUnityModel();
switch (rdUnityModel.UnitTestPreference.Value)
{
case UnitTestLaunchPreference.NUnit:
return HostProviderAvailability.Available;
case UnitTestLaunchPreference.PlayMode:
return HostProviderAvailability.Nonexistent;
case UnitTestLaunchPreference.EditMode:
{
var unityVersion = UnityVersion.Parse(rdUnityModel.ApplicationVersion.Maybe.ValueOrDefault ?? string.Empty);
return unityVersion == null || unityVersion < ourMinSupportedUnityVersion
? HostProviderAvailability.Nonexistent
: HostProviderAvailability.Available;
}
default:
return HostProviderAvailability.Nonexistent;
}
}
}
}
|
Disable tests coverage for unsupported Unity versions
|
Disable tests coverage for unsupported Unity versions
|
C#
|
apache-2.0
|
JetBrains/resharper-unity,JetBrains/resharper-unity,JetBrains/resharper-unity
|
2c1944fea1a3cb8f3cf3572cd662e3e186ef42f8
|
Master/Appleseed/Projects/Appleseed.Framework.UrlRewriting/Properties/AssemblyInfo.cs
|
Master/Appleseed/Projects/Appleseed.Framework.UrlRewriting/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("Appleseed.UrlRewriting")]
[assembly: AssemblyDescription("Appleseed Portal and Content Management System : URL Rewriting ")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("ANANT Corporation")]
[assembly: AssemblyProduct("Appleseed Portal")]
[assembly: AssemblyCopyright("Copyright © ANANT Corporation 2010-2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("01d79d33-2176-4a6d-a8aa-7cc02f308240")]
// Version information for an assembly consists of the following four values:
// Major Version
// Minor Version
// Build Number
// Revision
// You can specify all the values or you can default the Revision and Build Numbers
[assembly: AssemblyVersion("1.6.160.540")]
[assembly: AssemblyFileVersion("1.6.160.540")]
|
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("Appleseed.UrlRewriting")]
[assembly: AssemblyDescription("Appleseed Portal and Content Management System : URL Rewriting ")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("ANANT Corporation")]
[assembly: AssemblyProduct("Appleseed Portal")]
[assembly: AssemblyCopyright("Copyright © ANANT Corporation 2010-2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("01d79d33-2176-4a6d-a8aa-7cc02f308240")]
// Version information for an assembly consists of the following four values:
// Major Version
// Minor Version
// Build Number
// Revision
// You can specify all the values or you can default the Revision and Build Numbers
[assembly: AssemblyVersion("1.7.171.0")]
[assembly: AssemblyFileVersion("1.7.171.0")]
|
Update Version : 1.7.171.0 URL Changes + Fix User Manager Delete
|
Update Version : 1.7.171.0
URL Changes + Fix User Manager Delete
|
C#
|
apache-2.0
|
Appleseed/portal,Appleseed/portal,Appleseed/portal,Appleseed/portal,Appleseed/portal,Appleseed/portal,Appleseed/portal
|
a0076396ddd9434494cc8984352a9fecd03e06c6
|
Source/Lib/TraktApiSharp/Objects/Get/People/TraktPersonImages.cs
|
Source/Lib/TraktApiSharp/Objects/Get/People/TraktPersonImages.cs
|
namespace TraktApiSharp.Objects.Get.People
{
using Basic;
using Newtonsoft.Json;
public class TraktPersonImages
{
[JsonProperty(PropertyName = "headshot")]
public TraktImageSet Headshot { get; set; }
[JsonProperty(PropertyName = "fanart")]
public TraktImageSet FanArt { get; set; }
}
}
|
namespace TraktApiSharp.Objects.Get.People
{
using Basic;
using Newtonsoft.Json;
/// <summary>A collection of images and image sets for a Trakt person.</summary>
public class TraktPersonImages
{
/// <summary>Gets or sets the headshot image set.</summary>
[JsonProperty(PropertyName = "headshot")]
public TraktImageSet Headshot { get; set; }
/// <summary>Gets or sets the fan art image set.</summary>
[JsonProperty(PropertyName = "fanart")]
public TraktImageSet FanArt { get; set; }
}
}
|
Add documentation for person images.
|
Add documentation for person images.
|
C#
|
mit
|
henrikfroehling/TraktApiSharp
|
5c0dda3cf7baffd92a83dfc76b2991562149fbd8
|
Libs/Hopac.Core/Util/Condition.cs
|
Libs/Hopac.Core/Util/Condition.cs
|
// Copyright (C) by Housemarque, Inc.
namespace Hopac.Core {
using System.Threading;
/// <summary>Provides a low overhead, single shot waitable event.</summary>
internal static class Condition {
internal static bool warned;
internal static void Pulse(object o, ref int v) {
var w = v;
if (w < 0 || 0 != Interlocked.Exchange(ref v, ~w)) {
Monitor.Enter(o);
Monitor.Pulse(o);
Monitor.Exit(o);
}
}
internal static void Wait(object o, ref int v) {
if (0 <= v) {
Monitor.Enter(o);
var w = v;
if (0 <= w) {
if (0 == Interlocked.Exchange(ref v, ~w)) {
if (!warned && Worker.IsWorkerThread) {
warned = true;
StaticData.writeLine(
"WARNNG: You are making a blocking call from within a Hopac " +
"worker thread, which means that your program may deadlock.");
}
Monitor.Wait(o);
}
}
}
}
}
}
|
// Copyright (C) by Housemarque, Inc.
namespace Hopac.Core {
using System.Threading;
/// <summary>Provides a low overhead, single shot waitable event.</summary>
internal static class Condition {
internal static bool warned;
internal static void Pulse(object o, ref int v) {
var w = v;
if (w < 0 || 0 != Interlocked.Exchange(ref v, ~w)) {
Monitor.Enter(o);
Monitor.Pulse(o);
Monitor.Exit(o);
}
}
internal static void Wait(object o, ref int v) {
if (0 <= v) {
Monitor.Enter(o);
var w = v;
if (0 <= w) {
if (0 == Interlocked.Exchange(ref v, ~w)) {
if (!warned && Worker.IsWorkerThread) {
warned = true;
StaticData.writeLine(
"WARNING: You are making a blocking call from within a Hopac " +
"worker thread, which means that your program may deadlock.");
StaticData.writeLine("First occurrence (there may be others):");
StaticData.writeLine(System.Environment.StackTrace);
}
Monitor.Wait(o);
}
}
}
}
}
}
|
Add stack to deadlock warning (and fix typo)
|
Add stack to deadlock warning (and fix typo)
|
C#
|
mit
|
Hopac/Hopac,Hopac/Hopac
|
aeb703bd200594260fea97e35a5e59291770e951
|
src/Microsoft.DocAsCode.MarkdownLite/Basic/BlockTokens/MarkdownParagraphBlockToken.cs
|
src/Microsoft.DocAsCode.MarkdownLite/Basic/BlockTokens/MarkdownParagraphBlockToken.cs
|
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.DocAsCode.MarkdownLite
{
public class MarkdownParagraphBlockToken : IMarkdownToken, IMarkdownRewritable<MarkdownParagraphBlockToken>
{
public MarkdownParagraphBlockToken(IMarkdownRule rule, IMarkdownContext context, InlineContent inlineTokens, string rawMarkdown)
{
Rule = rule;
Context = context;
InlineTokens = inlineTokens;
RawMarkdown = rawMarkdown;
}
public IMarkdownRule Rule { get; }
public IMarkdownContext Context { get; }
public InlineContent InlineTokens { get; }
public string RawMarkdown { get; set; }
public static MarkdownParagraphBlockToken Create(IMarkdownRule rule, MarkdownParser engine, string content, string rawMarkdown)
{
return new MarkdownParagraphBlockToken(rule, engine.Context, engine.TokenizeInline(content), rawMarkdown);
}
public MarkdownParagraphBlockToken Rewrite(IMarkdownRewriteEngine rewriterEngine)
{
var c = InlineTokens.Rewrite(rewriterEngine);
if (c == InlineTokens)
{
return this;
}
return new MarkdownParagraphBlockToken(Rule, Context, InlineTokens, RawMarkdown);
}
}
}
|
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.DocAsCode.MarkdownLite
{
public class MarkdownParagraphBlockToken : IMarkdownToken, IMarkdownRewritable<MarkdownParagraphBlockToken>
{
public MarkdownParagraphBlockToken(IMarkdownRule rule, IMarkdownContext context, InlineContent inlineTokens, string rawMarkdown)
{
Rule = rule;
Context = context;
InlineTokens = inlineTokens;
RawMarkdown = rawMarkdown;
}
public IMarkdownRule Rule { get; }
public IMarkdownContext Context { get; }
public InlineContent InlineTokens { get; }
public string RawMarkdown { get; set; }
public static MarkdownParagraphBlockToken Create(IMarkdownRule rule, MarkdownParser engine, string content, string rawMarkdown)
{
return new MarkdownParagraphBlockToken(rule, engine.Context, engine.TokenizeInline(content), rawMarkdown);
}
public MarkdownParagraphBlockToken Rewrite(IMarkdownRewriteEngine rewriterEngine)
{
var c = InlineTokens.Rewrite(rewriterEngine);
if (c == InlineTokens)
{
return this;
}
return new MarkdownParagraphBlockToken(Rule, Context, c, RawMarkdown);
}
}
}
|
Fix bug in Paragraph rewriter
|
Fix bug in Paragraph rewriter
|
C#
|
mit
|
DuncanmaMSFT/docfx,LordZoltan/docfx,928PJY/docfx,sergey-vershinin/docfx,dotnet/docfx,dotnet/docfx,hellosnow/docfx,928PJY/docfx,pascalberger/docfx,hellosnow/docfx,hellosnow/docfx,928PJY/docfx,LordZoltan/docfx,LordZoltan/docfx,sergey-vershinin/docfx,DuncanmaMSFT/docfx,superyyrrzz/docfx,pascalberger/docfx,pascalberger/docfx,sergey-vershinin/docfx,dotnet/docfx,superyyrrzz/docfx,superyyrrzz/docfx,LordZoltan/docfx
|
82580726c2b9d69b8fc83b0a10325425ccdad647
|
MitternachtWeb/Program.cs
|
MitternachtWeb/Program.cs
|
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Mitternacht;
using System.Threading.Tasks;
namespace MitternachtWeb {
public class Program {
public static MitternachtBot MitternachtBot;
public static async Task Main(string[] args) {
MitternachtBot = new MitternachtBot(0, 0);
await MitternachtBot.RunAsync(args);
await CreateHostBuilder(args).Build().RunAsync();
}
public static IHostBuilder CreateHostBuilder(string[] args)
=> Host.CreateDefaultBuilder(args).ConfigureAppConfiguration((context, config) => {
config.AddJsonFile("mitternachtweb.config");
}).ConfigureWebHostDefaults(webBuilder => webBuilder.UseStartup<Startup>());
}
}
|
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Mitternacht;
using System;
using System.IO;
using System.Threading.Tasks;
namespace MitternachtWeb {
public class Program {
public static MitternachtBot MitternachtBot;
public static async Task Main(string[] args) {
MitternachtBot = new MitternachtBot(0, 0);
await MitternachtBot.RunAsync(args);
await CreateHostBuilder(args).Build().RunAsync();
}
public static IHostBuilder CreateHostBuilder(string[] args)
=> Host.CreateDefaultBuilder(args).ConfigureAppConfiguration((context, config) => {
config.SetBasePath(Environment.CurrentDirectory);
config.AddJsonFile("mitternachtweb.config");
}).ConfigureWebHostDefaults(webBuilder => {
webBuilder.UseStartup<Startup>();
webBuilder.UseContentRoot(Path.GetDirectoryName(typeof(Program).Assembly.Location));
});
}
}
|
Make content root path independent of working directory.
|
Make content root path independent of working directory.
|
C#
|
mit
|
Midnight-Myth/Mitternacht-NEW,Midnight-Myth/Mitternacht-NEW,Midnight-Myth/Mitternacht-NEW,Midnight-Myth/Mitternacht-NEW
|
80d0f4de2bee09f237703223a89065631d5736fc
|
SteamAccountSwitcher/TrayIconHelper.cs
|
SteamAccountSwitcher/TrayIconHelper.cs
|
using System;
using System.Windows;
using System.Windows.Media.Imaging;
using Hardcodet.Wpf.TaskbarNotification;
using SteamAccountSwitcher.Properties;
namespace SteamAccountSwitcher
{
internal class TrayIconHelper
{
public static void ShowRunningInTrayBalloon()
{
ShowTrayBalloon(
$"{Resources.AppName} is running in system tray.\nDouble click icon to show window.",
BalloonIcon.Info);
}
public static void ShowTrayBalloon(string text, BalloonIcon icon)
{
if (!Settings.Default.ShowTrayNotifications)
return;
App.NotifyIcon.ShowBalloonTip(Resources.AppName, text, icon);
}
public static void RefreshTrayIcon()
{
if (Settings.Default.AlwaysOn)
App.NotifyIcon.ContextMenu = MenuHelper.NotifyMenu();
}
public static void CreateTrayIcon()
{
if (App.NotifyIcon != null)
return;
App.NotifyIcon = new TaskbarIcon {ToolTipText = Resources.AppName};
var logo = new BitmapImage();
logo.BeginInit();
logo.UriSource =
new Uri($"pack://application:,,,/SteamAccountSwitcher;component/steam.ico");
logo.EndInit();
App.NotifyIcon.IconSource = logo;
App.NotifyIcon.Visibility = Settings.Default.AlwaysOn ? Visibility.Visible : Visibility.Hidden;
App.NotifyIcon.TrayMouseDoubleClick += (sender, args) => SwitchWindowHelper.ShowSwitcherWindow();
App.Accounts.CollectionChanged += (sender, args) => RefreshTrayIcon();
RefreshTrayIcon();
}
}
}
|
using System;
using System.Windows;
using System.Windows.Media.Imaging;
using Hardcodet.Wpf.TaskbarNotification;
using SteamAccountSwitcher.Properties;
namespace SteamAccountSwitcher
{
internal class TrayIconHelper
{
public static void ShowRunningInTrayBalloon()
{
ShowTrayBalloon(
$"{Resources.AppName} is running in system tray.\nDouble click icon to show window.",
BalloonIcon.Info);
}
public static void ShowTrayBalloon(string text, BalloonIcon icon)
{
if (!Settings.Default.ShowTrayNotifications)
return;
App.NotifyIcon.ShowBalloonTip(Resources.AppName, text, icon);
}
public static void RefreshTrayIcon()
{
if (Settings.Default.AlwaysOn)
App.NotifyIcon.ContextMenu = MenuHelper.NotifyMenu();
}
public static void CreateTrayIcon()
{
if (App.NotifyIcon != null)
return;
App.NotifyIcon = new TaskbarIcon {ToolTipText = Resources.AppName};
var logo = new BitmapImage();
logo.BeginInit();
logo.UriSource =
new Uri($"pack://application:,,,/SteamAccountSwitcher;component/steam.ico");
logo.EndInit();
App.NotifyIcon.IconSource = logo;
App.NotifyIcon.Visibility = Settings.Default.AlwaysOn ? Visibility.Visible : Visibility.Hidden;
App.NotifyIcon.TrayMouseDoubleClick += (sender, args) => SwitchWindowHelper.ActivateSwitchWindow();
App.Accounts.CollectionChanged += (sender, args) => RefreshTrayIcon();
RefreshTrayIcon();
}
}
}
|
Fix tray icon double click not activating switcher window
|
Fix tray icon double click not activating switcher window
|
C#
|
mit
|
danielchalmers/SteamAccountSwitcher
|
df852498319580168b47fc9dad8cf19156aef290
|
BasicSample/ExcelMediaConsole/Program.cs
|
BasicSample/ExcelMediaConsole/Program.cs
|
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Linq;
namespace ExcelMediaConsole
{
class Program
{
static void Main(string[] args)
{
var excelFilePath = "Book1.xlsx";
var outputDirPath = "Media";
Directory.CreateDirectory(outputDirPath);
using (var archive = ZipFile.OpenRead(excelFilePath))
{
var query = archive.Entries
.Where(e => e.FullName.StartsWith("xl/media/", StringComparison.InvariantCultureIgnoreCase));
foreach (var entry in query)
{
var filePath = Path.Combine(outputDirPath, entry.Name);
entry.ExtractToFile(filePath, true);
}
}
}
}
}
|
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Linq;
namespace ExcelMediaConsole
{
class Program
{
static void Main(string[] args)
{
var excelFilePath = "Book1.xlsx";
var outputDirPath = "Media";
Directory.CreateDirectory(outputDirPath);
using (var archive = ZipFile.OpenRead(excelFilePath))
{
// In case of Excel, the path separator is "/" not "\".
var query = archive.Entries
.Where(e => e.FullName.StartsWith("xl/media/", StringComparison.InvariantCultureIgnoreCase));
foreach (var entry in query)
{
var filePath = Path.Combine(outputDirPath, entry.Name);
entry.ExtractToFile(filePath, true);
}
}
}
static void ExtractAndZip()
{
var targetFilePath = "Book1.xlsx";
var extractDirPath = "Book1";
var zipFilePath = "Book1.zip";
ZipFile.ExtractToDirectory(targetFilePath, extractDirPath);
ZipFile.CreateFromDirectory(extractDirPath, zipFilePath);
}
}
}
|
Add method to extract and zip
|
Add method to extract and zip
|
C#
|
mit
|
sakapon/Samples-2013
|
c743a80d05aa2de9123bbb9f46ee1cf5b9175d63
|
Properties/AssemblyInfo.cs
|
Properties/AssemblyInfo.cs
|
using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Autofac.Integration.Web")]
[assembly: AssemblyDescription("Autofac ASP.NET Integration")]
[assembly: InternalsVisibleTo("Autofac.Tests.Integration.Web, PublicKey=00240000048000009400000006020000002400005253413100040000010001008728425885ef385e049261b18878327dfaaf0d666dea3bd2b0e4f18b33929ad4e5fbc9087e7eda3c1291d2de579206d9b4292456abffbe8be6c7060b36da0c33b883e3878eaf7c89fddf29e6e27d24588e81e86f3a22dd7b1a296b5f06fbfb500bbd7410faa7213ef4e2ce7622aefc03169b0324bcd30ccfe9ac8204e4960be6")]
[assembly: ComVisible(false)]
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Autofac.Integration.Web")]
[assembly: InternalsVisibleTo("Autofac.Tests.Integration.Web, PublicKey=00240000048000009400000006020000002400005253413100040000010001008728425885ef385e049261b18878327dfaaf0d666dea3bd2b0e4f18b33929ad4e5fbc9087e7eda3c1291d2de579206d9b4292456abffbe8be6c7060b36da0c33b883e3878eaf7c89fddf29e6e27d24588e81e86f3a22dd7b1a296b5f06fbfb500bbd7410faa7213ef4e2ce7622aefc03169b0324bcd30ccfe9ac8204e4960be6")]
[assembly: ComVisible(false)]
|
Build script now writes the package name and version into the AssemblyDescription attibute. This allows the package information to be seen in Visual Studio avoiding confusion with the assembly version that remains at the major.
|
Build script now writes the package name and version into the AssemblyDescription attibute. This allows the package information to be seen in Visual Studio avoiding confusion with the assembly version that remains at the major.
|
C#
|
mit
|
autofac/Autofac.Web
|
8af2c173e5b9efd6cdcf59f8ba5908c20e0de079
|
Properties/AssemblyInfo.cs
|
Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Commons;
[assembly: AssemblyTitle("TickTack")]
[assembly: AssemblyDescription("Delayed reminder!")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Rafael Teixeira")]
[assembly: AssemblyProduct("TickTack")]
[assembly: AssemblyCopyright("Copyright © 2008-2015 Rafael Teixeira")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("ac8af955-f068-4e26-af5e-f07c8f1c1e6e")]
[assembly: AssemblyVersion("1.0.0")]
[assembly: AssemblyFileVersion("1.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0-Alpha")]
[assembly: License(LicenseType.MIT)]
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Commons;
[assembly: AssemblyTitle("TickTack")]
[assembly: AssemblyDescription("Delayed reminder!")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Rafael Teixeira")]
[assembly: AssemblyProduct("TickTack")]
[assembly: AssemblyCopyright("Copyright © 2008-2015 Rafael Teixeira")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("ac8af955-f068-4e26-af5e-f07c8f1c1e6e")]
[assembly: AssemblyVersion("1.0.0")]
[assembly: AssemblyFileVersion("1.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: License(LicenseType.MIT)]
|
Drop alpha status, it is a 1.0.0 release as is
|
Drop alpha status, it is a 1.0.0 release as is
|
C#
|
mit
|
monoman/TickTack
|
464d053e8ffdb4dcd54da2d7db22cd3fc969531b
|
sln/Pagination.Release/ReleaseActions/Tag.cs
|
sln/Pagination.Release/ReleaseActions/Tag.cs
|
namespace Pagination.ReleaseActions {
class Tag : ReleaseAction {
public override void Work() {
var tag = Context.Version.StagedVersion;
Process("git", "commit", "-a", "-m", $"\"(Auto-)Commit version '{tag}'.\"");
Process("git", "tag", "-a", tag, "-m", $"\"(Auto-)Tag version '{tag}'.\"");
Process("git", "push", "origin", tag);
}
}
}
|
namespace Pagination.ReleaseActions {
class Tag : ReleaseAction {
public override void Work() {
var tag = Context.Version.StagedVersion;
Process("git", "status");
Process("git", "commit", "-a", "-m", $"\"(Auto-)Commit version '{tag}'.\"");
Process("git", "push");
Process("git", "tag", "-a", tag, "-m", $"\"(Auto-)Tag version '{tag}'.\"");
Process("git", "push", "origin", tag);
}
}
}
|
Add git commands to tool.
|
Add git commands to tool.
|
C#
|
mit
|
kyourek/Pagination,kyourek/Pagination,kyourek/Pagination
|
2ccc81ccc0ca7406d21e6283c60a77f5849bf681
|
osu.Game.Rulesets.Mania.Tests/Skinning/TestSceneHoldNote.cs
|
osu.Game.Rulesets.Mania.Tests/Skinning/TestSceneHoldNote.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Linq;
using NUnit.Framework;
using osu.Framework.Bindables;
using osu.Framework.Testing;
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Rulesets.Mania.Objects;
using osu.Game.Rulesets.Mania.Objects.Drawables;
namespace osu.Game.Rulesets.Mania.Tests.Skinning
{
public class TestSceneHoldNote : ManiaHitObjectTestScene
{
[Test]
public void TestHoldNote()
{
AddToggleStep("toggle hitting", v =>
{
foreach (var holdNote in CreatedDrawables.SelectMany(d => d.ChildrenOfType<DrawableHoldNote>()))
{
((Bindable<bool>)holdNote.IsHitting).Value = v;
}
});
}
protected override DrawableManiaHitObject CreateHitObject()
{
var note = new HoldNote { Duration = 1000 };
note.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());
return new DrawableHoldNote(note);
}
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
using osu.Framework.Bindables;
using osu.Framework.Testing;
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Rulesets.Mania.Objects;
using osu.Game.Rulesets.Mania.Objects.Drawables;
namespace osu.Game.Rulesets.Mania.Tests.Skinning
{
public class TestSceneHoldNote : ManiaHitObjectTestScene
{
[Test]
public void TestHoldNote()
{
AddToggleStep("toggle hitting", v =>
{
foreach (var holdNote in CreatedDrawables.SelectMany(d => d.ChildrenOfType<DrawableHoldNote>()))
{
((Bindable<bool>)holdNote.IsHitting).Value = v;
}
});
}
[Test]
public void TestFadeOnMiss()
{
AddStep("miss tick", () =>
{
foreach (var holdNote in holdNotes)
holdNote.ChildrenOfType<DrawableHoldNoteHead>().First().MissForcefully();
});
}
private IEnumerable<DrawableHoldNote> holdNotes => CreatedDrawables.SelectMany(d => d.ChildrenOfType<DrawableHoldNote>());
protected override DrawableManiaHitObject CreateHitObject()
{
var note = new HoldNote { Duration = 1000 };
note.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());
return new DrawableHoldNote(note);
}
}
}
|
Add test case for fading hold note
|
Add test case for fading hold note
|
C#
|
mit
|
peppy/osu,ppy/osu,peppy/osu,smoogipoo/osu,smoogipooo/osu,UselessToucan/osu,peppy/osu-new,smoogipoo/osu,NeoAdonis/osu,smoogipoo/osu,NeoAdonis/osu,NeoAdonis/osu,UselessToucan/osu,UselessToucan/osu,ppy/osu,ppy/osu,peppy/osu
|
19eb6fad7fca29af8f163ace52ba95e70383f542
|
osu.Game.Rulesets.Mania/Judgements/HoldNoteTickJudgement.cs
|
osu.Game.Rulesets.Mania/Judgements/HoldNoteTickJudgement.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Mania.Judgements
{
public class HoldNoteTickJudgement : ManiaJudgement
{
public override bool AffectsCombo => false;
protected override int NumericResultFor(HitResult result) => 20;
protected override double HealthIncreaseFor(HitResult result)
{
switch (result)
{
default:
return 0;
case HitResult.Perfect:
return 0.01;
}
}
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Mania.Judgements
{
public class HoldNoteTickJudgement : ManiaJudgement
{
protected override int NumericResultFor(HitResult result) => 20;
protected override double HealthIncreaseFor(HitResult result)
{
switch (result)
{
default:
return 0;
case HitResult.Perfect:
return 0.01;
}
}
}
}
|
Make hold note ticks affect combo score rather than bonus
|
Make hold note ticks affect combo score rather than bonus
|
C#
|
mit
|
ppy/osu,peppy/osu,UselessToucan/osu,smoogipooo/osu,UselessToucan/osu,smoogipoo/osu,ppy/osu,UselessToucan/osu,NeoAdonis/osu,ppy/osu,smoogipoo/osu,peppy/osu,smoogipoo/osu,peppy/osu,peppy/osu-new,NeoAdonis/osu,NeoAdonis/osu
|
6cadca8b518b68b3e95490285c58a32a23ecc368
|
Snowflake.Events/SnowflakeEventSource.cs
|
Snowflake.Events/SnowflakeEventSource.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Snowflake.Events
{
public partial class SnowflakeEventSource
{
public static SnowflakeEventSource SnowflakeEventSource;
SnowflakeEventSource()
{
}
public static void InitEventSource()
{
if (SnowflakeEventSource.SnowflakeEventSource == null)
{
SnowflakeEventSource.SnowflakeEventSource = new SnowflakeEventSource();
}
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Snowflake.Events
{
public partial class SnowflakeEventSource
{
public static SnowflakeEventSource EventSource;
SnowflakeEventSource()
{
}
public static void InitEventSource()
{
if (SnowflakeEventSource.EventSource == null)
{
SnowflakeEventSource.EventSource = new SnowflakeEventSource();
}
}
}
}
|
Fix a syntax error causing typo
|
EventSource: Fix a syntax error causing typo
|
C#
|
mpl-2.0
|
RonnChyran/snowflake,RonnChyran/snowflake,RonnChyran/snowflake,faint32/snowflake-1,SnowflakePowered/snowflake,SnowflakePowered/snowflake,faint32/snowflake-1,faint32/snowflake-1,SnowflakePowered/snowflake
|
85b1213ba85d309627ec27c96bcfe552deb3958b
|
src/Glimpse.Agent.Connection.Stream/Broker/RemoteStreamMessagePublisher.cs
|
src/Glimpse.Agent.Connection.Stream/Broker/RemoteStreamMessagePublisher.cs
|
using System;
namespace Glimpse.Agent
{
public class RemoteStreamMessagePublisher : BaseMessagePublisher
{
public override void PublishMessage(IMessage message)
{
var newMessage = ConvertMessage(message);
// TODO: Use SignalR to publish message
}
}
}
|
using Glimpse.Agent.Connection.Stream.Connection;
using System;
namespace Glimpse.Agent
{
public class RemoteStreamMessagePublisher : BaseMessagePublisher
{
private readonly IStreamProxy _messagePublisherHub;
public RemoteStreamMessagePublisher(IStreamProxy messagePublisherHub)
{
_messagePublisherHub = messagePublisherHub;
}
public override void PublishMessage(IMessage message)
{
var newMessage = ConvertMessage(message);
_messagePublisherHub.UseSender(x => x.Invoke("HandleMessage", newMessage));
}
}
}
|
Switch stream publisher over to use new proxy
|
Switch stream publisher over to use new proxy
|
C#
|
mit
|
Glimpse/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,Glimpse/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,Glimpse/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,zanetdev/Glimpse.Prototype,zanetdev/Glimpse.Prototype,Glimpse/Glimpse.Prototype,zanetdev/Glimpse.Prototype,pranavkm/Glimpse.Prototype,zanetdev/Glimpse.Prototype,pranavkm/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,pranavkm/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,pranavkm/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype
|
8ab09a414c2a1afd1fd974bd4d937822f3c2f74a
|
src/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/DispatchWrapperTests.cs
|
src/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/DispatchWrapperTests.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using Xunit;
namespace System.Runtime.InteropServices.Tests
{
#pragma warning disable 0618 // DispatchWrapper is marked as Obsolete.
public class DispatchWrapperTests
{
[Fact]
[PlatformSpecific(TestPlatforms.Windows)]
[SkipOnTargetFramework(TargetFrameworkMonikers.UapAot, "Throws PlatformNotSupportedException in UapAot")]
public void Ctor_NullWindows_Success()
{
var wrapper = new DispatchWrapper(null);
Assert.Null(wrapper.WrappedObject);
}
[Fact]
[SkipOnTargetFramework(~TargetFrameworkMonikers.UapAot, "Throws PlatformNotSupportedException in UapAot")]
public void Ctor_NullUapAot_ThrowsPlatformNotSupportedException()
{
Assert.Throws<PlatformNotSupportedException>(() => new DispatchWrapper(null));
}
[Fact]
[PlatformSpecific(TestPlatforms.AnyUnix)]
public void Ctor_NullUnix_ThrowsPlatformNotSupportedException()
{
Assert.Throws<PlatformNotSupportedException>(() => new DispatchWrapper(null));
}
[Theory]
[InlineData("")]
[InlineData(0)]
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "Marshal.GetIDispatchForObject is not supported in .NET Core.")]
public void Ctor_NonNull_ThrowsPlatformNotSupportedException(object value)
{
Assert.Throws<PlatformNotSupportedException>(() => new DispatchWrapper(value));
}
}
#pragma warning restore 0618
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using Xunit;
namespace System.Runtime.InteropServices.Tests
{
#pragma warning disable 0618 // DispatchWrapper is marked as Obsolete.
public class DispatchWrapperTests
{
[Fact]
public void Ctor_Null_Success()
{
var wrapper = new DispatchWrapper(null);
Assert.Null(wrapper.WrappedObject);
}
[Theory]
[InlineData("")]
[InlineData(0)]
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "Marshal.GetIDispatchForObject is not supported in .NET Core.")]
public void Ctor_NonNull_ThrowsPlatformNotSupportedException(object value)
{
Assert.Throws<PlatformNotSupportedException>(() => new DispatchWrapper(value));
}
}
#pragma warning restore 0618
}
|
Unify DispatchWrapper behavior for null
|
Unify DispatchWrapper behavior for null
|
C#
|
mit
|
ViktorHofer/corefx,ptoonen/corefx,wtgodbe/corefx,shimingsg/corefx,shimingsg/corefx,ericstj/corefx,shimingsg/corefx,ptoonen/corefx,shimingsg/corefx,BrennanConroy/corefx,BrennanConroy/corefx,ViktorHofer/corefx,ptoonen/corefx,ViktorHofer/corefx,ericstj/corefx,wtgodbe/corefx,ericstj/corefx,ptoonen/corefx,shimingsg/corefx,BrennanConroy/corefx,ViktorHofer/corefx,wtgodbe/corefx,ericstj/corefx,ViktorHofer/corefx,ViktorHofer/corefx,ptoonen/corefx,wtgodbe/corefx,ptoonen/corefx,wtgodbe/corefx,ericstj/corefx,ericstj/corefx,shimingsg/corefx,ericstj/corefx,shimingsg/corefx,wtgodbe/corefx,ptoonen/corefx,wtgodbe/corefx,ViktorHofer/corefx
|
0ae272b75b0a9a47b860a9e8a713be2638733fee
|
src/MobileApps/MyDriving/MyDriving.Utils/Helpers/DistanceUtils.cs
|
src/MobileApps/MyDriving/MyDriving.Utils/Helpers/DistanceUtils.cs
|
using System;
using static System.Math;
namespace MyDriving.Utils
{
public static class DistanceUtils
{
/// <summary>
/// Calculates the distance in miles
/// </summary>
/// <returns>The distance.</returns>
/// <param name="latitudeStart">Latitude start.</param>
/// <param name="longitudeStart">Longitude start.</param>
/// <param name="latitudeEnd">Latitude end.</param>
/// <param name="longitudeEnd">Longitude end.</param>
public static double CalculateDistance(double latitudeStart, double longitudeStart,
double latitudeEnd, double longitudeEnd)
{
var rlat1 = PI * latitudeStart / 180.0;
var rlat2 = PI * latitudeEnd / 180.0;
var theta = longitudeStart - longitudeEnd;
var rtheta = PI * theta / 180.0;
var dist = Sin(rlat1) * Sin(rlat2) + Cos(rlat1) * Cos(rlat2) * Cos(rtheta);
dist = Acos(dist);
dist = dist * 180.0 / PI;
return dist * 60.0 * 1.1515;
}
public static double MilesToKilometers(double miles) => miles * 1.609344;
}
}
|
using System;
using static System.Math;
namespace MyDriving.Utils
{
public static class DistanceUtils
{
/// <summary>
/// Calculates the distance in miles
/// </summary>
/// <returns>The distance.</returns>
/// <param name="latitudeStart">Latitude start.</param>
/// <param name="longitudeStart">Longitude start.</param>
/// <param name="latitudeEnd">Latitude end.</param>
/// <param name="longitudeEnd">Longitude end.</param>
public static double CalculateDistance(double latitudeStart, double longitudeStart,
double latitudeEnd, double longitudeEnd)
{
if (latitudeEnd == latitudeStart && longitudeEnd == longitudeStart)
return 0;
var rlat1 = PI * latitudeStart / 180.0;
var rlat2 = PI * latitudeEnd / 180.0;
var theta = longitudeStart - longitudeEnd;
var rtheta = PI * theta / 180.0;
var dist = Sin(rlat1) * Sin(rlat2) + Cos(rlat1) * Cos(rlat2) * Cos(rtheta);
dist = Acos(dist);
dist = dist * 180.0 / PI;
var final = dist * 60.0 * 1.1515;
if (double.IsNaN(final) || double.IsInfinity(final) || double.IsNegativeInfinity(final) || double.IsPositiveInfinity(final) || final < 0)
return 0;
return final;
}
public static double MilesToKilometers(double miles) => miles * 1.609344;
}
}
|
Fix for NAN on Distance Calculations
|
Fix for NAN on Distance Calculations
|
C#
|
mit
|
Azure-Samples/MyDriving,Azure-Samples/MyDriving,Azure-Samples/MyDriving
|
2d66723115a02260925cbd48c4e4ff5c819a82f2
|
src/BloomExe/WebLibraryIntegration/OverwriteWarningDialog.cs
|
src/BloomExe/WebLibraryIntegration/OverwriteWarningDialog.cs
|
using System.Windows.Forms;
namespace Bloom.WebLibraryIntegration
{
public partial class OverwriteWarningDialog : Form
{
public OverwriteWarningDialog()
{
InitializeComponent();
}
}
}
|
using System.Windows.Forms;
namespace Bloom.WebLibraryIntegration
{
public partial class OverwriteWarningDialog : Form
{
public OverwriteWarningDialog()
{
InitializeComponent();
}
protected override void OnLoad(System.EventArgs e)
{
base.OnLoad(e);
// Fix a display glitch on Linux with the Mono SWF implementation. The button were half off
// the bottom of the dialog on Linux, but fine on Windows.
if (SIL.PlatformUtilities.Platform.IsLinux)
{
if (ClientSize.Height < _replaceExistingButton.Location.Y + _replaceExistingButton.Height)
{
var delta = ClientSize.Height - (_replaceExistingButton.Location.Y + _replaceExistingButton.Height) - 4;
_replaceExistingButton.Location = new System.Drawing.Point(_replaceExistingButton.Location.X, _replaceExistingButton.Location.Y + delta);
}
if (ClientSize.Height < _cancelButton.Location.Y + _cancelButton.Height)
{
var delta = ClientSize.Height - (_cancelButton.Location.Y + _cancelButton.Height) - 4;
_cancelButton.Location = new System.Drawing.Point(_cancelButton.Location.X, _cancelButton.Location.Y + delta);
}
}
}
}
}
|
Fix a dialog display glitch on Linux (20190725)
|
Fix a dialog display glitch on Linux (20190725)
|
C#
|
mit
|
StephenMcConnel/BloomDesktop,StephenMcConnel/BloomDesktop,gmartin7/myBloomFork,BloomBooks/BloomDesktop,BloomBooks/BloomDesktop,BloomBooks/BloomDesktop,gmartin7/myBloomFork,BloomBooks/BloomDesktop,StephenMcConnel/BloomDesktop,BloomBooks/BloomDesktop,gmartin7/myBloomFork,StephenMcConnel/BloomDesktop,StephenMcConnel/BloomDesktop,gmartin7/myBloomFork,BloomBooks/BloomDesktop,gmartin7/myBloomFork,gmartin7/myBloomFork,StephenMcConnel/BloomDesktop
|
87def4a1fe1af32d8263be86e408e5071fa56bb0
|
src/StudentFollowingSystem/Controllers/StudentsController.cs
|
src/StudentFollowingSystem/Controllers/StudentsController.cs
|
using System.Collections.Generic;
using System.Web.Mvc;
using AutoMapper;
using StudentFollowingSystem.Data.Repositories;
using StudentFollowingSystem.Filters;
using StudentFollowingSystem.Models;
using StudentFollowingSystem.ViewModels;
using Validatr.Filters;
namespace StudentFollowingSystem.Controllers
{
[AuthorizeCounseler]
public class StudentsController : Controller
{
private readonly StudentRepository _studentRepository = new StudentRepository();
public ActionResult Dashboard()
{
var model = new StudentDashboardModel();
return View(model);
}
public ActionResult List()
{
var students = Mapper.Map<List<StudentModel>>(_studentRepository.GetAll());
return View(students);
}
public ActionResult Add()
{
return View(new StudentModel());
}
[HttpPost]
public ActionResult Add(StudentModel model)
{
if (ModelState.IsValid)
{
var student = Mapper.Map<Student>(model);
_studentRepository.Add(student);
return RedirectToAction("List");
}
return View(model);
}
}
}
|
using System.Collections.Generic;
using System.Web.Helpers;
using System.Web.Mvc;
using AutoMapper;
using StudentFollowingSystem.Data.Repositories;
using StudentFollowingSystem.Filters;
using StudentFollowingSystem.Models;
using StudentFollowingSystem.ViewModels;
namespace StudentFollowingSystem.Controllers
{
[AuthorizeCounseler]
public class StudentsController : Controller
{
private readonly StudentRepository _studentRepository = new StudentRepository();
public ActionResult Dashboard()
{
var model = new StudentDashboardModel();
return View(model);
}
public ActionResult List()
{
var students = Mapper.Map<List<StudentModel>>(_studentRepository.GetAll());
return View(students);
}
public ActionResult Add()
{
return View(new StudentModel());
}
[HttpPost]
public ActionResult Add(StudentModel model)
{
if (ModelState.IsValid)
{
var student = Mapper.Map<Student>(model);
student.Password = Crypto.HashPassword("test");
_studentRepository.Add(student);
return RedirectToAction("List");
}
return View(model);
}
}
}
|
Test password for new students.
|
Test password for new students.
|
C#
|
mit
|
henkmollema/StudentFollowingSystem,henkmollema/StudentFollowingSystem
|
f51a8842f0d99765fb4778bd5efbf99d0e0984a6
|
apis/Google.Cloud.Monitoring.V3/Google.Cloud.Monitoring.V3.Snippets/MetricServiceClientSnippets.cs
|
apis/Google.Cloud.Monitoring.V3/Google.Cloud.Monitoring.V3.Snippets/MetricServiceClientSnippets.cs
|
// Copyright 2016 Google Inc. 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 Google.Api;
using Google.Api.Gax;
using System;
using System.Linq;
using Xunit;
namespace Google.Cloud.Monitoring.V3
{
[Collection(nameof(MonitoringFixture))]
public class MetricServiceClientSnippets
{
private readonly MonitoringFixture _fixture;
public MetricServiceClientSnippets(MonitoringFixture fixture)
{
_fixture = fixture;
}
[Fact]
public void ListMetricDescriptors()
{
string projectId = _fixture.ProjectId;
// Sample: ListMetricDescriptors
// Additional: ListMetricDescriptors(*,*,*,*)
MetricServiceClient client = MetricServiceClient.Create();
string projectName = new ProjectName(projectId).ToString();
PagedEnumerable<ListMetricDescriptorsResponse, MetricDescriptor> metrics = client.ListMetricDescriptors(projectName);
foreach (MetricDescriptor metric in metrics.Take(10))
{
Console.WriteLine($"{metric.Name}: {metric.DisplayName}");
}
// End sample
}
}
}
|
// Copyright 2016 Google Inc. 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 Google.Api;
using Google.Api.Gax;
using System;
using System.Linq;
using Xunit;
namespace Google.Cloud.Monitoring.V3
{
[Collection(nameof(MonitoringFixture))]
public class MetricServiceClientSnippets
{
private readonly MonitoringFixture _fixture;
public MetricServiceClientSnippets(MonitoringFixture fixture)
{
_fixture = fixture;
}
[Fact]
public void ListMetricDescriptors()
{
string projectId = _fixture.ProjectId;
// Sample: ListMetricDescriptors
// Additional: ListMetricDescriptors(*,*,*,*)
MetricServiceClient client = MetricServiceClient.Create();
ProjectName projectName = new ProjectName(projectId);
PagedEnumerable<ListMetricDescriptorsResponse, MetricDescriptor> metrics = client.ListMetricDescriptors(projectName);
foreach (MetricDescriptor metric in metrics.Take(10))
{
Console.WriteLine($"{metric.Name}: {metric.DisplayName}");
}
// End sample
}
}
}
|
Fix hand-written Monitoring snippet to use resource names
|
Fix hand-written Monitoring snippet to use resource names
|
C#
|
apache-2.0
|
benwulfe/google-cloud-dotnet,evildour/google-cloud-dotnet,googleapis/google-cloud-dotnet,chrisdunelm/google-cloud-dotnet,jskeet/google-cloud-dotnet,chrisdunelm/google-cloud-dotnet,jskeet/google-cloud-dotnet,jskeet/gcloud-dotnet,googleapis/google-cloud-dotnet,benwulfe/google-cloud-dotnet,iantalarico/google-cloud-dotnet,benwulfe/google-cloud-dotnet,jskeet/google-cloud-dotnet,iantalarico/google-cloud-dotnet,chrisdunelm/gcloud-dotnet,jskeet/google-cloud-dotnet,iantalarico/google-cloud-dotnet,chrisdunelm/google-cloud-dotnet,googleapis/google-cloud-dotnet,evildour/google-cloud-dotnet,evildour/google-cloud-dotnet,jskeet/google-cloud-dotnet
|
3a4dced46edfba9815692b359ec7500f40724952
|
UniProgramGen/Data/Teacher.cs
|
UniProgramGen/Data/Teacher.cs
|
using System.Collections.Generic;
namespace UniProgramGen.Data
{
public class Teacher
{
public Requirements requirements { get; internal set; }
public string name { get; internal set; }
public Teacher(Requirements requirements, string name)
{
this.requirements = requirements;
this.name = name;
}
}
}
|
using System.Collections.Generic;
namespace UniProgramGen.Data
{
public class Teacher
{
public Requirements requirements { get; internal set; }
public string name { get; internal set; }
public string Name
{
get { return name; }
}
public Teacher(Requirements requirements, string name)
{
this.requirements = requirements;
this.name = name;
}
}
}
|
Add get method for teacher name
|
Add get method for teacher name
|
C#
|
bsd-2-clause
|
victoria92/university-program-generator,victoria92/university-program-generator
|
f0528e76b20ca47c37d2bd9a4e4642859851d9f3
|
Todo-List/Todo-List/Note.cs
|
Todo-List/Todo-List/Note.cs
|
// Note.cs
// <copyright file="Note.cs"> This code is protected under the MIT License. </copyright>
using System.Collections.Generic;
namespace Todo_List
{
/// <summary>
/// A data representation of a note.
/// </summary>
public class Note
{
/// <summary>
/// Initializes a new instance of the <see cref="Note" /> class.
/// </summary>
public Note()
{
this.Title = string.Empty;
this.Categories = new string[0];
}
/// <summary>
/// Initializes a new instance of the <see cref="Note" /> class.
/// </summary>
/// <param name="title"> The title of the note. </param>
/// <param name="categories"> The categories the note is in. </param>
public Note(string title, string[] categories)
{
this.Title = title;
this.Categories = categories;
}
/// <summary>
/// Gets or sets the title of the note.
/// </summary>
public string Title { get; set; }
/// <summary>
/// Gets or sets the categories the note is in.
/// </summary>
public string[] Categories { get; set; }
}
}
|
// Note.cs
// <copyright file="Note.cs"> This code is protected under the MIT License. </copyright>
using System.Collections.Generic;
namespace Todo_List
{
/// <summary>
/// A data representation of a note.
/// </summary>
public class Note
{
/// <summary>
/// Initializes a new instance of the <see cref="Note" /> class.
/// </summary>
public Note()
{
Title = string.Empty;
Categories = new string[0];
}
/// <summary>
/// Initializes a new instance of the <see cref="Note" /> class.
/// </summary>
/// <param name="title"> The title of the note. </param>
/// <param name="categories"> The categories the note is in. </param>
public Note(string title, string[] categories)
{
Title = title;
Categories = categories;
}
/// <summary>
/// Gets or sets the title of the note.
/// </summary>
public string Title { get; set; }
/// <summary>
/// Gets or sets the categories the note is in.
/// </summary>
public string[] Categories { get; set; }
}
}
|
Make styling consistent between files
|
Make styling consistent between files
|
C#
|
mit
|
It423/todo-list,wrightg42/todo-list
|
bf6d45292915ce18755a84fb1bbd831ed3d5db57
|
PalasoUIWindowsForms/Keyboarding/Linux/GlobalCachedInputContext.cs
|
PalasoUIWindowsForms/Keyboarding/Linux/GlobalCachedInputContext.cs
|
#if __MonoCS__
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using IBusDotNet;
using NDesk.DBus;
namespace Palaso.UI.WindowsForms.Keyboarding.Linux
{
/// <summary>
/// a global cache used only to reduce traffic with ibus via dbus.
/// </summary>
internal static class GlobalCachedInputContext
{
/// <summary>
/// Caches the current InputContext.
/// </summary>
public static InputContext InputContext { get; set; }
/// <summary>
/// Cache the keyboard of the InputContext.
/// </summary>
public static IBusKeyboardDescription Keyboard { get; set; }
/// <summary>
/// Clear the cached InputContext details.
/// </summary>
public static void Clear()
{
Keyboard = null;
InputContext = null;
}
}
}
#endif
|
#if __MonoCS__
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using IBusDotNet;
using NDesk.DBus;
namespace Palaso.UI.WindowsForms.Keyboarding.Linux
{
/// <summary>
/// a global cache used only to reduce traffic with ibus via dbus.
/// </summary>
internal static class GlobalCachedInputContext
{
/// <summary>
/// Caches the current InputContext.
/// </summary>
public static InputContext InputContext { get; set; }
/// <summary>
/// Cache the keyboard of the InputContext.
/// </summary>
public static IBusKeyboardDescription Keyboard { get; set; }
/// <summary>
/// Clear the cached InputContext details.
/// </summary>
public static void Clear()
{
InputContext = null;
}
}
}
#endif
|
Fix bug when deactivating ibus keyboards Setting the Keyboard to null in GlobalInputContext.Clear prevented the IbusKeyboardAdaptor.SetIMEKeyboard method from disabling the keyboard.
|
Fix bug when deactivating ibus keyboards
Setting the Keyboard to null in GlobalInputContext.Clear prevented
the IbusKeyboardAdaptor.SetIMEKeyboard method from disabling the
keyboard.
Change-Id: I738e73741852d368a028d6d7c5abd759cad8e32d
---
PalasoUIWindowsForms/Keyboarding/Linux/GlobalCachedInputContext.cs | 1 -
1 file changed, 1 deletion(-)
|
C#
|
mit
|
tombogle/libpalaso,andrew-polk/libpalaso,gmartin7/libpalaso,tombogle/libpalaso,glasseyes/libpalaso,JohnThomson/libpalaso,gtryus/libpalaso,mccarthyrb/libpalaso,marksvc/libpalaso,darcywong00/libpalaso,hatton/libpalaso,gmartin7/libpalaso,andrew-polk/libpalaso,JohnThomson/libpalaso,mccarthyrb/libpalaso,ddaspit/libpalaso,ddaspit/libpalaso,sillsdev/libpalaso,gmartin7/libpalaso,glasseyes/libpalaso,sillsdev/libpalaso,marksvc/libpalaso,gtryus/libpalaso,ermshiperete/libpalaso,mccarthyrb/libpalaso,gmartin7/libpalaso,ddaspit/libpalaso,gtryus/libpalaso,andrew-polk/libpalaso,ermshiperete/libpalaso,hatton/libpalaso,marksvc/libpalaso,glasseyes/libpalaso,ermshiperete/libpalaso,gtryus/libpalaso,glasseyes/libpalaso,tombogle/libpalaso,chrisvire/libpalaso,ddaspit/libpalaso,mccarthyrb/libpalaso,hatton/libpalaso,andrew-polk/libpalaso,sillsdev/libpalaso,chrisvire/libpalaso,tombogle/libpalaso,chrisvire/libpalaso,hatton/libpalaso,ermshiperete/libpalaso,sillsdev/libpalaso,JohnThomson/libpalaso,chrisvire/libpalaso,darcywong00/libpalaso,darcywong00/libpalaso,JohnThomson/libpalaso
|
55c28220d900a04bc6aefb9ffc0b0790ee994ba8
|
Dx.Runtime/DefaultObjectWithTypeSerializer.cs
|
Dx.Runtime/DefaultObjectWithTypeSerializer.cs
|
using System;
using System.IO;
using System.Runtime.Serialization;
using ProtoBuf;
using ProtoBuf.Meta;
namespace Dx.Runtime
{
public class DefaultObjectWithTypeSerializer : IObjectWithTypeSerializer
{
private readonly ILocalNode m_LocalNode;
public DefaultObjectWithTypeSerializer(ILocalNode localNode)
{
this.m_LocalNode = localNode;
}
public ObjectWithType Serialize(object obj)
{
if (obj == null)
{
return new ObjectWithType { AssemblyQualifiedTypeName = null, SerializedObject = null };
}
byte[] serializedObject;
using (var memory = new MemoryStream())
{
Serializer.Serialize(memory, obj);
var length = (int)memory.Position;
memory.Seek(0, SeekOrigin.Begin);
serializedObject = new byte[length];
memory.Read(serializedObject, 0, length);
}
return new ObjectWithType
{
AssemblyQualifiedTypeName = obj.GetType().AssemblyQualifiedName,
SerializedObject = serializedObject
};
}
public object Deserialize(ObjectWithType owt)
{
if (owt.AssemblyQualifiedTypeName == null)
{
return null;
}
var type = Type.GetType(owt.AssemblyQualifiedTypeName);
if (type == null)
{
throw new TypeLoadException();
}
using (var memory = new MemoryStream(owt.SerializedObject))
{
object instance;
if (type == typeof(string))
{
instance = string.Empty;
}
else
{
instance = FormatterServices.GetUninitializedObject(type);
}
var value = RuntimeTypeModel.Default.Deserialize(memory, instance, type);
GraphWalker.Apply(value, this.m_LocalNode);
return value;
}
}
}
}
|
using System;
using System.IO;
using System.Runtime.Serialization;
using ProtoBuf;
using ProtoBuf.Meta;
namespace Dx.Runtime
{
public class DefaultObjectWithTypeSerializer : IObjectWithTypeSerializer
{
private readonly ILocalNode m_LocalNode;
public DefaultObjectWithTypeSerializer(ILocalNode localNode)
{
this.m_LocalNode = localNode;
}
public ObjectWithType Serialize(object obj)
{
if (obj == null)
{
return new ObjectWithType { AssemblyQualifiedTypeName = null, SerializedObject = null };
}
byte[] serializedObject;
using (var memory = new MemoryStream())
{
Serializer.Serialize(memory, obj);
var length = (int)memory.Position;
memory.Seek(0, SeekOrigin.Begin);
serializedObject = new byte[length];
memory.Read(serializedObject, 0, length);
}
return new ObjectWithType
{
AssemblyQualifiedTypeName = obj.GetType().AssemblyQualifiedName,
SerializedObject = serializedObject
};
}
public object Deserialize(ObjectWithType owt)
{
if (owt.AssemblyQualifiedTypeName == null)
{
return null;
}
var type = Type.GetType(owt.AssemblyQualifiedTypeName);
if (type == null)
{
throw new TypeLoadException();
}
using (var memory = new MemoryStream(owt.SerializedObject))
{
var value = RuntimeTypeModel.Default.Deserialize(memory, null, type);
GraphWalker.Apply(value, this.m_LocalNode);
return value;
}
}
}
}
|
Remove old serialization check that is no longer required
|
Remove old serialization check that is no longer required
The serialization system explicitly uses SkipConstructor, so we don't need to
pass in an object created with FormatterServices into the Deserialize method.
This causes an exception when the type is a byte array (and it probably also
occurs for other arrays as well).
|
C#
|
mit
|
hach-que/Dx
|
e2e7e73835634df4ad8229b116742ad1366ae2ff
|
TheCollection.Domain/Contracts/Repository/ILinqSearchRepository.cs
|
TheCollection.Domain/Contracts/Repository/ILinqSearchRepository.cs
|
namespace TheCollection.Domain.Contracts.Repository {
using System.Collections.Generic;
using System.Threading.Tasks;
public interface ILinqSearchRepository<T> where T : class {
Task<IEnumerable<T>> SearchItemsAsync(System.Linq.Expressions.Expression<System.Func<T, bool>> predicate = null, int pageSize = 0, int page = 0);
}
}
|
namespace TheCollection.Domain.Contracts.Repository {
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Threading.Tasks;
public interface ILinqSearchRepository<T> where T : class {
Task<IEnumerable<T>> SearchItemsAsync(Expression<Func<T, bool>> predicate = null, int pageSize = 0, int page = 0);
}
}
|
Clean code with using instead of fixed namespaces
|
Clean code with using instead of fixed namespaces
|
C#
|
apache-2.0
|
projecteon/thecollection,projecteon/thecollection,projecteon/thecollection,projecteon/thecollection
|
447b6b8e0f6842032ad1bdcf5b92127edee7358c
|
AllReadyApp/Web-App/AllReady/Models/ApplicationUser.cs
|
AllReadyApp/Web-App/AllReady/Models/ApplicationUser.cs
|
using Microsoft.AspNet.Identity.EntityFramework;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
namespace AllReady.Models
{
// Add profile data for application users by adding properties to the ApplicationUser class
public class ApplicationUser : IdentityUser
{
[Display(Name = "Associated skills")]
public List<UserSkill> AssociatedSkills { get; set; } = new List<UserSkill>();
public string Name { get; set; }
[Display(Name = "Time Zone")]
[Required]
public string TimeZoneId { get; set; }
public string PendingNewEmail { get; set; }
public IEnumerable<ValidationResult> ValidateProfileCompleteness()
{
List<ValidationResult> validationResults = new List<ValidationResult>();
if (!EmailConfirmed)
{
validationResults.Add(new ValidationResult("Verify your email address", new string[] { nameof(Email) }));
}
if (string.IsNullOrWhiteSpace(Name))
{
validationResults.Add(new ValidationResult("Enter your name", new string[] { nameof(Name) }));
}
if (string.IsNullOrWhiteSpace(PhoneNumber))
{
validationResults.Add(new ValidationResult("Add a phone number", new string[] { nameof(PhoneNumber) }));
}
if (!string.IsNullOrWhiteSpace(PhoneNumber) && !PhoneNumberConfirmed)
{
validationResults.Add(new ValidationResult("Confirm your phone number", new string[] { nameof(PhoneNumberConfirmed) }));
}
return validationResults;
}
public bool IsProfileComplete()
{
return !ValidateProfileCompleteness().Any();
}
}
}
|
using Microsoft.AspNet.Identity.EntityFramework;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
namespace AllReady.Models
{
// Add profile data for application users by adding properties to the ApplicationUser class
public class ApplicationUser : IdentityUser
{
[Display(Name = "Associated skills")]
public List<UserSkill> AssociatedSkills { get; set; } = new List<UserSkill>();
public string Name { get; set; }
[Display(Name = "Time Zone")]
[Required]
public string TimeZoneId { get; set; }
public string PendingNewEmail { get; set; }
public IEnumerable<ValidationResult> ValidateProfileCompleteness()
{
List<ValidationResult> validationResults = new List<ValidationResult>();
if (!EmailConfirmed)
{
validationResults.Add(new ValidationResult("Verify your email address", new string[] { nameof(Email) }));
}
if (string.IsNullOrWhiteSpace(Name))
{
validationResults.Add(new ValidationResult("Enter your name", new string[] { nameof(Name) }));
}
if (string.IsNullOrWhiteSpace(PhoneNumber))
{
validationResults.Add(new ValidationResult("Add a phone number", new string[] { nameof(PhoneNumber) }));
}
else if (!PhoneNumberConfirmed)
{
validationResults.Add(new ValidationResult("Confirm your phone number", new string[] { nameof(PhoneNumberConfirmed) }));
}
return validationResults;
}
public bool IsProfileComplete()
{
return !ValidateProfileCompleteness().Any();
}
}
}
|
Simplify logic in user profile validation
|
Simplify logic in user profile validation
|
C#
|
mit
|
mikesigs/allReady,mikesigs/allReady,mikesigs/allReady,mikesigs/allReady
|
922e84d146e33752b379ba78f24105c79286c1d2
|
MadCat/NutEngine/Physics/Collider/Collider.cs
|
MadCat/NutEngine/Physics/Collider/Collider.cs
|
using NutEngine.Physics.Shapes;
namespace NutEngine.Physics
{
public static partial class Collider
{
public static bool Collide(IBody<IShape> a, IBody<IShape> b, out Manifold manifold)
{
return Collide((dynamic)a, (dynamic)b, out manifold);
}
}
}
|
using NutEngine.Physics.Shapes;
namespace NutEngine.Physics
{
public static partial class Collider
{
public static bool Collide(IBody<IShape> a, IBody<IShape> b, out Manifold manifold)
{
return Collide((dynamic)a, (dynamic)b, out manifold);
}
public static bool Collide(IBody<IShape> a, IBody<IShape> b)
{
return Collide((dynamic)a, (dynamic)b);
}
}
}
|
Add collide without manifold generation
|
Add collide without manifold generation
|
C#
|
mit
|
EasyPeasyLemonSqueezy/MadCat
|
90d6445914b1217a1a7875392837880060c3f8f9
|
src/PagedList.Tests/SplitAndPartitionFacts.cs
|
src/PagedList.Tests/SplitAndPartitionFacts.cs
|
using System.Linq;
using Xunit;
namespace PagedList.Tests
{
public class SplitAndPartitionFacts
{
[Fact]
public void Partition_Works()
{
//arrange
var list = Enumerable.Range(1, 9999);
//act
var splitList = list.Partition(1000);
//assert
Assert.Equal(10, splitList.Count());
Assert.Equal(1000, splitList.First().Count());
Assert.Equal(999, splitList.Last().Count());
}
[Fact]
public void Split_Works()
{
//arrange
var list = Enumerable.Range(1, 9999);
//act
var splitList = list.Split(10);
//assert
Assert.Equal(10, splitList.Count());
Assert.Equal(1000, splitList.First().Count());
Assert.Equal(999, splitList.Last().Count());
}
}
}
|
using System.Linq;
using Xunit;
namespace PagedList.Tests
{
public class SplitAndPartitionFacts
{
[Fact]
public void Partition_Works()
{
//arrange
var list = Enumerable.Range(1, 9999);
//act
var splitList = list.Partition(1000);
//assert
Assert.Equal(10, splitList.Count());
Assert.Equal(1000, splitList.First().Count());
Assert.Equal(999, splitList.Last().Count());
}
[Fact]
public void Paritiion_Returns_Enumerable_With_One_Item_When_Count_Less_Than_Page_Size()
{
//arrange
var list = Enumerable.Range(1,10);
//act
var partitionList = list.Partition(1000);
//assert
Assert.Equal(1, splitList.Count());
Assert.Equal(10, splitList.First().Count());
}
[Fact]
public void Split_Works()
{
//arrange
var list = Enumerable.Range(1, 9999);
//act
var splitList = list.Split(10);
//assert
Assert.Equal(10, splitList.Count());
Assert.Equal(1000, splitList.First().Count());
Assert.Equal(999, splitList.Last().Count());
}
}
}
|
Add unit test for partition change
|
Add unit test for partition change
|
C#
|
mit
|
vishalmane/MVCScrolling,dncuug/X.PagedList,lingsu/PagedList,gary75952/PagedList,troygoode/PagedList,weiwei695/PagedList,kpi-ua/X.PagedList,troygoode/PagedList,lingsu/PagedList,ernado-x/X.PagedList,kpi-ua/X.PagedList,ernado-x/X.PagedList,vishalmane/MVCScrolling,weiwei695/PagedList,lingsu/PagedList,gary75952/PagedList,weiwei695/PagedList,troygoode/PagedList,vishalmane/MVCScrolling,gary75952/PagedList,lingsu/PagedList
|
6210e9388939d47ee1ef6b8017c2aae5da405d51
|
School/REPL.cs
|
School/REPL.cs
|
using System;
namespace School
{
public class REPL
{
public REPL()
{
}
public void Run()
{
Evaluator evaluator = new Evaluator();
string line;
Console.WriteLine("School REPL:");
do
{
Console.Write("> ");
line = Console.ReadLine();
if (!String.IsNullOrEmpty(line))
{
try {
Value value = evaluator.Evaluate(line);
Console.WriteLine(value);
} catch (Exception e) {
Console.WriteLine(e);
}
}
} while (line != null);
}
}
}
|
using System;
using Mono.Terminal;
namespace School
{
public class REPL
{
public REPL()
{
}
public void Run()
{
Evaluator evaluator = new Evaluator();
LineEditor editor = new LineEditor("School");
Console.WriteLine("School REPL:");
string line;
while ((line = editor.Edit("> ", "")) != null)
{
try {
Value value = evaluator.Evaluate(line);
Console.WriteLine(value);
} catch (Exception e) {
Console.WriteLine(e);
}
}
}
}
}
|
Use LineEditor instead of Console.ReadLine.
|
Use LineEditor instead of Console.ReadLine.
|
C#
|
apache-2.0
|
alldne/school,alldne/school
|
487b60d45b367760c2c6c1e3a8d38c49314bb9d6
|
elbsms_core/Properties/AssemblyInfo.cs
|
elbsms_core/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("elbsms_core")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyProduct("elbsms_core")]
// 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("59ef0f57-7a82-4cd8-80a6-0d0536ce1ed3")]
// 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: InternalsVisibleTo("elbsms_console")]
|
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("elbsms_core")]
[assembly: AssemblyDescription("elbsms core")]
[assembly: AssemblyProduct("elbsms_core")]
// 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("59ef0f57-7a82-4cd8-80a6-0d0536ce1ed3")]
// 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: InternalsVisibleTo("elbsms_console")]
|
Update assembly description attribute in elbsms_core
|
Update assembly description attribute in elbsms_core
|
C#
|
mit
|
eightlittlebits/elbsms
|
376834b2eb020b209b228f3387ffb545a3c96672
|
source/CroquetAustraliaWebsite.Application/app/home/BlogPostViewModel.cs
|
source/CroquetAustraliaWebsite.Application/app/home/BlogPostViewModel.cs
|
using System;
using System.Web;
using Casper.Domain.Features.BlogPosts;
using CroquetAustraliaWebsite.Library.Content;
namespace CroquetAustraliaWebsite.Application.App.home
{
public class BlogPostViewModel
{
private readonly BlogPost _blogPost;
private readonly Lazy<IHtmlString> _contentFactory;
public BlogPostViewModel(BlogPost blogPost, IMarkdownTransformer markdownTransformer)
{
_blogPost = blogPost;
_contentFactory = new Lazy<IHtmlString>(() => markdownTransformer.MarkdownToHtml(_blogPost.Content));
}
public string Title { get { return _blogPost.Title; } }
public IHtmlString Content { get { return _contentFactory.Value; } }
public DateTimeOffset Published { get { return _blogPost.Published; } }
}
}
|
using System;
using System.Web;
using Anotar.NLog;
using Casper.Domain.Features.BlogPosts;
using CroquetAustraliaWebsite.Library.Content;
namespace CroquetAustraliaWebsite.Application.App.home
{
public class BlogPostViewModel
{
private readonly BlogPost _blogPost;
private readonly Lazy<IHtmlString> _contentFactory;
public BlogPostViewModel(BlogPost blogPost, IMarkdownTransformer markdownTransformer)
{
_blogPost = blogPost;
_contentFactory = new Lazy<IHtmlString>(() => MarkdownToHtml(markdownTransformer));
}
public string Title => _blogPost.Title;
public IHtmlString Content => _contentFactory.Value;
public DateTimeOffset Published => _blogPost.Published;
private IHtmlString MarkdownToHtml(IMarkdownTransformer markdownTransformer)
{
try
{
return markdownTransformer.MarkdownToHtml(_blogPost.Content);
}
catch (Exception innerException)
{
var exception = new Exception($"Could not convert content of blog post '{Title}' to HTML.",
innerException);
exception.Data.Add("BlogPost.Title", _blogPost.Title);
exception.Data.Add("BlogPost.Content", _blogPost.Content);
exception.Data.Add("BlogPost.Published", _blogPost.Published);
exception.Data.Add("BlogPost.RelativeUri", _blogPost.RelativeUri);
LogTo.ErrorException(exception.Message, exception);
return new HtmlString("<p>Content currently not available.<p>");
}
}
}
}
|
Improve error message when BlogPost.Content markdown to html fails
|
Improve error message when BlogPost.Content markdown to html fails
|
C#
|
mit
|
croquet-australia/website-application,croquet-australia/croquet-australia-website,croquet-australia/croquet-australia-website,croquet-australia/croquet-australia-website,croquet-australia/croquet-australia.com.au,croquet-australia/croquet-australia.com.au,croquet-australia/website-application,croquet-australia/croquet-australia-website,croquet-australia/website-application,croquet-australia/croquet-australia.com.au,croquet-australia/website-application,croquet-australia/croquet-australia.com.au
|
a01896a652ee042cc66149a99ccf5b76dddef535
|
osu.Game/Configuration/ScoreMeterType.cs
|
osu.Game/Configuration/ScoreMeterType.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.ComponentModel;
namespace osu.Game.Configuration
{
public enum ScoreMeterType
{
[Description("None")]
None,
[Description("Hit Error (left)")]
HitErrorLeft,
[Description("Hit Error (right)")]
HitErrorRight,
[Description("Hit Error (bottom)")]
HitErrorBottom,
[Description("Hit Error (left+right)")]
HitErrorBoth,
[Description("Colour (left)")]
ColourLeft,
[Description("Colour (right)")]
ColourRight,
[Description("Colour (left+right)")]
ColourBoth,
[Description("Colour (bottom)")]
ColourBottom,
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.ComponentModel;
namespace osu.Game.Configuration
{
public enum ScoreMeterType
{
[Description("None")]
None,
[Description("Hit Error (left)")]
HitErrorLeft,
[Description("Hit Error (right)")]
HitErrorRight,
[Description("Hit Error (left+right)")]
HitErrorBoth,
[Description("Hit Error (bottom)")]
HitErrorBottom,
[Description("Colour (left)")]
ColourLeft,
[Description("Colour (right)")]
ColourRight,
[Description("Colour (left+right)")]
ColourBoth,
[Description("Colour (bottom)")]
ColourBottom,
}
}
|
Fix misordered hit error in score meter types
|
Fix misordered hit error in score meter types
|
C#
|
mit
|
peppy/osu,UselessToucan/osu,peppy/osu,ppy/osu,peppy/osu-new,smoogipoo/osu,ppy/osu,smoogipoo/osu,UselessToucan/osu,peppy/osu,NeoAdonis/osu,smoogipooo/osu,NeoAdonis/osu,ppy/osu,UselessToucan/osu,NeoAdonis/osu,smoogipoo/osu
|
e539a4421a3554673d6edb341d16165cac843ff5
|
samples/ClaimsTransformation/Controllers/AccountController.cs
|
samples/ClaimsTransformation/Controllers/AccountController.cs
|
using System.Collections.Generic;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Mvc;
namespace AuthSamples.ClaimsTransformer.Controllers
{
public class AccountController : Controller
{
[HttpGet]
public IActionResult Login(string returnUrl = null)
{
ViewData["ReturnUrl"] = returnUrl;
return View();
}
private bool ValidateLogin(string userName, string password)
{
// For this sample, all logins are successful.
return true;
}
[HttpPost]
public async Task<IActionResult> Login(string userName, string password, string returnUrl = null)
{
ViewData["ReturnUrl"] = returnUrl;
// Normally Identity handles sign in, but you can do it directly
if (ValidateLogin(userName, password))
{
var claims = new List<Claim>
{
new Claim("user", userName),
new Claim("role", "Member")
};
await HttpContext.SignInAsync(new ClaimsPrincipal(new ClaimsIdentity(claims, "Cookies", "user", "role")));
if (Url.IsLocalUrl(returnUrl))
{
return Redirect(returnUrl);
}
else
{
return Redirect("/");
}
}
return View();
}
public async Task<IActionResult> Logout()
{
await HttpContext.SignOutAsync();
return Redirect("/");
}
}
}
|
using System.Collections.Generic;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Mvc;
namespace AuthSamples.ClaimsTransformer.Controllers
{
public class AccountController : Controller
{
[HttpGet]
public IActionResult Login(string returnUrl = null)
{
ViewData["ReturnUrl"] = returnUrl;
return View();
}
private bool ValidateLogin(string userName, string password)
{
// For this sample, all logins are successful.
return true;
}
[HttpPost]
public async Task<IActionResult> Login(string userName, string password, string returnUrl = null)
{
ViewData["ReturnUrl"] = returnUrl;
// Normally Identity handles sign in, but you can do it directly
if (ValidateLogin(userName, password))
{
var claims = new List<Claim>
{
new Claim("user", userName),
new Claim("role", "Member")
};
await HttpContext.SignInAsync(new ClaimsPrincipal(new ClaimsIdentity(claims, CookieAuthenticationDefaults.AuthenticationScheme, "user", "role")));
if (Url.IsLocalUrl(returnUrl))
{
return Redirect(returnUrl);
}
else
{
return Redirect("/");
}
}
return View();
}
public async Task<IActionResult> Logout()
{
await HttpContext.SignOutAsync();
return Redirect("/");
}
}
}
|
Replace hardcoded string with constant
|
Replace hardcoded string with constant
|
C#
|
apache-2.0
|
aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore
|
a1cc9a970de2679359bfe7ff8f6f29b51f1c4053
|
tests/Booma.Proxy.Packets.Tests/UnitTests/PacketCaptureTestEntry.cs
|
tests/Booma.Proxy.Packets.Tests/UnitTests/PacketCaptureTestEntry.cs
|
namespace Booma.Proxy
{
public sealed partial class CapturedPacketsTests
{
public class PacketCaptureTestEntry
{
public short OpCode { get; }
public byte[] BinaryData { get; }
public string FileName { get; }
/// <inheritdoc />
public PacketCaptureTestEntry(short opCode, byte[] binaryData, string fileName)
{
OpCode = opCode;
BinaryData = binaryData;
FileName = fileName;
}
/// <inheritdoc />
public override string ToString()
{
//Special naming for 0x60 to make it easier to search
if(OpCode == 0x60)
return FileName.Replace("0x60_", $"0x60_0x{BinaryData[6]:X}_");
return $"{FileName}";
}
/// <inheritdoc />
public override int GetHashCode()
{
return FileName.GetHashCode();
}
}
}
}
|
namespace Booma.Proxy
{
public sealed partial class CapturedPacketsTests
{
public class PacketCaptureTestEntry
{
public short OpCode { get; }
public byte[] BinaryData { get; }
public string FileName { get; }
/// <inheritdoc />
public PacketCaptureTestEntry(short opCode, byte[] binaryData, string fileName)
{
OpCode = opCode;
BinaryData = binaryData;
FileName = fileName;
}
/// <inheritdoc />
public override string ToString()
{
//Special naming for 0x60 to make it easier to search
if(OpCode == 0x60)
return FileName.Replace("0x60_", $"0x60_0x{(int)(BinaryData[6]):X2}_");
return $"{FileName}";
}
/// <inheritdoc />
public override int GetHashCode()
{
return FileName.GetHashCode();
}
}
}
}
|
Change subcommand60 packet test case name in VS
|
Change subcommand60 packet test case name in VS
|
C#
|
agpl-3.0
|
HelloKitty/Booma.Proxy
|
b42cd1c04889fcade60ee3ebd2abb0c29c652006
|
Core/Notification/Screenshot/FormNotificationScreenshotable.cs
|
Core/Notification/Screenshot/FormNotificationScreenshotable.cs
|
using System;
using System.Windows.Forms;
using CefSharp;
using TweetDck.Core.Bridge;
using TweetDck.Core.Controls;
using TweetDck.Resources;
namespace TweetDck.Core.Notification.Screenshot{
sealed class FormNotificationScreenshotable : FormNotification{
public FormNotificationScreenshotable(Action callback, FormBrowser owner, NotificationFlags flags) : base(owner, null, flags){
browser.RegisterAsyncJsObject("$TD_NotificationScreenshot", new CallbackBridge(this, callback));
browser.FrameLoadEnd += (sender, args) => {
if (args.Frame.IsMain && browser.Address != "about:blank"){
ScriptLoader.ExecuteScript(args.Frame, "window.setTimeout(() => $TD_NotificationScreenshot.trigger(), 25)", "gen:screenshot");
}
};
UpdateTitle();
}
public void LoadNotificationForScreenshot(TweetNotification tweet, int width, int height){
browser.LoadHtml(tweet.GenerateHtml(enableCustomCSS: false), "http://tweetdeck.twitter.com/?"+DateTime.Now.Ticks);
Location = ControlExtensions.InvisibleLocation;
FormBorderStyle = Program.UserConfig.ShowScreenshotBorder ? FormBorderStyle.FixedToolWindow : FormBorderStyle.None;
SetNotificationSize(width, height, false);
}
public void TakeScreenshotAndHide(){
MoveToVisibleLocation();
Activate();
SendKeys.SendWait("%{PRTSC}");
Reset();
}
public void Reset(){
Location = ControlExtensions.InvisibleLocation;
browser.LoadHtml("", "about:blank");
}
}
}
|
using System;
using System.Windows.Forms;
using CefSharp;
using TweetDck.Core.Bridge;
using TweetDck.Core.Controls;
using TweetDck.Resources;
namespace TweetDck.Core.Notification.Screenshot{
sealed class FormNotificationScreenshotable : FormNotification{
public FormNotificationScreenshotable(Action callback, FormBrowser owner, NotificationFlags flags) : base(owner, null, flags){
browser.RegisterAsyncJsObject("$TD_NotificationScreenshot", new CallbackBridge(this, callback));
browser.FrameLoadEnd += (sender, args) => {
if (args.Frame.IsMain && browser.Address != "about:blank"){
ScriptLoader.ExecuteScript(args.Frame, "window.setTimeout($TD_NotificationScreenshot.trigger, 25)", "gen:screenshot");
}
};
UpdateTitle();
}
public void LoadNotificationForScreenshot(TweetNotification tweet, int width, int height){
browser.LoadHtml(tweet.GenerateHtml(enableCustomCSS: false), "http://tweetdeck.twitter.com/?"+DateTime.Now.Ticks);
Location = ControlExtensions.InvisibleLocation;
FormBorderStyle = Program.UserConfig.ShowScreenshotBorder ? FormBorderStyle.FixedToolWindow : FormBorderStyle.None;
SetNotificationSize(width, height, false);
}
public void TakeScreenshotAndHide(){
MoveToVisibleLocation();
Activate();
SendKeys.SendWait("%{PRTSC}");
Reset();
}
public void Reset(){
Location = ControlExtensions.InvisibleLocation;
browser.LoadHtml("", "about:blank");
}
}
}
|
Tweak screenshot notification script (minor edit)
|
Tweak screenshot notification script (minor edit)
|
C#
|
mit
|
chylex/TweetDuck,chylex/TweetDuck,chylex/TweetDuck,chylex/TweetDuck
|
18844272fafa25fac6665b9c577e010512db7290
|
Anlab.Mvc/Views/Home/Index.cshtml
|
Anlab.Mvc/Views/Home/Index.cshtml
|
@{
ViewData["Title"] = "Home Page";
}
<div class="col-8">
<p class="lead">The UC Davis Analytical Laboratory is a core support facility of the UC Davis College of Agriculture and Environmental Sciences.</p>
<p>Analytical Laboratory clients are University of California academics, other educational institutions, government agencies, and research-based businesses.
</p>
<p>In addition to analytical services, the Laboratory provides project assistance in the areas of analytical, agricultural and environmental chemistry. The Laboratory has an educational role, providing training to students and researchers in the
operation of a number of analytical methods and instruments.</p>
</div>
<div class="col-4">
<address>
<p>UC Davis Analytical Lab<br> University of California Davis, California <br> 95616-5270 <br> Phone: <span style="white-space: nowrap">(530) 752-0147</span> <br> Fax: <span style="white-space: nowrap">(530) 752-9892</span> <br> Email: <a href="mailto:anlab@ucdavis.edu">anlab@ucdavis.edu</a></p>
</address>
</div>
|
@{
ViewData["Title"] = "Home Page";
}
<div class="col-8">
<p class="lead">PLEASE NOTE: The Analytical Lab will be closed on July 4th and 5th.</p>
<p class="lead">The UC Davis Analytical Laboratory is a core support facility of the UC Davis College of Agriculture and Environmental Sciences.</p>
<p>Analytical Laboratory clients are University of California academics, other educational institutions, government agencies, and research-based businesses.
</p>
<p>In addition to analytical services, the Laboratory provides project assistance in the areas of analytical, agricultural and environmental chemistry. The Laboratory has an educational role, providing training to students and researchers in the
operation of a number of analytical methods and instruments.</p>
</div>
<div class="col-4">
<address>
<p>UC Davis Analytical Lab<br> University of California Davis, California <br> 95616-5270 <br> Phone: <span style="white-space: nowrap">(530) 752-0147</span> <br> Fax: <span style="white-space: nowrap">(530) 752-9892</span> <br> Email: <a href="mailto:anlab@ucdavis.edu">anlab@ucdavis.edu</a></p>
</address>
</div>
|
Add temporary warning of upcoming lab closure.
|
Add temporary warning of upcoming lab closure.
|
C#
|
mit
|
ucdavis/Anlab,ucdavis/Anlab,ucdavis/Anlab,ucdavis/Anlab
|
14975b0ff5bd9a0cb67566a2a895d49949f7423f
|
AzureSpeed.WebUI/Models/Prefix.cs
|
AzureSpeed.WebUI/Models/Prefix.cs
|
using Newtonsoft.Json;
namespace AzureSpeed.WebUI.Models
{
public class Prefix
{
[JsonProperty("ip_prefix")]
public string IpPrefix { get; set; }
[JsonProperty("region")]
public string Region { get; set; }
[JsonProperty("region")]
public string Service { get; set; }
}
}
|
using Newtonsoft.Json;
namespace AzureSpeed.WebUI.Models
{
public class Prefix
{
[JsonProperty("ip_prefix")]
public string IpPrefix { get; set; }
[JsonProperty("region")]
public string Region { get; set; }
[JsonProperty("service")]
public string Service { get; set; }
}
}
|
Fix IP look up page broken
|
Fix IP look up page broken
|
C#
|
mit
|
blrchen/AzureSpeed,blrchen/AzureSpeed,blrchen/AzureSpeed,blrchen/AzureSpeed
|
8c80f2c685e8657d32595d13cd1f6e5cf11a95de
|
src/SFA.DAS.ReferenceData.Api/WebRole.cs
|
src/SFA.DAS.ReferenceData.Api/WebRole.cs
|
using System;
using System.Diagnostics;
using Microsoft.Web.Administration;
using Microsoft.WindowsAzure.ServiceRuntime;
using System.Linq;
namespace SFA.DAS.ReferenceData.Api
{
public class WebRole : RoleEntryPoint
{
public override void Run()
{
using (var serverManager = new ServerManager())
{
foreach (var application in serverManager.Sites.SelectMany(x => x.Applications))
{
application["preloadEnabled"] = true;
}
foreach (var applicationPool in serverManager.ApplicationPools)
{
applicationPool["startMode"] = "AlwaysRunning";
}
serverManager.CommitChanges();
}
base.Run();
}
}
}
|
using System;
using System.Diagnostics;
using Microsoft.Web.Administration;
using Microsoft.WindowsAzure.ServiceRuntime;
using System.Linq;
namespace SFA.DAS.ReferenceData.Api
{
public class WebRole : RoleEntryPoint
{
public override void Run()
{
using (var serverManager = new ServerManager())
{
foreach (var application in serverManager.Sites.SelectMany(x => x.Applications))
{
application["preloadEnabled"] = true;
}
foreach (var applicationPool in serverManager.ApplicationPools)
{
applicationPool["startMode"] = "AlwaysRunning";
applicationPool.ProcessModel.IdleTimeout = new System.TimeSpan(0);
}
serverManager.CommitChanges();
}
base.Run();
}
}
}
|
Remove Idle timeout in IIS
|
Remove Idle timeout in IIS
|
C#
|
mit
|
SkillsFundingAgency/das-referencedata,SkillsFundingAgency/das-referencedata
|
5d36a8c037cd83488acc8c98f8b4e0dc7ae74af0
|
exercises/concept/strings/.meta/Example.cs
|
exercises/concept/strings/.meta/Example.cs
|
static class LogLine
{
public static string Message(string logLine)
{
return logLine.Substring(logLine.IndexOf(":") + 1).Trim();
}
public static string LogLevel(string logLine)
{
return logLine.Substring(1, (logLine.IndexOf("]") - 1).ToLower();
}
public static string Reformat(string logLine)
{
return $"{Message(logLine)} ({LogLevel(logLine)})";
}
}
|
static class LogLine
{
public static string Message(string logLine)
{
return logLine.Substring(logLine.IndexOf(":") + 1).Trim();
}
public static string LogLevel(string logLine)
{
return logLine.Substring(1, logLine.IndexOf("]") - 1).ToLower();
}
public static string Reformat(string logLine)
{
return $"{Message(logLine)} ({LogLevel(logLine)})";
}
}
|
Fix example of strings exercise
|
Fix example of strings exercise
|
C#
|
mit
|
exercism/xcsharp,exercism/xcsharp
|
5976e8bfeb6142583fdf1422d2902356055a51f7
|
CIV.Test/Common.cs
|
CIV.Test/Common.cs
|
using System;
using System.Collections.Generic;
using CIV.Ccs;
using CIV.Interfaces;
using Moq;
namespace CIV.Test
{
public static class Common
{
/// <summary>
/// Setup a mock process that can only do the given action.
/// </summary>
/// <returns>The mock process.</returns>
/// <param name="action">Action.</param>
public static CcsProcess SetupMockProcess(String action = "action")
{
return Mock.Of<CcsProcess>(p => p.Transitions() == new List<Transition>
{
SetupTransition(action)
}
);
}
static Transition SetupTransition(String label)
{
return new Transition
{
Label = label,
Process = Mock.Of<CcsProcess>()
};
}
}
}
|
using System;
using System.Collections.Generic;
using CIV.Ccs;
using CIV.Interfaces;
using Moq;
namespace CIV.Test
{
public static class Common
{
/// <summary>
/// Setup a mock process that can only do the given action.
/// </summary>
/// <returns>The mock process.</returns>
/// <param name="action">Action.</param>
public static CcsProcess SetupMockProcess(String action = "action")
{
return Mock.Of<CcsProcess>(p => p.GetTransitions() == new List<Transition>
{
SetupTransition(action)
}
);
}
static Transition SetupTransition(String label)
{
return new Transition
{
Label = label,
Process = Mock.Of<CcsProcess>()
};
}
}
}
|
Use new Process interface in tests
|
Use new Process interface in tests
|
C#
|
mit
|
lou1306/CIV,lou1306/CIV
|
0a550a23091095e98b778ef09987043f8ccc1ff9
|
Framework/Extension.cs
|
Framework/Extension.cs
|
using System;
using System.Collections.Generic;
using System.Net;
using System.Threading;
using System.Threading.Tasks;
namespace TirkxDownloader.Framework
{
public static class Extension
{
public static async Task<HttpWebResponse> GetResponseAsync(this HttpWebRequest request, CancellationToken ct)
{
using (ct.Register(() => request.Abort(), useSynchronizationContext: false))
{
try
{
var response = await request.GetResponseAsync();
ct.ThrowIfCancellationRequested();
return (HttpWebResponse)response;
}
catch (WebException webEx)
{
if (ct.IsCancellationRequested)
{
throw new OperationCanceledException(webEx.Message, webEx, ct);
}
throw;
}
}
}
public static T[] Dequeue<T>(this Queue<T> queue, int count)
{
T[] list = new T[count];
for (int i = 0; i < count; i++)
{
list[i] = queue.Dequeue();
}
return list;
}
}
}
|
using System;
using System.Collections.Generic;
using System.Net;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
namespace TirkxDownloader.Framework
{
public static class Extension
{
public static async Task<HttpWebResponse> GetResponseAsync(this HttpWebRequest request, CancellationToken ct)
{
using (ct.Register(() => request.Abort(), useSynchronizationContext: false))
{
try
{
var response = await request.GetResponseAsync();
ct.ThrowIfCancellationRequested();
return (HttpWebResponse)response;
}
catch (WebException webEx)
{
if (ct.IsCancellationRequested)
{
throw new OperationCanceledException(webEx.Message, webEx, ct);
}
throw;
}
}
}
public static T[] Dequeue<T>(this Queue<T> queue, int count)
{
T[] list = new T[count];
for (int i = 0; i < count; i++)
{
list[i] = queue.Dequeue();
}
return list;
}
/// <summary>
/// Compares the string against a given pattern.
/// </summary>
/// <param name="str">The string.</param>
/// <param name="pattern">The pattern to match, where "*" means any sequence of characters, and "?" means any single character.</param>
/// <returns><c>true</c> if the string matches the given pattern; otherwise <c>false</c>.</returns>
public static bool Like(this string str, string pattern)
{
return new Regex(
"^" + Regex.Escape(pattern).Replace(@"\*", ".*").Replace(@"\?", ".") + "$",
RegexOptions.IgnoreCase | RegexOptions.Singleline
).IsMatch(str);
}
}
}
|
Add Link method to compare string with wildcards
|
Add Link method to compare string with wildcards
from https://stackoverflow.com/questions/188892/glob-pattern-matching-in-net
|
C#
|
mit
|
witoong623/TirkxDownloader,witoong623/TirkxDownloader
|
ae1436ad3b314432923b3e18048d99ce27338681
|
Libraries/src/Amazon.Lambda.APIGatewayEvents/APIGatewayCustomAuthorizerRequest.cs
|
Libraries/src/Amazon.Lambda.APIGatewayEvents/APIGatewayCustomAuthorizerRequest.cs
|
namespace Amazon.Lambda.APIGatewayEvents
{
/// <summary>
/// For requests coming in to a custom API Gateway authorizer function.
/// </summary>
public class APIGatewayCustomAuthorizerRequest
{
/// <summary>
/// Gets or sets the 'type' property.
/// </summary>
public string Type { get; set; }
/// <summary>
/// Gets or sets the 'authorizationToken' property.
/// </summary>
public string AuthorizationToken { get; set; }
/// <summary>
/// Gets or sets the 'methodArn' property.
/// </summary>
public string MethodArn { get; set; }
}
}
|
using System.Collections.Generic;
namespace Amazon.Lambda.APIGatewayEvents
{
/// <summary>
/// For requests coming in to a custom API Gateway authorizer function.
/// </summary>
public class APIGatewayCustomAuthorizerRequest
{
/// <summary>
/// Gets or sets the 'type' property.
/// </summary>
public string Type { get; set; }
/// <summary>
/// Gets or sets the 'authorizationToken' property.
/// </summary>
public string AuthorizationToken { get; set; }
/// <summary>
/// Gets or sets the 'methodArn' property.
/// </summary>
public string MethodArn { get; set; }
/// <summary>
/// The url path for the caller. For Request type API Gateway Custom Authorizer only.
/// </summary>
public string Path { get; set; }
/// <summary>
/// The HTTP method used. For Request type API Gateway Custom Authorizer only.
/// </summary>
public string HttpMethod { get; set; }
/// <summary>
/// The headers sent with the request. For Request type API Gateway Custom Authorizer only.
/// </summary>
public IDictionary<string, string> Headers {get;set;}
/// <summary>
/// The query string parameters that were part of the request. For Request type API Gateway Custom Authorizer only.
/// </summary>
public IDictionary<string, string> QueryStringParameters { get; set; }
/// <summary>
/// The path parameters that were part of the request. For Request type API Gateway Custom Authorizer only.
/// </summary>
public IDictionary<string, string> PathParameters { get; set; }
/// <summary>
/// The stage variables defined for the stage in API Gateway. For Request type API Gateway Custom Authorizer only.
/// </summary>
public IDictionary<string, string> StageVariables { get; set; }
/// <summary>
/// The request context for the request. For Request type API Gateway Custom Authorizer only.
/// </summary>
public APIGatewayProxyRequest.ProxyRequestContext RequestContext { get; set; }
}
}
|
Add parameter for a REQUEST type API Gateway Custom Authorizer
|
Add parameter for a REQUEST type API Gateway Custom Authorizer
|
C#
|
apache-2.0
|
thedevopsmachine/aws-lambda-dotnet,thedevopsmachine/aws-lambda-dotnet,thedevopsmachine/aws-lambda-dotnet,thedevopsmachine/aws-lambda-dotnet
|
ae442ecb3fa52e58001acbfe481fe2e5c8841258
|
Xamarin.Forms.GoogleMaps/Xamarin.Forms.GoogleMaps/Internals/ProductInformation.cs
|
Xamarin.Forms.GoogleMaps/Xamarin.Forms.GoogleMaps/Internals/ProductInformation.cs
|
using System;
namespace Xamarin.Forms.GoogleMaps.Internals
{
internal class ProductInformation
{
public const string Author = "amay077";
public const string Name = "Xamarin.Forms.GoogleMaps";
public const string Copyright = "Copyright © amay077. 2016 - 2017";
public const string Trademark = "";
public const string Version = "2.2.1.4";
}
}
|
using System;
namespace Xamarin.Forms.GoogleMaps.Internals
{
internal class ProductInformation
{
public const string Author = "amay077";
public const string Name = "Xamarin.Forms.GoogleMaps";
public const string Copyright = "Copyright © amay077. 2016 - 2017";
public const string Trademark = "";
public const string Version = "2.2.1.5";
}
}
|
Update file version to 2.2.1.5
|
Update file version to 2.2.1.5
|
C#
|
mit
|
JKennedy24/Xamarin.Forms.GoogleMaps,JKennedy24/Xamarin.Forms.GoogleMaps,amay077/Xamarin.Forms.GoogleMaps
|
0a423ff84d438f48422876781708eaf73d999dd6
|
src/Example/CassetteConfiguration.cs
|
src/Example/CassetteConfiguration.cs
|
using System.Text.RegularExpressions;
using Cassette;
using Cassette.HtmlTemplates;
using Cassette.Scripts;
using Cassette.Stylesheets;
namespace Example
{
public class CassetteConfiguration : ICassetteConfiguration
{
public void Configure(ModuleConfiguration modules)
{
modules.Add(
new PerSubDirectorySource<ScriptModule>("Scripts")
{
FilePattern = "*.js",
Exclude = new Regex("-vsdoc\\.js$")
},
new ExternalScriptModule("twitter", "http://platform.twitter.com/widgets.js")
{
Location = "body"
}
);
modules.Add(new DirectorySource<StylesheetModule>("Styles")
{
FilePattern = "*.css;*.less"
});
modules.Add(new PerSubDirectorySource<HtmlTemplateModule>("HtmlTemplates"));
modules.Customize<StylesheetModule>(m => m.Processor = new StylesheetPipeline
{
CompileLess = true,
ConvertImageUrlsToDataUris = true
});
}
}
}
|
using System.Text.RegularExpressions;
using Cassette;
using Cassette.HtmlTemplates;
using Cassette.Scripts;
using Cassette.Stylesheets;
namespace Example
{
public class CassetteConfiguration : ICassetteConfiguration
{
public void Configure(ModuleConfiguration modules)
{
modules.Add(
new PerSubDirectorySource<ScriptModule>("Scripts")
{
FilePattern = "*.js",
Exclude = new Regex("-vsdoc\\.js$")
},
new ExternalScriptModule("twitter", "http://platform.twitter.com/widgets.js")
{
Location = "body"
}
);
modules.Add(new DirectorySource<StylesheetModule>("Styles")
{
FilePattern = "*.css;*.less"
});
modules.Add(new PerSubDirectorySource<HtmlTemplateModule>("HtmlTemplates"));
modules.Customize<StylesheetModule>(m => m.Processor = new StylesheetPipeline
{
CompileLess = true,
ConvertImageUrlsToDataUris = true
});
modules.Customize<HtmlTemplateModule>(m => m.Processor = new JQueryTmplPipeline{KnockoutJS = true});
}
}
}
|
Use HTML template compiler in example.
|
Use HTML template compiler in example.
|
C#
|
mit
|
BluewireTechnologies/cassette,honestegg/cassette,BluewireTechnologies/cassette,honestegg/cassette,honestegg/cassette,andrewdavey/cassette,damiensawyer/cassette,andrewdavey/cassette,damiensawyer/cassette,andrewdavey/cassette,damiensawyer/cassette
|
f51894c850ef89db4eafe25f8e76819e86c0e767
|
src/SharedAssemblyInfo.cs
|
src/SharedAssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.CompilerServices;
[assembly: AssemblyProduct("Aggregates.NET")]
[assembly: AssemblyDescription(".NET event sourced domain driven design model via NServiceBus and EventStore")]
[assembly: AssemblyCopyright("Copyright © Charles Solar 2017")]
[assembly: AssemblyVersion("0.12.0.0")]
[assembly: AssemblyFileVersion("0.12.0.0")]
[assembly: AssemblyInformationalVersion("0.12.0.0")]
[assembly: InternalsVisibleTo("Aggregates.NET.UnitTests")]
[assembly: InternalsVisibleTo("Aggregates.NET")]
[assembly: InternalsVisibleTo("Aggregates.NET.EventStore")]
[assembly: InternalsVisibleTo("Aggregates.NET.NServiceBus")]
[assembly: InternalsVisibleTo("Aggregates.NET.NewtonsoftJson")]
[assembly: InternalsVisibleTo("Aggregates.NET.StructureMap")]
[assembly: InternalsVisibleTo("Aggregates.NET.SimpleInjector")]
|
using System.Reflection;
using System.Runtime.CompilerServices;
[assembly: AssemblyProduct("Aggregates.NET")]
[assembly: AssemblyDescription(".NET event sourced domain driven design model via NServiceBus and EventStore")]
[assembly: AssemblyCopyright("Copyright © Charles Solar 2017")]
[assembly: AssemblyVersion("0.13.0.0")]
[assembly: AssemblyFileVersion("0.13.0.0")]
[assembly: AssemblyInformationalVersion("0.13.0.0")]
[assembly: InternalsVisibleTo("Aggregates.NET.UnitTests")]
[assembly: InternalsVisibleTo("Aggregates.NET")]
[assembly: InternalsVisibleTo("Aggregates.NET.EventStore")]
[assembly: InternalsVisibleTo("Aggregates.NET.NServiceBus")]
[assembly: InternalsVisibleTo("Aggregates.NET.NewtonsoftJson")]
[assembly: InternalsVisibleTo("Aggregates.NET.StructureMap")]
[assembly: InternalsVisibleTo("Aggregates.NET.SimpleInjector")]
|
Increment library version as version on pre-release line messed up versioning
|
Increment library version as version on pre-release line messed up versioning
|
C#
|
mit
|
volak/Aggregates.NET,volak/Aggregates.NET
|
ad882939d9b97f4d466759a0e65b876a3504c25a
|
src/Mime/MagicParams.cs
|
src/Mime/MagicParams.cs
|
namespace HeyRed.Mime
{
public enum MagicParams
{
MAGIC_PARAM_INDIR_MAX = 0,
MAGIC_PARAM_NAME_MAX,
MAGIC_PARAM_ELF_PHNUM_MAX,
MAGIC_PARAM_ELF_SHNUM_MAX,
MAGIC_PARAM_ELF_NOTES_MAX,
MAGIC_PARAM_REGEX_MAX,
MAGIC_PARAM_BYTES_MAX
}
}
|
namespace HeyRed.Mime
{
public enum MagicParams
{
/// <summary>
/// The parameter controls how many levels of recursion will be followed for indirect magic entries.
/// </summary>
MAGIC_PARAM_INDIR_MAX = 0,
/// <summary>
/// The parameter controls the maximum number of calls for name/use.
/// </summary>
MAGIC_PARAM_NAME_MAX,
/// <summary>
/// The parameter controls how many ELF program sections will be processed.
/// </summary>
MAGIC_PARAM_ELF_PHNUM_MAX,
/// <summary>
/// The parameter controls how many ELF sections will be processed.
/// </summary>
MAGIC_PARAM_ELF_SHNUM_MAX,
/// <summary>
/// The parameter controls how many ELF notes will be processed.
/// </summary>
MAGIC_PARAM_ELF_NOTES_MAX,
MAGIC_PARAM_REGEX_MAX,
MAGIC_PARAM_BYTES_MAX
}
}
|
Add description for magic params
|
Add description for magic params
|
C#
|
mit
|
hey-red/Mime
|
c1f3bf124f06c73259b7f488e2899d3011179157
|
template-game/TemplateGame.Game/MainScreen.cs
|
template-game/TemplateGame.Game/MainScreen.cs
|
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Screens;
namespace TemplateGame.Game
{
public class MainScreen : Screen
{
[BackgroundDependencyLoader]
private void load()
{
AddInternal(new SpinningBox
{
Anchor = Anchor.Centre,
});
}
}
}
|
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Screens;
using osuTK.Graphics;
namespace TemplateGame.Game
{
public class MainScreen : Screen
{
[BackgroundDependencyLoader]
private void load()
{
InternalChildren = new Drawable[]
{
new Box
{
Colour = Color4.Violet,
RelativeSizeAxes = Axes.Both,
},
new SpriteText
{
Y = 20,
Text = "Main Screen",
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Font = FontUsage.Default.With(size: 40)
},
new SpinningBox
{
Anchor = Anchor.Centre,
}
};
}
}
}
|
Make main screen a bit more identifiable
|
Make main screen a bit more identifiable
|
C#
|
mit
|
peppy/osu-framework,smoogipooo/osu-framework,EVAST9919/osu-framework,ppy/osu-framework,ZLima12/osu-framework,smoogipooo/osu-framework,EVAST9919/osu-framework,peppy/osu-framework,peppy/osu-framework,ZLima12/osu-framework,ppy/osu-framework,ppy/osu-framework,EVAST9919/osu-framework,EVAST9919/osu-framework
|
7569473dd569bac4d9611a5f6b945cc42695e801
|
src/SFA.DAS.EmployerFinance.Jobs/ScheduledJobs/ExpireFundsJob.cs
|
src/SFA.DAS.EmployerFinance.Jobs/ScheduledJobs/ExpireFundsJob.cs
|
using System.Threading.Tasks;
using Microsoft.Azure.WebJobs;
using Microsoft.Extensions.Logging;
using NServiceBus;
using SFA.DAS.EmployerFinance.Messages.Commands;
namespace SFA.DAS.EmployerFinance.Jobs.ScheduledJobs
{
public class ExpireFundsJob
{
private readonly IMessageSession _messageSession;
public ExpireFundsJob(IMessageSession messageSession)
{
_messageSession = messageSession;
}
public Task Run([TimerTrigger("0 0 0 10 * *")] TimerInfo timer, ILogger logger)
{
return _messageSession.Send(new ExpireFundsCommand());
}
}
}
|
using System.Threading.Tasks;
using Microsoft.Azure.WebJobs;
using Microsoft.Extensions.Logging;
using NServiceBus;
using SFA.DAS.EmployerFinance.Messages.Commands;
namespace SFA.DAS.EmployerFinance.Jobs.ScheduledJobs
{
public class ExpireFundsJob
{
private readonly IMessageSession _messageSession;
public ExpireFundsJob(IMessageSession messageSession)
{
_messageSession = messageSession;
}
public Task Run([TimerTrigger("0 0 0 28 * *")] TimerInfo timer, ILogger logger)
{
return _messageSession.Send(new ExpireFundsCommand());
}
}
}
|
Change expiry job back to 28th
|
Change expiry job back to 28th
|
C#
|
mit
|
SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice
|
8c46bcca9aa37906746e6490b033a72e531dd5eb
|
src/Zenini/Patterns/KeyValuePattern.cs
|
src/Zenini/Patterns/KeyValuePattern.cs
|
using System;
using System.Text.RegularExpressions;
namespace Zenini.Patterns
{
public class KeyValuePattern
{
private static readonly Regex KeyValueRegex = new Regex(@"^\s*(.+?)\s*=\s*(.+?)\s*$", RegexOptions.Compiled);
public virtual bool Matches(string line)
{
return KeyValueRegex.IsMatch(line);
}
public virtual Tuple<string, string> Extract(string line)
{
MatchCollection collection = KeyValueRegex.Matches(line);
string key = collection[0].Groups[1].Value;
string value = collection[0].Groups[2].Value;
if (value.StartsWith("\"") && value.EndsWith("\""))
value = value.Substring(1, value.Length - 2);
return new Tuple<string, string>(key, value);
}
}
}
|
using System;
using System.Text.RegularExpressions;
namespace Zenini.Patterns
{
public class KeyValuePattern
{
private static readonly Regex KeyValueRegex = new Regex(@"^\s*(.+?)\s*=\s*(?:"")?(.+?)(?:\"")?\s*$", RegexOptions.Compiled);
public virtual bool Matches(string line)
{
return KeyValueRegex.IsMatch(line);
}
public virtual Tuple<string, string> Extract(string line)
{
MatchCollection collection = KeyValueRegex.Matches(line);
string key = collection[0].Groups[1].Value;
string value = collection[0].Groups[2].Value;
return new Tuple<string, string>(key, value);
}
}
}
|
Improve key/value pattern values enclosed in quotation marks
|
Improve key/value pattern values enclosed in quotation marks
|
C#
|
mit
|
tommarien/zenini
|
2e68951e0f6c45c392008160c54fa521b808280a
|
src/Microsoft.Azure.EventHubs/Primitives/ClientInfo.cs
|
src/Microsoft.Azure.EventHubs/Primitives/ClientInfo.cs
|
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.Azure.EventHubs
{
using System;
using System.Reflection;
using System.Runtime.Versioning;
using Microsoft.Azure.Amqp;
static class ClientInfo
{
static readonly string product;
static readonly string version;
static readonly string framework;
static readonly string platform;
static ClientInfo()
{
try
{
Assembly assembly = typeof(ClientInfo).GetTypeInfo().Assembly;
product = GetAssemblyAttributeValue<AssemblyProductAttribute>(assembly, p => p.Product);
version = GetAssemblyAttributeValue<AssemblyVersionAttribute>(assembly, v => v.Version);
framework = GetAssemblyAttributeValue<TargetFrameworkAttribute>(assembly, f => f.FrameworkName);
#if NETSTANDARD
platform = System.Runtime.InteropServices.RuntimeInformation.OSDescription;
#else
platform = Environment.OSVersion.VersionString;
#endif
}
catch { }
}
public static void Add(AmqpConnectionSettings settings)
{
settings.AddProperty("product", product);
settings.AddProperty("version", version);
settings.AddProperty("framework", framework);
settings.AddProperty("platform", platform);
}
static string GetAssemblyAttributeValue<T>(Assembly assembly, Func<T, string> getter) where T : Attribute
{
var attribute = assembly.GetCustomAttribute(typeof(T)) as T;
return attribute == null ? null : getter(attribute);
}
}
}
|
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.Azure.EventHubs
{
using System;
using System.Reflection;
using System.Runtime.Versioning;
using Microsoft.Azure.Amqp;
static class ClientInfo
{
static readonly string product;
static readonly string version;
static readonly string framework;
static readonly string platform;
static ClientInfo()
{
try
{
Assembly assembly = typeof(ClientInfo).GetTypeInfo().Assembly;
product = GetAssemblyAttributeValue<AssemblyProductAttribute>(assembly, p => p.Product);
version = GetAssemblyAttributeValue<AssemblyFileVersionAttribute>(assembly, v => v.Version);
framework = GetAssemblyAttributeValue<TargetFrameworkAttribute>(assembly, f => f.FrameworkName);
#if NETSTANDARD
platform = System.Runtime.InteropServices.RuntimeInformation.OSDescription;
#else
platform = Environment.OSVersion.VersionString;
#endif
}
catch { }
}
public static void Add(AmqpConnectionSettings settings)
{
settings.AddProperty("product", product);
settings.AddProperty("version", version);
settings.AddProperty("framework", framework);
settings.AddProperty("platform", platform);
}
static string GetAssemblyAttributeValue<T>(Assembly assembly, Func<T, string> getter) where T : Attribute
{
var attribute = assembly.GetCustomAttribute(typeof(T)) as T;
return attribute == null ? null : getter(attribute);
}
}
}
|
Use file version as client version
|
Use file version as client version
|
C#
|
mit
|
SeanFeldman/azure-event-hubs-dotnet,jtaubensee/azure-event-hubs-dotnet
|
2c34a9de89bad3632a3b41a5d0f80d60b62e5823
|
Mod.cs
|
Mod.cs
|
using ICities;
using MetroOverhaul.OptionsFramework.Extensions;
namespace MetroOverhaul
{
public class Mod : IUserMod
{
public string Name => "Metro Overhaul";
public string Description => "Brings metro depots, ground and elevated metro tracks";
public void OnSettingsUI(UIHelperBase helper)
{
helper.AddOptionsGroup<Options>();
}
}
}
|
using ICities;
using MetroOverhaul.OptionsFramework.Extensions;
namespace MetroOverhaul
{
public class Mod : IUserMod
{
#if IS_PATCH
public const bool isPatch = true;
#else
public const bool isPatch = false;
#endif
public string Name => "Metro Overhaul" + (isPatch ? " [Patched]" : "");
public string Description => "Brings metro depots, ground and elevated metro tracks";
public void OnSettingsUI(UIHelperBase helper)
{
helper.AddOptionsGroup<Options>();
}
}
}
|
Make different mod name in patched version
|
Make different mod name in patched version
|
C#
|
mit
|
earalov/Skylines-ElevatedTrainStationTrack
|
8382881127d2384848d24bbf8a12925ddd365e65
|
NBi.Core/Structure/Relational/Builders/SchemaDiscoveryCommandBuilder.cs
|
NBi.Core/Structure/Relational/Builders/SchemaDiscoveryCommandBuilder.cs
|
using NBi.Core.Structure;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NBi.Core.Structure.Relational.Builders
{
class SchemaDiscoveryCommandBuilder : RelationalDiscoveryCommandBuilder
{
protected override string BasicCommandText
{
get { return base.BasicCommandText + " and [schema_owner]='dbo'"; }
}
public SchemaDiscoveryCommandBuilder()
{
CaptionName = "schema";
TableName = "schemata";
}
protected override IEnumerable<ICommandFilter> BuildCaptionFilters(IEnumerable<CaptionFilter> filters)
{
var filter = filters.SingleOrDefault(f => f.Target == Target.Perspectives);
if (filter != null)
yield return new CommandFilter(string.Format("[schema_name]='{0}'"
, filter.Caption
));
}
}
}
|
using NBi.Core.Structure;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NBi.Core.Structure.Relational.Builders
{
class SchemaDiscoveryCommandBuilder : RelationalDiscoveryCommandBuilder
{
protected override string BasicCommandText
{
get { return base.BasicCommandText; }
}
public SchemaDiscoveryCommandBuilder()
{
CaptionName = "schema";
TableName = "schemata";
}
protected override IEnumerable<ICommandFilter> BuildCaptionFilters(IEnumerable<CaptionFilter> filters)
{
var filter = filters.SingleOrDefault(f => f.Target == Target.Perspectives);
if (filter != null)
yield return new CommandFilter(string.Format("[schema_name]='{0}'"
, filter.Caption
));
}
}
}
|
Remove requirement for [schema_owner] = 'dbo'
|
Remove requirement for [schema_owner] = 'dbo'
If schema_owner differed from 'dbo', schema existence tests would fail.
|
C#
|
apache-2.0
|
Seddryck/NBi,Seddryck/NBi
|
ba00adc29348272e4f55a98efbf53cc7d292b32c
|
zipkin4net-aspnetcore/Criteo.Profiling.Tracing.Middleware/TracingMiddleware.cs
|
zipkin4net-aspnetcore/Criteo.Profiling.Tracing.Middleware/TracingMiddleware.cs
|
using System;
using Microsoft.AspNetCore.Builder;
using Criteo.Profiling.Tracing;
namespace Criteo.Profiling.Tracing.Middleware
{
public static class TracingMiddleware
{
public static void UseTracing(this IApplicationBuilder app, string serviceName)
{
app.Use(async (context, next) => {
var trace = Trace.Create();
Trace.Current = trace;
trace.Record(Annotations.ServerRecv());
trace.Record(Annotations.ServiceName(serviceName));
trace.Record(Annotations.Rpc(context.Request.Method));
await next.Invoke();
trace.Record(Annotations.ServerSend());
});
}
}
}
|
using System;
using Microsoft.AspNetCore.Builder;
using Criteo.Profiling.Tracing;
namespace Criteo.Profiling.Tracing.Middleware
{
public static class TracingMiddleware
{
public static void UseTracing(this IApplicationBuilder app, string serviceName)
{
var extractor = new ZipkinHttpTraceExtractor();
app.Use(async (context, next) => {
Trace trace;
if (!extractor.TryExtract(context.Request.Headers, out trace))
{
trace = Trace.Create();
}
Trace.Current = trace;
trace.Record(Annotations.ServerRecv());
trace.Record(Annotations.ServiceName(serviceName));
trace.Record(Annotations.Rpc(context.Request.Method));
await next.Invoke();
trace.Record(Annotations.ServerSend());
});
}
}
}
|
Enable middleware to extract trace from incoming request headers.
|
Enable middleware to extract trace from incoming request headers.
If such headers exist, the trace is created from these values.
|
C#
|
apache-2.0
|
criteo/zipkin4net,criteo/zipkin4net
|
cdd70d134ca74df3c0a6e1a1c7234607a3f5a2e5
|
src/Plethora.Common/MathEx.cs
|
src/Plethora.Common/MathEx.cs
|
using System;
namespace Plethora
{
public static class MathEx
{
/// <summary>
/// Returns the greatest common divisor of two numbers.
/// </summary>
/// <param name="a">The first number.</param>
/// <param name="b">The second number.</param>
/// <returns>The greatest common divisor of <paramref name="a"/> and <paramref name="b"/>.</returns>
/// <remarks>
/// This implementation uses the Euclidean algorithm.
/// <seealso cref="https://en.wikipedia.org/wiki/Euclidean_algorithm"/>
/// </remarks>
public static int GreatestCommonDivisor(int a, int b)
{
a = Math.Abs(a);
b = Math.Abs(b);
while (b != 0)
{
int rem = a % b;
a = b;
b = rem;
}
return a;
}
}
}
|
using System;
namespace Plethora
{
public static class MathEx
{
/// <summary>
/// Returns the greatest common divisor of two numbers.
/// </summary>
/// <param name="a">The first number.</param>
/// <param name="b">The second number.</param>
/// <returns>The greatest common divisor of <paramref name="a"/> and <paramref name="b"/>.</returns>
/// <remarks>
/// This implementation uses the Euclidean algorithm.
/// <seealso href="https://en.wikipedia.org/wiki/Euclidean_algorithm"/>
/// </remarks>
public static int GreatestCommonDivisor(int a, int b)
{
a = Math.Abs(a);
b = Math.Abs(b);
while (b != 0)
{
int rem = a % b;
a = b;
b = rem;
}
return a;
}
}
}
|
Correct href in <see/> tag
|
Correct href in <see/> tag
|
C#
|
mit
|
mikebarker/Plethora.NET
|
af56e5c9f724aad319d86dd452644b0e891df2c3
|
ShopifyAPIAdapterLibrary/ShopifyAPIAdapterLibrary.Models/ShopifyResourceModel.cs
|
ShopifyAPIAdapterLibrary/ShopifyAPIAdapterLibrary.Models/ShopifyResourceModel.cs
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
namespace ShopifyAPIAdapterLibrary.Models
{
public class ShopifyResourceModel : IResourceModel
{
public event PropertyChangedEventHandler PropertyChanged;
private HashSet<string> Dirty;
public void SetProperty<T>(ref T field, T value, [CallerMemberName] string name = "")
{
// thanks to http://danrigby.com/2012/03/01/inotifypropertychanged-the-net-4-5-way/
if (!EqualityComparer<T>.Default.Equals(field, value))
{
if (PropertyChanged != null) {
PropertyChanged(this, new PropertyChangedEventArgs(name));
}
field = value;
Dirty.Add(name);
}
}
public void Reset()
{
Dirty.Clear();
}
public bool IsFieldDirty(string field)
{
return Dirty.Contains(field);
}
public bool IsClean()
{
return Dirty.Count == 0;
}
private int? id;
public int? Id
{
get { return id; }
set
{
SetProperty(ref id, value);
}
}
public ShopifyResourceModel()
{
Dirty = new HashSet<string>();
}
}
}
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
namespace ShopifyAPIAdapterLibrary.Models
{
public class ShopifyResourceModel : IResourceModel
{
public event PropertyChangedEventHandler PropertyChanged;
private HashSet<string> Dirty;
public void SetProperty<T>(ref T field, T value, [CallerMemberName] string name = null)
{
if (name == null)
{
throw new ShopifyConfigurationException("Field name is coming up null in SetProperty. Something's wrong.");
}
Console.WriteLine("SETTING PROPERTY {0} to {1}", name, value);
// thanks to http://danrigby.com/2012/03/01/inotifypropertychanged-the-net-4-5-way/
if (!EqualityComparer<T>.Default.Equals(field, value))
{
if (PropertyChanged != null) {
PropertyChanged(this, new PropertyChangedEventArgs(name));
}
field = value;
Dirty.Add(name);
}
}
public void Reset()
{
Dirty.Clear();
}
public bool IsFieldDirty(string field)
{
return Dirty.Contains(field);
}
public bool IsClean()
{
return Dirty.Count == 0;
}
private int? id;
public int? Id
{
get { return id; }
set
{
SetProperty(ref id, value);
}
}
public ShopifyResourceModel()
{
Dirty = new HashSet<string>();
}
}
}
|
Throw an exception of [CallerMemberName] misbehaves.
|
Throw an exception of [CallerMemberName] misbehaves.
|
C#
|
mit
|
orospakr/sharpify,orospakr/sharpify,orospakr/sharpify
|
dcf3ae5765dc5ce9eb39ae4cbdf7d5c47ee74f9c
|
LibGit2Sharp/IndexEntry.cs
|
LibGit2Sharp/IndexEntry.cs
|
using System;
using System.Runtime.InteropServices;
using LibGit2Sharp.Core;
namespace LibGit2Sharp
{
public class IndexEntry
{
public IndexEntryState State { get; set; }
public string Path { get; private set; }
public ObjectId Id { get; private set; }
internal static IndexEntry CreateFromPtr(IntPtr ptr)
{
var entry = (GitIndexEntry) Marshal.PtrToStructure(ptr, typeof (GitIndexEntry));
return new IndexEntry
{
Path = entry.Path,
Id = new ObjectId(entry.oid),
};
}
}
}
|
using System;
using System.Runtime.InteropServices;
using LibGit2Sharp.Core;
namespace LibGit2Sharp
{
public class IndexEntry
{
public IndexEntryState State { get; private set; }
public string Path { get; private set; }
public ObjectId Id { get; private set; }
internal static IndexEntry CreateFromPtr(IntPtr ptr)
{
var entry = (GitIndexEntry) Marshal.PtrToStructure(ptr, typeof (GitIndexEntry));
return new IndexEntry
{
Path = entry.Path,
Id = new ObjectId(entry.oid),
};
}
}
}
|
Reduce exposure of public API
|
Reduce exposure of public API
|
C#
|
mit
|
oliver-feng/libgit2sharp,AArnott/libgit2sharp,nulltoken/libgit2sharp,AArnott/libgit2sharp,carlosmn/libgit2sharp,rcorre/libgit2sharp,dlsteuer/libgit2sharp,github/libgit2sharp,xoofx/libgit2sharp,mono/libgit2sharp,jeffhostetler/public_libgit2sharp,mono/libgit2sharp,psawey/libgit2sharp,Skybladev2/libgit2sharp,libgit2/libgit2sharp,vivekpradhanC/libgit2sharp,nulltoken/libgit2sharp,jamill/libgit2sharp,rcorre/libgit2sharp,whoisj/libgit2sharp,AMSadek/libgit2sharp,shana/libgit2sharp,yishaigalatzer/LibGit2SharpCheckOutTests,red-gate/libgit2sharp,jamill/libgit2sharp,shana/libgit2sharp,github/libgit2sharp,paulcbetts/libgit2sharp,vorou/libgit2sharp,vorou/libgit2sharp,red-gate/libgit2sharp,dlsteuer/libgit2sharp,Zoxive/libgit2sharp,jorgeamado/libgit2sharp,OidaTiftla/libgit2sharp,oliver-feng/libgit2sharp,Skybladev2/libgit2sharp,carlosmn/libgit2sharp,whoisj/libgit2sharp,jorgeamado/libgit2sharp,AMSadek/libgit2sharp,sushihangover/libgit2sharp,psawey/libgit2sharp,GeertvanHorrik/libgit2sharp,jeffhostetler/public_libgit2sharp,sushihangover/libgit2sharp,yishaigalatzer/LibGit2SharpCheckOutTests,vivekpradhanC/libgit2sharp,GeertvanHorrik/libgit2sharp,Zoxive/libgit2sharp,ethomson/libgit2sharp,PKRoma/libgit2sharp,ethomson/libgit2sharp,paulcbetts/libgit2sharp,OidaTiftla/libgit2sharp,xoofx/libgit2sharp
|
8f496095a9a42d5ada559ad3cb565511284ade70
|
Properties/AssemblyInfo.cs
|
Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("TweetDick")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TweetDick")]
[assembly: AssemblyCopyright("")]
[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("7f09373d-8beb-416f-a48d-45d8aaeb8caf")]
// 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.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("TweetDick")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TweetDick")]
[assembly: AssemblyCopyright("")]
[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("7f09373d-8beb-416f-a48d-45d8aaeb8caf")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.9.0.0")]
[assembly: AssemblyFileVersion("0.9.0.0")]
|
Change version to 0.9.0.0 for the premature build
|
Change version to 0.9.0.0 for the premature build
|
C#
|
mit
|
chylex/TweetDuck,chylex/TweetDuck,chylex/TweetDuck,chylex/TweetDuck
|
a9f6ad312a757475426e8fd6ec25a7d717d86808
|
Proto/Assets/Scripts/UI/LeaderboardUI.cs
|
Proto/Assets/Scripts/UI/LeaderboardUI.cs
|
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
public class LeaderboardUI : MonoBehaviour
{
[SerializeField] private RectTransform _scoresList;
[SerializeField] private Text _sceneTitle;
[SerializeField] private string _defaultScene = "Tuto";
private const string _path = "./";
private string _filePath;
private Leaderboard _leaderboard;
private const string _leaderboardTitle = "Leaderboard - ";
private void Start ()
{
Cursor.lockState = CursorLockMode.None;
Cursor.visible = true;
LoadScene(_defaultScene);
}
public void LoadScene(string scene)
{
_filePath = _path + scene + ".json";
_leaderboard = new Leaderboard(_filePath);
_leaderboard.Show(_scoresList);
UpdateLeaderboardTitle(scene);
}
public void BackToMainMenu()
{
SceneManager.LoadScene("MainMenu");
}
private void UpdateLeaderboardTitle(string sceneTitle)
{
_sceneTitle.text = _leaderboardTitle + sceneTitle;
}
}
|
using UnityEditor;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
public class LeaderboardUI : MonoBehaviour
{
[SerializeField] private RectTransform _scoresList;
[SerializeField] private Text _sceneTitle;
[SerializeField] private string _defaultScene = "Tuto";
private const string _path = "./";
private string _filePath;
private Leaderboard _leaderboard;
private const string _leaderboardTitle = "Leaderboard - ";
private void Start ()
{
Cursor.lockState = CursorLockMode.None;
Cursor.visible = true;
LoadScene(_defaultScene);
}
public void LoadScene(string scene)
{
ResetList();
_filePath = _path + scene + ".json";
_leaderboard = new Leaderboard(_filePath);
_leaderboard.Show(_scoresList);
UpdateLeaderboardTitle(scene);
}
private void ResetList()
{
for (var i = 0; i < _scoresList.childCount; ++i)
{
Destroy(_scoresList.GetChild(i).gameObject);
}
}
public void BackToMainMenu()
{
SceneManager.LoadScene("MainMenu");
}
private void UpdateLeaderboardTitle(string sceneTitle)
{
_sceneTitle.text = _leaderboardTitle + sceneTitle;
}
}
|
Remove list element when switching scene
|
Remove list element when switching scene
|
C#
|
mit
|
DragonEyes7/ConcoursUBI17,DragonEyes7/ConcoursUBI17
|
4c162561160a6dcb83500d8c80e6e2f36b33f655
|
source/projects/MyCouch.Net45/Responses/Materializers/BasicResponseMaterializer.cs
|
source/projects/MyCouch.Net45/Responses/Materializers/BasicResponseMaterializer.cs
|
using System.Net.Http;
using MyCouch.Extensions;
namespace MyCouch.Responses.Materializers
{
public class BasicResponseMaterializer
{
public virtual void Materialize(Response response, HttpResponseMessage httpResponse)
{
response.RequestUri = httpResponse.RequestMessage.RequestUri;
response.StatusCode = httpResponse.StatusCode;
response.RequestMethod = httpResponse.RequestMessage.Method;
response.ContentLength = httpResponse.Content.Headers.ContentLength;
response.ContentType = httpResponse.Content.Headers.ContentType.ToString();
response.ETag = httpResponse.Headers.GetETag();
}
}
}
|
using System.Net.Http;
using MyCouch.Extensions;
namespace MyCouch.Responses.Materializers
{
public class BasicResponseMaterializer
{
public virtual void Materialize(Response response, HttpResponseMessage httpResponse)
{
response.RequestUri = httpResponse.RequestMessage.RequestUri;
response.StatusCode = httpResponse.StatusCode;
response.RequestMethod = httpResponse.RequestMessage.Method;
response.ContentLength = httpResponse.Content.Headers.ContentLength;
response.ContentType = httpResponse.Content.Headers.ContentType != null ? httpResponse.Content.Headers.ContentType.ToString() : null;
response.ETag = httpResponse.Headers.GetETag();
}
}
}
|
Fix for content type NULL in rare cercumstances
|
Fix for content type NULL in rare cercumstances
|
C#
|
mit
|
danielwertheim/mycouch,danielwertheim/mycouch
|
50963adcbf82d2cb797cf435764a42dc1f25a44a
|
TelerikListViewPoc/Controls/BookListCell.cs
|
TelerikListViewPoc/Controls/BookListCell.cs
|
using Telerik.XamarinForms.DataControls.ListView;
using TelerikListViewPoc.Components;
using Xamarin.Forms;
namespace TelerikListViewPoc.Controls
{
public class BookListCell : ListViewTemplateCell
{
public BookListCell()
{
var titleLabel = new Label
{
FontSize = Device.GetNamedSize(NamedSize.Default, typeof(Label))
};
titleLabel.SetBinding (Label.TextProperty, nameof(this.DataContext.Title), BindingMode.OneWay);
var authorLabel = new Label
{
FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label))
};
authorLabel.SetBinding (Label.TextProperty, nameof(this.DataContext.Author), BindingMode.OneWay);
var yearLabel = new Label
{
FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label))
};
yearLabel.SetBinding(Label.TextProperty, nameof(this.DataContext.Year), BindingMode.OneWay);
var viewLayout = new StackLayout
{
Orientation = StackOrientation.Vertical,
HorizontalOptions = LayoutOptions.FillAndExpand,
Children = { titleLabel, authorLabel, yearLabel }
};
this.View = viewLayout;
}
public Book DataContext
{
get { return this.BindingContext as Book; }
}
}
}
|
using System.Diagnostics;
using Telerik.XamarinForms.DataControls.ListView;
using TelerikListViewPoc.Components;
using Xamarin.Forms;
namespace TelerikListViewPoc.Controls
{
public class BookListCell : ListViewTemplateCell
{
public BookListCell()
{
var titleLabel = new Label
{
FontSize = Device.GetNamedSize(NamedSize.Default, typeof(Label))
};
titleLabel.SetBinding (Label.TextProperty, nameof(this.DataContext.Title), BindingMode.OneWay);
var authorLabel = new Label
{
FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label))
};
authorLabel.SetBinding (Label.TextProperty, nameof(this.DataContext.Author), BindingMode.OneWay);
var yearLabel = new Label
{
FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label))
};
yearLabel.SetBinding(Label.TextProperty, nameof(this.DataContext.Year), BindingMode.OneWay);
var viewLayout = new StackLayout
{
Orientation = StackOrientation.Vertical,
HorizontalOptions = LayoutOptions.FillAndExpand,
Children = { titleLabel, authorLabel, yearLabel },
HeightRequest = 100
};
this.View = viewLayout;
}
public Book DataContext
{
get { return this.BindingContext as Book; }
}
protected override void OnAppearing()
{
Debug.WriteLine("OnAppearing");
base.OnAppearing();
}
protected override void OnDisappearing()
{
Debug.WriteLine("OnDisappearing");
base.OnDisappearing();
}
}
}
|
Set fixed height and add debug messages for OnAppearing/OnDisappearing
|
Set fixed height and add debug messages for OnAppearing/OnDisappearing
|
C#
|
mit
|
esskar/TelerikListViewPoc
|
2fc47c6b2fb0ecd98c0a89cce430a22c7f195f54
|
DanTup.DartAnalysis/Events/ServerStatusEvent.cs
|
DanTup.DartAnalysis/Events/ServerStatusEvent.cs
|
using System;
namespace DanTup.DartAnalysis
{
#region JSON deserialisation objects
class ServerStatusEvent
{
public ServerAnalysisStatus analysis = null;
}
class ServerAnalysisStatus
{
public bool analyzing = false;
}
#endregion
public class ServerStatusNotification
{
public bool IsAnalysing { get; internal set; }
}
internal static class ServerStatusEventImplementation
{
public static void RaiseServerStatusEvent(this DartAnalysisService service, ServerStatusEvent notification, EventHandler<ServerStatusNotification> handler)
{
if (handler != null)
handler.Invoke(service, new ServerStatusNotification { IsAnalysing = notification.analysis.analyzing });
}
}
}
|
using System;
namespace DanTup.DartAnalysis
{
#region JSON deserialisation objects
class ServerStatusEvent
{
public ServerAnalysisStatus analysis = null;
}
class ServerAnalysisStatus
{
public bool analyzing = false;
}
#endregion
public struct ServerStatusNotification
{
public bool IsAnalysing { get; internal set; }
}
internal static class ServerStatusEventImplementation
{
public static void RaiseServerStatusEvent(this DartAnalysisService service, ServerStatusEvent notification, EventHandler<ServerStatusNotification> handler)
{
if (handler != null)
handler.Invoke(service, new ServerStatusNotification { IsAnalysing = notification.analysis.analyzing });
}
}
}
|
Use struct instead of class for event/notification data.
|
Use struct instead of class for event/notification data.
|
C#
|
mit
|
modulexcite/DartVS,modulexcite/DartVS,modulexcite/DartVS,DartVS/DartVS,DartVS/DartVS,DartVS/DartVS
|
655a63bd61dca22f94055156c5ca10519f65d197
|
src/Step-0-No-DI/AdamS.StoreTemp/Models/Common/StringExtensions.cs
|
src/Step-0-No-DI/AdamS.StoreTemp/Models/Common/StringExtensions.cs
|
namespace AdamS.StoreTemp.Models.Common
{
public static class StringExtensions
{
public static bool IsValidEmailAddress(this string emailAddress)
{
return !string.IsNullOrWhiteSpace(emailAddress);
}
}
}
|
using System.Text.RegularExpressions;
namespace AdamS.StoreTemp.Models.Common
{
public static class StringExtensions
{
public static bool IsValidEmailAddress(this string emailAddress)
{
Regex regex = new Regex(@"^[\w-]+(?:\.[\w-]+)*@(?:[\w-]+\.)+[a-zA-Z]{2,7}$");
Match match = regex.Match(emailAddress);
return match.Success;
}
}
}
|
Update StringExtension to validate email
|
Update StringExtension to validate email
|
C#
|
apache-2.0
|
SSWConsulting/SSWTV.DevSuperPower.DI,SSWConsulting/SSWTV.DevSuperPower.DI,SSWConsulting/SSWTV.DevSuperPower.DI
|
951b5c7e4d1ef1917402110e6329935b119d6b8d
|
BmpListener/Bgp/BgpMessage.cs
|
BmpListener/Bgp/BgpMessage.cs
|
using System;
using System.Linq;
namespace BmpListener.Bgp
{
public abstract class BgpMessage
{
protected const int BgpHeaderLength = 19;
protected BgpMessage(ref ArraySegment<byte> data)
{
Header = new BgpHeader(data);
var offset = data.Offset + BgpHeaderLength;
var count = Header.Length - BgpHeaderLength;
data = new ArraySegment<byte>(data.Array, offset, count);
}
public enum Type
{
Open = 1,
Update,
Notification,
Keepalive,
RouteRefresh
}
public BgpHeader Header { get; }
public abstract void DecodeFromBytes(ArraySegment<byte> data);
public static BgpMessage GetBgpMessage(ArraySegment<byte> data)
{
var msgType = (Type) data.ElementAt(18);
switch (msgType)
{
case Type.Open:
return new BgpOpenMessage(data);
case Type.Update:
return new BgpUpdateMessage(data);
case Type.Notification:
return new BgpNotification(data);
case Type.Keepalive:
throw new NotImplementedException();
case Type.RouteRefresh:
throw new NotImplementedException();
default:
throw new NotImplementedException();
}
}
}
}
|
using System;
namespace BmpListener.Bgp
{
public abstract class BgpMessage
{
protected const int BgpHeaderLength = 19;
protected BgpMessage(ArraySegment<byte> data)
{
Header = new BgpHeader(data);
var offset = data.Offset + BgpHeaderLength;
var count = Header.Length - BgpHeaderLength;
MessageData = new ArraySegment<byte>(data.Array, offset, count);
}
public enum Type
{
Open = 1,
Update,
Notification,
Keepalive,
RouteRefresh
}
protected ArraySegment<byte> MessageData { get; }
public BgpHeader Header { get; }
public abstract void DecodeFromBytes(ArraySegment<byte> data);
public static BgpMessage GetBgpMessage(ArraySegment<byte> data)
{
var msgType = (Type)data.Array[data.Offset + 18];
switch (msgType)
{
case Type.Open:
return new BgpOpenMessage(data);
case Type.Update:
return new BgpUpdateMessage(data);
case Type.Notification:
return new BgpNotification(data);
case Type.Keepalive:
throw new NotImplementedException();
case Type.RouteRefresh:
throw new NotImplementedException();
default:
throw new NotImplementedException();
}
}
}
}
|
Replace ASN array with IList
|
Replace ASN array with IList
|
C#
|
mit
|
mstrother/BmpListener
|
4c2f697858f4838549a8e6d1bfe15557311b3342
|
MSBuildTracer/ImportTracer.cs
|
MSBuildTracer/ImportTracer.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using MBEV = Microsoft.Build.Evaluation;
using MBEX = Microsoft.Build.Execution;
namespace MSBuildTracer
{
class ImportTracer
{
private MBEV.Project project;
public ImportTracer(MBEV.Project project)
{
this.project = project;
}
public void Trace(MBEV.ResolvedImport import, int traceLevel = 0)
{
PrintImportInfo(import, traceLevel);
foreach (var childImport in project.Imports.Where(
i => string.Equals(i.ImportingElement.ContainingProject.FullPath,
project.ResolveAllProperties(import.ImportingElement.Project),
StringComparison.OrdinalIgnoreCase)))
{
Trace(childImport, traceLevel + 1);
}
}
private void PrintImportInfo(MBEV.ResolvedImport import, int indentCount)
{
var indent = indentCount > 0 ? new StringBuilder().Insert(0, " ", indentCount).ToString() : "";
Utils.WriteColor(indent, ConsoleColor.White);
Utils.WriteColor($"{import.ImportingElement.Location.Line}: ", ConsoleColor.Cyan);
Utils.WriteLineColor(project.ResolveAllProperties(import.ImportedProject.Location.File), ConsoleColor.Green);
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using MBEV = Microsoft.Build.Evaluation;
using MBEX = Microsoft.Build.Execution;
namespace MSBuildTracer
{
class ImportTracer
{
private MBEV.Project project;
public ImportTracer(MBEV.Project project)
{
this.project = project;
}
public void Trace(MBEV.ResolvedImport import, int traceLevel = 0)
{
PrintImportInfo(import, traceLevel);
foreach (var childImport in project.Imports.Where(
i => string.Equals(i.ImportingElement.ContainingProject.FullPath,
project.ResolveAllProperties(import.ImportedProject.Location.File),
StringComparison.OrdinalIgnoreCase)))
{
Trace(childImport, traceLevel + 1);
}
}
private void PrintImportInfo(MBEV.ResolvedImport import, int indentCount)
{
var indent = indentCount > 0 ? new StringBuilder().Insert(0, " ", indentCount).ToString() : "";
Utils.WriteColor(indent, ConsoleColor.White);
Utils.WriteColor($"{import.ImportingElement.Location.Line}: ", ConsoleColor.Cyan);
Utils.WriteLineColor(project.ResolveAllProperties(import.ImportedProject.Location.File), ConsoleColor.Green);
}
}
}
|
Fix import tracer to property trace all imports
|
Fix import tracer to property trace all imports
|
C#
|
mit
|
jefflinse/MSBuildTracer
|
7a1525b7f4c631130fa21f4c766287a98bbc337b
|
samples/MediatR.Examples/ExceptionHandler/ExceptionsHandlersOverrides.cs
|
samples/MediatR.Examples/ExceptionHandler/ExceptionsHandlersOverrides.cs
|
using MediatR.Pipeline;
using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
namespace MediatR.Examples.ExceptionHandler.Overrides;
public class CommonExceptionHandler : AsyncRequestExceptionHandler<PingResourceTimeout, Pong>
{
private readonly TextWriter _writer;
public CommonExceptionHandler(TextWriter writer) => _writer = writer;
protected override async Task Handle(PingResourceTimeout request,
Exception exception,
RequestExceptionHandlerState<Pong> state,
CancellationToken cancellationToken)
{
await _writer.WriteLineAsync($"---- Exception Handler: '{typeof(CommonExceptionHandler).FullName}'").ConfigureAwait(false);
state.SetHandled(new Pong());
}
}
public class ServerExceptionHandler : ExceptionHandler.ServerExceptionHandler
{
private readonly TextWriter _writer;
public ServerExceptionHandler(TextWriter writer) : base(writer) => _writer = writer;
public override async Task Handle(PingNewResource request,
ServerException exception,
RequestExceptionHandlerState<Pong> state,
CancellationToken cancellationToken)
{
await _writer.WriteLineAsync($"---- Exception Handler: '{typeof(ServerExceptionHandler).FullName}'").ConfigureAwait(false);
state.SetHandled(new Pong());
}
}
|
using MediatR.Pipeline;
using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
namespace MediatR.Examples.ExceptionHandler.Overrides;
public class CommonExceptionHandler : AsyncRequestExceptionHandler<PingResourceTimeout, Pong>
{
private readonly TextWriter _writer;
public CommonExceptionHandler(TextWriter writer) => _writer = writer;
protected override async Task Handle(PingResourceTimeout request,
Exception exception,
RequestExceptionHandlerState<Pong> state,
CancellationToken cancellationToken)
{
// Exception type name required because it is checked later in messages
await _writer.WriteLineAsync($"Handling {exception.GetType().FullName}");
// Exception handler type name required because it is checked later in messages
await _writer.WriteLineAsync($"---- Exception Handler: '{typeof(CommonExceptionHandler).FullName}'").ConfigureAwait(false);
state.SetHandled(new Pong());
}
}
public class ServerExceptionHandler : ExceptionHandler.ServerExceptionHandler
{
private readonly TextWriter _writer;
public ServerExceptionHandler(TextWriter writer) : base(writer) => _writer = writer;
public override async Task Handle(PingNewResource request,
ServerException exception,
RequestExceptionHandlerState<Pong> state,
CancellationToken cancellationToken)
{
// Exception type name required because it is checked later in messages
await _writer.WriteLineAsync($"Handling {exception.GetType().FullName}");
// Exception handler type name required because it is checked later in messages
await _writer.WriteLineAsync($"---- Exception Handler: '{typeof(ServerExceptionHandler).FullName}'").ConfigureAwait(false);
state.SetHandled(new Pong());
}
}
|
Fix MediatR examples exception handlers overrides
|
Fix MediatR examples exception handlers overrides
|
C#
|
apache-2.0
|
jbogard/MediatR
|
6035869f05545d8f18b7c07b291c71ddd25c348d
|
SharpResume.Tests/UnitTest.cs
|
SharpResume.Tests/UnitTest.cs
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using NUnit.Framework;
using SharpResume.Model;
using Assert = Microsoft.VisualStudio.TestTools.UnitTesting.Assert;
namespace SharpResume.Tests
{
[TestClass]
public class UnitTest
{
const string JsonName = "resume.json";
static readonly string _json = File.ReadAllText(Path.Combine(
Directory.GetParent(Directory.GetCurrentDirectory()).Parent.FullName,
JsonName));
readonly Resume _resume = Resume.Create(_json);
readonly dynamic _expected = JObject.Parse(_json);
[TestMethod]
public void TestName()
{
string name = _expected.basics.name;
Assert.AreEqual(name, _resume.Basics.Name);
}
[TestMethod]
public void TestCoursesCount()
{
var educations = _expected.education.ToObject<List<Education>>();
Assert.AreEqual(educations.Count, _resume.Education.Length);
}
}
}
|
using System.Collections.Generic;
using System.IO;
using Newtonsoft.Json.Linq;
using NUnit.Framework;
using SharpResume.Model;
using Assert = NUnit.Framework.Assert;
namespace SharpResume.Tests
{
[TestFixture]
public class UnitTest
{
const string JsonName = "resume.json";
static readonly string _json = File.ReadAllText(Path.Combine(
Directory.GetParent(Directory.GetCurrentDirectory()).Parent.FullName,
JsonName));
readonly Resume _resume = Resume.Create(_json);
readonly dynamic _expected = JObject.Parse(_json);
[Test]
public void TestName()
{
string name = _expected.basics.name;
Assert.AreEqual(name, _resume.Basics.Name);
}
[Test]
public void TestCoursesCount()
{
var educations = _expected.education.ToObject<List<Education>>();
Assert.AreEqual(educations.Count, _resume.Education.Length);
}
}
}
|
Move from MSTest to NUnit
|
Fix: Move from MSTest to NUnit
|
C#
|
mit
|
aloisdg/SharpResume
|
ccb64a98c40b656cf12f70153698464555ef7e8e
|
src/Google.Events.Protobuf/Cloud/PubSub/V1/ConverterAttributes.cs
|
src/Google.Events.Protobuf/Cloud/PubSub/V1/ConverterAttributes.cs
|
// Copyright 2020, 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
//
// https://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.
// TODO: Generate this file!
// This file contains partial classes for all event and event data messages, to apply
// the converter attributes to them.
namespace Google.Events.Protobuf.Cloud.PubSub.V1
{
[CloudEventDataConverter(typeof(ProtobufCloudEventDataConverter<PubsubMessage>))]
public partial class PubsubMessage { }
}
|
// Copyright 2020, 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
//
// https://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.
// TODO: Generate this file!
// This file contains partial classes for all event data messages, to apply
// the converter attributes to them.
namespace Google.Events.Protobuf.Cloud.PubSub.V1
{
[CloudEventDataConverter(typeof(ProtobufCloudEventDataConverter<PubsubMessage>))]
public partial class PubsubMessage { }
}
|
Fix comment (which was in an unsaved file, unfortunately)
|
Fix comment (which was in an unsaved file, unfortunately)
|
C#
|
apache-2.0
|
googleapis/google-cloudevents-dotnet,googleapis/google-cloudevents-dotnet
|
add533cdc6fb091222ceb14ac47c4a94eb72d01d
|
Yeena/Data/PersistentCache.cs
|
Yeena/Data/PersistentCache.cs
|
// Copyright 2013 J.C. Moyer
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using System;
using System.Threading.Tasks;
namespace Yeena.Data {
abstract class PersistentCache<T> where T : class {
protected string Name { get; private set; }
public T Value { get; protected set; }
protected PersistentCache(string name) {
Name = name;
}
public T Load(Func<T> factory) {
OnLoad();
return Value ?? (Value = factory());
}
public async Task<T> LoadAsync(Func<Task<T>> factory) {
OnLoad();
return Value ?? (Value = await factory());
}
public void Save() {
OnSave();
}
protected abstract void OnLoad();
protected abstract void OnSave();
}
}
|
// Copyright 2013 J.C. Moyer
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using System;
using System.Threading.Tasks;
namespace Yeena.Data {
abstract class PersistentCache<T> where T : class {
protected string Name { get; private set; }
public T Value { get; set; }
protected PersistentCache(string name) {
Name = name;
}
public T Load(Func<T> factory) {
OnLoad();
return Value ?? (Value = factory());
}
public async Task<T> LoadAsync(Func<Task<T>> factory) {
OnLoad();
return Value ?? (Value = await factory());
}
public void Save() {
OnSave();
}
protected abstract void OnLoad();
protected abstract void OnSave();
}
}
|
Allow manual changing of Value
|
Allow manual changing of Value
|
C#
|
apache-2.0
|
jcmoyer/Yeena
|
323728833fb87df9d9eeea746f9b4f24295e1797
|
Properties/AssemblyInfo.cs
|
Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("XiboClientWatchdog")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("XiboClientWatchdog")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[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("ec4eaabc-ad30-4ac5-8e0a-0ddb06dad4b1")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.2.0")]
[assembly: AssemblyFileVersion("1.0.2.0")]
|
using System.Reflection;
using System.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("XiboClientWatchdog")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("XiboClientWatchdog")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[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("ec4eaabc-ad30-4ac5-8e0a-0ddb06dad4b1")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.3.0")]
[assembly: AssemblyFileVersion("1.0.3.0")]
|
Prepare for a release - this will go out with v2 R255
|
Prepare for a release - this will go out with v2 R255
|
C#
|
agpl-3.0
|
xibosignage/xibo-windows-client-watchdog
|
d8374b76cc712153a10ed6d36f1ad3dfc68d0d6e
|
ShopifySharp/Services/FulfillmentOrders/FulfillmentOrderService.cs
|
ShopifySharp/Services/FulfillmentOrders/FulfillmentOrderService.cs
|
using System.Net.Http;
using ShopifySharp.Filters;
using System.Collections.Generic;
using System.Threading.Tasks;
using ShopifySharp.Infrastructure;
using System;
using System.Threading;
using ShopifySharp.Lists;
namespace ShopifySharp
{
/// <summary>
/// A service for manipulating Shopify fulfillment orders.
/// </summary>
public class FulfillmentOrderService : ShopifyService
{
/// <summary>
/// Creates a new instance of <see cref="FulfillmentOrderService" />.
/// </summary>
/// <param name="myShopifyUrl">The shop's *.myshopify.com URL.</param>
/// <param name="shopAccessToken">An API access token for the shop.</param>
public FulfillmentOrderService(string myShopifyUrl, string shopAccessToken) : base(myShopifyUrl, shopAccessToken) { }
/// <summary>
/// Gets a list of up to 250 of the order's fulfillments.
/// </summary>
/// <param name="orderId">The order id to which the fulfillments belong.</param>
/// <param name="cancellationToken">Cancellation Token</param>
public virtual async Task<ListResult<FulfillmentOrder>> ListAsync(long orderId, CancellationToken cancellationToken = default)
{
return await ExecuteGetListAsync<FulfillmentOrder>($"orders/{orderId}/fulfillment_orders.json", "fulfillment_orders",null, cancellationToken);
}
}
}
|
using System.Net.Http;
using ShopifySharp.Filters;
using System.Collections.Generic;
using System.Threading.Tasks;
using ShopifySharp.Infrastructure;
using System;
using System.Threading;
using ShopifySharp.Lists;
namespace ShopifySharp
{
/// <summary>
/// A service for manipulating Shopify fulfillment orders.
/// </summary>
public class FulfillmentOrderService : ShopifyService
{
/// <summary>
/// Creates a new instance of <see cref="FulfillmentOrderService" />.
/// </summary>
/// <param name="myShopifyUrl">The shop's *.myshopify.com URL.</param>
/// <param name="shopAccessToken">An API access token for the shop.</param>
public FulfillmentOrderService(string myShopifyUrl, string shopAccessToken) : base(myShopifyUrl, shopAccessToken) { }
/// <summary>
/// Gets a list of up to 250 of the order's fulfillments.
/// </summary>
/// <param name="orderId">The order id to which the fulfillments belong.</param>
/// <param name="cancellationToken">Cancellation Token</param>
public virtual async Task<IEnumerable<FulfillmentOrder>> ListAsync(long orderId, CancellationToken cancellationToken = default)
{
var req = PrepareRequest($"orders/{orderId}/fulfillment_orders.json");
var response = await ExecuteRequestAsync<IEnumerable<FulfillmentOrder>>(req, HttpMethod.Get, cancellationToken, rootElement: "fulfillment_orders");
return response.Result;
}
}
}
|
Return IEnumerable<FulfillmentOrder> instead of ListResult<FulfillmentOrder>
|
Return IEnumerable<FulfillmentOrder> instead of ListResult<FulfillmentOrder>
Result for this endpoint is not paginated.
|
C#
|
mit
|
nozzlegear/ShopifySharp,clement911/ShopifySharp
|
98d3ebcc1192b6bac82229719fe059738bc932d3
|
UI/Pdf/WinFormPdfHost.cs
|
UI/Pdf/WinFormPdfHost.cs
|
using System.Windows.Forms;
namespace XComponent.Common.UI.Pdf
{
public partial class WinFormPdfHost : UserControl
{
public WinFormPdfHost()
{
InitializeComponent();
if(!DesignMode)
axAcroPDF1.setShowToolbar(true);
}
public void LoadFile(string path)
{
if (path != null)
{
axAcroPDF1.LoadFile(path);
axAcroPDF1.src = path;
axAcroPDF1.setViewScroll("FitH", 0);
}
}
public void SetShowToolBar(bool on)
{
axAcroPDF1.setShowToolbar(on);
}
}
}
|
using System;
using System.Windows.Forms;
namespace XComponent.Common.UI.Pdf
{
public partial class WinFormPdfHost : UserControl
{
public WinFormPdfHost()
{
InitializeComponent();
if(!DesignMode)
axAcroPDF1.setShowToolbar(true);
}
public void LoadFile(string path)
{
if (path != null)
{
try
{
axAcroPDF1.LoadFile(path);
axAcroPDF1.src = path;
axAcroPDF1.setViewScroll("FitH", 0);
}
catch (Exception e)
{
System.Windows.Forms.MessageBox.Show(e.ToString());
}
}
}
public void SetShowToolBar(bool on)
{
axAcroPDF1.setShowToolbar(on);
}
}
}
|
Fix crash when acrobat is not correctly installed
|
Fix crash when acrobat is not correctly installed
|
C#
|
apache-2.0
|
xcomponent/xcomponent.ui,Invivoo-software/xcomponent.ui
|
4d26ca9028d9a93522ea9272a72e1cba06eb6e71
|
test/WebApps/SimpleApi/Startup.cs
|
test/WebApps/SimpleApi/Startup.cs
|
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using ExplicitlyImpl.AspNetCore.Mvc.FluentActions;
namespace SimpleApi
{
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc().AddFluentActions();
services.AddTransient<IUserService, UserService>();
services.AddTransient<INoteService, NoteService>();
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
app.UseMvc();
app.UseFluentActions(actions =>
{
actions.RouteGet("/").To(() => "Hello World!");
actions.Add(UserActions.All);
actions.Add(NoteActions.All);
});
}
}
}
|
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using ExplicitlyImpl.AspNetCore.Mvc.FluentActions;
namespace SimpleApi
{
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc().AddFluentActions();
services.AddTransient<IUserService, UserService>();
services.AddTransient<INoteService, NoteService>();
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
app.UseFluentActions(actions =>
{
actions.RouteGet("/").To(() => "Hello World!");
actions.Add(UserActions.All);
actions.Add(NoteActions.All);
});
app.UseMvc();
}
}
}
|
Move call to UseFluentActions before UseMvc in api test project
|
Move call to UseFluentActions before UseMvc in api test project
|
C#
|
mit
|
ExplicitlyImplicit/AspNetCore.Mvc.FluentActions,ExplicitlyImplicit/AspNetCore.Mvc.FluentActions
|
748054c05919078980474ed86cad86f5dfebe664
|
Source/Lib/TraktApiSharp/Core/TraktConstants.cs
|
Source/Lib/TraktApiSharp/Core/TraktConstants.cs
|
namespace TraktApiSharp.Core
{
public static class TraktConstants
{
public static string OAuthBaseAuthorizeUrl => "https://trakt.tv";
public static string OAuthAuthorizeUri => "oauth/authorize";
public static string OAuthTokenUri => "oauth/token";
public static string OAuthRevokeUri => "oauth/revoke";
public static string OAuthDeviceCodeUri => "oauth/device/code";
public static string OAuthDeviceTokenUri => "oauth/device/token";
}
}
|
namespace TraktApiSharp.Core
{
internal static class TraktConstants
{
internal static string OAuthBaseAuthorizeUrl => "https://trakt.tv";
internal static string OAuthAuthorizeUri => "oauth/authorize";
internal static string OAuthTokenUri => "oauth/token";
internal static string OAuthRevokeUri => "oauth/revoke";
internal static string OAuthDeviceCodeUri => "oauth/device/code";
internal static string OAuthDeviceTokenUri => "oauth/device/token";
}
}
|
Change access modifier for constants.
|
Change access modifier for constants.
|
C#
|
mit
|
henrikfroehling/TraktApiSharp
|
0d8ad7b1ff7239c974641b8c44bd82fe1d4e148b
|
src/Loggers/MassTransit.Log4NetIntegration/Logging/Log4NetLogger.cs
|
src/Loggers/MassTransit.Log4NetIntegration/Logging/Log4NetLogger.cs
|
// Copyright 2007-2011 Chris Patterson, Dru Sellers, Travis Smith, et. al.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
// this file except in compliance with the License. You may obtain a copy of the
// License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
namespace MassTransit.Log4NetIntegration.Logging
{
using System.IO;
using MassTransit.Logging;
using log4net;
using log4net.Config;
public class Log4NetLogger :
ILogger
{
public MassTransit.Logging.ILog Get(string name)
{
return new Log4NetLog(LogManager.GetLogger(name));
}
public static void Use()
{
Logger.UseLogger(new Log4NetLogger());
}
public static void Use(string file)
{
Logger.UseLogger(new Log4NetLogger());
var configFile = new FileInfo(file);
XmlConfigurator.Configure(configFile);
}
}
}
|
// Copyright 2007-2011 Chris Patterson, Dru Sellers, Travis Smith, et. al.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
// this file except in compliance with the License. You may obtain a copy of the
// License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
namespace MassTransit.Log4NetIntegration.Logging
{
using System;
using System.IO;
using MassTransit.Logging;
using log4net;
using log4net.Config;
public class Log4NetLogger :
ILogger
{
public MassTransit.Logging.ILog Get(string name)
{
return new Log4NetLog(LogManager.GetLogger(name));
}
public static void Use()
{
Logger.UseLogger(new Log4NetLogger());
}
public static void Use(string file)
{
Logger.UseLogger(new Log4NetLogger());
file = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, file);
var configFile = new FileInfo(file);
XmlConfigurator.Configure(configFile);
}
}
}
|
Fix Log4Net path for loading config file
|
Fix Log4Net path for loading config file
The Log4Net config file should be picked up from the base directory of
the current app domain so that when running as a windows service MT will
load the log4net config file from the app directory and not a Windows
system folder
|
C#
|
apache-2.0
|
vebin/MassTransit,abombss/MassTransit,ccellar/MassTransit,lahma/MassTransit,abombss/MassTransit,petedavis/MassTransit,ccellar/MassTransit,lahma/MassTransit,D3-LucaPiombino/MassTransit,abombss/MassTransit,ccellar/MassTransit,lahma/MassTransit,jsmale/MassTransit,lahma/MassTransit,ccellar/MassTransit,petedavis/MassTransit,vebin/MassTransit,lahma/MassTransit
|
512edcd02ebfad7e37e49f805325df1687077aff
|
src/StraightSql/IReader.cs
|
src/StraightSql/IReader.cs
|
namespace StraightSql
{
using System;
using System.Data.Common;
public interface IReader
{
Object Read(DbDataReader reader);
Type Type { get; }
}
}
|
namespace StraightSql
{
using System;
using System.Data.Common;
public interface IReader
{
Type Type { get; }
Object Read(DbDataReader reader);
}
}
|
Sort properties vs. methods; whitespace.
|
Sort properties vs. methods; whitespace.
|
C#
|
mit
|
brendanjbaker/StraightSQL
|
99bb4548db7755c4f3982948147b8f9b66d133c3
|
src/Firehose.Web/Authors/ShaneONeill.cs
|
src/Firehose.Web/Authors/ShaneONeill.cs
|
public class ShaneONeill : IAmACommunityMember, IFilterMyBlogPosts
{
public string FirstName => "Shane";
public string LastName => "O'Neill";
public string ShortBioOrTagLine => "DBA. Food, Coffee, Whiskey (not necessarily in that order)... ";
public string StateOrRegion => "Ireland";
public string EmailAddress => string.Empty;
public string TwitterHandle => "SOZDBA";
public string GravatarHash => "0440d5d8f1b51b4765e3d48aec441510";
public string GitHubHandle => "shaneis";
public GeoPosition Position => new GeoPosition(53.2707, 9.0568);
public Uri WebSite => new Uri("https://nocolumnname.blog/");
public IEnumerable<Uri> FeedUris { get { yield return new Uri("https://nocolumnname.blog/feed/"); } }
public bool Filter(SyndicationItem item)
{
// This filters out only the posts that have the "PowerShell" category
return item.Categories.Any(c => c.Name.ToLowerInvariant().Equals("powershell"));
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel.Syndication;
using System.Web;
using Firehose.Web.Infrastructure;
namespace Firehose.Web.Authors
{
public class ShaneONeill : IAmACommunityMember, IFilterMyBlogPosts
{
public string FirstName => "Shane";
public string LastName => "O'Neill";
public string ShortBioOrTagLine => "DBA. Food, Coffee, Whiskey (not necessarily in that order)... ";
public string StateOrRegion => "Ireland";
public string EmailAddress => string.Empty;
public string TwitterHandle => "SOZDBA";
public string GravatarHash => "0440d5d8f1b51b4765e3d48aec441510";
public string GitHubHandle => "shaneis";
public GeoPosition Position => new GeoPosition(53.2707, 9.0568);
public Uri WebSite => new Uri("https://nocolumnname.blog/");
public IEnumerable<Uri> FeedUris { get { yield return new Uri("https://nocolumnname.blog/feed/"); } }
public bool Filter(SyndicationItem item)
{
// This filters out only the posts that have the "PowerShell" category
return item.Categories.Any(c => c.Name.ToLowerInvariant().Equals("powershell"));
}
}
}
|
Add using lines and namespaces
|
Add using lines and namespaces
|
C#
|
mit
|
planetpowershell/planetpowershell,planetpowershell/planetpowershell,planetpowershell/planetpowershell,planetpowershell/planetpowershell
|
658c29cebcc454886451da9528a58408b0cee1c3
|
Log4NetlyTesting/Program.cs
|
Log4NetlyTesting/Program.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using log4net;
namespace Log4NetlyTesting {
class Program {
static void Main(string[] args) {
log4net.Config.XmlConfigurator.Configure();
var logger = LogManager.GetLogger(typeof(Program));
////logger.Info("I know he can get the job, but can he do the job?");
////logger.Debug("I'm not arguing that with you.");
////logger.Warn("Be careful!");
logger.Error("Have you used a computer before?", new FieldAccessException("You can't access this field.", new AggregateException("You can't aggregate this!")));
try {
var hi = 1/int.Parse("0");
} catch (Exception ex) {
logger.Error("I'm afraid I can't do that.", ex);
}
////logger.Fatal("That's it. It's over.");
Console.ReadKey();
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using log4net;
using log4net.Core;
namespace Log4NetlyTesting {
class Program {
static void Main(string[] args) {
log4net.Config.XmlConfigurator.Configure();
var logger = LogManager.GetLogger(typeof(Program));
////logger.Info("I know he can get the job, but can he do the job?");
////logger.Debug("I'm not arguing that with you.");
////logger.Warn("Be careful!");
logger.Error("Have you used a computer before?", new FieldAccessException("You can't access this field.", new AggregateException("You can't aggregate this!")));
try {
var hi = 1/int.Parse("0");
} catch (Exception ex) {
logger.Error("I'm afraid I can't do that.", ex);
}
var loggingEvent = new LoggingEvent(typeof(LogManager), logger.Logger.Repository, logger.Logger.Name, Level.Fatal, "Fatal properties, here.", new IndexOutOfRangeException());
loggingEvent.Properties["Foo"] = "Bar";
loggingEvent.Properties["Han"] = "Solo";
loggingEvent.Properties["Two Words"] = "Three words here";
logger.Logger.Log(loggingEvent);
Console.ReadKey();
}
}
}
|
Add test for new properties feature.
|
Add test for new properties feature.
|
C#
|
mit
|
jonfreeland/Log4Netly
|
0a43e54dfc5d605d45f55cc1327cb95056fdc262
|
osu.Game/Online/Rooms/JoinRoomRequest.cs
|
osu.Game/Online/Rooms/JoinRoomRequest.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Net.Http;
using osu.Framework.IO.Network;
using osu.Game.Online.API;
namespace osu.Game.Online.Rooms
{
public class JoinRoomRequest : APIRequest
{
public readonly Room Room;
public readonly string Password;
public JoinRoomRequest(Room room, string password)
{
Room = room;
Password = password;
}
protected override WebRequest CreateWebRequest()
{
var req = base.CreateWebRequest();
req.Method = HttpMethod.Put;
if (!string.IsNullOrEmpty(Password))
req.AddParameter("password", Password);
return req;
}
protected override string Target => $"rooms/{Room.RoomID.Value}/users/{User.Id}";
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Net.Http;
using osu.Framework.IO.Network;
using osu.Game.Online.API;
namespace osu.Game.Online.Rooms
{
public class JoinRoomRequest : APIRequest
{
public readonly Room Room;
public readonly string Password;
public JoinRoomRequest(Room room, string password)
{
Room = room;
Password = password;
}
protected override WebRequest CreateWebRequest()
{
var req = base.CreateWebRequest();
req.Method = HttpMethod.Put;
return req;
}
// Todo: Password needs to be specified here rather than via AddParameter() because this is a PUT request. May be a framework bug.
protected override string Target => $"rooms/{Room.RoomID.Value}/users/{User.Id}?password={Password}";
}
}
|
Fix request failing due to parameters
|
Fix request failing due to parameters
|
C#
|
mit
|
peppy/osu,ppy/osu,smoogipoo/osu,peppy/osu,smoogipoo/osu,NeoAdonis/osu,ppy/osu,peppy/osu,UselessToucan/osu,UselessToucan/osu,UselessToucan/osu,NeoAdonis/osu,ppy/osu,smoogipoo/osu,smoogipooo/osu,NeoAdonis/osu,peppy/osu-new
|
1e5eb4209dcd39b10a4eb12d604dedf6340d616d
|
src/Core/Vipr/Program.cs
|
src/Core/Vipr/Program.cs
|
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Text;
using System.Xml.Linq;
using Vipr.Core;
namespace Vipr
{
internal class Program
{
private static void Main(string[] args)
{
var bootstrapper = new Bootstrapper();
bootstrapper.Start(args);
}
}
}
|
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System.Collections.Generic;
using System.IO;
namespace Vipr
{
internal class Program
{
private static void Main(string[] args)
{
var bootstrapper = new Bootstrapper();
bootstrapper.Start(args);
}
}
}
|
Enable automatic versioning and Nuget packaging of shippable Vipr binaries
|
Enable automatic versioning and Nuget packaging of shippable Vipr binaries
|
C#
|
mit
|
tonycrider/Vipr,Microsoft/Vipr,MSOpenTech/Vipr,ysanghi/Vipr,tonycrider/Vipr,v-am/Vipr
|
bebd093f709be5ff2e413a76f94ebad216e2a4cd
|
src/Sitecore.FakeDb/Data/Engines/DataCommands/CreateItemCommand.cs
|
src/Sitecore.FakeDb/Data/Engines/DataCommands/CreateItemCommand.cs
|
namespace Sitecore.FakeDb.Data.Engines.DataCommands
{
using System;
using Sitecore.Data.Items;
using Sitecore.Diagnostics;
public class CreateItemCommand : Sitecore.Data.Engines.DataCommands.CreateItemCommand
{
private readonly DataStorage dataStorage;
public CreateItemCommand(DataStorage dataStorage)
{
Assert.ArgumentNotNull(dataStorage, "dataStorage");
this.dataStorage = dataStorage;
}
public DataStorage DataStorage
{
get { return this.dataStorage; }
}
protected override Sitecore.Data.Engines.DataCommands.CreateItemCommand CreateInstance()
{
throw new NotSupportedException();
}
protected override Item DoExecute()
{
var item = new DbItem(this.ItemName, this.ItemId, this.TemplateId) { ParentID = this.Destination.ID };
this.dataStorage.AddFakeItem(item);
item.VersionsCount.Clear();
return this.dataStorage.GetSitecoreItem(this.ItemId);
}
}
}
|
namespace Sitecore.FakeDb.Data.Engines.DataCommands
{
using System;
using Sitecore.Data.Items;
using Sitecore.Diagnostics;
using Sitecore.Globalization;
public class CreateItemCommand : Sitecore.Data.Engines.DataCommands.CreateItemCommand
{
private readonly DataStorage dataStorage;
public CreateItemCommand(DataStorage dataStorage)
{
Assert.ArgumentNotNull(dataStorage, "dataStorage");
this.dataStorage = dataStorage;
}
public DataStorage DataStorage
{
get { return this.dataStorage; }
}
protected override Sitecore.Data.Engines.DataCommands.CreateItemCommand CreateInstance()
{
throw new NotSupportedException();
}
protected override Item DoExecute()
{
var item = new DbItem(this.ItemName, this.ItemId, this.TemplateId) { ParentID = this.Destination.ID };
this.dataStorage.AddFakeItem(item);
item.RemoveVersion(Language.Current.Name);
return this.dataStorage.GetSitecoreItem(this.ItemId);
}
}
}
|
Use the RemoveVersion method to clean up the unnecessary first version
|
Use the RemoveVersion method to clean up the unnecessary first version
|
C#
|
mit
|
hermanussen/Sitecore.FakeDb,sergeyshushlyapin/Sitecore.FakeDb,pveller/Sitecore.FakeDb
|
820a672940b151a43b54f510dc03b8476bd95ce9
|
osu.Game/Rulesets/Mods/ModUsage.cs
|
osu.Game/Rulesets/Mods/ModUsage.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
namespace osu.Game.Rulesets.Mods
{
/// <summary>
/// The usage of this mod to determine its playability.
/// </summary>
public enum ModUsage
{
/// <summary>
/// In a solo gameplay session.
/// </summary>
User,
/// <summary>
/// In a multiplayer match, as a required mod.
/// </summary>
MultiplayerRequired,
/// <summary>
/// In a multiplayer match, as a "free" mod.
/// </summary>
MultiplayerFree,
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
namespace osu.Game.Rulesets.Mods
{
/// <summary>
/// The usage of this mod to determine whether it's playable in such context.
/// </summary>
public enum ModUsage
{
/// <summary>
/// Used for a per-user gameplay session. Determines whether the mod is playable by an end user.
/// </summary>
User,
/// <summary>
/// Used as a "required mod" for a multiplayer match.
/// </summary>
MultiplayerRequired,
/// <summary>
/// Used as a "free mod" for a multiplayer match.
/// </summary>
MultiplayerFree,
}
}
|
Reword xmldoc to make more sense
|
Reword xmldoc to make more sense
|
C#
|
mit
|
NeoAdonis/osu,ppy/osu,peppy/osu,ppy/osu,NeoAdonis/osu,NeoAdonis/osu,peppy/osu,ppy/osu,peppy/osu
|
eed07096f6b39c7e6948543a092ed9f1f387f0b3
|
Refit/RequestBuilder.cs
|
Refit/RequestBuilder.cs
|
using System;
using System.Collections.Generic;
using System.Net.Http;
namespace Refit
{
public interface IRequestBuilder
{
IEnumerable<string> InterfaceHttpMethods { get; }
Func<object[], HttpRequestMessage> BuildRequestFactoryForMethod(string methodName, string basePath = "");
Func<HttpClient, object[], object> BuildRestResultFuncForMethod(string methodName);
}
interface IRequestBuilderFactory
{
IRequestBuilder Create(Type interfaceType, RefitSettings settings);
}
public static class RequestBuilder
{
static readonly IRequestBuilderFactory platformRequestBuilderFactory = new RequestBuilderFactory();
public static IRequestBuilder ForType(Type interfaceType, RefitSettings settings)
{
return platformRequestBuilderFactory.Create(interfaceType, settings);
}
public static IRequestBuilder ForType(Type interfaceType)
{
return platformRequestBuilderFactory.Create(interfaceType, null);
}
public static IRequestBuilder ForType<T>(RefitSettings settings)
{
return ForType(typeof(T), settings);
}
public static IRequestBuilder ForType<T>()
{
return ForType(typeof(T), null);
}
}
#if PORTABLE
class RequestBuilderFactory : IRequestBuilderFactory
{
public IRequestBuilder Create(Type interfaceType, RefitSettings settings = null)
{
throw new NotImplementedException("You've somehow included the PCL version of Refit in your app. You need to use the platform-specific version!");
}
}
#endif
}
|
using System;
using System.Collections.Generic;
using System.Net.Http;
namespace Refit
{
public interface IRequestBuilder
{
IEnumerable<string> InterfaceHttpMethods { get; }
Func<HttpClient, object[], object> BuildRestResultFuncForMethod(string methodName);
}
interface IRequestBuilderFactory
{
IRequestBuilder Create(Type interfaceType, RefitSettings settings);
}
public static class RequestBuilder
{
static readonly IRequestBuilderFactory platformRequestBuilderFactory = new RequestBuilderFactory();
public static IRequestBuilder ForType(Type interfaceType, RefitSettings settings)
{
return platformRequestBuilderFactory.Create(interfaceType, settings);
}
public static IRequestBuilder ForType(Type interfaceType)
{
return platformRequestBuilderFactory.Create(interfaceType, null);
}
public static IRequestBuilder ForType<T>(RefitSettings settings)
{
return ForType(typeof(T), settings);
}
public static IRequestBuilder ForType<T>()
{
return ForType(typeof(T), null);
}
}
#if PORTABLE
class RequestBuilderFactory : IRequestBuilderFactory
{
public IRequestBuilder Create(Type interfaceType, RefitSettings settings = null)
{
throw new NotImplementedException("You've somehow included the PCL version of Refit in your app. You need to use the platform-specific version!");
}
}
#endif
}
|
Remove method from interface because it's only useful for testing. Generates incorrect results if not used right
|
Remove method from interface because it's only useful for testing. Generates incorrect results if not used right
|
C#
|
mit
|
PKRoma/refit,onovotny/refit,mteper/refit,PureWeen/refit,jlucansky/refit,ammachado/refit,jlucansky/refit,mteper/refit,onovotny/refit,PureWeen/refit,paulcbetts/refit,paulcbetts/refit,ammachado/refit
|
c0d207f2286b15034254e2214a9807fb14c26700
|
src/Orchard.Web/Modules/Lucene/Models/LuceneSearchHit.cs
|
src/Orchard.Web/Modules/Lucene/Models/LuceneSearchHit.cs
|
using System;
using Lucene.Net.Documents;
using Orchard.Indexing;
namespace Lucene.Models {
public class LuceneSearchHit : ISearchHit {
private readonly Document _doc;
private readonly float _score;
public float Score { get { return _score; } }
public LuceneSearchHit(Document document, float score) {
_doc = document;
_score = score;
}
public int ContentItemId { get { return int.Parse(GetString("id")); } }
public int GetInt(string name) {
var field = _doc.GetField(name);
return field == null ? 0 : Int32.Parse(field.StringValue);
}
public double GetDouble(string name) {
var field = _doc.GetField(name);
return field == null ? 0 : double.Parse(field.StringValue);
}
public bool GetBoolean(string name) {
return GetInt(name) > 0;
}
public string GetString(string name) {
var field = _doc.GetField(name);
return field == null ? null : field.StringValue;
}
public DateTime GetDateTime(string name) {
var field = _doc.GetField(name);
return field == null ? DateTime.MinValue : DateTools.StringToDate(field.StringValue);
}
}
}
|
using System;
using Lucene.Net.Documents;
using Orchard.Indexing;
namespace Lucene.Models {
public class LuceneSearchHit : ISearchHit {
private readonly Document _doc;
private readonly float _score;
public float Score { get { return _score; } }
public LuceneSearchHit(Document document, float score) {
_doc = document;
_score = score;
}
public int ContentItemId { get { return GetInt("id"); } }
public int GetInt(string name) {
var field = _doc.GetField(name);
return field == null ? 0 : Int32.Parse(field.StringValue);
}
public double GetDouble(string name) {
var field = _doc.GetField(name);
return field == null ? 0 : double.Parse(field.StringValue);
}
public bool GetBoolean(string name) {
return GetInt(name) > 0;
}
public string GetString(string name) {
var field = _doc.GetField(name);
return field == null ? null : field.StringValue;
}
public DateTime GetDateTime(string name) {
var field = _doc.GetField(name);
return field == null ? DateTime.MinValue : DateTools.StringToDate(field.StringValue);
}
}
}
|
Fix potential NRE in lucene index
|
Fix potential NRE in lucene index
|
C#
|
bsd-3-clause
|
jimasp/Orchard,jersiovic/Orchard,LaserSrl/Orchard,abhishekluv/Orchard,ehe888/Orchard,yersans/Orchard,omidnasri/Orchard,Codinlab/Orchard,LaserSrl/Orchard,hbulzy/Orchard,Lombiq/Orchard,jersiovic/Orchard,Dolphinsimon/Orchard,Codinlab/Orchard,hannan-azam/Orchard,tobydodds/folklife,jimasp/Orchard,rtpHarry/Orchard,jtkech/Orchard,SouleDesigns/SouleDesigns.Orchard,hbulzy/Orchard,mvarblow/Orchard,grapto/Orchard.CloudBust,Dolphinsimon/Orchard,jimasp/Orchard,omidnasri/Orchard,Praggie/Orchard,li0803/Orchard,Praggie/Orchard,grapto/Orchard.CloudBust,tobydodds/folklife,grapto/Orchard.CloudBust,vairam-svs/Orchard,hannan-azam/Orchard,sfmskywalker/Orchard,li0803/Orchard,abhishekluv/Orchard,bedegaming-aleksej/Orchard,Fogolan/OrchardForWork,yersans/Orchard,jimasp/Orchard,omidnasri/Orchard,LaserSrl/Orchard,jersiovic/Orchard,jtkech/Orchard,Fogolan/OrchardForWork,IDeliverable/Orchard,sfmskywalker/Orchard,rtpHarry/Orchard,OrchardCMS/Orchard,xkproject/Orchard,xkproject/Orchard,abhishekluv/Orchard,jimasp/Orchard,jtkech/Orchard,jchenga/Orchard,Fogolan/OrchardForWork,OrchardCMS/Orchard,vairam-svs/Orchard,Dolphinsimon/Orchard,mvarblow/Orchard,gcsuk/Orchard,Praggie/Orchard,rtpHarry/Orchard,yersans/Orchard,AdvantageCS/Orchard,OrchardCMS/Orchard,AdvantageCS/Orchard,xkproject/Orchard,rtpHarry/Orchard,hannan-azam/Orchard,omidnasri/Orchard,omidnasri/Orchard,li0803/Orchard,LaserSrl/Orchard,bedegaming-aleksej/Orchard,mvarblow/Orchard,vairam-svs/Orchard,gcsuk/Orchard,jersiovic/Orchard,aaronamm/Orchard,mvarblow/Orchard,bedegaming-aleksej/Orchard,jchenga/Orchard,grapto/Orchard.CloudBust,hbulzy/Orchard,Lombiq/Orchard,li0803/Orchard,sfmskywalker/Orchard,aaronamm/Orchard,Lombiq/Orchard,aaronamm/Orchard,hbulzy/Orchard,omidnasri/Orchard,grapto/Orchard.CloudBust,Codinlab/Orchard,jtkech/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,fassetar/Orchard,Dolphinsimon/Orchard,hannan-azam/Orchard,Serlead/Orchard,ehe888/Orchard,yersans/Orchard,Dolphinsimon/Orchard,Lombiq/Orchard,vairam-svs/Orchard,brownjordaninternational/OrchardCMS,sfmskywalker/Orchard,fassetar/Orchard,IDeliverable/Orchard,abhishekluv/Orchard,omidnasri/Orchard,sfmskywalker/Orchard,li0803/Orchard,mvarblow/Orchard,gcsuk/Orchard,brownjordaninternational/OrchardCMS,SouleDesigns/SouleDesigns.Orchard,Codinlab/Orchard,brownjordaninternational/OrchardCMS,abhishekluv/Orchard,sfmskywalker/Orchard,vairam-svs/Orchard,aaronamm/Orchard,SouleDesigns/SouleDesigns.Orchard,gcsuk/Orchard,tobydodds/folklife,grapto/Orchard.CloudBust,tobydodds/folklife,aaronamm/Orchard,ehe888/Orchard,rtpHarry/Orchard,sfmskywalker/Orchard,jersiovic/Orchard,Serlead/Orchard,Praggie/Orchard,hbulzy/Orchard,IDeliverable/Orchard,Serlead/Orchard,Serlead/Orchard,IDeliverable/Orchard,omidnasri/Orchard,brownjordaninternational/OrchardCMS,SouleDesigns/SouleDesigns.Orchard,abhishekluv/Orchard,AdvantageCS/Orchard,Fogolan/OrchardForWork,IDeliverable/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,OrchardCMS/Orchard,Serlead/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,bedegaming-aleksej/Orchard,xkproject/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,dmitry-urenev/extended-orchard-cms-v10.1,jchenga/Orchard,ehe888/Orchard,ehe888/Orchard,AdvantageCS/Orchard,tobydodds/folklife,xkproject/Orchard,AdvantageCS/Orchard,OrchardCMS/Orchard,fassetar/Orchard,jtkech/Orchard,bedegaming-aleksej/Orchard,Praggie/Orchard,Fogolan/OrchardForWork,brownjordaninternational/OrchardCMS,tobydodds/folklife,yersans/Orchard,gcsuk/Orchard,fassetar/Orchard,Lombiq/Orchard,jchenga/Orchard,Codinlab/Orchard,sfmskywalker/Orchard,SouleDesigns/SouleDesigns.Orchard,LaserSrl/Orchard,jchenga/Orchard,omidnasri/Orchard,hannan-azam/Orchard,fassetar/Orchard
|
f83c5fa81d8f5291e0c3d75b37e65a35ec8b2a8a
|
osu.Game.Rulesets.Taiko/Objects/BarLine.cs
|
osu.Game.Rulesets.Taiko/Objects/BarLine.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Objects;
namespace osu.Game.Rulesets.Taiko.Objects
{
public class BarLine : TaikoHitObject, IBarLine
{
public bool Major { get; set; }
public override Judgement CreateJudgement() => new IgnoreJudgement();
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Bindables;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Objects;
namespace osu.Game.Rulesets.Taiko.Objects
{
public class BarLine : TaikoHitObject, IBarLine
{
public bool Major
{
get => MajorBindable.Value;
set => MajorBindable.Value = value;
}
public readonly Bindable<bool> MajorBindable = new BindableBool();
public override Judgement CreateJudgement() => new IgnoreJudgement();
}
}
|
Add backing bindable for major field
|
Add backing bindable for major field
|
C#
|
mit
|
smoogipoo/osu,UselessToucan/osu,NeoAdonis/osu,peppy/osu-new,peppy/osu,NeoAdonis/osu,UselessToucan/osu,smoogipoo/osu,ppy/osu,smoogipoo/osu,ppy/osu,peppy/osu,UselessToucan/osu,ppy/osu,smoogipooo/osu,NeoAdonis/osu,peppy/osu
|
a5b0307cfb472342bb56a08548b8245d7a8604be
|
osu.Game/Skinning/LegacyAccuracyCounter.cs
|
osu.Game/Skinning/LegacyAccuracyCounter.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osu.Game.Screens.Play;
using osu.Game.Screens.Play.HUD;
using osuTK;
namespace osu.Game.Skinning
{
public class LegacyAccuracyCounter : PercentageCounter, IAccuracyCounter
{
private readonly ISkin skin;
public LegacyAccuracyCounter(ISkin skin)
{
Anchor = Anchor.TopRight;
Origin = Anchor.TopRight;
Scale = new Vector2(0.6f);
Margin = new MarginPadding(10);
this.skin = skin;
}
[Resolved(canBeNull: true)]
private HUDOverlay hud { get; set; }
protected sealed override OsuSpriteText CreateSpriteText() => (OsuSpriteText)skin?.GetDrawableComponent(new HUDSkinComponent(HUDSkinComponents.ScoreText));
protected override void Update()
{
base.Update();
if (hud?.ScoreCounter.Drawable is LegacyScoreCounter score)
{
// for now align with the score counter. eventually this will be user customisable.
Y = Parent.ToLocalSpace(score.ScreenSpaceDrawQuad.BottomRight).Y;
}
}
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osu.Game.Screens.Play;
using osu.Game.Screens.Play.HUD;
using osuTK;
namespace osu.Game.Skinning
{
public class LegacyAccuracyCounter : PercentageCounter, IAccuracyCounter
{
private readonly ISkin skin;
public LegacyAccuracyCounter(ISkin skin)
{
Anchor = Anchor.TopRight;
Origin = Anchor.TopRight;
Scale = new Vector2(0.6f);
Margin = new MarginPadding(10);
this.skin = skin;
}
[Resolved(canBeNull: true)]
private HUDOverlay hud { get; set; }
protected sealed override OsuSpriteText CreateSpriteText()
=> (OsuSpriteText)skin?.GetDrawableComponent(new HUDSkinComponent(HUDSkinComponents.ScoreText))
?.With(s => s.Anchor = s.Origin = Anchor.TopRight);
protected override void Update()
{
base.Update();
if (hud?.ScoreCounter.Drawable is LegacyScoreCounter score)
{
// for now align with the score counter. eventually this will be user customisable.
Y = Parent.ToLocalSpace(score.ScreenSpaceDrawQuad.BottomRight).Y;
}
}
}
}
|
Apply same fix to legacy accuracy counter
|
Apply same fix to legacy accuracy counter
|
C#
|
mit
|
UselessToucan/osu,NeoAdonis/osu,ppy/osu,UselessToucan/osu,NeoAdonis/osu,peppy/osu,peppy/osu,smoogipooo/osu,smoogipoo/osu,NeoAdonis/osu,smoogipoo/osu,peppy/osu,peppy/osu-new,UselessToucan/osu,ppy/osu,smoogipoo/osu,ppy/osu
|
e22f4409099619194187dd1b4e8688443fee1f4d
|
Assets/Scripts/Player.cs
|
Assets/Scripts/Player.cs
|
using UnityEngine;
using System.Collections;
public class Player : MonoBehaviour {
// Movement speed, can be set in the editor
public float speed = 1.0f;
// Player (camera) rotation
private Vector3 playerRotation = new Vector3 (35, 0, 0);
// Player (camera) height
private float playerHeight = 5.0f;
void Start () {
// Setup the player camera
Camera camera = gameObject.AddComponent<Camera> ();
}
void Update () {
float horizontalMovement = Input.GetAxis ("Horizontal");
float verticalMovement = Input.GetAxis ("Vertical");
float rotationMovement = 0.0f;
// Handle camera rotation
if (Input.GetKey (KeyCode.Q)) {
rotationMovement = -1.0f;
} else if (Input.GetKey (KeyCode.E)) {
rotationMovement = 1.0f;
}
playerRotation.y += rotationMovement * (speed / 2);
// Handle movement on the terrain
Vector3 movement = new Vector3 (horizontalMovement, 0.0f, verticalMovement);
GetComponent<Rigidbody>().velocity = movement * speed;
// Keep position with a variable height
transform.position = new Vector3 (transform.position.x, playerHeight, transform.position.z);
// Set player rotation
transform.rotation = Quaternion.Euler (playerRotation);
}
}
|
using UnityEngine;
using System.Collections;
public class Player : MonoBehaviour {
// Movement speed, can be set in the editor
public float speed = 1.0f;
// Player (camera) rotation
private Vector3 playerRotation = new Vector3 (35, 0, 0);
// Player (camera) height
private float playerHeight = 5.0f;
void Start () {
// Setup the player camera
Camera camera = gameObject.AddComponent<Camera> ();
// This is probably stupid to do
gameObject.tag = "MainCamera";
}
void Update () {
float horizontalMovement = Input.GetAxis ("Horizontal");
float verticalMovement = Input.GetAxis ("Vertical");
float rotationMovement = 0.0f;
// Handle camera rotation
if (Input.GetKey (KeyCode.Q)) {
rotationMovement = -1.0f;
} else if (Input.GetKey (KeyCode.E)) {
rotationMovement = 1.0f;
}
playerRotation.y += rotationMovement * (speed / 2);
// Calculate movement velocity
Vector3 velocityVertical = transform.forward * speed * verticalMovement;
Vector3 velocityHorizontal = transform.right * speed * horizontalMovement;
Vector3 calculatedVelocity = velocityHorizontal + velocityVertical;
calculatedVelocity.y = 0.0f;
// Apply calculated velocity
GetComponent<Rigidbody>().velocity = calculatedVelocity;
// Keep position with a variable height
transform.position = new Vector3 (transform.position.x, playerHeight, transform.position.z);
// Set player rotation
transform.rotation = Quaternion.Euler (playerRotation);
}
}
|
Apply velocity based on rotational value
|
Apply velocity based on rotational value
|
C#
|
mit
|
bastuijnman/open-park
|
4e5ddea40188ffb027c392ed139eeb412c354631
|
src/Features/LanguageServer/Protocol/Handler/Initialize/InitializeHandler.cs
|
src/Features/LanguageServer/Protocol/Handler/Initialize/InitializeHandler.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Composition;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.VisualStudio.LanguageServer.Protocol;
namespace Microsoft.CodeAnalysis.LanguageServer.Handler
{
[Shared]
[ExportLspMethod(Methods.InitializeName)]
internal class InitializeHandler : IRequestHandler<InitializeParams, InitializeResult>
{
private static readonly InitializeResult s_initializeResult = new InitializeResult
{
Capabilities = new ServerCapabilities
{
DefinitionProvider = true,
ImplementationProvider = true,
CompletionProvider = new CompletionOptions { ResolveProvider = true, TriggerCharacters = new[] { "." } },
SignatureHelpProvider = new SignatureHelpOptions { TriggerCharacters = new[] { "(", "," } },
DocumentSymbolProvider = true,
WorkspaceSymbolProvider = true,
DocumentFormattingProvider = true,
DocumentRangeFormattingProvider = true,
DocumentOnTypeFormattingProvider = new DocumentOnTypeFormattingOptions { FirstTriggerCharacter = "}", MoreTriggerCharacter = new[] { ";", "\n" } },
DocumentHighlightProvider = true,
}
};
public Task<InitializeResult> HandleRequestAsync(Solution solution, InitializeParams request, ClientCapabilities clientCapabilities, CancellationToken cancellationToken)
=> Task.FromResult(s_initializeResult);
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Composition;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.VisualStudio.LanguageServer.Protocol;
namespace Microsoft.CodeAnalysis.LanguageServer.Handler
{
[Shared]
[ExportLspMethod(Methods.InitializeName)]
internal class InitializeHandler : IRequestHandler<InitializeParams, InitializeResult>
{
private static readonly InitializeResult s_initializeResult = new InitializeResult
{
Capabilities = new ServerCapabilities
{
DefinitionProvider = true,
ImplementationProvider = true,
CompletionProvider = new CompletionOptions { ResolveProvider = true, TriggerCharacters = new[] { ".", " ", "#", "<", ">", "\"", ":", "[", "(", "~" } },
SignatureHelpProvider = new SignatureHelpOptions { TriggerCharacters = new[] { "(", "," } },
DocumentSymbolProvider = true,
WorkspaceSymbolProvider = true,
DocumentFormattingProvider = true,
DocumentRangeFormattingProvider = true,
DocumentOnTypeFormattingProvider = new DocumentOnTypeFormattingOptions { FirstTriggerCharacter = "}", MoreTriggerCharacter = new[] { ";", "\n" } },
DocumentHighlightProvider = true,
}
};
public Task<InitializeResult> HandleRequestAsync(Solution solution, InitializeParams request, ClientCapabilities clientCapabilities, CancellationToken cancellationToken)
=> Task.FromResult(s_initializeResult);
}
}
|
Update completion triggers in LSP to better match local completion.
|
Update completion triggers in LSP to better match local completion.
|
C#
|
mit
|
physhi/roslyn,jasonmalinowski/roslyn,bartdesmet/roslyn,ErikSchierboom/roslyn,shyamnamboodiripad/roslyn,AmadeusW/roslyn,wvdd007/roslyn,genlu/roslyn,aelij/roslyn,bartdesmet/roslyn,AmadeusW/roslyn,AlekseyTs/roslyn,stephentoub/roslyn,genlu/roslyn,weltkante/roslyn,bartdesmet/roslyn,sharwell/roslyn,diryboy/roslyn,gafter/roslyn,reaction1989/roslyn,mgoertz-msft/roslyn,brettfo/roslyn,wvdd007/roslyn,ErikSchierboom/roslyn,dotnet/roslyn,mavasani/roslyn,CyrusNajmabadi/roslyn,davkean/roslyn,panopticoncentral/roslyn,KevinRansom/roslyn,eriawan/roslyn,brettfo/roslyn,heejaechang/roslyn,physhi/roslyn,panopticoncentral/roslyn,dotnet/roslyn,tmat/roslyn,AmadeusW/roslyn,brettfo/roslyn,tmat/roslyn,tmat/roslyn,jmarolf/roslyn,jmarolf/roslyn,AlekseyTs/roslyn,sharwell/roslyn,davkean/roslyn,physhi/roslyn,heejaechang/roslyn,gafter/roslyn,aelij/roslyn,stephentoub/roslyn,tannergooding/roslyn,KevinRansom/roslyn,KirillOsenkov/roslyn,KirillOsenkov/roslyn,CyrusNajmabadi/roslyn,weltkante/roslyn,mgoertz-msft/roslyn,CyrusNajmabadi/roslyn,weltkante/roslyn,reaction1989/roslyn,tannergooding/roslyn,diryboy/roslyn,wvdd007/roslyn,shyamnamboodiripad/roslyn,jasonmalinowski/roslyn,heejaechang/roslyn,stephentoub/roslyn,mavasani/roslyn,ErikSchierboom/roslyn,jmarolf/roslyn,KevinRansom/roslyn,genlu/roslyn,KirillOsenkov/roslyn,davkean/roslyn,jasonmalinowski/roslyn,gafter/roslyn,eriawan/roslyn,diryboy/roslyn,sharwell/roslyn,dotnet/roslyn,shyamnamboodiripad/roslyn,eriawan/roslyn,reaction1989/roslyn,tannergooding/roslyn,mgoertz-msft/roslyn,panopticoncentral/roslyn,AlekseyTs/roslyn,aelij/roslyn,mavasani/roslyn
|
baf0fb2f836cefb149f44598096c8d41dacf3d9b
|
tests/Bugsnag.Tests/BreadcrumbsTests.cs
|
tests/Bugsnag.Tests/BreadcrumbsTests.cs
|
using System.Linq;
using Xunit;
namespace Bugsnag.Tests
{
public class BreadcrumbsTests
{
[Fact]
public void RestrictsMaxNumberOfBreadcrumbs()
{
var breadcrumbs = new Breadcrumbs(new Configuration { MaximumBreadcrumbs = 25 });
for (int i = 0; i < 30; i++)
{
breadcrumbs.Leave($"{i}");
}
Assert.Equal(25, breadcrumbs.Retrieve().Count());
}
[Fact]
public void WhenRetrievingBreadcrumbsCorrectNumberIsReturned()
{
var breadcrumbs = new Breadcrumbs(new Configuration { MaximumBreadcrumbs = 25 });
for (int i = 0; i < 10; i++)
{
breadcrumbs.Leave($"{i}");
}
Assert.Equal(10, breadcrumbs.Retrieve().Count());
}
[Fact]
public void CorrectBreadcrumbsAreReturned()
{
var breadcrumbs = new Breadcrumbs(new Configuration { MaximumBreadcrumbs = 5 });
for (int i = 0; i < 10; i++)
{
breadcrumbs.Leave($"{i}");
}
var breadcrumbNames = breadcrumbs.Retrieve().Select(b => b.Name);
Assert.Equal(new string[] { "5", "6", "7", "8", "9" }, breadcrumbNames);
}
}
}
|
using System.Linq;
using Xunit;
namespace Bugsnag.Tests
{
public class BreadcrumbsTests
{
[Fact]
public void RestrictsMaxNumberOfBreadcrumbs()
{
var breadcrumbs = new Breadcrumbs(new Configuration { MaximumBreadcrumbs = 25 });
for (int i = 0; i < 30; i++)
{
breadcrumbs.Leave($"{i}");
}
Assert.Equal(25, breadcrumbs.Retrieve().Count());
}
[Fact]
public void WhenRetrievingBreadcrumbsCorrectNumberIsReturned()
{
var breadcrumbs = new Breadcrumbs(new Configuration { MaximumBreadcrumbs = 25 });
for (int i = 0; i < 10; i++)
{
breadcrumbs.Leave($"{i}");
}
Assert.Equal(10, breadcrumbs.Retrieve().Count());
}
[Fact]
public void CorrectBreadcrumbsAreReturned()
{
var breadcrumbs = new Breadcrumbs(new Configuration { MaximumBreadcrumbs = 5 });
for (int i = 0; i < 6; i++)
{
breadcrumbs.Leave($"{i}");
}
var breadcrumbNames = breadcrumbs.Retrieve().Select(b => b.Name);
Assert.Equal(new string[] { "1", "2", "3", "4", "5" }, breadcrumbNames);
}
}
}
|
Update test to check that breadcrumbs are returned in correct order when MaximumBreadcrumbs is exceeded
|
Update test to check that breadcrumbs are returned in correct order when MaximumBreadcrumbs is exceeded
|
C#
|
mit
|
bugsnag/bugsnag-dotnet,bugsnag/bugsnag-dotnet
|
c81a158ac7cede25aed3b8152013db0e82553952
|
brewlib/Audio/AudioSample.cs
|
brewlib/Audio/AudioSample.cs
|
using ManagedBass;
using System;
using System.Diagnostics;
using System.Resources;
namespace BrewLib.Audio
{
public class AudioSample
{
private const int MaxSimultaneousPlayBacks = 8;
private string path;
public string Path => path;
private int sample;
public readonly AudioManager Manager;
internal AudioSample(AudioManager audioManager, string path, ResourceManager resourceManager)
{
Manager = audioManager;
this.path = path;
sample = Bass.SampleLoad(path, 0, 0, MaxSimultaneousPlayBacks, BassFlags.Default);
if (sample == 0)
{
Trace.WriteLine($"Failed to load audio sample ({path}): {Bass.LastError}");
return;
}
}
public void Play(float volume = 1)
{
if (sample == 0) return;
var channel = new AudioChannel(Manager, Bass.SampleGetChannel(sample), true)
{
Volume = volume,
};
Manager.RegisterChannel(channel);
channel.Playing = true;
}
#region IDisposable Support
private bool disposedValue = false;
protected virtual void Dispose(bool disposing)
{
if (!disposedValue)
{
if (disposing)
{
}
if (sample != 0)
{
Bass.SampleFree(sample);
sample = 0;
}
disposedValue = true;
}
}
~AudioSample()
{
Dispose(false);
}
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
#endregion
}
}
|
using ManagedBass;
using System;
using System.Diagnostics;
using System.Resources;
namespace BrewLib.Audio
{
public class AudioSample
{
private const int MaxSimultaneousPlayBacks = 8;
private string path;
public string Path => path;
private int sample;
public readonly AudioManager Manager;
internal AudioSample(AudioManager audioManager, string path, ResourceManager resourceManager)
{
Manager = audioManager;
this.path = path;
sample = Bass.SampleLoad(path, 0, 0, MaxSimultaneousPlayBacks, BassFlags.SampleOverrideLongestPlaying);
if (sample == 0)
{
Trace.WriteLine($"Failed to load audio sample ({path}): {Bass.LastError}");
return;
}
}
public void Play(float volume = 1)
{
if (sample == 0) return;
var channel = new AudioChannel(Manager, Bass.SampleGetChannel(sample), true)
{
Volume = volume,
};
Manager.RegisterChannel(channel);
channel.Playing = true;
}
#region IDisposable Support
private bool disposedValue = false;
protected virtual void Dispose(bool disposing)
{
if (!disposedValue)
{
if (disposing)
{
}
if (sample != 0)
{
Bass.SampleFree(sample);
sample = 0;
}
disposedValue = true;
}
}
~AudioSample()
{
Dispose(false);
}
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
#endregion
}
}
|
Use SampleOverrideLongestPlaying for audio samples.
|
Use SampleOverrideLongestPlaying for audio samples.
|
C#
|
mit
|
Damnae/storybrew
|
ab0daeccce39bd9e3abb02c0872bddfdff403bdb
|
SnippetsToMarkdown/SnippetsToMarkdown/Commands/WriteHeaderHtmlCommand.cs
|
SnippetsToMarkdown/SnippetsToMarkdown/Commands/WriteHeaderHtmlCommand.cs
|
using System.Text;
namespace SnippetsToMarkdown.Commands
{
class WriteHeaderHtmlCommand : ICommand
{
private string directory;
public WriteHeaderHtmlCommand(string directory)
{
this.directory = directory;
}
public void WriteToOutput(StringBuilder output)
{
output.AppendLine("<h3>" + directory.Substring(directory.LastIndexOf('\\') + 1) + "</h3>");
output.AppendLine("<br />");
output.AppendLine("<table>");
output.AppendLine("<thead>");
output.AppendLine("<tr>");
output.AppendLine("<td>Shortcut</td>");
output.AppendLine("<td>Name</td>");
output.AppendLine("</tr>");
output.AppendLine("</thead>");
output.AppendLine("<tbody>");
}
}
}
|
using System.Text;
namespace SnippetsToMarkdown.Commands
{
class WriteHeaderHtmlCommand : ICommand
{
private string directory;
public WriteHeaderHtmlCommand(string directory)
{
this.directory = directory;
}
public void WriteToOutput(StringBuilder output)
{
output.AppendLine("<h4>" + directory.Substring(directory.LastIndexOf('\\') + 1) + "</h4>");
output.AppendLine("<br />");
output.AppendLine("<table>");
output.AppendLine("<thead>");
output.AppendLine("<tr>");
output.AppendLine("<td>Shortcut</td>");
output.AppendLine("<td>Name</td>");
output.AppendLine("</tr>");
output.AppendLine("</thead>");
output.AppendLine("<tbody>");
}
}
}
|
Change header size in HTML generation.
|
Change header size in HTML generation.
|
C#
|
mit
|
gilles-leblanc/Sniptaculous
|
2b87997ff753d92912ebb67070f0a9dabec43b2b
|
JSNLog.aspnet5/PublicFacing/Configuration/JSNlogLogger.cs
|
JSNLog.aspnet5/PublicFacing/Configuration/JSNlogLogger.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Extensions.Logging;
using JSNLog.Infrastructure;
namespace JSNLog
{
internal class JSNlogLogger : IJSNLogLogger
{
private ILoggerFactory _loggerFactory;
public JSNlogLogger(ILoggerFactory loggerFactory)
{
_loggerFactory = loggerFactory;
}
public void Log(FinalLogData finalLogData)
{
ILogger logger = _loggerFactory.CreateLogger(finalLogData.FinalLogger);
Object message = LogMessageHelpers.DeserializeIfPossible(finalLogData.FinalMessage);
switch (finalLogData.FinalLevel)
{
case Level.TRACE: logger.LogDebug("{logMessage}", message); break;
case Level.DEBUG: logger.LogVerbose("{logMessage}", message); break;
case Level.INFO: logger.LogInformation("{logMessage}", message); break;
case Level.WARN: logger.LogWarning("{logMessage}", message); break;
case Level.ERROR: logger.LogError("{logMessage}", message); break;
case Level.FATAL: logger.LogCritical("{logMessage}", message); break;
}
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Extensions.Logging;
using JSNLog.Infrastructure;
namespace JSNLog
{
public class JSNlogLogger : IJSNLogLogger
{
private ILoggerFactory _loggerFactory;
public JSNlogLogger(ILoggerFactory loggerFactory)
{
_loggerFactory = loggerFactory;
}
public void Log(FinalLogData finalLogData)
{
ILogger logger = _loggerFactory.CreateLogger(finalLogData.FinalLogger);
Object message = LogMessageHelpers.DeserializeIfPossible(finalLogData.FinalMessage);
switch (finalLogData.FinalLevel)
{
case Level.TRACE: logger.LogDebug("{logMessage}", message); break;
case Level.DEBUG: logger.LogVerbose("{logMessage}", message); break;
case Level.INFO: logger.LogInformation("{logMessage}", message); break;
case Level.WARN: logger.LogWarning("{logMessage}", message); break;
case Level.ERROR: logger.LogError("{logMessage}", message); break;
case Level.FATAL: logger.LogCritical("{logMessage}", message); break;
}
}
}
}
|
Make JSNLogLogger available to the outside world, so it can actually be used in ASP.NET 5 apps
|
Make JSNLogLogger available to the outside world, so it can actually be used in ASP.NET 5 apps
|
C#
|
mit
|
mperdeck/jsnlog
|
ae7547bbdafdb7b3bdaae3c9386a423fd8f42ea1
|
osu.Game/Modes/Objects/Types/IHasDistance.cs
|
osu.Game/Modes/Objects/Types/IHasDistance.cs
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
namespace osu.Game.Modes.Objects.Types
{
/// <summary>
/// A HitObject that has a distance.
/// </summary>
public interface IHasDistance : IHasEndTime
{
/// <summary>
/// The distance of the HitObject.
/// </summary>
double Distance { get; }
}
}
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
namespace osu.Game.Modes.Objects.Types
{
/// <summary>
/// A HitObject that has a positional length.
/// </summary>
public interface IHasDistance : IHasEndTime
{
/// <summary>
/// The positional length of the HitObject.
/// </summary>
double Distance { get; }
}
}
|
Fix up distance -> positional length comments.
|
Fix up distance -> positional length comments.
|
C#
|
mit
|
EVAST9919/osu,ppy/osu,2yangk23/osu,DrabWeb/osu,smoogipoo/osu,NeoAdonis/osu,ppy/osu,DrabWeb/osu,peppy/osu,Damnae/osu,ZLima12/osu,NeoAdonis/osu,Nabile-Rahmani/osu,tacchinotacchi/osu,smoogipoo/osu,ZLima12/osu,smoogipoo/osu,nyaamara/osu,peppy/osu-new,2yangk23/osu,osu-RP/osu-RP,johnneijzen/osu,peppy/osu,UselessToucan/osu,smoogipooo/osu,EVAST9919/osu,ppy/osu,peppy/osu,DrabWeb/osu,naoey/osu,NeoAdonis/osu,Frontear/osuKyzer,RedNesto/osu,Drezi126/osu,naoey/osu,naoey/osu,UselessToucan/osu,johnneijzen/osu,UselessToucan/osu
|
afa5506415dc8690dbe87e59333932b20b428702
|
src/Month.cs
|
src/Month.cs
|
namespace Nvelope
{
public enum Month
{
January = 1,
February = 2,
March = 3,
April = 4,
May = 5,
June = 6,
July = 7,
August = 8,
September = 9,
October = 10,
November = 11,
December = 12
}
}
|
//-----------------------------------------------------------------------
// <copyright file="Month.cs" company="TWU">
// MIT Licenced
// </copyright>
//-----------------------------------------------------------------------
namespace Nvelope
{
using System.Diagnostics.CodeAnalysis;
/// <summary>
/// Represents a month of the year
/// </summary>
[SuppressMessage("Microsoft.Design", "CA1008:EnumsShouldHaveZeroValue",
Justification = "There's no such thing as a 'default' or 'none' month.")]
public enum Month
{
/* These doc comments are stupid, but it keeps FxCop from getting made
* and it by looking at Microsoft's docs it seems to be in line with
* their practices */
/// <summary>
/// Indicates January
/// </summary>
January = 1,
/// <summary>
/// Indicates February
/// </summary>
February = 2,
/// <summary>
/// Indicates January
/// </summary>
March = 3,
/// <summary>
/// Indicates April
/// </summary>
April = 4,
/// <summary>
/// Indicates January
/// </summary>
May = 5,
/// <summary>
/// Indicates June
/// </summary>
June = 6,
/// <summary>
/// Indicates July
/// </summary>
July = 7,
/// <summary>
/// Indicates August
/// </summary>
August = 8,
/// <summary>
/// Indicates September
/// </summary>
September = 9,
/// <summary>
/// Indicates October
/// </summary>
October = 10,
/// <summary>
/// Indicates November
/// </summary>
November = 11,
/// <summary>
/// Indicates December
/// </summary>
December = 12
}
}
|
Document and suppress an FxCop warning
|
Document and suppress an FxCop warning
|
C#
|
mit
|
badjer/Nvelope,badjer/Nvelope,TrinityWestern/Nvelope,TrinityWestern/Nvelope
|
d3269ff87fef1184535d08762bbcfe5b4c3e3b78
|
csharp/device/Microsoft.Azure.Devices.Client/AuthenticationScheme.cs
|
csharp/device/Microsoft.Azure.Devices.Client/AuthenticationScheme.cs
|
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.Azure.Devices.Client
{
public enum AuthenticationScheme
{
// Shared Access Signature
SAS = 0,
// X509 Certificate
X509 = 1
}
}
|
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.Azure.Devices.Client
{
/// <summary>
/// Specifies the Authentication Scheme used by Device Client
/// </summary>
public enum S
{
// Shared Access Signature
SAS = 0,
// X509 Certificate
X509 = 1
}
}
|
Add XML description for Authentication Scheme
|
Add XML description for Authentication Scheme
|
C#
|
mit
|
damonbarry/azure-iot-sdks-1,damonbarry/azure-iot-sdks-1,oriolpinol/azure-iot-sdks,Eclo/azure-iot-sdks,damonbarry/azure-iot-sdks-1,Eclo/azure-iot-sdks,dominicbetts/azure-iot-sdks,Eclo/azure-iot-sdks,Eclo/azure-iot-sdks,kevinledinh/azure-iot-sdks,dominicbetts/azure-iot-sdks,kevinledinh/azure-iot-sdks,kevinledinh/azure-iot-sdks,Eclo/azure-iot-sdks,kevinledinh/azure-iot-sdks,Eclo/azure-iot-sdks,oriolpinol/azure-iot-sdks,Eclo/azure-iot-sdks,kevinledinh/azure-iot-sdks,damonbarry/azure-iot-sdks-1,dominicbetts/azure-iot-sdks,kevinledinh/azure-iot-sdks,dominicbetts/azure-iot-sdks,dominicbetts/azure-iot-sdks,damonbarry/azure-iot-sdks-1,damonbarry/azure-iot-sdks-1,Eclo/azure-iot-sdks,damonbarry/azure-iot-sdks-1,oriolpinol/azure-iot-sdks,kevinledinh/azure-iot-sdks,oriolpinol/azure-iot-sdks,oriolpinol/azure-iot-sdks,kevinledinh/azure-iot-sdks,dominicbetts/azure-iot-sdks,dominicbetts/azure-iot-sdks,kevinledinh/azure-iot-sdks,Eclo/azure-iot-sdks,oriolpinol/azure-iot-sdks,damonbarry/azure-iot-sdks-1,oriolpinol/azure-iot-sdks,oriolpinol/azure-iot-sdks,dominicbetts/azure-iot-sdks
|
70d22b22ab43a31f44fa646754db7e5c2e1f2e61
|
TacoTinder/Assets/Scripts/Player.cs
|
TacoTinder/Assets/Scripts/Player.cs
|
using UnityEngine;
using System.Collections;
public class Player : MonoBehaviour {
public float baseFireCooldown;
public float baseRotationSpeed;
public God god;
// public Weapon weapon;
public Vector2 direction; // Maybe this should be private?
public Vector2 targetDirection; // This too.
// Temporary
public GameObject tempProjectile;
private float cooldownTimeStamp;
// Use this for initialization
void Start () {
}
public void Move(float horizontal, float vertical) {
targetDirection = new Vector2 (horizontal, vertical);
}
public void Fire () {
// Don't fire when the cooldown is still active.
if (this.cooldownTimeStamp >= Time.time) {
return;
}
// Fire the weapon.
// TODO
Moveable arrowMoveable = Instantiate(tempProjectile).GetComponent<Moveable> ();
arrowMoveable.direction = this.direction;
// Set the cooldown.
this.cooldownTimeStamp = Time.time + this.baseFireCooldown;
}
// Update is called once per frame
void Update () {
float angle = Vector2.Angle (direction, targetDirection);
this.transform.Rotate (targetDirection.x, angle * baseRotationSpeed * Time.deltaTime);
this.direction = new Vector2 (this.transform.TransformDirection.x, this.transform.TransformDirection.y);
}
}
|
using UnityEngine;
using System.Collections;
public class Player : MonoBehaviour {
public int playerID;
public float baseFireCooldown;
public float baseRotationSpeed;
public God god;
// public Weapon weapon;
public Vector2 direction; // Maybe this should be private?
public Vector2 targetDirection; // This too.
// Temporary
public GameObject tempProjectile;
private float cooldownTimeStamp;
// Use this for initialization
void Start () {
}
public void Move(float horizontal, float vertical) {
targetDirection = new Vector2 (horizontal, vertical);
}
public void Fire () {
// Don't fire when the cooldown is still active.
if (this.cooldownTimeStamp >= Time.time) {
return;
}
// Fire the weapon.
// TODO
Moveable arrowMoveable = Instantiate(tempProjectile).GetComponent<Moveable> ();
arrowMoveable.direction = this.direction;
// Set the cooldown.
this.cooldownTimeStamp = Time.time + this.baseFireCooldown;
}
// Update is called once per frame
void Update () {
float angle = Vector2.Angle (direction, targetDirection);
// this.transform.Rotate (targetDirection.x, angle * baseRotationSpeed * Time.deltaTime);
this.direction = new Vector2 (this.transform.TransformDirection.x , this.transform.TransformDirection.y);
}
}
|
Add playerID and revisit the moving.
|
Add playerID and revisit the moving.
|
C#
|
apache-2.0
|
TammiLion/TacoTinder
|
4beb86f674c3f90392dea27c922383c6d7784f3b
|
Junctionizer/UI/Styles/DataGridStyles.xaml.cs
|
Junctionizer/UI/Styles/DataGridStyles.xaml.cs
|
using System.Diagnostics;
using System.Windows.Controls;
using System.Windows.Input;
using Junctionizer.Model;
namespace Junctionizer.UI.Styles
{
public partial class DataGridStyles
{
private void DataGridRow_OnMouseDoubleClick(object sender, MouseButtonEventArgs e)
{
if (e.ChangedButton != MouseButton.Left) return;
var dataGridRow = sender as DataGridRow;
if (dataGridRow?.Item is GameFolder folder)
{
OpenInFileExplorer(folder);
}
else if (dataGridRow?.Item is GameFolderPair pair)
{
if (pair.SourceEntry?.IsJunction == false) OpenInFileExplorer(pair.SourceEntry);
if (pair.DestinationEntry?.IsJunction == false) OpenInFileExplorer(pair.DestinationEntry);
}
}
private static void OpenInFileExplorer(GameFolder folder)
{
var path = folder.DirectoryInfo.FullName;
ErrorHandling.ThrowIfDirectoryNotFound(path);
Process.Start(path);
}
}
}
|
using System.Diagnostics;
using System.Windows.Controls;
using System.Windows.Input;
using Junctionizer.Model;
namespace Junctionizer.UI.Styles
{
public partial class DataGridStyles
{
private void DataGridRow_OnMouseDoubleClick(object sender, MouseButtonEventArgs e)
{
if (e.ChangedButton != MouseButton.Left) return;
var dataGridRow = sender as DataGridRow;
if (dataGridRow?.Item is GameFolder folder)
{
OpenInFileExplorer(folder);
}
else if (dataGridRow?.Item is GameFolderPair pair)
{
if (pair.DestinationEntry == null || pair.SourceEntry?.IsJunction == false) OpenInFileExplorer(pair.SourceEntry);
if (pair.DestinationEntry != null) OpenInFileExplorer(pair.DestinationEntry);
}
}
private static void OpenInFileExplorer(GameFolder folder)
{
var path = folder.DirectoryInfo.FullName;
ErrorHandling.ThrowIfDirectoryNotFound(path);
Process.Start(path);
}
}
}
|
Allow double click to open on junctions when lacking a destination
|
Allow double click to open on junctions when lacking a destination
|
C#
|
mit
|
NickLargen/Junctionizer
|
54bae40f921a4433c5c7caf94ab78e0f7c3f2672
|
StackUsageAnalyzer/StackAnalysisToolWindow.cs
|
StackUsageAnalyzer/StackAnalysisToolWindow.cs
|
//------------------------------------------------------------------------------
// <copyright file="StackAnalysisToolWindow.cs" company="Microsoft">
// Copyright (c) Microsoft. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
namespace StackUsageAnalyzer
{
using System;
using System.Runtime.InteropServices;
using Microsoft.VisualStudio.Shell;
/// <summary>
/// This class implements the tool window exposed by this package and hosts a user control.
/// </summary>
/// <remarks>
/// In Visual Studio tool windows are composed of a frame (implemented by the shell) and a pane,
/// usually implemented by the package implementer.
/// <para>
/// This class derives from the ToolWindowPane class provided from the MPF in order to use its
/// implementation of the IVsUIElementPane interface.
/// </para>
/// </remarks>
[Guid("ffbd67c0-1100-4fa5-8c20-cc10264c540b")]
public class StackAnalysisToolWindow : ToolWindowPane
{
/// <summary>
/// Initializes a new instance of the <see cref="StackAnalysisToolWindow"/> class.
/// </summary>
public StackAnalysisToolWindow() : base(null)
{
this.Caption = "StackAnalysisToolWindow";
// This is the user control hosted by the tool window; Note that, even if this class implements IDisposable,
// we are not calling Dispose on this object. This is because ToolWindowPane calls Dispose on
// the object returned by the Content property.
this.Content = new StackAnalysisToolWindowControl();
}
}
}
|
//------------------------------------------------------------------------------
// <copyright file="StackAnalysisToolWindow.cs" company="Microsoft">
// Copyright (c) Microsoft. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
namespace StackUsageAnalyzer
{
using System;
using System.Runtime.InteropServices;
using Microsoft.VisualStudio.Shell;
/// <summary>
/// This class implements the tool window exposed by this package and hosts a user control.
/// </summary>
/// <remarks>
/// In Visual Studio tool windows are composed of a frame (implemented by the shell) and a pane,
/// usually implemented by the package implementer.
/// <para>
/// This class derives from the ToolWindowPane class provided from the MPF in order to use its
/// implementation of the IVsUIElementPane interface.
/// </para>
/// </remarks>
[Guid("ffbd67c0-1100-4fa5-8c20-cc10264c540b")]
public class StackAnalysisToolWindow : ToolWindowPane
{
/// <summary>
/// Initializes a new instance of the <see cref="StackAnalysisToolWindow"/> class.
/// </summary>
public StackAnalysisToolWindow() : base(null)
{
this.Caption = "Function Stack Analysis";
// This is the user control hosted by the tool window; Note that, even if this class implements IDisposable,
// we are not calling Dispose on this object. This is because ToolWindowPane calls Dispose on
// the object returned by the Content property.
this.Content = new StackAnalysisToolWindowControl();
}
}
}
|
Change caption of Tool Window
|
Change caption of Tool Window
|
C#
|
mit
|
xoriath/atmelstudio-fstack-usage
|
c3e4a08b007a00ac848f89d6a10b580bc1997032
|
Wox.Infrastructure/Logger/Log.cs
|
Wox.Infrastructure/Logger/Log.cs
|
using NLog;
namespace Wox.Infrastructure.Logger
{
public class Log
{
private static NLog.Logger logger = LogManager.GetCurrentClassLogger();
public static void Error(System.Exception e)
{
#if DEBUG
throw e;
#else
while (e.InnerException != null)
{
logger.Error(e.Message);
logger.Error(e.StackTrace);
e = e.InnerException;
}
#endif
}
public static void Debug(string msg)
{
System.Diagnostics.Debug.WriteLine($"DEBUG: {msg}");
logger.Debug(msg);
}
public static void Info(string msg)
{
System.Diagnostics.Debug.WriteLine($"INFO: {msg}");
logger.Info(msg);
}
public static void Warn(string msg)
{
System.Diagnostics.Debug.WriteLine($"WARN: {msg}");
logger.Warn(msg);
}
public static void Fatal(System.Exception e)
{
#if DEBUG
throw e;
#else
logger.Fatal(ExceptionFormatter.FormatExcpetion(e));
#endif
}
}
}
|
using NLog;
using Wox.Infrastructure.Exception;
namespace Wox.Infrastructure.Logger
{
public class Log
{
private static NLog.Logger logger = LogManager.GetCurrentClassLogger();
public static void Error(System.Exception e)
{
#if DEBUG
throw e;
#else
while (e.InnerException != null)
{
logger.Error(e.Message);
logger.Error(e.StackTrace);
e = e.InnerException;
}
#endif
}
public static void Debug(string msg)
{
System.Diagnostics.Debug.WriteLine($"DEBUG: {msg}");
logger.Debug(msg);
}
public static void Info(string msg)
{
System.Diagnostics.Debug.WriteLine($"INFO: {msg}");
logger.Info(msg);
}
public static void Warn(string msg)
{
System.Diagnostics.Debug.WriteLine($"WARN: {msg}");
logger.Warn(msg);
}
public static void Fatal(System.Exception e)
{
#if DEBUG
throw e;
#else
logger.Fatal(ExceptionFormatter.FormatExcpetion(e));
#endif
}
}
}
|
Fix using for Release build
|
Fix using for Release build
|
C#
|
mit
|
qianlifeng/Wox,lances101/Wox,qianlifeng/Wox,Wox-launcher/Wox,lances101/Wox,Wox-launcher/Wox,qianlifeng/Wox
|
0de2961330df2f953ad52d7630c908cdcdd7b6d7
|
src/tools/SmugMugCodeGen/Options.cs
|
src/tools/SmugMugCodeGen/Options.cs
|
// Copyright (c) Alex Ghiondea. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.IO;
namespace SmugMugCodeGen
{
public class Options
{
public string OutputDir { get; private set; }
public string OutputDirEnums { get; private set; }
public string[] InputFiles { get; private set; }
public Options(string[] args)
{
OutputDir = args[0];
OutputDirEnums = Path.Combine(OutputDir, "Enums");
// Copy the input files from the args array.
InputFiles = new string[args.Length - 1];
Array.Copy(args, 1, InputFiles, 0, args.Length - 1);
}
}
}
|
// Copyright (c) Alex Ghiondea. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.IO;
namespace SmugMugCodeGen
{
public class Options
{
public string OutputDir { get; private set; }
public string OutputDirEnums { get; private set; }
public string[] InputFiles { get; private set; }
public Options(string[] args)
{
OutputDir = args[0];
OutputDirEnums = Path.Combine(OutputDir, @"\..\Enums");
// Copy the input files from the args array.
InputFiles = new string[args.Length - 1];
Array.Copy(args, 1, InputFiles, 0, args.Length - 1);
}
}
}
|
Change the location of where the Enums are generated to be at the same level as the types.
|
Change the location of where the Enums are generated to be at the same level as the types.
|
C#
|
mit
|
AlexGhiondea/SmugMug.NET
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.