Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Apply velocity based on rotational value | 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 St... | 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 St... |
Update test to check that breadcrumbs are returned in correct order when MaximumBreadcrumbs is exceeded | 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(... | 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(... |
Use SampleOverrideLongestPlaying for audio samples. | 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 readonl... | 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 readonl... |
Change header size in HTML generation. | using System.Text;
namespace SnippetsToMarkdown.Commands
{
class WriteHeaderHtmlCommand : ICommand
{
private string directory;
public WriteHeaderHtmlCommand(string directory)
{
this.directory = directory;
}
public void WriteToOutput(StringBuild... | using System.Text;
namespace SnippetsToMarkdown.Commands
{
class WriteHeaderHtmlCommand : ICommand
{
private string directory;
public WriteHeaderHtmlCommand(string directory)
{
this.directory = directory;
}
public void WriteToOutput(StringBuild... |
Make JSNLogLogger available to the outside world, so it can actually be used in ASP.NET 5 apps | 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 log... | 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 logge... |
Fix up distance -> positional length comments. | // 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 : IHasE... | // 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 IHasDistanc... |
Document and suppress an FxCop warning |
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>
... |
Add XML description for Authentication Scheme | // 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
... | // 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
... |
Add playerID and revisit the moving. | 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... | 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.... |
Allow double click to open on junctions when lacking a destination | 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.Change... | 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.Change... |
Change caption of Tool Window | //------------------------------------------------------------------------------
// <copyright file="StackAnalysisToolWindow.cs" company="Microsoft">
// Copyright (c) Microsoft. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
namespace StackUs... | //------------------------------------------------------------------------------
// <copyright file="StackAnalysisToolWindow.cs" company="Microsoft">
// Copyright (c) Microsoft. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
namespace StackUs... |
Fix using for Release build | 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)
{
... | 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.Inn... |
Change the location of where the Enums are generated to be at the same level as the types. | // 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 stri... | // 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 stri... |
Remove stray integration test call. | using System;
using System.Collections;
using UnityEngine;
using System.Threading;
using UnityEngine.Networking;
namespace GLTF {
class GLTFComponent : MonoBehaviour
{
public string Url;
public Shader Shader;
public bool Multithreaded = true;
IEnumerator Start()
{
... | using System;
using System.Collections;
using UnityEngine;
using System.Threading;
using UnityEngine.Networking;
namespace GLTF {
class GLTFComponent : MonoBehaviour
{
public string Url;
public Shader Shader;
public bool Multithreaded = true;
IEnumerator Start()
{
... |
Return IServiceCollection from AddSession extension methods | // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Session;
namespace Microsoft.Extensions.DependencyInjection
{
/// <sum... | // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Session;
namespace Microsoft.Extensions.DependencyInjection
{
/// <sum... |
Add missing "announce" channel type | // 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.Online.Chat
{
public enum ChannelType
{
Public,
Private,
Multiplayer,
Spectator,
Temporary,
PM,... | // 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.Online.Chat
{
public enum ChannelType
{
Public,
Private,
Multiplayer,
Spectator,
Temporary,
PM,... |
Add test of scheduler usage | // 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.Threading;
using NUnit.Framework;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Shapes;
using osuTK;
namespace osu.Framework.Tests.Visual.Drawa... | // 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.Threading;
using NUnit.Framework;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Shapes;
using osuTK;
namespace osu.Framework.Tests.Visual.Drawa... |
Add EnumerateArray() extension for tables | using System;
namespace Eluant
{
public static class LuaValueExtensions
{
public static bool IsNil(this LuaValue self)
{
return self == null || self == LuaNil.Instance;
}
}
}
| using System;
using System.Collections.Generic;
namespace Eluant
{
public static class LuaValueExtensions
{
public static bool IsNil(this LuaValue self)
{
return self == null || self == LuaNil.Instance;
}
public static IEnumerable<LuaValue> EnumerateArray(this LuaTa... |
Fix NullException ocurring in GetFeaturesInView() when BoundingBox is null | using Mapsui.Fetcher;
using Mapsui.Geometries;
using Mapsui.Providers;
using System.Collections.Generic;
using System.Threading.Tasks;
using Mapsui.Styles;
namespace Mapsui.Layers
{
public class MemoryLayer : BaseLayer
{
public IProvider DataSource { get; set; }
public override IEnumerable<IF... | using Mapsui.Fetcher;
using Mapsui.Geometries;
using Mapsui.Providers;
using System.Collections.Generic;
using System.Threading.Tasks;
using Mapsui.Styles;
namespace Mapsui.Layers
{
public class MemoryLayer : BaseLayer
{
public IProvider DataSource { get; set; }
public override IEnumerable<IF... |
Allow cactbot to be restarted | using Advanced_Combat_Tracker;
using CefSharp;
using CefSharp.Wpf;
using System;
using System.Windows.Forms;
namespace Cactbot
{
public class ACTPlugin : IActPluginV1
{
SettingsTab settingsTab = new SettingsTab();
BrowserWindow browserWindow;
#region IActPluginV1 Members
public... | using Advanced_Combat_Tracker;
using CefSharp;
using CefSharp.Wpf;
using System;
using System.Windows.Forms;
namespace Cactbot
{
public class ACTPlugin : IActPluginV1
{
SettingsTab settingsTab = new SettingsTab();
BrowserWindow browserWindow;
#region IActPluginV1 Members
public... |
Use new API to build durable Exchange | using System;
using System.Threading.Tasks;
using Carrot.Configuration;
using Carrot.Extensions;
using RabbitMQ.Client;
using RabbitMQ.Client.Events;
namespace Carrot.Messages
{
public abstract class ConsumedMessageBase
{
protected readonly BasicDeliverEventArgs Args;
protected ConsumedMessage... | using System;
using System.Threading.Tasks;
using Carrot.Configuration;
using Carrot.Extensions;
using RabbitMQ.Client;
using RabbitMQ.Client.Events;
namespace Carrot.Messages
{
public abstract class ConsumedMessageBase
{
protected readonly BasicDeliverEventArgs Args;
protected ConsumedMessage... |
Add mLogger to Unity Window menu | using UnityEngine;
using UnityEditor;
using System;
using System.Collections;
namespace mLogger {
public class LoggerWindow : EditorWindow {
private Logger loggerInstance;
public Logger LoggerInstance {
get {
if (loggerInstance == null) {
loggerI... | using UnityEngine;
using UnityEditor;
using System;
using System.Collections;
namespace mLogger {
public class LoggerWindow : EditorWindow {
private Logger loggerInstance;
public Logger LoggerInstance {
get {
if (loggerInstance == null) {
loggerI... |
Remove Main()'s unused args parameter | using System;
namespace Yeamul.Test {
class Program {
static void Main(string[] args) {
Node nn = Node.Null;
Console.WriteLine(nn);
Node nbt = true;
Console.WriteLine(nbt);
Node nbf = false;
Console.WriteLine(nbf);
Node n16 = short.MinValue;
Console.WriteLine(n16);
Node n32 = int.Min... | using System;
namespace Yeamul.Test {
class Program {
static void Main() {
Node nn = Node.Null;
Console.WriteLine(nn);
Node nbt = true;
Console.WriteLine(nbt);
Node nbf = false;
Console.WriteLine(nbf);
Node n16 = short.MinValue;
Console.WriteLine(n16);
Node n32 = int.MinValue;
Con... |
Add test for autor properties | using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace LivrariaTest
{
[TestClass]
public class AutorTest
{
[TestMethod]
public void TestMethod1()
{
Assert.AreEqual(true, true);
}
}
}
| using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Livraria;
namespace LivrariaTest
{
[TestClass]
public class AutorTest
{
[TestMethod]
public void TestProperties()
{
Autor autor = new Autor();
autor.CodAutor = 999;
... |
Use graying rather than alpha | // Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Configuration;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input.Events;
namespace osu.Game.Screens.Multi.Components
{
publi... | // Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Configuration;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input.Events;
using osuTK.Graphics;
namespace osu.Game.Screens.Multi.... |
Use OpenTK triangle sample in OpenTkApp project | using System;
namespace OpenTkApp
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
}
| using System;
using OpenTK;
using OpenTK.Graphics;
using OpenTK.Graphics.OpenGL;
using OpenTK.Input;
namespace OpenTkApp
{
class Game : GameWindow
{
public Game()
: base(800, 600, GraphicsMode.Default, "OpenTK Quick Start Sample")
{
VSync = VSyncMode.On;
}
... |
Mark WinApiNet assembly as not CLS-compliant | // --------------------------------------------------------------------------------------------------------------------
// <copyright file="AssemblyInfo.cs" company="WinAPI.NET">
// Copyright (c) Marek Dzikiewicz, All Rights Reserved.
// </copyright>
// ---------------------------------------------------------------... | // --------------------------------------------------------------------------------------------------------------------
// <copyright file="AssemblyInfo.cs" company="WinAPI.NET">
// Copyright (c) Marek Dzikiewicz, All Rights Reserved.
// </copyright>
// ---------------------------------------------------------------... |
Set property store before creating the root collection to make the property store available for some internal file hiding logic | // <copyright file="DotNetFileSystem.cs" company="Fubar Development Junker">
// Copyright (c) Fubar Development Junker. All rights reserved.
// </copyright>
using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using FubarDev.WebDavServer.Props.Store;
using Microsoft.VisualStudio.Thre... | // <copyright file="DotNetFileSystem.cs" company="Fubar Development Junker">
// Copyright (c) Fubar Development Junker. All rights reserved.
// </copyright>
using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using FubarDev.WebDavServer.Props.Store;
using Microsoft.VisualStudio.Thre... |
Make Compose a non-extension method | using System;
namespace Sharper.C.Data
{
using static UnitModule;
public static class FunctionModule
{
public static Func<A, B> Fun<A, B>(Func<A, B> f)
=>
f;
public static Func<A, Unit> Fun<A>(Action<A> f)
=>
ToFunc(f);
public static Action<A> Act<A>(Action<A> f)
=>
... | using System;
namespace Sharper.C.Data
{
using static UnitModule;
public static class FunctionModule
{
public static Func<A, B> Fun<A, B>(Func<A, B> f)
=>
f;
public static Func<A, Unit> Fun<A>(Action<A> f)
=>
ToFunc(f);
public static Action<A> Act<A>(Action<A> f)
=>
... |
Fix travis/mono by remove SUO | using Autofac;
using SceneJect.Autofac;
using SceneJect.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
namespace SceneJect.Autofac
{
public class AutofacServiceAdapter : ContainerServiceProvider, IResolver, IServiceRegister
{
private readonly Autof... | using Autofac;
using SceneJect.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
namespace SceneJect.Autofac
{
public class AutofacServiceAdapter : ContainerServiceProvider, IResolver, IServiceRegister
{
private readonly AutofacRegisterationStrat regi... |
Correct in order not to use "Wait" method for synchronized method | using System.IO;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.Scripting;
using Microsoft.CodeAnalysis.CSharp.Scripting;
namespace UserInputMacro
{
static class ScriptExecuter
{
public static async Task ExecuteAsync( string scriptPath )
{
using( var hook = new UserInputHook() ) {
HookSetting... | using System.IO;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.Scripting;
using Microsoft.CodeAnalysis.CSharp.Scripting;
namespace UserInputMacro
{
static class ScriptExecuter
{
public static async Task ExecuteAsync( string scriptPath )
{
using( var hook = new UserInputHook() ) {
HookSetting... |
Validate data in the ctors | namespace ElectronicCash
{
public struct ActorName
{
private readonly string _firstName;
private readonly string _middleName;
private readonly string _lastName;
private readonly string _title;
private readonly string _entityName;
public ActorName(string firstNam... | using System;
namespace ElectronicCash
{
public struct ActorName
{
private readonly string _firstName;
private readonly string _middleName;
private readonly string _lastName;
private readonly string _title;
private readonly string _entityName;
public ActorName(... |
Improve time service interface documentation | // Copyright (c) MarinAtanasov. All rights reserved.
// Licensed under the MIT License (MIT). See License.txt in the project root for license information.
//
using System;
namespace AppBrix.Time
{
/// <summary>
/// Service which operates with <see cref="DateTime"/>.
/// </summary>
public interface ITim... | // Copyright (c) MarinAtanasov. All rights reserved.
// Licensed under the MIT License (MIT). See License.txt in the project root for license information.
//
using System;
namespace AppBrix.Time
{
/// <summary>
/// Service which operates with <see cref="DateTime"/>.
/// </summary>
public interface ITim... |
Improve how the link is made and page is cached | using ToSic.Razor.Blade;
// todo: change to use Get
public class Links : Custom.Hybrid.Code12
{
// Returns a safe url to a post details page
public dynamic LinkToDetailsPage(dynamic post) {
var detailsPageTabId = Text.Has(Settings.DetailsPage)
? int.Parse((AsEntity(App.Settings).GetBestValue("DetailsPage... | using ToSic.Razor.Blade;
public class Links : Custom.Hybrid.Code12
{
/// <Summary>
/// Returns a safe url to a post details page
/// </Summary>
public dynamic LinkToDetailsPage(dynamic post) {
return Link.To(pageId: DetailsPageId, parameters: "details=" + post.UrlKey);
}
/// <Summary>
/// Get / cach... |
Use the correct call to FunctionNameHelper | #load "LogHelper.csx"
#load "FunctionNameHelper.csx"
using System.Configuration;
public static class AppSettingsHelper
{
public static string GetAppSetting(string SettingName, bool LogValue = true )
{
string SettingValue = "";
string methodName = this.GetType().FullName;
try
... | #load "LogHelper.csx"
#load "FunctionNameHelper.csx"
using System.Configuration;
public static class AppSettingsHelper
{
public static string GetAppSetting(string SettingName, bool LogValue = true )
{
string SettingValue = "";
string methodName = this.GetType().FullName;
try
... |
Change aliasing of Modded Showdown Import | namespace PKHeX.WinForms
{
partial class Main
{
public System.Windows.Forms.ToolStripMenuItem EnableAutoLegality(System.ComponentModel.ComponentResourceManager resources)
{
this.Menu_ShowdownImportPKMModded = new System.Windows.Forms.ToolStripMenuItem();
this.Menu_Showdow... | namespace PKHeX.WinForms
{
partial class Main
{
public System.Windows.Forms.ToolStripMenuItem EnableAutoLegality(System.ComponentModel.ComponentResourceManager resources)
{
this.Menu_ShowdownImportPKMModded = new System.Windows.Forms.ToolStripMenuItem();
this.Menu_Showdow... |
Fix S3 create bucket test | using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using FluentAssertions;
using NuGet.Test.Helpers;
using Sleet.Test.Common;
namespace Sleet.AmazonS3.Tests
{
public class AmazonS3FileSystemTests
{
[EnvVarExistsFact(AmazonS3TestConte... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using FluentAssertions;
using NuGet.Test.Helpers;
using Sleet.Test.Common;
namespace Sleet.AmazonS3.Tests
{
public class AmazonS3FileSystemTests
{
[EnvVarExistsFact(AmazonS3TestConte... |
Trim end of post on Save. Incase someone hits enter loads and then blows the size of the page. This will stop that. | using NGM.Forum.Models;
namespace NGM.Forum.ViewModels {
public class PostBodyEditorViewModel {
public PostPart PostPart { get; set; }
public string Text {
get { return PostPart.Record.Text; }
set { PostPart.Record.Text = value; }
}
public strin... | using NGM.Forum.Models;
namespace NGM.Forum.ViewModels {
public class PostBodyEditorViewModel {
public PostPart PostPart { get; set; }
public string Text {
get { return PostPart.Record.Text; }
set { PostPart.Record.Text = string.IsNullOrWhiteSpace(value) ? value : ... |
Fix if httpContext is null we cannot wrap it | using System;
using System.Web;
namespace Umbraco.Web
{
internal class AspNetHttpContextAccessor : IHttpContextAccessor
{
public HttpContextBase HttpContext
{
get
{
return new HttpContextWrapper(System.Web.HttpContext.Current);
}
... | using System;
using System.Web;
namespace Umbraco.Web
{
internal class AspNetHttpContextAccessor : IHttpContextAccessor
{
public HttpContextBase HttpContext
{
get
{
var httpContext = System.Web.HttpContext.Current;
return httpContext is n... |
Add message inside this class to convey exception | using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Web;
namespace ADWS.Models
{
[DataContract]
public class UserInfoResponse
{
[DataMember]
public string Title { set; get; }
[DataMember]
public string Display... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Web;
namespace ADWS.Models
{
[DataContract]
public class UserInfoResponse
{
[DataMember]
public string Title { set; get; }
[DataMember]
public string Display... |
Add log for audit api | using System;
using System.Threading.Tasks;
using MediatR;
using NLog;
using SFA.DAS.EmployerUsers.Application.Commands.DeleteUser;
using SFA.DAS.EmployerUsers.Application.Queries.GetUsersWithExpiredRegistrations;
namespace SFA.DAS.EmployerUsers.RegistrationTidyUpJob.RegistrationManagement
{
public class... | using System;
using System.Threading.Tasks;
using MediatR;
using Microsoft.Azure;
using NLog;
using SFA.DAS.EmployerUsers.Application.Commands.DeleteUser;
using SFA.DAS.EmployerUsers.Application.Queries.GetUsersWithExpiredRegistrations;
namespace SFA.DAS.EmployerUsers.RegistrationTidyUpJob.RegistrationManagem... |
Move https redirection above basic auth | using System;
using System.IO;
using hutel.Filters;
using hutel.Middleware;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.FileProviders;
using Microsoft.Extensions.Logging;
using Newtons... | using System;
using System.IO;
using hutel.Filters;
using hutel.Middleware;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.FileProviders;
using Microsoft.Extensions.Logging;
using Newtons... |
Fix formatting exception when script compilation fails with certain error messages | using System;
namespace Casper {
public class CasperException : Exception {
public const int EXIT_CODE_COMPILATION_ERROR = 1;
public const int EXIT_CODE_MISSING_TASK = 2;
public const int EXIT_CODE_CONFIGURATION_ERROR = 3;
public const int EXIT_CODE_TASK_FAILED = 4;
public const int EXIT_CODE_UNHANDLED_EX... | using System;
namespace Casper {
public class CasperException : Exception {
public const int EXIT_CODE_COMPILATION_ERROR = 1;
public const int EXIT_CODE_MISSING_TASK = 2;
public const int EXIT_CODE_CONFIGURATION_ERROR = 3;
public const int EXIT_CODE_TASK_FAILED = 4;
public const int EXIT_CODE_UNHANDLED_EX... |
Make the client request the RavenDB server version. If we don't do this the client doesn't appear to raise an exception in the case of a dead server so the health check will still return healthy. | using Raven.Abstractions.Data;
using System;
namespace Dotnet.Microservice.Health.Checks
{
public class RavenDbHealthCheck
{
public static HealthResponse CheckHealth(string connectionString)
{
try
{
ConnectionStringParser<RavenConnectionStringOptions> pa... | using Raven.Abstractions.Data;
using System;
namespace Dotnet.Microservice.Health.Checks
{
public class RavenDbHealthCheck
{
public static HealthResponse CheckHealth(string connectionString)
{
try
{
ConnectionStringParser<RavenConnectionStringOptions> pa... |
Switch to new backup email recipient | using FluentEmail.Core;
using FluentScheduler;
using System;
namespace BatteryCommander.Web.Jobs
{
public class SqliteBackupJob : IJob
{
private const String Recipient = "mattgwagner+backup@gmail.com"; // TODO Make this configurable
private readonly IFluentEmail emailSvc;
public Sqli... | using FluentEmail.Core;
using FluentScheduler;
using System;
namespace BatteryCommander.Web.Jobs
{
public class SqliteBackupJob : IJob
{
private const String Recipient = "Backups@RedLeg.app";
private readonly IFluentEmail emailSvc;
public SqliteBackupJob(IFluentEmail emailSvc)
... |
Fix up how we generate debugging info for var simple. | using System;
using LinqToTTreeInterfacesLib;
using LINQToTTreeLib.Utils;
namespace LINQToTTreeLib.Variables
{
/// <summary>
/// A simple variable (like int, etc.).
/// </summary>
public class VarSimple : IVariable
{
public string VariableName { get; private set; }
publ... | using System;
using LinqToTTreeInterfacesLib;
using LINQToTTreeLib.Utils;
namespace LINQToTTreeLib.Variables
{
/// <summary>
/// A simple variable (like int, etc.).
/// </summary>
public class VarSimple : IVariable
{
public string VariableName { get; private set; }
publ... |
Add editor button to update build path | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
[CustomEditor(typeof(MicrogameCollection))]
public class MicrogameCollectionEditor : Editor
{
public override void OnInspectorGUI()
{
MicrogameCollection collection = (MicrogameCollection)target;
if (GUILayout.Butt... | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
[CustomEditor(typeof(MicrogameCollection))]
public class MicrogameCollectionEditor : Editor
{
public override void OnInspectorGUI()
{
MicrogameCollection collection = (MicrogameCollection)target;
if (GUILayout.Butt... |
Add square extension method to floats | using System;
namespace DynamixelServo.Quadruped
{
static class MathExtensions
{
public static double RadToDegree(this double angle)
{
return angle * (180.0 / Math.PI);
}
public static float RadToDegree(this float angle)
{
return angle * (180f /... | using System;
namespace DynamixelServo.Quadruped
{
static class MathExtensions
{
public static double RadToDegree(this double angle)
{
return angle * (180.0 / Math.PI);
}
public static float RadToDegree(this float angle)
{
return angle * (180f /... |
Order organization members by name. | @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
Layout = "_Layout.cshtml";
}
@{ Html.RenderPartial("PageHeading"); }
<div class="row">
<div class="small-12 large-12 columns">
@{
var members = Umbraco.TypedContentAtXPath("//OrganizationMember")
.Where(m => m.GetPropertyVal... | @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
Layout = "_Layout.cshtml";
}
@{ Html.RenderPartial("PageHeading"); }
<div class="row">
<div class="small-12 large-12 columns">
@{
var members = Umbraco.TypedContentAtXPath("//OrganizationMember")
.Where(m => m.GetPropertyVal... |
Fix running on < iOS 6.0 | using System;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using Eto.Platform.iOS.Forms;
using Eto.Forms;
namespace Eto.Platform.iOS
{
[MonoTouch.Foundation.Register("EtoAppDelegate")]
public class EtoAppDelegate : UIApplicationDelegate
{
public EtoAppDelegate ()
{
}
public override bool WillFinishLa... | using System;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using Eto.Platform.iOS.Forms;
using Eto.Forms;
namespace Eto.Platform.iOS
{
[MonoTouch.Foundation.Register("EtoAppDelegate")]
public class EtoAppDelegate : UIApplicationDelegate
{
public EtoAppDelegate ()
{
}
public override bool FinishedLaun... |
Add custom display option props based on sliders | using Newtonsoft.Json;
namespace SurveyMonkey.Containers
{
[JsonConverter(typeof(TolerantJsonConverter))]
public class QuestionDisplayOptionsCustomOptions
{
}
} | using Newtonsoft.Json;
using System.Collections.Generic;
namespace SurveyMonkey.Containers
{
[JsonConverter(typeof(TolerantJsonConverter))]
public class QuestionDisplayOptionsCustomOptions
{
public List<string> OptionSet { get; set; }
public int StartingPosition { get; set; }
publi... |
Convert all dates to UTC time | using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization;
namespace Presentation.Web
{
// Note: For instructions on enabling IIS6 or IIS7 classic mode,
// visit http://go.... | using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
namespace Presentation.Web
{
// Note: For instructions on enabling IIS6 or IIS7 classic mode,
// visit http://go.microsoft.com/?LinkId=9394801
... |
Change ASN int array to IList | namespace BmpListener.Bgp
{
public class ASPathSegment
{
public ASPathSegment(Type type, int[] asns)
{
SegmentType = Type;
ASNs = asns;
}
public enum Type
{
AS_SET = 1,
AS_SEQUENCE,
AS_CONFED_SEQUENCE,
... | using System.Collections.Generic;
namespace BmpListener.Bgp
{
public class ASPathSegment
{
public ASPathSegment(Type type, IList<int> asns)
{
SegmentType = type;
ASNs = asns;
}
public enum Type
{
AS_SET = 1,
AS_SEQUENCE,
... |
Bump assembly info for 1.2.2 release | 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("Su... | 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("Su... |
Use inspector for child classes | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using UnityEditor;
namespace Microsoft.MixedReality.Toolkit.Input.Editor
{
[CustomEditor(typeof(MixedRealityControllerVisualizer))]
public class MixedRealit... | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using UnityEditor;
namespace Microsoft.MixedReality.Toolkit.Input.Editor
{
[CustomEditor(typeof(MixedRealityControllerVisualizer), true)]
public class Mixed... |
Update bundle config to match exampe in wiki page | using System.Diagnostics.CodeAnalysis;
using System.Web.Optimization;
namespace T4MVCHostMvcApp.App_Start
{
public static class BundleConfig
{
// For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkId=254725
[SuppressMessage("Microsoft.Design", "CA1062:Validate argument... | using System.Diagnostics.CodeAnalysis;
using System.Web.Optimization;
namespace T4MVCHostMvcApp.App_Start
{
public static class BundleConfig
{
// For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkId=254725
[SuppressMessage("Microsoft.Design", "CA1062:Validate argument... |
Use character class as transition key | using System.Collections.Generic;
namespace slang.Lexing.Trees.Nodes
{
public class Transitions : Dictionary<char,Node>
{
}
}
| using System.Collections.Generic;
namespace slang.Lexing.Trees.Nodes
{
public class Transitions : Dictionary<Character,Transition>
{
}
}
|
Add a way to get the vendors from the Site entity. | // Copyright (c) Alex Ghiondea. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using SmugMug.v2.Authentication;
using System.Threading.Tasks;
namespace SmugMug.v2.Types
{
public class SiteEntity : SmugMugEntity
{
public SiteE... | // Copyright (c) Alex Ghiondea. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using SmugMug.v2.Authentication;
using System.Threading.Tasks;
namespace SmugMug.v2.Types
{
public class SiteEntity : SmugMugEntity
{
public SiteE... |
Fix InMemory context for unit tests | using System.ComponentModel.Composition;
using Microsoft.EntityFrameworkCore;
using Waf.BookLibrary.Library.Applications.Data;
using Waf.BookLibrary.Library.Applications.Services;
using Waf.BookLibrary.Library.Domain;
namespace Test.BookLibrary.Library.Applications.Services
{
[Export, Export(typeof(IDBContextServ... | using System.ComponentModel.Composition;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Storage;
using Waf.BookLibrary.Library.Applications.Data;
using Waf.BookLibrary.Library.Applications.Services;
using Waf.BookLibrary.Library.Domain;
namespace Test.BookLibrary.Library.Applications.Service... |
Refactor the menu's max height to be a property | // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using osu.Framework.Graphics;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Settings
{
public class SettingsEnumDropdown<T> : Set... | // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using osu.Framework.Graphics;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Settings
{
public class SettingsEnumDropdown<T> : Set... |
Write test to ensure characters are normalized. | using System;
using FluentAssertions;
using Xunit;
namespace Grobid.PdfToXml.Test
{
public class TokenBlockFactoryTest
{
[Fact]
public void TestA()
{
var stub = new TextRenderInfoStub();
var testSubject = new TokenBlockFactory(100, 100);
... | using System;
using FluentAssertions;
using iTextSharp.text.pdf.parser;
using Xunit;
namespace Grobid.PdfToXml.Test
{
public class TokenBlockFactoryTest
{
[Fact]
public void FactoryShouldNormalizeUnicodeStrings()
{
var stub = new TextRenderInfoStub
... |
Simplify Login() action - no explicit return necessary | // Copyright(c) 2016 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy of
// the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agree... | // Copyright(c) 2016 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy of
// the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agree... |
Update Custom field to the correct POCO representation | using System.Collections.Generic;
using commercetools.Common;
using commercetools.CustomFields;
using Newtonsoft.Json;
namespace commercetools.Carts
{
/// <summary>
/// API representation for creating a new CustomLineItem.
/// </summary>
/// <see href="http://dev.commercetools.com/http-api-projects-... | using System.Collections.Generic;
using commercetools.Common;
using commercetools.CustomFields;
using Newtonsoft.Json;
namespace commercetools.Carts
{
/// <summary>
/// API representation for creating a new CustomLineItem.
/// </summary>
/// <see href="http://dev.commercetools.com/http-api-projects-... |
Remove unnecessary argument exception documentation on user info | namespace Cronofy
{
using System;
/// <summary>
/// Interface for a Cronofy client base that manages the
/// access token and any shared client methods.
/// </summary>
public interface ICronofyUserInfoClient
{
/// <summary>
/// Gets the user info belonging to the account.
... | namespace Cronofy
{
using System;
/// <summary>
/// Interface for a Cronofy client base that manages the
/// access token and any shared client methods.
/// </summary>
public interface ICronofyUserInfoClient
{
/// <summary>
/// Gets the user info belonging to the account.
... |
Improve when there is no carrier | namespace MyParcelApi.Net.Models
{
public enum Carrier
{
PostNl = 1,
BPost = 2
}
}
| namespace MyParcelApi.Net.Models
{
public enum Carrier
{
None = 0,
PostNl = 1,
BPost = 2
}
}
|
Check for shots going out of bounds and kill them | using UnityEngine;
using System.Collections;
public class ShotControl : MonoBehaviour {
public float speed = 0.2f;
private bool inBlock;
private int life = 3;
void Start () {
}
void Update () {
// Old position
Vector3 position = transform.position;
// Move
transform.Translate(Vector3.up * speed);... | using UnityEngine;
using System.Collections;
public class ShotControl : MonoBehaviour {
public float speed = 0.2f;
private bool inBlock;
private int life = 3;
void Start () {
}
void Update () {
// Old position
Vector3 position = transform.position;
// Move
transform.Translate(Vector3.up * speed);... |
Add more style extension methods | using WootzJs.Mvc.Views;
using WootzJs.Mvc.Views.Css;
namespace WootzJs.Mvc
{
public static class StyleExtensions
{
public static T WithBold<T>(this T control) where T : Control
{
control.Style.Font.Weight = new CssFontWeight(CssFontWeightType.Bold);
return control;
... | using WootzJs.Mvc.Views;
using WootzJs.Mvc.Views.Css;
namespace WootzJs.Mvc
{
public static class StyleExtensions
{
public static T WithBold<T>(this T control) where T : Control
{
control.Style.Font.Weight = new CssFontWeight(CssFontWeightType.Bold);
return control;
... |
Handle URL's with or without a / suffix | using System.Net;
using System.Web.Script.Serialization;
namespace MultiMiner.MobileMiner.Api
{
public class ApiContext
{
static public void SubmitMiningStatistics(string url, MiningStatistics miningStatistics)
{
string fullUrl = url + "/api/MiningStatisticsInput";
usin... | using System.Net;
using System.Web.Script.Serialization;
namespace MultiMiner.MobileMiner.Api
{
public class ApiContext
{
static public void SubmitMiningStatistics(string url, MiningStatistics miningStatistics)
{
if (!url.EndsWith("/"))
url = url + "/";
... |
Disable dupfinder because of Hg.Net | #load nuget:https://www.myget.org/F/cake-contrib/api/v2?package=Cake.Recipe&prerelease
Environment.SetVariableNames();
BuildParameters.SetParameters(context: Context,
buildSystem: BuildSystem,
sourceDirectoryPath: "./src",
title: "Cak... | #load nuget:https://www.myget.org/F/cake-contrib/api/v2?package=Cake.Recipe&prerelease
Environment.SetVariableNames();
BuildParameters.SetParameters(context: Context,
buildSystem: BuildSystem,
sourceDirectoryPath: "./src",
title: "Cake.Hg",
repositoryOwner: "cake-contrib",
repositoryName: "Cake.Hg... |
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. | using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Autofac.Extras.DomainServices")]
[assembly: AssemblyDescription("Autofac Integration for RIA Services")]
[assembly: ComVisible(false)] | using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Autofac.Extras.DomainServices")]
[assembly: ComVisible(false)] |
Use a const for excess length | // Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Linq;
using osu.Framework.Audio.Track;
using osu.Game.Rulesets.Objects.Types;
namespace osu.Game.Beatmaps
{
public partial class WorkingBeatmap
{
... | // Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Linq;
using osu.Framework.Audio.Track;
using osu.Game.Rulesets.Objects.Types;
namespace osu.Game.Beatmaps
{
public partial class WorkingBeatmap
{
... |
Remove printing of invocation in case of non-zero exit code. | // Copyright Matthias Koch 2017.
// Distributed under the MIT License.
// https://github.com/nuke-build/nuke/blob/master/LICENSE
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using JetBrains.Annotations;
using Nuke.Core.Utilities;
namespace Nuke.Core.To... | // Copyright Matthias Koch 2017.
// Distributed under the MIT License.
// https://github.com/nuke-build/nuke/blob/master/LICENSE
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using JetBrains.Annotations;
using Nuke.Core.Utilities;
namespace Nuke.Core.To... |
Create directory for error screenshot if it does not exist | using System;
using System.Drawing.Imaging;
using System.IO;
using Tellurium.MvcPages.Utils;
namespace Tellurium.MvcPages.BrowserCamera.Storage
{
public class FileSystemScreenshotStorage : IScreenshotStorage
{
private readonly string screenshotDirectoryPath;
public FileSystemScreenshotStorage... | using System;
using System.Drawing.Imaging;
using System.IO;
using Tellurium.MvcPages.Utils;
namespace Tellurium.MvcPages.BrowserCamera.Storage
{
public class FileSystemScreenshotStorage : IScreenshotStorage
{
private readonly string screenshotDirectoryPath;
public FileSystemScreenshotStorage... |
Use different percentage in the unit test. | // Copyright Dirk Lemstra https://github.com/dlemstra/Magick.NET.
// Licensed under the Apache License, Version 2.0.
using ImageMagick;
using Xunit;
using Xunit.Sdk;
namespace Magick.NET.Tests
{
public partial class ResourceLimitsTests
{
[Collection(nameof(RunTestsSeparately))]
public class T... | // Copyright Dirk Lemstra https://github.com/dlemstra/Magick.NET.
// Licensed under the Apache License, Version 2.0.
using ImageMagick;
using Xunit;
using Xunit.Sdk;
namespace Magick.NET.Tests
{
public partial class ResourceLimitsTests
{
[Collection(nameof(RunTestsSeparately))]
public class T... |
Add process index to state as primary key. Use process name as property | using System.Collections.Generic;
namespace AttachToolbar
{
internal static class State
{
public static string ProcessName = "";
public static List<string> ProcessList = new List<string>();
public static EngineType EngineType = EngineType.Native;
public static bool IsAttached =... | using System.Collections.Generic;
namespace AttachToolbar
{
internal static class State
{
public static int ProcessIndex = -1;
public static List<string> ProcessList = new List<string>();
public static EngineType EngineType = EngineType.Native;
public static bool IsAttached = f... |
Fix system memory check for Linux (20210323) | using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Bloom.Utils
{
class MemoryUtils
{
/// <summary>
/// A crude way of measuring when we might be short enough of memory to need a full reload.
/// </summary>
/... | using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Bloom.Utils
{
class MemoryUtils
{
/// <summary>
/// A crude way of measuring when we might be short enough of memory to need a full reload.
/// </summary>
/... |
Add new line for file logging | using System;
using System.Diagnostics;
using System.IO;
namespace PackageRunner
{
/// <summary>
/// </summary>
internal class FileLogging
{
private readonly string _file;
private static readonly object _lock = new object();
public FileLogging(string file)
{
... | using System;
using System.Diagnostics;
using System.IO;
namespace PackageRunner
{
/// <summary>
/// </summary>
internal class FileLogging
{
private readonly string _file;
private static readonly object _lock = new object();
public FileLogging(string file)
{
... |
Add Debug writer for diagnostic purpose | using System;
using System.Threading;
using Topshelf;
namespace Tellurium.VisualAssertion.Dashboard
{
public class Program
{
public static void Main(string[] args)
{
#if DEBUG
using (var server = new WebServer())
{
server.Run(consoleMode:true);
... | using System;
using System.Diagnostics;
using System.IO;
using System.Threading;
using Topshelf;
namespace Tellurium.VisualAssertion.Dashboard
{
public class Program
{
public static void Main(string[] args)
{
#if DEBUG
using (var server = new WebServer())
{
... |
Fix - RuntimeUniqueIdProdiver is static | #if FAT
namespace Theraot.Threading
{
public static partial class ThreadingHelper
{
private static readonly RuntimeUniqueIdProdiver _threadIdProvider = new RuntimeUniqueIdProdiver();
// Leaked until AppDomain unload
private static readonly NoTrackingThreadLocal<RuntimeUniqueIdProdiver.... | #if FAT
namespace Theraot.Threading
{
public static partial class ThreadingHelper
{
// Leaked until AppDomain unload
private static readonly NoTrackingThreadLocal<RuntimeUniqueIdProdiver.UniqueId> _threadRuntimeUniqueId = new NoTrackingThreadLocal<RuntimeUniqueIdProdiver.UniqueId>(RuntimeUniqu... |
Fix namespace and add inheritance | using IdentityServer3.Core.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using IdentityServer3.Core.Models;
using IdentityServer3.Contrib.RedisStores.Models;
using StackExchange.Redis;
using IdentityServer3.Contrib.RedisStores.Converters;
namespace Identity... | using IdentityServer3.Core.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using IdentityServer3.Core.Models;
using IdentityServer3.Contrib.RedisStores.Models;
using StackExchange.Redis;
using IdentityServer3.Contrib.RedisStores.Converters;
namespace Identity... |
Fix handling of CONNECTION_PLAYER when sending response to GameServer | using AutomaticTypeMapper;
using EOLib.Logger;
using EOLib.Net;
using EOLib.Net.Communication;
using EOLib.Net.Handlers;
using EOLib.Net.PacketProcessing;
namespace EOLib.PacketHandlers
{
/// <summary>
/// Handles incoming CONNECTION_PLAYER packets which are used for updating sequence numbers in the EO protoc... | using AutomaticTypeMapper;
using EOLib.Logger;
using EOLib.Net;
using EOLib.Net.Communication;
using EOLib.Net.Handlers;
using EOLib.Net.PacketProcessing;
namespace EOLib.PacketHandlers
{
/// <summary>
/// Handles incoming CONNECTION_PLAYER packets which are used for updating sequence numbers in the EO protoc... |
Fix issue where Dapper was trying to insert Read into the post table where that column doesnt exist | using System;
namespace gdRead.Data.Models
{
public class Post
{
public int Id { get; set; }
public int FeedId { get; set; }
public string Name { get; set; }
public string Url { get; set; }
public string Summary { get; set; }
public string Content { get; set; }... | using System;
using DapperExtensions.Mapper;
namespace gdRead.Data.Models
{
public class Post
{
public int Id { get; set; }
public int FeedId { get; set; }
public string Name { get; set; }
public string Url { get; set; }
public string Summary { get; set; }
publ... |
Replace string[] field by IEnumerable<string> property | using System;
using System.Collections.Generic;
using System.Linq;
using Avalonia.Controls;
using WalletWasabi.Gui.ViewModels;
namespace WalletWasabi.Gui.ManagedDialogs
{
internal class ManagedFileChooserFilterViewModel : ViewModelBase
{
private readonly string[] Extensions;
public string Name { get; }
public... | using System;
using System.Collections.Generic;
using System.Linq;
using Avalonia.Controls;
using WalletWasabi.Gui.ViewModels;
namespace WalletWasabi.Gui.ManagedDialogs
{
internal class ManagedFileChooserFilterViewModel : ViewModelBase
{
private IEnumerable<string> Extensions { get; }
public string Name { get; }... |
Use GitVersion for test app | // Copyright (c) 2015 Eberhard Beilharz
// This software is licensed under the MIT license (http://opensource.org/licenses/MIT)
using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your proje... | // Copyright (c) 2015 Eberhard Beilharz
// This software is licensed under the MIT license (http://opensource.org/licenses/MIT)
using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your proje... |
Fix issue when adding type to ExtensionsProvider | using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace DotVVM.Framework.Compilation.Binding
{
public class DefaultExtensionsProvider : IExtensionsProvider
{
private readonly List<Type> typesLookup;
... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace DotVVM.Framework.Compilation.Binding
{
public class DefaultExtensionsProvider : IExtensionsProvider
{
private readonly List<Type> typesLookup;
... |
Stop exception when no argument sare suppplied to minigzip | // project created on 11.11.2001 at 15:19
using System;
using System.IO;
using ICSharpCode.SharpZipLib.GZip;
class MainClass
{
public static void Main(string[] args)
{
if (args[0] == "-d") { // decompress
Stream s = new GZipInputStream(File.OpenRead(args[1]));
FileStream fs = File.Create(Path.GetFileNameWit... | // project created on 11.11.2001 at 15:19
using System;
using System.IO;
using ICSharpCode.SharpZipLib.GZip;
class MainClass
{
public static void Main(string[] args)
{
if ( args.Length > 0 ) {
if ( args[0] == "-d" ) { // decompress
Stream s = new GZipInputStream(File.OpenRead(args[1]));
FileStream fs =... |
Remove assembly load debug lines. | using System;
using System.IO;
using System.Reflection;
// ReSharper disable once CheckNamespace
internal static class Program
{
private static int Main(string[] args)
{
// Mono's XBuild uses assembly redirects to make sure it uses .NET 4.5 target binaries.
// We emulate it using our own assem... | using System;
using System.IO;
using System.Reflection;
// ReSharper disable once CheckNamespace
internal static class Program
{
private static int Main(string[] args)
{
var mainAsm = Assembly.Load("citizenmp_server_updater");
mainAsm.GetType("Costura.AssemblyLoader")
.GetMethod("... |
Test if a failed test will fail the build | using Microsoft.VisualStudio.TestTools.UnitTesting;
using SaurusConsole.OthelloAI;
namespace SaurusConsoleTests
{
[TestClass]
public class MoveTests
{
[TestMethod]
public void NotationConstuctorTest()
{
Move e4move = new Move("E4");
Assert.AreEqual("E4", e4mov... | using Microsoft.VisualStudio.TestTools.UnitTesting;
using SaurusConsole.OthelloAI;
namespace SaurusConsoleTests
{
[TestClass]
public class MoveTests
{
[TestMethod]
public void NotationConstuctorTest()
{
Move e4move = new Move("E4");
Assert.AreEqual("E4", e4mov... |
Set interval to 10 minutes | using System.Diagnostics;
using System.IO;
using Hangfire;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Server.HttpSys;
using SupportManager.Contracts;
using Topshelf;
namespace SupportManager.Web
{
public class Program
{
private static string[] args;
... | using System.Diagnostics;
using System.IO;
using Hangfire;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Server.HttpSys;
using SupportManager.Contracts;
using Topshelf;
namespace SupportManager.Web
{
public class Program
{
private static string[] args;
... |
Make identity-test API easier to consume | // Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Linq;
namespace Nether.Web.Features.Identity
{
[Route("identity-test")]
... | // Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Linq;
namespace Nether.Web.Features.Identity
{
[Route("identity-test")]
... |
Fix Alpaca error message deserialization | /*
* The official C# API client for alpaca brokerage
* Sourced from: https://github.com/alpacahq/alpaca-trade-api-csharp/tree/v3.0.2
*/
using System;
using Newtonsoft.Json;
namespace QuantConnect.Brokerages.Alpaca.Markets
{
internal sealed class JsonError
{
[JsonProperty(PropertyName = "code", Requ... | /*
* The official C# API client for alpaca brokerage
* Sourced from: https://github.com/alpacahq/alpaca-trade-api-csharp/tree/v3.0.2
*/
using System;
using Newtonsoft.Json;
namespace QuantConnect.Brokerages.Alpaca.Markets
{
internal sealed class JsonError
{
[JsonProperty(PropertyName = "code", Requ... |
Change user id type to int | // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable enable
using System;
using osu.Game.Users;
namespace osu.Game.Online.RealtimeMultiplayer
{
[Serializable]
public class MultiplayerRoomUser : IEquatabl... | // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable enable
using System;
using osu.Game.Users;
namespace osu.Game.Online.RealtimeMultiplayer
{
[Serializable]
public class MultiplayerRoomUser : IEquatabl... |
Remove locking code and make it possible to have a dummy history, by calling the parameterless constructor. | using System;
using System.Collections.Generic;
namespace IvionSoft
{
public class History<T>
{
public int Length { get; private set; }
HashSet<T> hashes;
Queue<T> queue;
object _locker = new object();
public History(int length) : this(length, null)
{}
... | using System;
using System.Collections.Generic;
namespace IvionSoft
{
public class History<T>
{
public int Length { get; private set; }
HashSet<T> hashes;
Queue<T> queue;
public History()
{
Length = 0;
}
public History(int length) : this(l... |
Add helpers for saving in Library and Library/Caches | using System;
using System.IO;
using System.Security.Cryptography;
using System.Text;
namespace Stampsy.ImageSource
{
public class FileDestination : IDestination<FileRequest>
{
public string Folder { get; private set; }
public FileDestination (string folder)
{
Folder = fold... | using System;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
namespace Stampsy.ImageSource
{
public class FileDestination : IDestination<FileRequest>
{
public static FileDestination InLibrary (params string [] folders)
{
var folder = Path.... |
Update to use new User | using System;
using System.Collections.Generic;
namespace Simple.Domain.Model
{
public class Organization
{
public Guid Id { get; set; }
public string Name { get; set; }
public string CatchPhrase { get; set; }
public string BSPhrase { get; set; }
// Ref
public DomainUser Owner { get; set; }
// List ... | using System;
using System.Collections.Generic;
using Simple.Domain.Entities;
namespace Simple.Domain.Model
{
public class Organization
{
public Guid Id { get; set; }
public string Name { get; set; }
public string CatchPhrase { get; set; }
public string BSPhrase { get; set; }
// Ref
public User Owner {... |
Add some helpers and stuff | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ElectronicCash
{
/// <summary>
/// The customer
/// </summary>
public class Alice : BaseActor
{
}
}
| using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ElectronicCash
{
/// <summary>
/// The customer
/// </summary>
public class Alice : BaseActor
{
public List<MoneyOrder> MoneyOrders { get; private set; }
pu... |
Revert "Use a PrivateAdditionalLibrary for czmq.lib instead of a public one" | // Copyright 2015 Palm Stone Games, Inc. All Rights Reserved.
using System.IO;
namespace UnrealBuildTool.Rules
{
public class ue4czmq : ModuleRules
{
public ue4czmq(TargetInfo Target)
{
// Include paths
//PublicIncludePaths.AddRange(new string[] {});
//PrivateIncludePat... | // Copyright 2015 Palm Stone Games, Inc. All Rights Reserved.
using System.IO;
namespace UnrealBuildTool.Rules
{
public class ue4czmq : ModuleRules
{
public ue4czmq(TargetInfo Target)
{
// Include paths
//PublicIncludePaths.AddRange(new string[] {});
//PrivateIncludePat... |
Make soldier a dropdown list | @model APFT
@using (Html.BeginForm("Edit", "APFT", FormMethod.Post, new { @class = "form-horizontal" role = "form" }))
{
@Html.AntiForgeryToken()
@Html.HiddenFor(model => model.Id)
@Html.ValidationSummary()
<div class="form-group form-group-lg">
@Html.DisplayNameFor(model => model.Soldier)
... | @model APFT
@using (Html.BeginForm("Edit", "APFT", FormMethod.Post, new { @class = "form-horizontal" role = "form" }))
{
@Html.AntiForgeryToken()
@Html.HiddenFor(model => model.Id)
@Html.ValidationSummary()
<div class="form-group form-group-lg">
@Html.DisplayNameFor(model => model.Soldier)
... |
Update unit test error for new const | #region copyright
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="SimpleTests.cs" company="Stephen Reindl">
// Copyright (c) Stephen Reindl. All rights reserved.
// Licensed under the MIT license. See LICENSE.md file in the pro... | #region copyright
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="SimpleTests.cs" company="Stephen Reindl">
// Copyright (c) Stephen Reindl. All rights reserved.
// Licensed under the MIT license. See LICENSE.md file in the pro... |
Disable warning "Type is not CLS-compliant" | namespace MvvmFx.CaliburnMicro
{
using System;
/// <summary>
/// Used to manage logging.
/// </summary>
public static class LogManager
{
private static readonly Logging.ILog NullLogInstance = new Logging.NullLogger();
/// <summary>
/// Creates an <see cref="Logging.ILo... | namespace MvvmFx.CaliburnMicro
{
using System;
/// <summary>
/// Used to manage logging.
/// </summary>
public static class LogManager
{
private static readonly Logging.ILog NullLogInstance = new Logging.NullLogger();
#pragma warning disable CS3003 // Type is not CLS-compliant
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.