Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Fix exception when including this in a project without TriggerAction | using UnityEngine;
using System.Collections;
public abstract class ConsoleAction : ActionBase {
public abstract void Activate();
}
| using UnityEngine;
using System.Collections;
public abstract class ConsoleAction : MonoBehaviour {
public abstract void Activate();
}
|
Use the correct strong name for dbus-sharp-glib friend assembly | // Copyright 2006 Alp Toker <alp@atoker.com>
// This software is made available under the MIT License
// See COPYING for details
using System.Reflection;
using System.Runtime.CompilerServices;
//[assembly: AssemblyVersion("0.0.0.*")]
[assembly: AssemblyTitle ("NDesk.DBus")]
[assembly: AssemblyDescription ("D-Bus IPC ... | // Copyright 2006 Alp Toker <alp@atoker.com>
// This software is made available under the MIT License
// See COPYING for details
using System.Reflection;
using System.Runtime.CompilerServices;
//[assembly: AssemblyVersion("0.0.0.*")]
[assembly: AssemblyTitle ("NDesk.DBus")]
[assembly: AssemblyDescription ("D-Bus IPC ... |
Add a builder for the base environ, so it's easier to work with | using System;
using System.Collections.Generic;
namespace NValidate
{
public class BaseEnviron : Environ
{
readonly Dictionary<Type, Func<Environ, object>> _modelExtractors;
readonly Dictionary<Type, object> _models;
public BaseEnviron(Dictionary<Type, Func<Environ, objec... | using System;
using System.Collections.Generic;
namespace NValidate
{
public class BaseEnviron : Environ
{
readonly Dictionary<Type, Func<Environ, object>> _modelExtractors;
readonly Dictionary<Type, object> _models;
public BaseEnviron(Dictionary<Type, Func<Environ, objec... |
Fix problem with parsing server url. | // Copyright 2015 Apcera Inc. All rights reserved.
using System;
namespace NATS.Client
{
// Tracks individual backend servers.
internal class Srv
{
internal Uri url = null;
internal bool didConnect = false;
internal int reconnects = 0;
internal DateTime lastAtt... | // Copyright 2015 Apcera Inc. All rights reserved.
using System;
namespace NATS.Client
{
// Tracks individual backend servers.
internal class Srv
{
internal Uri url = null;
internal bool didConnect = false;
internal int reconnects = 0;
internal DateTime lastAtt... |
Update Step 3 - Remove integration test category. | using NSubstitute;
using NUnit.Framework;
namespace DependencyKata.Tests
{
[TestFixture]
public class DoItAllTests
{
[Test, Category("Integration")]
public void DoItAll_Does_ItAll()
{
var expected = "The passwords don't match";
var io = Substitute.For<IOutpu... | using NSubstitute;
using NUnit.Framework;
namespace DependencyKata.Tests
{
[TestFixture]
public class DoItAllTests
{
[Test, Category("Integration")]
public void DoItAll_Does_ItAll()
{
var expected = "The passwords don't match";
var io = Substitute.For<IOutpu... |
Extend TriggerHelp for querying help | using System.Collections.Generic;
using MeidoCommon;
namespace MeidoBot
{
public static class PluginExtensions
{
public static string Name(this IMeidoHook plugin)
{
string name = plugin.Name.Trim();
switch (name)
{
case "":
c... | using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using MeidoCommon;
namespace MeidoBot
{
public static class PluginExtensions
{
public static string Name(this IMeidoHook plugin)
{
string name = plugin.Name.Trim();
switch (name)
... |
Add user32 function in winutilities | using Sloth.Interfaces.Core;
using System;
namespace Sloth.Core
{
public class WinUtilities : IWinUtilities
{
public IntPtr FindControlHandle(IntPtr windowsHandle, string controlName)
{
throw new NotImplementedException();
}
public IntPtr FindWindowsHandle(string c... | using Sloth.Interfaces.Core;
using System;
using System.Runtime.InteropServices;
using System.Text;
namespace Sloth.Core
{
public class WinUtilities : IWinUtilities
{
public IntPtr FindControlHandle(IntPtr windowsHandle, string controlName)
{
throw new NotImplementedException();
... |
Create project and editor explicitly | // Copyright (c) Wiesław Šoltés. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Dependencies;
namespace Core2D.Sample
{
... | // Copyright (c) Wiesław Šoltés. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Dependencies;
namespace Core2D.Sample
{
... |
Change messages attribute to type "object" | using System;
using System.Collections.Generic;
using Newtonsoft.Json;
namespace Shippo
{
[JsonObject (MemberSerialization.OptIn)]
public class BatchShipment : ShippoId
{
[JsonProperty (PropertyName = "object_status")]
public string ObjectStatus;
[JsonProperty (PropertyName = "car... | using System;
using System.Collections.Generic;
using Newtonsoft.Json;
namespace Shippo
{
[JsonObject (MemberSerialization.OptIn)]
public class BatchShipment : ShippoId
{
[JsonProperty (PropertyName = "object_status")]
public string ObjectStatus;
[JsonProperty (PropertyName = "car... |
Adjust timing ratio to prevent occasional failing | using System;
using System.Threading;
using System.Windows.Threading;
using Throttle;
using Xunit;
using TomsToolbox.Desktop;
public class ThrottleSample
{
int throttledCalls;
[Fact]
public void Run()
{
var dispatcher = Dispatcher.CurrentDispatcher;
dispatcher.BeginInvoke(() =>
... | using System;
using System.Threading;
using System.Windows.Threading;
using Throttle;
using Xunit;
using TomsToolbox.Desktop;
public class ThrottleSample
{
int throttledCalls;
[Fact]
public void Run()
{
var dispatcher = Dispatcher.CurrentDispatcher;
dispatcher.BeginInvoke(() =>
... |
Remove random SoftPwm test code | using System;
using Treehopper;
using System.Threading.Tasks;
using System.Diagnostics;
using System.Collections.Generic;
using System.Threading;
namespace Blink
{
/// <summary>
/// This demo blinks the built-in LED using async programming.
/// </summary>
class Program
{
static Treehopper... | using System;
using Treehopper;
using System.Threading.Tasks;
using System.Diagnostics;
using System.Collections.Generic;
using System.Threading;
namespace Blink
{
/// <summary>
/// This demo blinks the built-in LED using async programming.
/// </summary>
class Program
{
static Treehopper... |
Fix Navigation link on acl | @model biz.dfch.CS.Appclusive.UI.Models.Core.Acl
@using biz.dfch.CS.Appclusive.UI.App_LocalResources
@if (Model != null && !string.IsNullOrEmpty(Model.Name))
{
if (biz.dfch.CS.Appclusive.UI.Navigation.PermissionDecisions.Current.HasPermission(Model.GetType(), "CanRead"))
{
string id = (string)ViewCont... | @model biz.dfch.CS.Appclusive.UI.Models.Core.Acl
@using biz.dfch.CS.Appclusive.UI.App_LocalResources
@if (Model != null && !string.IsNullOrEmpty(Model.Name))
{
if (biz.dfch.CS.Appclusive.UI.Navigation.PermissionDecisions.Current.HasPermission(Model.GetType(), "CanRead"))
{
string id = (string)ViewCont... |
Remove drop menus from main menu | <header class="main-header">
<div class="row">
<div class="column">
<ul class="menu">
<li class="mobile-expand" id="mobile-expand">
<a href="#">
<i class="fa fa-align-justify"></i>
</a>
</li>
... | <header class="main-header">
<div class="row">
<div class="column">
<ul class="menu">
<li class="mobile-expand" id="mobile-expand">
<a href="#">
<i class="fa fa-align-justify"></i>
</a>
</li>
... |
Make sure playerComp is in the node lookup list | using System.Collections.Generic;
using Hacknet;
using HarmonyLib;
using Pathfinder.Event;
using Pathfinder.Event.Loading;
using Pathfinder.Util;
namespace Pathfinder.BaseGameFixes.Performance
{
[HarmonyPatch]
internal static class NodeLookup
{
[HarmonyPostfix]
[HarmonyPatch(typeof(List<Co... | using System.Collections.Generic;
using Hacknet;
using HarmonyLib;
using Pathfinder.Event;
using Pathfinder.Event.Loading;
using Pathfinder.Util;
namespace Pathfinder.BaseGameFixes.Performance
{
[HarmonyPatch]
internal static class NodeLookup
{
[HarmonyPostfix]
[HarmonyPatch(typeof(List<Co... |
Add GetEndpointData manual test to ConsoleAppTester | using System;
using System.Linq;
namespace SSLLWrapper.ConsoleAppTester
{
class Program
{
private const string apiUrl = "https://api.dev.ssllabs.com/api/fa78d5a4";
static void Main(string[] args)
{
AnalyzeTester();
}
static void AnalyzeTester()
{
var apiService = new ApiService(apiUrl);
var a... | using System;
using System.Linq;
namespace SSLLWrapper.ConsoleAppTester
{
class Program
{
private const string ApiUrl = "https://api.dev.ssllabs.com/api/fa78d5a4";
static readonly ApiService ApiService = new ApiService(ApiUrl);
static void Main(string[] args)
{
//AnalyzeTester();
//InfoTester();
G... |
Use element type name for variable names | using Mono.Cecil;
using Mono.Cecil.Cil;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
namespace MonoMod.DebugIL {
public static class DebugILGeneratorExt {
public readonly static Type ... | using Mono.Cecil;
using Mono.Cecil.Cil;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
namespace MonoMod.DebugIL {
public static class DebugILGeneratorExt {
public readonly static Type ... |
Fix GetStocks by reading the response in the proper format. | using System.Threading.Tasks;
using Stockfighter.Helpers;
namespace Stockfighter
{
public class Venue
{
public string Symbol { get; private set; }
public Venue(string symbol)
{
Symbol = symbol;
}
public async Task<bool> IsUp()
{
using (... | using System.Threading.Tasks;
using Stockfighter.Helpers;
namespace Stockfighter
{
public class Venue
{
public string Symbol { get; private set; }
public Venue(string symbol)
{
Symbol = symbol;
}
public async Task<bool> IsUp()
{
using (... |
Fix compiler error introduced by merge conflict | // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.IO;
namespace RepoTasks.ProjectModel
{
internal class ProjectInfo
{
public... | // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.IO;
namespace RepoTasks.ProjectModel
{
internal class ProjectInfo
{
public... |
Use FormatMessageHandler instead of eagerly formatting. | using System;
using System.Threading.Tasks;
using System.Web;
using System.Web.UI;
using Common.Logging;
namespace NuGet.Lucene.Web
{
public static class UnhandledExceptionLogger
{
internal static readonly ILog Log = LogManager.GetLogger(typeof(UnhandledExceptionLogger));
public static void L... | using System;
using System.Threading.Tasks;
using System.Web;
using System.Web.UI;
using Common.Logging;
namespace NuGet.Lucene.Web
{
public static class UnhandledExceptionLogger
{
internal static readonly ILog Log = LogManager.GetLogger(typeof(UnhandledExceptionLogger));
public static void L... |
Update message converter to access context | using Newtonsoft.Json;
using System;
using System.Globalization;
using System.IO;
using System.Text;
namespace Glimpse
{
public class DefaultMessageConverter : IMessageConverter
{
private readonly JsonSerializer _jsonSerializer;
public DefaultMessageConverter(JsonSerializer jsonSerializer)
... | using Newtonsoft.Json;
using System;
using System.Globalization;
using System.IO;
using System.Text;
namespace Glimpse
{
public class DefaultMessageConverter : IMessageConverter
{
private readonly JsonSerializer _jsonSerializer;
private readonly IServiceProvider _serviceProvider;
publ... |
Add ToString override to Process File | using System.ComponentModel;
using System.Diagnostics;
using Xceed.Wpf.Toolkit.PropertyGrid.Attributes;
namespace DesktopWidgets.Classes
{
[ExpandableObject]
[DisplayName("Process File")]
public class ProcessFile : FilePath
{
public ProcessFile(string path) : base(path)
{
P... | using System.ComponentModel;
using System.Diagnostics;
using Xceed.Wpf.Toolkit.PropertyGrid.Attributes;
namespace DesktopWidgets.Classes
{
[ExpandableObject]
[DisplayName("Process File")]
public class ProcessFile : FilePath
{
public ProcessFile(string path) : base(path)
{
P... |
Add Start Manually option to IMEI prefab | using System;
using UnityEngine;
namespace com.adjust.sdk.imei
{
public class AdjustImei : MonoBehaviour
{
private const string errorMsgEditor = "[AdjustImei]: Adjust IMEI plugin can not be used in Editor.";
private const string errorMsgPlatform = "[AdjustImei]: Adjust IMEI plugin can only be u... | using System;
using UnityEngine;
namespace com.adjust.sdk.imei
{
public class AdjustImei : MonoBehaviour
{
private const string errorMsgEditor = "[AdjustImei]: Adjust IMEI plugin can not be used in Editor.";
private const string errorMsgPlatform = "[AdjustImei]: Adjust IMEI plugin can only be u... |
Fix Trigger2D wrong method names | using UnityEngine;
namespace Devdayo
{
[DisallowMultipleComponent]
public class TriggerEnter2D : FsmEvent<Collider2D>
{
void OnTrigger2DEnter(Collider2D other)
{
Notify(other);
}
}
[DisallowMultipleComponent]
public class TriggerStay2D : FsmEvent<Collider2D... | using UnityEngine;
namespace Devdayo
{
[DisallowMultipleComponent]
public class TriggerEnter2D : FsmEvent<Collider2D>
{
void OnTriggerEnter2D(Collider2D other)
{
Notify(other);
}
}
[DisallowMultipleComponent]
public class TriggerStay2D : FsmEvent<Collider2D... |
Make this interface disposable so taht code analysis should hopefully remind users to call .Dispose on it. | // Copyright © 2010-2015 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
using System.Collections.Specialized;
namespace CefSharp
{
public interface IRequest
{
string Url { get; set; }
string Me... | // Copyright © 2010-2015 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
using System;
using System.Collections.Specialized;
namespace CefSharp
{
public interface IRequest : IDisposable
{
string Url { g... |
Add auth to Learners endpoint | using System;
using System.Net;
using System.Threading.Tasks;
using MediatR;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using SFA.DAS.CommitmentsV2.Api.Types.Responses;
using SFA.DAS.CommitmentsV2.Application.Queries.GetAllLearners;
namespace SFA.DAS.CommitmentsV2.Api.Controllers
{
[ApiController]
... | using MediatR;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using SFA.DAS.CommitmentsV2.Api.Types.Responses;
using SFA.DAS.CommitmentsV2.Application.Queries.GetAllLearners;
using System;
using System.Net;
using System.Threading.Tasks;
namespace SFA.DAS.CommitmentsV2... |
Check for AD credentials, check if local account | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Andromeda
{
public static class CredentialManager
{
public static string GetUser()
{
return "null";
}
public static string GetPass()
... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.DirectoryServices.AccountManagement;
namespace Andromeda
{
public static class CredentialManager
{
public static string UserName { get; set; }
public static string GetDomain()
{
... |
Replace the BELL character before writing to the console. | namespace ForwarderConsole
{
using System;
using System.Text;
public static class Print
{
public static void Error(string error)
{
InternalPrint("--- ERROR --", error, ConsoleColor.Red);
}
public static void Request(byte[] bytes)
{
strin... | namespace ForwarderConsole
{
using System;
using System.Text;
public static class Print
{
public static void Error(string error)
{
InternalPrint("--- ERROR --", error, ConsoleColor.Red);
}
public static void Request(byte[] bytes)
{
strin... |
Add Bigsby Trovalds was here | using System;
namespace ConsoleApplication
{
public class Program
{
public static void Main(string[] args)
{
Console.WriteLine("Hello World, I was created by my father, Bigsby, in an unidentified evironment!");
Console.WriteLine("Bigsby Gates was here!");
}
... | using System;
namespace ConsoleApplication
{
public class Program
{
public static void Main(string[] args)
{
Console.WriteLine("Hello World, I was created by my father, Bigsby, in an unidentified evironment!");
Console.WriteLine("Bigsby Gates was here!");
Co... |
Use the AppData instead of the CommonAppData folder to save the profile and settings, to avoid the UAC. | using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Mime;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace CloudNotes.DesktopClient
{
public static class Directories
{
private const string CloudNotesDataFolder = "Cl... | using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Mime;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace CloudNotes.DesktopClient
{
public static class Directories
{
private const string CloudNotesDataFolder = "Cl... |
Clean up old BoundObject code | using CefSharp.Wpf;
using System.Windows.Controls;
namespace Cactbot
{
public partial class BrowserControl : UserControl
{
public BrowserControl()
{
DataContext = this;
InitializeComponent();
CreationHandlers = delegate {};
}
public delegate... | using CefSharp.Wpf;
using System.Windows.Controls;
namespace Cactbot
{
public partial class BrowserControl : UserControl
{
public BrowserControl()
{
DataContext = this;
InitializeComponent();
CreationHandlers = delegate {};
}
public delegate... |
Use Id instead of fixed value | using System;
namespace Business.Core
{
public partial class Individual
{
public IDatabase Database { get; private set; }
public Individual(IDatabase database, UInt64? id = null) {
Database = database;
if(id != null)
Load((UInt64)id);
}
private void Load(UInt64 id) {
// Overwrite this object w... | using System;
namespace Business.Core
{
public partial class Individual
{
public IDatabase Database { get; private set; }
public Individual(IDatabase database, UInt64? id = null) {
Database = database;
if(id != null)
Load((UInt64)id);
}
private void Load(UInt64 id) {
// Overwrite this object w... |
Fix ctor to take arbitrary object type as model. | // ViewUserControl.cs
// Copyright (c) Nikhil Kothari, 2008. All Rights Reserved.
// http://www.nikhilk.net
//
// Silverlight.FX is an application framework for building RIAs with Silverlight.
// This project is licensed under the BSD license. See the accompanying License.txt
// file for more information.
// For updat... | // ViewUserControl.cs
// Copyright (c) Nikhil Kothari, 2008. All Rights Reserved.
// http://www.nikhilk.net
//
// Silverlight.FX is an application framework for building RIAs with Silverlight.
// This project is licensed under the BSD license. See the accompanying License.txt
// file for more information.
// For updat... |
Remove duplicate addresses before converting to dictionary | using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Sockets;
namespace Nowin
{
public class IpIsLocalChecker : IIpIsLocalChecker
{
readonly Dictionary<IPAddress, bool> _dict;
public IpIsLocalChecker()
{
var host = Dns.GetHostEntry(Dns.Get... | using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Sockets;
namespace Nowin
{
public class IpIsLocalChecker : IIpIsLocalChecker
{
readonly Dictionary<IPAddress, bool> _dict;
public IpIsLocalChecker()
{
var host = Dns.GetHostEntry(Dns.Get... |
Change default attributeStyle to lower for search | using System;
using System.Net.Http;
using System.Web.Http.Controllers;
using System.Web.Http.ModelBinding;
using WebAPI.Domain.InputOptions;
namespace WebAPI.API.ModelBindings
{
public class SearchOptionsModelBinding : IModelBinder
{
public bool BindModel(HttpActionContext actionContext, ModelBinding... | using System;
using System.Net.Http;
using System.Web.Http.Controllers;
using System.Web.Http.ModelBinding;
using WebAPI.Domain.InputOptions;
namespace WebAPI.API.ModelBindings
{
public class SearchOptionsModelBinding : IModelBinder
{
public bool BindModel(HttpActionContext actionContext, ModelBinding... |
Fix incorrect file path in benchmarks | using System.IO;
using BenchmarkDotNet.Attributes;
using FreeImageAPI;
using ImageMagick;
using DS = DevILSharp;
namespace Pfim.Benchmarks
{
public class TargaBenchmark
{
[Params("true-32-rle-large.tga", "true-24-large.tga", "true-24.tga", "true-32-rle.tga", "rgb24_top_left")]
public string Pa... | using System.IO;
using BenchmarkDotNet.Attributes;
using FreeImageAPI;
using ImageMagick;
using DS = DevILSharp;
namespace Pfim.Benchmarks
{
public class TargaBenchmark
{
[Params("true-32-rle-large.tga", "true-24-large.tga", "true-24.tga", "true-32-rle.tga", "rgb24_top_left.tga")]
public strin... |
Use <Title in about page. | @page "/about"
@inject Navigator Navigator
<h1>Money</h1>
<h4>Neptuo</h4>
<p class="gray">
v@(typeof(About).Assembly.GetName().Version.ToString(3))
</p>
<p>
<a target="_blank" href="@Navigator.UrlMoneyProject()">Documentation</a>
</p>
<p>
<a target="_blank" href="@Navigator.UrlMoneyProjectIssueNew()">Repo... | @page "/about"
@inject Navigator Navigator
<Title Main="Money" Sub="Nepuo" />
<p class="gray">
v@(typeof(About).Assembly.GetName().Version.ToString(3))
</p>
<p>
<a target="_blank" href="@Navigator.UrlMoneyProject()">Documentation</a>
</p>
<p>
<a target="_blank" href="@Navigator.UrlMoneyProjectIssueNew()"... |
Set port to -1 if port is 80 | using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNet.SignalR.Owin;
namespace JabbR.Middleware
{
using AppFunc = Func<IDictionary<string, object>, Task>;
public class RequireHttpsHandler
{
private readonly AppFunc _next;
public RequireHttps... | using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNet.SignalR.Owin;
namespace JabbR.Middleware
{
using AppFunc = Func<IDictionary<string, object>, Task>;
public class RequireHttpsHandler
{
private readonly AppFunc _next;
public RequireHttps... |
Add GetExtent to viewport extensions | using Mapsui.Utilities;
using System;
using System.Collections.Generic;
using System.Text;
namespace Mapsui.Extensions
{
public static class ViewportExtensions
{
/// <summary>
/// True if Width and Height are not zero
/// </summary>
public static bool HasSize(this IReadOnlyView... | using Mapsui.Utilities;
using System;
using System.Collections.Generic;
using System.Text;
namespace Mapsui.Extensions
{
public static class ViewportExtensions
{
/// <summary>
/// True if Width and Height are not zero
/// </summary>
public static bool HasSize(this IReadOnlyView... |
Change guild permissions to have ReadGuildConfig when ViewAuditLog is true. | using Discord;
using System;
namespace MitternachtWeb.Models {
[Flags]
public enum BotLevelPermission {
None = 0b_0000,
ReadBotConfig = 0b_0001,
WriteBotConfig = 0b_0011,
ReadAllGuildConfigs = 0b_0100,
WriteAllGuildConfigs = 0b_1100,
All = 0b_1111,
}
[Fl... | using Discord;
using System;
namespace MitternachtWeb.Models {
[Flags]
public enum BotLevelPermission {
None = 0b_0000,
ReadBotConfig = 0b_0001,
WriteBotConfig = 0b_0011,
ReadAllGuildConfigs = 0b_0100,
WriteAllGuildConfigs = 0b_1100,
All = 0b_1111,
}
[Fl... |
Use ParallelEnumerable in puzzle 10 | // Copyright (c) Martin Costello, 2015. All rights reserved.
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
namespace MartinCostello.ProjectEuler.Puzzles
{
using System;
using System.Linq;
/// <summary>
/// A class representing the sol... | // Copyright (c) Martin Costello, 2015. All rights reserved.
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
namespace MartinCostello.ProjectEuler.Puzzles
{
using System;
using System.Linq;
/// <summary>
/// A class representing the sol... |
Remove unused variable compiler warning when building release build. | using CommonUtil.Disk;
namespace Common
{
public static class SourceDirectoryFinder
{
private static string crayonSourceDirectoryCached = null;
public static string CrayonSourceDirectory
{
// Presumably running from source. Walk up to the root directory and find th... | using CommonUtil.Disk;
namespace Common
{
public static class SourceDirectoryFinder
{
private static string crayonSourceDirectoryCached = null;
public static string CrayonSourceDirectory
{
// Presumably running from source. Walk up to the root directory and find th... |
Remove unhelpful line of code. | using System;
using Microsoft.AspNet.SignalR;
using Microsoft.Owin;
using Microsoft.Owin.Cors;
using Owin;
[assembly: OwinStartup(typeof(SignInCheckIn.Startup))]
[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config", Watch = true)]
namespace SignInCheckIn
{
public class Startup
{
pub... | using System;
using Microsoft.AspNet.SignalR;
using Microsoft.Owin;
using Microsoft.Owin.Cors;
using Owin;
[assembly: OwinStartup(typeof(SignInCheckIn.Startup))]
[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config", Watch = true)]
namespace SignInCheckIn
{
public class Startup
{
pub... |
Remove test fire schedule for eval due | using FluentScheduler;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Logging;
using System;
namespace BatteryCommander.Web.Jobs
{
internal static class JobHandler
{
public static void UseJobScheduler(this IApplicationBuilder app, ILoggerFactory loggerFactory)
{
var... | using FluentScheduler;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Logging;
using System;
namespace BatteryCommander.Web.Jobs
{
internal static class JobHandler
{
public static void UseJobScheduler(this IApplicationBuilder app, ILoggerFactory loggerFactory)
{
var... |
Update assembly info - copyright date | // --------------------------------------------------------------------------------------------------------------------
// <copyright file="GlobalAssemblyInfo.cs" company="Helix Toolkit">
// Copyright (c) 2014 Helix Toolkit contributors
// </copyright>
// -------------------------------------------------------------... | // --------------------------------------------------------------------------------------------------------------------
// <copyright file="GlobalAssemblyInfo.cs" company="Helix Toolkit">
// Copyright (c) 2014 Helix Toolkit contributors
// </copyright>
// -------------------------------------------------------------... |
Fix Razor tag helpers and usings | @using Dangl.WebDocumentation
@using Dangl.WebDocumentation.Models
@using Dangl.WebDocumentation.ViewModels.Account
@using Dangl.WebDocumentation.ViewModels.Manage
@using Microsoft.AspNet.Identity
@addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers"
@inject Microsoft.ApplicationInsights.Extensibility.TelemetryConfigurat... | @using Dangl.WebDocumentation
@using Dangl.WebDocumentation.Models
@using Dangl.WebDocumentation.ViewModels.Account
@using Dangl.WebDocumentation.ViewModels.Manage
@using Microsoft.AspNetCore.Identity
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
Update ViewComponentContext to respond to changed type |
namespace Glimpse.Agent.Internal.Inspectors.Mvc.Proxies
{
public interface IViewComponentContext
{
IViewComponentDescriptor ViewComponentDescriptor { get; }
object[] Arguments { get; }
}
}
|
using System.Collections.Generic;
namespace Glimpse.Agent.Internal.Inspectors.Mvc.Proxies
{
public interface IViewComponentContext
{
IViewComponentDescriptor ViewComponentDescriptor { get; }
IDictionary<string, object> Arguments { get; }
}
}
|
Convert to minutes in the duration display | @model Dashboard.Models.JobSummary
@{
ViewBag.Title = $"{Model.Name} Summary";
var summaryValues = string.Join(
";",
Model.JobDaySummaryList.Select(x => $"{x.Date.ToLocalTime().ToString("yyyy-MM-dd")},{x.Succeeded},{x.Failed},{x.Aborted}"));
var durationDates = string.Join(
";",
... | @model Dashboard.Models.JobSummary
@{
ViewBag.Title = $"{Model.Name} Summary";
var jobs = Model.JobDaySummaryList.OrderBy(x => x.Date);
var summaryValues = string.Join(
";",
jobs.Select(x => $"{x.Date.ToLocalTime().ToString("yyyy-MM-dd")},{x.Succeeded},{x.Failed},{x.Aborted}"));
var ... |
Allow progress dialog ready API call to proceed without sync (BL-11484) | using System;
using System.IO;
using System.Net;
using System.Windows.Forms;
using Bloom.Api;
using Bloom.Book;
using Bloom.MiscUI;
using Bloom.Publish;
using Bloom.Utils;
using SIL.IO;
namespace Bloom.web.controllers
{
public class ProgressDialogApi
{
private static Action _cancelHandler;
public static void Se... | using System;
using System.IO;
using System.Net;
using System.Windows.Forms;
using Bloom.Api;
using Bloom.Book;
using Bloom.MiscUI;
using Bloom.Publish;
using Bloom.Utils;
using SIL.IO;
namespace Bloom.web.controllers
{
public class ProgressDialogApi
{
private static Action _cancelHandler;
public static void Se... |
Add (temporary) event handler delegate. | using System;
using Microsoft.SPOT;
namespace IntervalTimer
{
public class IntervalTimer
{
public TimeSpan ShortDuration { get; set; }
public TimeSpan LongDuration { get; set; }
public IntervalTimer(TimeSpan shortDuration, TimeSpan longDuration)
{
Short... | using System;
using Microsoft.SPOT;
namespace IntervalTimer
{
public delegate void IntervalEventHandler(object sender, EventArgs e);
public class IntervalTimer
{
public TimeSpan ShortDuration { get; set; }
public TimeSpan LongDuration { get; set; }
public IntervalTime... |
Add double click to copy functionality | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;... |
Change invalid character enum to make more send (None becomes Error) |
/// <summary>
/// Action to take if the message text contains an invalid character
/// Valid characters are defined in the GSM 03.38 character set
/// </summary>
public enum InvalidCharacterAction
{
/// <summary>
/// Use the default setting from your account
/// </summary>
AccountDefault = 0,
/// ... |
/// <summary>
/// Action to take if the message text contains an invalid character
/// Valid characters are defined in the GSM 03.38 character set
/// </summary>
public enum InvalidCharacterAction
{
/// <summary>
/// Use the default setting from your account
/// </summary>
AccountDefault = 0,
/// ... |
Update version number to 0.3.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("TrayLeds")]
[assembly: AssemblyDescription... | 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("TrayLeds")]
[assembly: AssemblyDescription... |
Set title for console window. | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DangerousPanel_Server
{
class Program
{
static void Main(string[] args)
{
}
}
}
| using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DangerousPanel_Server
{
class Program
{
static void Log(string text, ConsoleColor color)
{
ConsoleColor oldColor = Console.ForegroundColor;
Cons... |
Rewrite request path to serve up index instead of sending it without content type | using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Http;
using Microsoft.AspNet.StaticFiles;
using Microsoft.Framework.DependencyInjection;
using Microsoft.Framework.Logging;
namespace DocNuget {
public class Startup {
public void ConfigureServices(IServiceCollection services) {
services.Ad... | using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Http;
using Microsoft.AspNet.StaticFiles;
using Microsoft.Framework.DependencyInjection;
using Microsoft.Framework.Logging;
namespace DocNuget {
public class Startup {
public void ConfigureServices(IServiceCollection services) {
services.Ad... |
Add a GetRootNode method, to match the interface of the sdk. | using System;
using System.Collections.Generic;
namespace FbxSharp
{
public class Scene : Document
{
public Scene(string name="")
{
RootNode = new Node();
Nodes.Add(RootNode);
}
public List<Node> Nodes = new List<Node>();
public Node RootNode { ... | using System;
using System.Collections.Generic;
namespace FbxSharp
{
public class Scene : Document
{
public Scene(string name="")
{
RootNode = new Node();
Nodes.Add(RootNode);
}
public List<Node> Nodes = new List<Node>();
public Node RootNode { ... |
Fix typo: ouath -> oauth | using System;
using System.Collections.Generic;
#if NET_45
using System.Collections.ObjectModel;
#endif
namespace Octokit
{
/// <summary>
/// Extra information returned as part of each api response.
/// </summary>
public class ApiInfo
{
public ApiInfo(IDictionary<string, Uri> links,
... | using System;
using System.Collections.Generic;
#if NET_45
using System.Collections.ObjectModel;
#endif
namespace Octokit
{
/// <summary>
/// Extra information returned as part of each api response.
/// </summary>
public class ApiInfo
{
public ApiInfo(IDictionary<string, Uri> links,
... |
Use linq expression to create dictionary | using System;
using System.Linq;
using System.Collections.Generic;
namespace Octokit
{
internal static class CollectionExtensions
{
public static TValue SafeGet<TKey, TValue>(this IReadOnlyDictionary<TKey, TValue> dictionary, TKey key)
{
Ensure.ArgumentNotNull(dictionary, "dictiona... | using System;
using System.Linq;
using System.Collections.Generic;
namespace Octokit
{
internal static class CollectionExtensions
{
public static TValue SafeGet<TKey, TValue>(this IReadOnlyDictionary<TKey, TValue> dictionary, TKey key)
{
Ensure.ArgumentNotNull(dictionary, "dictiona... |
Make internals visible to test assembly | using System.Reflection;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Basics Algorithms")]
[assembly: AssemblyCulture("")]
| using System.Reflection;
using System.Runtime.CompilerServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Basics Algorithms")]
[assembly: Assembly... |
Use prepared http client to build odata client. | using Autofac;
using Bit.ViewModel.Contracts;
using Simple.OData.Client;
using System;
using System.Net.Http;
namespace Prism.Ioc
{
public static class ContainerBuilderExtensions
{
public static ContainerBuilder RegisterODataClient(this ContainerBuilder containerBuilder)
{
if (cont... | using Autofac;
using Bit.ViewModel.Contracts;
using Simple.OData.Client;
using System;
using System.Net.Http;
namespace Prism.Ioc
{
public static class ContainerBuilderExtensions
{
public static ContainerBuilder RegisterODataClient(this ContainerBuilder containerBuilder)
{
if (cont... |
Set status code for not found servlet |
namespace WebServer
{
public class Default404Servlet : HTMLServlet
{
protected override void OnService()
{
Write(
DocType("html"),
Tag("html", lang => "en", another => "blah")(
Tag("head")(
Tag("title")("Er... |
namespace WebServer
{
public class Default404Servlet : HTMLServlet
{
protected override void OnService()
{
Response.StatusCode = 404;
Write(
DocType("html"),
Tag("html", lang => "en", another => "blah")(
Tag("head")(
... |
Check if initialize string is available before setting it | using System.Collections.Generic;
using AgGateway.ADAPT.ApplicationDataModel;
using AgGateway.ADAPT.PluginManager;
namespace AgGateway.ADAPT.Visualizer
{
public class DataProvider
{
private PluginFactory _pluginFactory;
public void Initialize(string pluginsPath)
{
_pluginF... | using System.Collections.Generic;
using AgGateway.ADAPT.ApplicationDataModel;
using AgGateway.ADAPT.PluginManager;
namespace AgGateway.ADAPT.Visualizer
{
public class DataProvider
{
private PluginFactory _pluginFactory;
public void Initialize(string pluginsPath)
{
_pluginF... |
Attach dev tools only in debug builds | // Copyright (c) Wiesław Šoltés. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Core2D.Avalonia
{
public class MainWindow : Window
{
public MainWin... | // Copyright (c) Wiesław Šoltés. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Core2D.Avalonia
{
public class MainWindow : Window
{
public MainWin... |
Set improved ThreadPool values for nancy | using System;
using System.Collections.Generic;
using System.Web;
using Nancy;
using Nancy.ErrorHandling;
namespace NancyBenchmark
{
public class Global : HttpApplication
{
protected void Application_Start()
{
}
}
} | using System;
using System.Collections.Generic;
using System.Web;
using Nancy;
using Nancy.ErrorHandling;
using System.Threading;
namespace NancyBenchmark
{
public class Global : HttpApplication
{
protected void Application_Start()
{
var threads = 40 * Environment.ProcessorCount;
... |
Rename TimeStamp to EventTimeStamp to avoid confusion with native Azure Table Storage "Timestamp" column | using System;
using System.Collections;
using System.Globalization;
using System.Text;
using Microsoft.WindowsAzure.Storage.Table;
using log4net.Core;
namespace log4net.Appender
{
internal sealed class AzureLoggingEventEntity : TableEntity
{
public AzureLoggingEventEntity(LoggingEvent e)
{
... | using System;
using System.Collections;
using System.Globalization;
using System.Text;
using Microsoft.WindowsAzure.Storage.Table;
using log4net.Core;
namespace log4net.Appender
{
internal sealed class AzureLoggingEventEntity : TableEntity
{
public AzureLoggingEventEntity(LoggingEvent e)
{
... |
Add support for vscode install via snap | using System;
using System.Collections.Generic;
using System.Linq;
namespace Assent.Reporters.DiffPrograms
{
public class VsCodeDiffProgram : DiffProgramBase
{
static VsCodeDiffProgram()
{
var paths = new List<string>();
if (DiffReporter.IsWindows)
{
... | using System;
using System.Collections.Generic;
using System.Linq;
namespace Assent.Reporters.DiffPrograms
{
public class VsCodeDiffProgram : DiffProgramBase
{
static VsCodeDiffProgram()
{
var paths = new List<string>();
if (DiffReporter.IsWindows)
{
... |
Add the extension method ToSJIS() | using System.Linq;
using System.Text;
namespace ReimuPlugins.Common
{
public static class StringExtensions
{
public static string ToCStr(this string str)
{
return str.Contains('\0') ? str : str + '\0';
}
public static string Convert(this string str, Encoding src, E... | using System.Linq;
using System.Text;
namespace ReimuPlugins.Common
{
public static class StringExtensions
{
public static string ToCStr(this string str)
{
return str.Contains('\0') ? str : str + '\0';
}
public static string Convert(this string str, Encoding src, E... |
Fix typo in build. We should add tests. | using System;
namespace Equifax
{
/// <summary>
/// Creates globally secure Equifax-style GUIDs.
/// </summary>
public static class Guid
{
/// <summary>
/// Creates a new Equifax secure GUID using the current UTC time.
/// UTC ensures global consistency and uniqueness.
... | using System;
namespace Equifax
{
/// <summary>
/// Creates globally secure Equifax-style GUIDs.
/// </summary>
public static class Guid
{
/// <summary>
/// Creates a new Equifax secure GUID using the current UTC time.
/// UTC ensures global consistency and uniqueness.
... |
Stop the loop when there are no subscribers | using System;
using System.Diagnostics;
using System.Threading;
namespace Avalonia.Rendering
{
public class SleepLoopRenderTimer : IRenderTimer
{
public event Action<TimeSpan> Tick;
public SleepLoopRenderTimer(int fps)
{
var timeBetweenTicks = TimeSpan.FromSeconds(1d / fps)... | using System;
using System.Diagnostics;
using System.Threading;
namespace Avalonia.Rendering
{
public class SleepLoopRenderTimer : IRenderTimer
{
private Action<TimeSpan> _tick;
private int _count;
private readonly object _lock = new object();
private bool _running;
priv... |
Use th esupplied access mappign instead of looking it up a second time. | #if TFS2015u2
using System;
using System.Diagnostics.CodeAnalysis;
using Microsoft.TeamFoundation.Framework.Server;
using Microsoft.VisualStudio.Services.Location;
using Microsoft.VisualStudio.Services.Location.Server;
namespace Aggregator.Core.Extensions
{
public static class LocationServiceExtensions
{
... | #if TFS2015u2
using System;
using System.Diagnostics.CodeAnalysis;
using Microsoft.TeamFoundation.Framework.Server;
using Microsoft.VisualStudio.Services.Location;
using Microsoft.VisualStudio.Services.Location.Server;
namespace Aggregator.Core.Extensions
{
public static class LocationServiceExtensions
{
... |
Fix NH-2927 - Oracle Dialect does not handle the correct resolution for timestamp version columns | using System.Data;
using NHibernate.SqlCommand;
using NHibernate.SqlTypes;
namespace NHibernate.Dialect
{
public class Oracle9iDialect : Oracle8iDialect
{
public override string CurrentTimestampSelectString
{
get { return "select systimestamp from dual"; }
}
public override string CurrentTim... | using System.Data;
using NHibernate.SqlCommand;
using NHibernate.SqlTypes;
namespace NHibernate.Dialect
{
public class Oracle9iDialect : Oracle8iDialect
{
public override string CurrentTimestampSelectString
{
get { return "select systimestamp from dual"; }
}
public override string CurrentTim... |
Integrate cell resources with player resources code | using UnityEngine;
using System.Collections;
public class NurseryResource : CellFeature {
public override int Amount
{
set
{
// add _amount - value to the player's resource store
_amount = value;
Debug.Log("child thingy");
}
}
// Use this for ... | using UnityEngine;
using System.Collections;
public class NurseryResource : CellFeature {
public override int Amount
{
set
{
_amount = value;
FindObjectOfType<Resources>().addPlacementResource(_amount - value);
}
}
// Use this for initialization
void Sta... |
Fix casing of jQuery validation fallback test | <environment names="Development">
<script src="~/lib/jquery-validation/jquery.validate.js"></script>
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js"></script>
</environment>
<environment names="Staging,Production">
<script src="https://ajax.aspnetcdn.com/ajax/jquery.validat... | <environment names="Development">
<script src="~/lib/jquery-validation/jquery.validate.js"></script>
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js"></script>
</environment>
<environment names="Staging,Production">
<script src="https://ajax.aspnetcdn.com/ajax/jquery.validat... |
Implement IComparable interface for sorting | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TfsHelperLib
{
public class TfsChangeset
{
public int ChangesetId { get; set; }
public string Owner { get; set; }
public DateTime CreationDate {... | using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TfsHelperLib
{
public class TfsChangeset : IComparable
{
public int ChangesetId { get; set; }
public string Owner { get; set; }
... |
Change IGuild parameter to ulong | using System.Threading.Tasks;
using Discord;
using Discord.Commands;
using NoAdsHere.Common;
using NoAdsHere.Common.Preconditions;
namespace NoAdsHere.Commands.Master
{
public class MasterModule : ModuleBase
{
[Command("Reset Guild")]
[RequirePermission(AccessLevel.Master)]
public async... | using System.Threading.Tasks;
using Discord;
using Discord.Commands;
using NoAdsHere.Common;
using NoAdsHere.Common.Preconditions;
namespace NoAdsHere.Commands.Master
{
public class MasterModule : ModuleBase
{
[Command("Reset Guild")]
[RequirePermission(AccessLevel.Master)]
public async... |
Change model reference with old namespace to new | @model IEnumerable<Zk.Models.Crop>
@{
ViewBag.Title = "Gewassen";
}
<div id="top"></div>
<div id="yearCalendar">
<h1>Dit zijn de gewassen in onze database:</h1>
<table class="table table-striped">
<tr>
<th>Naam</th><th>Ras</th><th>Categorie</th><th>Opp. per 1</th>
<th>Opp. per zak</th><th>Prijs p... | @model IEnumerable<Oogstplanner.Models.Crop>
@{
ViewBag.Title = "Gewassen";
}
<div id="top"></div>
<div id="yearCalendar">
<h1>Dit zijn de gewassen in onze database:</h1>
<table class="table table-striped">
<tr>
<th>Naam</th><th>Ras</th><th>Categorie</th><th>Opp. per 1</th>
<th>Opp. per zak</th><... |
Remove studio repo Create call used for testing | using System;
using System.Collections.Generic;
using System.Linq;
using AutoMapper;
using ISTS.Domain.Studios;
namespace ISTS.Application.Studios
{
public class StudioService : IStudioService
{
private readonly IStudioRepository _studioRepository;
private readonly IMapper _mapper;
p... | using System;
using System.Collections.Generic;
using System.Linq;
using AutoMapper;
using ISTS.Domain.Studios;
namespace ISTS.Application.Studios
{
public class StudioService : IStudioService
{
private readonly IStudioRepository _studioRepository;
private readonly IMapper _mapper;
p... |
Fix build, this is not allwoed on the method itself | //
// Urho's Object C# sugar
//
// Authors:
// Miguel de Icaza (miguel@xamarin.com)
//
// Copyrigh 2015 Xamarin INc
//
using System;
using System.Runtime.InteropServices;
namespace Urho {
public partial class UrhoObject : RefCounted {
// Invoked by the subscribe methods
[UnmanagedFunctionPointer(CallingConv... | //
// Urho's Object C# sugar
//
// Authors:
// Miguel de Icaza (miguel@xamarin.com)
//
// Copyrigh 2015 Xamarin INc
//
using System;
using System.Runtime.InteropServices;
namespace Urho {
public partial class UrhoObject : RefCounted {
// Invoked by the subscribe methods
static void ObjectCallback (IntPtr da... |
Use the new reflection API on .NET 4.5 and .NET Core | // Copyright 2005-2015 Giacomo Stelluti Scala & Contributors. All rights reserved. See License.md in the project root for license information.
using System;
using System.Collections.Generic;
using System.Linq;
#if PLATFORM_DOTNET
using System.Reflection;
#endif
namespace CommandLine.Core
{
sealed clas... | // Copyright 2005-2015 Giacomo Stelluti Scala & Contributors. All rights reserved. See License.md in the project root for license information.
using System;
using System.Collections.Generic;
using System.Linq;
#if !NET40
using System.Reflection;
#endif
namespace CommandLine.Core
{
sealed class Verb
... |
Add skeleton code to main program | using CurrencyRates.Entity;
using System;
namespace CurrencyRates
{
class Program
{
static void Main(string[] args)
{
}
}
}
| using System;
namespace CurrencyRates
{
class Program
{
enum Actions { Fetch, Show };
static void Main(string[] args)
{
try
{
var action = Actions.Fetch;
if (args.Length > 0)
{
... |
Update top navigation dropdown menu | @(Html.X().Panel()
.Header(false)
.Region(Region.North)
.Border(false)
.Height(70)
.Content(
@<text>
<header class="site-header" role="banner">
<nav class="top-navigation">
<div class="logo-container">
<img src="../../resources/images/extd... | @(Html.X().Panel()
.Header(false)
.Region(Region.North)
.Border(false)
.Height(70)
.Content(
@<text>
<header class="site-header" role="banner">
<nav class="top-navigation">
<div class="logo-container">
<img src="../../resources/images/extd... |
Add remove method for cache | using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Caching;
using System.Text;
using System.Threading.Tasks;
namespace Mozu.Api.Cache
{
public class CacheManager
{
private readonly ObjectCache _cache;
private static readonly object _lockObj = new Object();
... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Caching;
using System.Text;
using System.Threading.Tasks;
namespace Mozu.Api.Cache
{
public class CacheManager
{
private readonly ObjectCache _cache;
private static readonly object _lockObj = new Object();
... |
Fix ansi filename decoded as gibberish in zip file | using System.Globalization;
using System.Text;
namespace SharpCompress.Common
{
public class ArchiveEncoding
{
/// <summary>
/// Default encoding to use when archive format doesn't specify one.
/// </summary>
public static Encoding Default;
/// <summary>
... | using System.Globalization;
using System.Text;
namespace SharpCompress.Common
{
public class ArchiveEncoding
{
/// <summary>
/// Default encoding to use when archive format doesn't specify one.
/// </summary>
public static Encoding Default;
/// <summary>
... |
Update to use UTC instead of local time | using System;
using System.Threading;
namespace Shuttle.Core.Infrastructure
{
public static class ThreadSleep
{
public const int MaxStepSize = 1000;
public static void While(int ms, IThreadState state)
{
// step size should be as large as possible,
// max step s... | using System;
using System.Threading;
namespace Shuttle.Core.Infrastructure
{
public static class ThreadSleep
{
public const int MaxStepSize = 1000;
public static void While(int ms, IThreadState state)
{
// step size should be as large as possible,
// max step s... |
Return 0xFF for an undefined cartridge read rather than 0x00 | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace elbgb_core.Memory
{
class NullCartridge : Cartridge
{
public NullCartridge(CartridgeHeader header, byte[] romData)
: base(header, romData)
{
}
public override byte ReadByte(usho... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace elbgb_core.Memory
{
class NullCartridge : Cartridge
{
public NullCartridge(CartridgeHeader header, byte[] romData)
: base(header, romData)
{
}
public override byte ReadByte(usho... |
Change priority of StrokeWatcherScheduler to Highest. | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Crevice.GestureMachine
{
using System.Threading;
using System.Drawing;
using Crevice.Core.FSM;
using Crevice.Core.Events;
using Crevice.Threading;
public class Gesture... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Crevice.GestureMachine
{
using System.Threading;
using System.Drawing;
using Crevice.Core.FSM;
using Crevice.Core.Events;
using Crevice.Threading;
public class Gesture... |
Make sure the OWIN sample runs | namespace OwinApp
{
using System;
using Microsoft.Owin.Hosting;
using Owin;
using Nancy.Owin;
public class Program
{
public static void Main(string[] args)
{
const string url = "http://localhost:5000";
using (WebApp.Start(url, Configuration))
... | namespace OwinApp
{
using System;
using Microsoft.Owin.Hosting;
using Nancy.Bootstrappers.Autofac;
using Owin;
using Nancy.Owin;
public class Program
{
public static void Main(string[] args)
{
const string url = "http://localhost:5000";
using (WebAp... |
Fix minor bug for mix mode. | using UnityEngine;
using System.Collections;
public class GP_ResourcePhase : Phase
{
public override void OnEnter()
{
base.OnEnter();
var hexes = TowerManager.Instance.GetHexagonsInRange(CurrentPlayer, TowerType.ResourceTower);
var vision = RangeUtils.GetPlayerVisionServer(CurrentPla... | using UnityEngine;
using System.Collections;
public class GP_ResourcePhase : Phase
{
/*
public override void OnEnter()
{
base.OnEnter();
var hexes = TowerManager.Instance.GetHexagonsInRange(CurrentPlayer, TowerType.ResourceTower);
var vision = RangeUtils.GetPlayerVisionServer(Curr... |
Send keystrokes to the console main window | using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Grr
{
public static class ConsoleExtensions
{
[DllImport("User32.dll")]
static extern int SetF... | using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Grr
{
public static class ConsoleExtensions
{
[DllImport("User32.dll")]
static extern int SetF... |
Correct names of test methods | using FluentAssertions;
using NUnit.Framework;
namespace MyInfluxDbClient.UnitTests
{
public class ShowSeriesTests : UnitTestsOf<ShowSeries>
{
[Test]
public void Generate_Should_return_drop_series_When_constructed_empty()
{
SUT = new ShowSeries();
SUT.Generate()... | using FluentAssertions;
using NUnit.Framework;
namespace MyInfluxDbClient.UnitTests
{
public class ShowSeriesTests : UnitTestsOf<ShowSeries>
{
[Test]
public void Generate_Should_return_show_series_When_constructed_empty()
{
SUT = new ShowSeries();
SUT.Generate()... |
Change starting line in script processor to 1 instead of 0 for easier debugging | using System;
using System.IO;
using System.Text;
using System.Windows.Forms;
using CefSharp;
using CefSharp.WinForms;
namespace TweetDck.Resources{
static class ScriptLoader{
private const string UrlPrefix = "td:";
public static string LoadResource(string name){
try{
... | using System;
using System.IO;
using System.Text;
using System.Windows.Forms;
using CefSharp;
using CefSharp.WinForms;
namespace TweetDck.Resources{
static class ScriptLoader{
private const string UrlPrefix = "td:";
public static string LoadResource(string name){
try{
... |
Fix for segfault on end of Qt test | using System;
using NUnit.Framework;
using Gtk;
using Qyoto;
namespace Selene.Testing
{
[TestFixture]
public partial class Harness
{
[TestFixtureSetUp]
public void Setup()
{
#if GTK
string[] Dummy = new string[] { };
Init.Check(ref Dummy);
#endif
#if QYOTO
... | using System;
using NUnit.Framework;
using Gtk;
using Qyoto;
namespace Selene.Testing
{
[TestFixture]
public partial class Harness
{
[TestFixtureSetUp]
public void Setup()
{
#if GTK
string[] Dummy = new string[] { };
Init.Check(ref Dummy);
#endif
#if QYOTO
... |
Create a hysteresis observable transform. | using System.Collections;
using System.Collections.Generic;
using UniRx;
using UnityEngine;
public class GeneratedSignals
{
public static IObservable<float> CreateTriangleSignal(float period)
{
return Observable.IntervalFrame(1, FrameCountType.Update)
.Scan(0f, (c, _) => c + Time.deltaTime... | using System;
using System.Collections;
using System.Collections.Generic;
using UniRx;
using UnityEngine;
public static class GeneratedSignals
{
public static IObservable<float> CreateTriangleSignal(float period)
{
return Observable.IntervalFrame(1, FrameCountType.Update)
.Scan(0f, (c, _) ... |
Fix media player allocation error | using System.Collections.Generic;
using System.IO;
using System.Threading;
using DesktopWidgets.Properties;
using WMPLib;
namespace DesktopWidgets.Classes
{
public static class MediaPlayerStore
{
private static readonly List<WindowsMediaPlayer> _mediaPlayerList = new List<WindowsMediaPlayer>();
... | using System.Collections.Generic;
using System.IO;
using System.Threading;
using DesktopWidgets.Properties;
using WMPLib;
namespace DesktopWidgets.Classes
{
public static class MediaPlayerStore
{
private static readonly List<WindowsMediaPlayer> MediaPlayers = new List<WindowsMediaPlayer>
{
... |
Add ability to specify xml root without decorating the target class. | using System;
using System.IO;
using System.Text.RegularExpressions;
using System.Xml.Serialization;
namespace Rock.Messaging.Routing
{
public class XmlMessageParser : IMessageParser
{
public string GetTypeName(Type type)
{
var xmlRootAttribute = Attribute.GetCustomAttribute(type, ... | using System;
using System.Collections.Concurrent;
using System.IO;
using System.Text.RegularExpressions;
using System.Xml.Serialization;
namespace Rock.Messaging.Routing
{
public class XmlMessageParser : IMessageParser
{
private readonly ConcurrentDictionary<Type, XmlRootAttribute> _xmlRootAttributes... |
Use pure in-memory db in development environment | using LiteDB;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
namespace LanfeustBridge.Services
{
public class DbService
{
public DbService(DirectoryService directoryService)
{
var... | using LiteDB;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
namespace LanfeustBridge.Services
{
public class DbService
{
public DbService(DirectoryService directo... |
Add logic to inject NAME in ViewBag based of Identity | using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace MvcNG.Controllers
{
public class ngAppController : BaseTSController
{
//
// GET: /ngApp/main
public ActionResult main() { //DON'T USE Index - DON'T WORK!
... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Web
using System.Web.Mvc;
namespace MvcNG.Controllers
{
public class ngAppController : BaseTSController
{
//
// GET: /ngApp/main
public ActionResult main() { //DON'T USE Index - DON'T WORK!
... |
Replace copyright with LICENSE reference | using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("VulkanInfo GUI")]
[assembly: AssemblyDescription("Small program to obtain information from the Vulkan Runtime.")]
#if DEBUG
[assembly: AssemblyConfiguration("Debug")]
#else
[assembly: AssemblyConfiguration("Release")]... | using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("VulkanInfo GUI")]
[assembly: AssemblyDescription("Small program to obtain information from the Vulkan Runtime.")]
#if DEBUG
[assembly: AssemblyConfiguration("Debug")]
#else
[assembly: AssemblyConfiguration("Release")]... |
Remove superfluous call to ToImmutableArray | using System;
using System.Collections.Immutable;
namespace ApiPorter.Patterns
{
public sealed partial class PatternSearch
{
private PatternSearch(string text, ImmutableArray<PatternVariable> variables)
{
Text = text;
Variables = variables;
}
public sta... | using System;
using System.Collections.Immutable;
namespace ApiPorter.Patterns
{
public sealed partial class PatternSearch
{
private PatternSearch(string text, ImmutableArray<PatternVariable> variables)
{
Text = text;
Variables = variables;
}
public sta... |
Change "Note" default size / minimum size | using System.ComponentModel;
using DesktopWidgets.WidgetBase.Settings;
namespace DesktopWidgets.Widgets.Note
{
public class Settings : WidgetSettingsBase
{
public Settings()
{
Style.Width = 160;
Style.Height = 132;
}
[DisplayName("Saved Text")]
... | using System.ComponentModel;
using DesktopWidgets.WidgetBase.Settings;
namespace DesktopWidgets.Widgets.Note
{
public class Settings : WidgetSettingsBase
{
public Settings()
{
Style.MinWidth = 160;
Style.MinHeight = 132;
}
[DisplayName("Saved Text")]
... |
Allow only one instance of application | using System;
using System.IO;
using System.Windows.Forms;
namespace SteamShutdown
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
AppDomain.CurrentDom... | using System;
using System.Diagnostics;
using System.IO;
using System.Windows.Forms;
namespace SteamShutdown
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.