doc_id stringlengths 36 36 | metadata dict | input stringlengths 28 4.3k | output stringlengths 11 5.45k |
|---|---|---|---|
2eac847e-eb3d-4f4c-ba97-4b30b18ae515 | {
"language": "C#"
} | ```c#
using System;
using System.IO;
namespace dot10.PE {
/// <summary>
/// Represents the IMAGE_DATA_DIRECTORY PE section
/// </summary>
public class ImageDataDirectory : FileSection {
RVA virtualAddress;
uint dataSize;
/// <summary>
/// Default constructor
/// </summary>
public ImageDataDirectory()... | ```c#
using System;
using System.IO;
namespace dot10.PE {
/// <summary>
/// Represents the IMAGE_DATA_DIRECTORY PE section
/// </summary>
public class ImageDataDirectory : FileSection {
RVA virtualAddress;
uint dataSize;
/// <summary>
/// Returns the IMAGE_DATA_DIRECTORY.VirtualAddress field
/// </summ... |
6a4050f0-70bf-4719-86bc-b85b2eab923b | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NeuralNet.Configuration;
namespace NeuralNetTypes
{
class NeuralNetBooleanFormatter : NetInputOutputFormatter
{
private const double high = 0.9, low = 0.1, maxError = 0.1;
... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NeuralNet.Configuration;
namespace NeuralNetTypes
{
class NeuralNetBooleanFormatter : NetInputOutputFormatter
{
private const double high = 0.9, low = 0.1, maxError = 0.1;
... |
1231c49e-28ff-4aa6-a8b2-5bfebdc7529f | {
"language": "C#"
} | ```c#
namespace MultiMiner.Xgminer.Api
{
public class DeviceInformation
{
public string Kind { get; set; }
public int Index { get; set; }
public bool Enabled { get; set; }
public string Status { get; set; }
public double Temperature { get; set; }
public int FanSp... | ```c#
using System;
namespace MultiMiner.Xgminer.Api
{
public class DeviceInformation
{
public DeviceInformation()
{
Status = String.Empty;
}
public string Kind { get; set; }
public int Index { get; set; }
public bool Enabled { get; set; }
pu... |
771112c7-cf39-4ec2-9f4f-630fe7255dd1 | {
"language": "C#"
} | ```c#
using System.Collections.Generic;
namespace DiffPlex.DiffBuilder.Model
{
public enum ChangeType
{
Unchanged,
Deleted,
Inserted,
Imaginary,
Modified
}
public class DiffPiece
{
public ChangeType Type { get; set; }
public int? Position { ... | ```c#
using System.Collections.Generic;
namespace DiffPlex.DiffBuilder.Model
{
public enum ChangeType
{
Unchanged,
Deleted,
Inserted,
Imaginary,
Modified
}
public class DiffPiece
{
public ChangeType Type { get; set; }
public int? Position { ... |
c4c21fc9-a3ba-4228-99d9-bb8bff29c0f7 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Rock
{
/// <summary>
/// An implementation of <see cref="IApplicationInfo"/> that uses a config
/// file's appSettings section.
/// </summary>... | ```c#
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Rock
{
/// <summary>
/// An implementation of <see cref="IApplicationInfo"/> that uses a config
/// file's appSettings section.
/// </summary>... |
c6bb0954-8051-422e-90c5-f85601253b74 | {
"language": "C#"
} | ```c#
using System.Web.Http;
using System.Web.Http.Controllers;
using System.Web.Http.Filters;
namespace Umbraco.Web.WebApi
{
/// <summary>
/// Ensures controllers have detailed error messages even when debug mode is off
/// </summary>
public class EnableDetailedErrorsAttribute : ActionFilterAttribute... | ```c#
using System.Web;
using System.Web.Http;
using System.Web.Http.Controllers;
using System.Web.Http.Filters;
namespace Umbraco.Web.WebApi
{
/// <summary>
/// Ensures controllers have detailed error messages even when debug mode is off
/// </summary>
public class EnableDetailedErrorsAttribute : Act... |
d91867a7-48c9-459b-ba44-8b80d35cf86b | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
namespace Exceptionless.Core.Extensions {
public static class UriExtensions {
public static string ToQueryString(this NameValueCollection collection) {
return collection.AsKeyValuePai... | ```c#
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
namespace Exceptionless.Core.Extensions {
public static class UriExtensions {
public static string ToQueryString(this NameValueCollection collection) {
return collection.AsKeyValuePai... |
1c50b068-4bc5-429c-b2e4-af753abc02ec | {
"language": "C#"
} | ```c#
using System;
using System.Web.Mvc;
namespace NuGetGallery
{
public class HttpHeaderValueProviderFactory : ValueProviderFactory
{
public override IValueProvider GetValueProvider(ControllerContext controllerContext)
{
var request = controllerContext.RequestContext.HttpContext.... | ```c#
using System;
using System.Web.Mvc;
namespace NuGetGallery
{
public class HttpHeaderValueProviderFactory : ValueProviderFactory
{
public override IValueProvider GetValueProvider(ControllerContext controllerContext)
{
var request = controllerContext.RequestContext.HttpContext.... |
12a2910c-acd4-49fc-ba70-1149ef5aad93 | {
"language": "C#"
} | ```c#
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class NecrophageBehavior : AgentBehavior
{
// "pursue" nearest corpse
public override bool updatePlan(List<AgentPercept> percepts, int allottedWorkUnits)
{
Action newMoveAction;
Action newLookAction;
Agent tempAgent;... | ```c#
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class NecrophageBehavior : AgentBehavior
{
// "pursue" nearest corpse
public override bool updatePlan(List<AgentPercept> percepts, int allottedWorkUnits)
{
Action newMoveAction;
Action newLookAction;
Agent tempAgent;... |
0df0d875-0523-4aa4-a3c2-1af97c3081e0 | {
"language": "C#"
} | ```c#
using System;
using System.IO;
using Wasm.Binary;
namespace Wasm.Dump
{
public static class Program
{
public static void Main(string[] args)
{
if (args.Length != 1)
Console.WriteLine("usage: wasm-dump file.wasm");
WasmFile file;
using ... | ```c#
using System;
using System.IO;
using Wasm.Binary;
namespace Wasm.Dump
{
public static class Program
{
public static void Main(string[] args)
{
if (args.Length != 1)
{
Console.WriteLine("usage: wasm-dump file.wasm");
return;
... |
515ffb5c-7158-4b6d-886f-43fd44a8a95b | {
"language": "C#"
} | ```c#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MicrogameStage : Stage
{
public static string microgameId;
[SerializeField]
private string forceMicrogame;
public override Microgame getMicrogame(int num)
{
Microgame microgame = new Microgame(microgameId);
mi... | ```c#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MicrogameStage : Stage
{
public static string microgameId;
[SerializeField]
private string forceMicrogame;
public override void onStageStart()
{
//Update collection if microgame is forced, in case it... |
83d1ad4d-acee-404f-9067-4d135bf398d4 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Text;
namespace Csla.Core
{
/// <summary>
/// Contains event data for the RemovingItem
/// event.
/// </summary>
[Serializable]
public class RemovingItemEventArgs : EventArgs
{
private object _removingItem;
/// <summary>
/// ... | ```c#
using System;
using System.Collections.Generic;
using System.Text;
namespace Csla.Core
{
/// <summary>
/// Contains event data for the RemovingItem
/// event.
/// </summary>
public class RemovingItemEventArgs : EventArgs
{
private object _removingItem;
/// <summary>
/// Gets a reference ... |
2318eb9c-908a-497c-ab1b-d89604290284 | {
"language": "C#"
} | ```c#
using Newtonsoft.Json;
namespace Ivvy.API.Venue
{
public class CostCenter
{
public enum DefaultTypes
{
Other = 1,
VenueFood = 2,
VenueBeverage = 3,
VenueAudioVisual = 4,
VenueRoomHire = 5,
VenueAccommodation = 6,
... | ```c#
using Newtonsoft.Json;
namespace Ivvy.API.Venue
{
public class CostCenter : Account.CostCenter
{
[JsonProperty("parentId")]
public int? ParentId
{
get; set;
}
}
}``` |
65f809d9-6d7a-4b5a-ac73-c91fc7ab00fa | {
"language": "C#"
} | ```c#
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
namespace osu.Framework.Audio.Track
{
public struct TrackAmplitudes
{
public float LeftChannel;
public float RightChannel... | ```c#
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
using System;
namespace osu.Framework.Audio.Track
{
public struct TrackAmplitudes
{
public float LeftChannel;
public f... |
1c610146-82a1-4a49-9cae-21a991005136 | {
"language": "C#"
} | ```c#
namespace TraktApiSharp.Core
{
using System.Net.Http;
public class TraktConfiguration
{
internal TraktConfiguration()
{
ApiVersion = 2;
UseStagingUrl = false;
}
internal static HttpClient HTTP_CLIENT = null;
public int ApiVersion { ge... | ```c#
namespace TraktApiSharp.Core
{
using System.Net.Http;
/// <summary>Provides global client settings.</summary>
public class TraktConfiguration
{
internal TraktConfiguration()
{
ApiVersion = 2;
UseStagingUrl = false;
}
internal static HttpCl... |
b6be8f3d-1ad5-4871-bd8c-e1461a679380 | {
"language": "C#"
} | ```c#
using Mono.Addins;
[assembly:Addin ("Dnx",
Namespace = "MonoDevelop",
Version = "0.5",
Category = "IDE extensions")]
[assembly:AddinName ("DNX")]
[assembly:AddinDescription ("Adds .NET Core and ASP.NET Core support.")]
[assembly:AddinDependency ("Core", "6.0")]
[assembly:AddinDependency ("Ide", "6.0")]
[as... | ```c#
using Mono.Addins;
[assembly:Addin ("Dnx",
Namespace = "MonoDevelop",
Version = "0.5",
Category = "IDE extensions")]
[assembly:AddinName ("DNX")]
[assembly:AddinDescription ("Adds .NET Core and ASP.NET Core support.\n\nPlease uninstall any older version of the addin and restart the application before instal... |
01cbdb41-b67e-4a17-b6f3-f51b64f29ad9 | {
"language": "C#"
} | ```c#
using System.IO;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace LiteDB.Tests.Engine
{
[TestClass]
public class Shell_Tests
{
[TestMethod]
public void Shell_Commands()
{
using (var db = new LiteEngine(new MemoryStream()))
... | ```c#
using System.IO;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace LiteDB.Tests.Engine
{
[TestClass]
public class Shell_Tests
{
[TestMethod]
public void Shell_Commands()
{
using (var db = new LiteEngine(new MemoryStream()))
... |
c4cf368e-a4c0-4ba0-b8d4-f77dc6abe3b2 | {
"language": "C#"
} | ```c#
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Drawables;
using OpenTK;
namespace osu.Game.GameModes.P... | ```c#
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Drawables;
using OpenTK;
namespace osu.Game.GameModes.P... |
526ae324-266d-42db-9607-45bd58207339 | {
"language": "C#"
} | ```c#
using System.Collections.Generic;
namespace Mond.VirtualMachine
{
class Object
{
public readonly Dictionary<MondValue, MondValue> Values;
public bool Locked;
public MondValue Prototype;
public object UserData;
private MondState _dispatcherState;
public M... | ```c#
using System.Collections.Generic;
namespace Mond.VirtualMachine
{
class Object
{
public readonly Dictionary<MondValue, MondValue> Values;
public bool Locked;
public MondValue Prototype;
public object UserData;
private MondState _dispatcherState;
public M... |
837fd0ad-388f-45bc-8757-2e5ba0818e8e | {
"language": "C#"
} | ```c#
using Raven.Client;
using Raven.Client.Embedded;
using fn = qed.Functions;
namespace qed
{
public static partial class Functions
{
public static IDocumentStore GetRavenStore()
{
var ravenStore = GetConfiguration<IDocumentStore>(Constants.Configuration.RavenStoreKey);
... | ```c#
using Raven.Client;
using Raven.Client.Document;
using Raven.Client.Embedded;
using fn = qed.Functions;
namespace qed
{
public static partial class Functions
{
public static IDocumentStore GetRavenStore()
{
var ravenStore = GetConfiguration<IDocumentStore>(Constants.Configura... |
6c8300d8-6733-496b-a08f-9a553454050c | {
"language": "C#"
} | ```c#
using System.IO;
using System.Net.Sockets;
namespace ItzWarty.Networking {
public interface INetworkingProxy {
IConnectedSocket CreateConnectedSocket(string host, int port);
IConnectedSocket CreateConnectedSocket(ITcpEndPoint endpoint);
IListenerSocket CreateListenerSocket(int port);
... | ```c#
using System.IO;
using System.Net.Sockets;
namespace ItzWarty.Networking {
public interface INetworkingProxy {
IConnectedSocket CreateConnectedSocket(string host, int port);
IConnectedSocket CreateConnectedSocket(ITcpEndPoint endpoint);
IListenerSocket CreateListenerSocket(int port);
... |
bab250fe-380f-46a5-9f95-d641795e270a | {
"language": "C#"
} | ```c#
using System;
using System.Diagnostics;
using System.IO;
namespace WebMConverter
{
class FFplay : Process
{
public string FFplayPath = Path.Combine(Environment.CurrentDirectory, "Binaries", "Win32", "ffplay.exe");
public FFplay(string argument)
{
this.StartInfo.FileN... | ```c#
using System;
using System.Diagnostics;
using System.IO;
namespace WebMConverter
{
class FFplay : Process
{
public string FFplayPath = Path.Combine(Environment.CurrentDirectory, "Binaries", "Win32", "ffplay.exe");
public FFplay(string argument)
{
this.StartInfo.FileN... |
c4ef5ce2-6d54-4e03-8f0b-05a231dd1a49 | {
"language": "C#"
} | ```c#
using System.Collections.Generic;
using System.Threading;
using log4net.Appender;
using log4net.Core;
namespace ZeroLog.Benchmarks
{
internal class Log4NetTestAppender : AppenderSkeleton
{
private readonly bool _captureLoggedMessages;
private int _messageCount;
private ManualRese... | ```c#
using System.Collections.Generic;
using System.Threading;
using log4net.Appender;
using log4net.Core;
namespace ZeroLog.Benchmarks
{
internal class Log4NetTestAppender : AppenderSkeleton
{
private readonly bool _captureLoggedMessages;
private int _messageCount;
private ManualRese... |
b20d38c3-b89b-4358-880b-1460c821fff3 | {
"language": "C#"
} | ```c#
using Skoodle.Models;
using System.Data.Entity;
namespace Skoodle.App_Start
{
public class CustomInitializer: DropCreateDatabaseAlways<ApplicationDbContext>
{
protected override void Seed(ApplicationDbContext context)
{
context.Topics.Add(new Topic { Name = "Topic1", Category... | ```c#
using Skoodle.Models;
using System.Data.Entity;
namespace Skoodle.App_Start
{
public class CustomInitializer: DropCreateDatabaseAlways<ApplicationDbContext>
{
protected override void Seed(ApplicationDbContext context)
{
Cathegory Category1 = new Cathegory { CathegoryName = "C... |
836dd8ae-be62-4a2f-87e1-4d4d26d88277 | {
"language": "C#"
} | ```c#
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Training.CSharpWorkshop.Tests
{
[TestClass]
public class ProgramTests
{
[Ignore]
[TestMethod]
public void IgnoreTest()
{
Assert.Fail();
}
[TestMethod()]
pu... | ```c#
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Training.CSharpWorkshop.Tests
{
[TestClass]
public class ProgramTests
{
[Ignore]
[TestMethod]
public void IgnoreTest()
{
Assert.Fail();
}
[TestMethod()]
pu... |
e2b2742f-e452-4f4b-adc8-074b50b8640f | {
"language": "C#"
} | ```c#
// 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.IO;
using System.Runtime.InteropServices;
namespace Interop.FunctionalTests
{
public static class ChromeConstants... | ```c#
// 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.IO;
using System.Runtime.InteropServices;
namespace Interop.FunctionalTests
{
public static class ChromeConstants... |
7cdd2397-ab54-449d-84ac-6e9b8c40bda8 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Activation;
using System.ServiceModel.Web;
using System.Text;
namespace DemoWcfRest
{
[ServiceContract(Namespace = "")]
[AspNetCompatibilityRequirem... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Activation;
using System.ServiceModel.Web;
using System.Text;
namespace DemoWcfRest
{
[ServiceContract(Namespace = "")]
[AspNetCompatibilityRequirem... |
da90865f-fe73-4b54-aff5-f077057fb317 | {
"language": "C#"
} | ```c#
using System.Collections.Concurrent;
using LmpClient.Base;
using LmpClient.Base.Interface;
using LmpClient.Systems.Chat;
using LmpCommon.Message.Data.Motd;
using LmpCommon.Message.Interface;
namespace LmpClient.Systems.Motd
{
public class MotdMessageHandler : SubSystem<MotdSystem>, IMessageHandler
{
... | ```c#
using LmpClient.Base;
using LmpClient.Base.Interface;
using LmpCommon.Message.Data.Motd;
using LmpCommon.Message.Interface;
using System.Collections.Concurrent;
namespace LmpClient.Systems.Motd
{
public class MotdMessageHandler : SubSystem<MotdSystem>, IMessageHandler
{
public ConcurrentQueue<IS... |
a32f256f-bb8b-491b-b2a1-f4d992e5a4ee | {
"language": "C#"
} | ```c#
using UnityEngine;
public class Planet : MonoBehaviour {
[SerializeField]
private float _radius;
public float Radius {
get { return _radius; }
set { _radius = value; }
}
public float Permieter {
get { return 2 * Mathf.PI * Radius; }
}
public float Volume {
... | ```c#
using UnityEngine;
[ExecuteInEditMode]
public class Planet : MonoBehaviour {
[SerializeField]
private float _radius;
public float Radius {
get { return _radius; }
set { _radius = value; }
}
public float Permieter {
get { return 2 * Mathf.PI * Radius; }
}
pu... |
960da05a-88dc-4adf-9439-b12d81001093 | {
"language": "C#"
} | ```c#
using BatteryCommander.Web.Models;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System;
using System.IO;
namespace BatteryCommander.Web.Controllers
{
[Authorize, ApiExplorerSettings(IgnoreApi = true)]
public class AdminController : Controller
{
// Admin Tas... | ```c#
using BatteryCommander.Web.Models;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System;
using System.IO;
namespace BatteryCommander.Web.Controllers
{
[Authorize, ApiExplorerSettings(IgnoreApi = true)]
public class AdminController : Controller
{
// Admin Tas... |
30849e38-beb8-4f31-ad64-c3aabe2223a2 | {
"language": "C#"
} | ```c#
using Newtonsoft.Json;
using Swashbuckle.Swagger;
using System;
using System.Globalization;
using System.Linq;
using System.Reflection;
using Zinc.Json;
namespace Zinc.WebServices
{
/// <summary />
public class ZincSchemaFilter : ISchemaFilter
{
/// <summary />
public void Apply( Sch... | ```c#
using Newtonsoft.Json;
using Swashbuckle.Swagger;
using System;
using System.Globalization;
using System.Linq;
using System.Reflection;
using Zinc.Json;
namespace Zinc.WebServices
{
/// <summary />
public class ZincSchemaFilter : ISchemaFilter
{
/// <summary />
public void Apply( Sch... |
ca1c66b3-77f3-4a19-855c-ebe1e4ce0038 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Wox.Core.i18n
{
internal static class AvailableLanguages
{
public static Language English = new Language("en", "English");
public static Language Chinese = new Language("zh-cn", "中文");
... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Wox.Core.i18n
{
internal static class AvailableLanguages
{
public static Language English = new Language("en", "English");
public static Language Chinese = new Language("zh-cn", "中文");
... |
532616bc-26cf-4039-acba-b04bab87759b | {
"language": "C#"
} | ```c#
using System.ComponentModel;
using System.Runtime.CompilerServices;
using NDC2015.Annotations;
namespace NDC2015
{
public class ViewModelBase : INotifyPropertyChanged
{
protected void Set<T>(ref T member, T value, [CallerMemberName] string propertyName = null)
{
member = valu... | ```c#
using System.ComponentModel;
using System.Runtime.CompilerServices;
using NDC2015.Annotations;
namespace NDC2015
{
public class ViewModelBase : INotifyPropertyChanged
{
protected void Set<T>(ref T member, T value, [CallerMemberName] string propertyName = null)
{
member = valu... |
9ed2d8d9-7ffd-4790-a962-0c7deac9817b | {
"language": "C#"
} | ```c#
using System.Collections.Generic;
namespace CefSharp
{
public interface IDialogHandler
{
bool OnOpenFile(IWebBrowser browser, string title, string default_file_name, List<string> accept_types, out List<string> result);
}
}
```
Rename params to match convention | ```c#
using System.Collections.Generic;
namespace CefSharp
{
public interface IDialogHandler
{
bool OnOpenFile(IWebBrowser browser, string title, string defaultFileName, List<string> acceptTypes, out List<string> result);
}
}
``` |
d61ca95c-a9bd-4289-9dd7-017491b6d997 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using ColossalFramework.Plugins;
using ICities;
namespace ModTools
{
public static class FileUtil
{
public static List<string> ListFilesInDirectory(string path, List<string>... | ```c#
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using ColossalFramework.Plugins;
using ICities;
namespace ModTools
{
public static class FileUtil
{
public static List<string> ListFilesInDirectory(string path, List<string>... |
6a675503-8713-4b8f-9a86-6592348daab0 | {
"language": "C#"
} | ```c#
//using UnityEditor;
//using UnityEngine;
//using System.Collections;
using System.Diagnostics;
public class ShellHelpers {
public static Process StartProcess(string filename, string arguments) {
Process p = new Process();
p.StartInfo.Arguments = arguments;
p.StartInfo.CreateNoWindow = true;
p.... | ```c#
#define DEBUG_COMMANDS
//using UnityEditor;
//using UnityEngine;
//using System.Collections;
using System.Diagnostics;
public class ShellHelpers {
public static Process StartProcess(string filename, string arguments) {
#if DEBUG_COMMANDS
UnityEngine.Debug.Log("Running: " + filename + " " + arguments);
#end... |
32bb2de1-0858-4f21-bbdf-8804f2e66eb4 | {
"language": "C#"
} | ```c#
using System.Collections.Generic;
namespace MR.AspNet.Deps
{
public class OutputHelper
{
private List<Element> _elements = new List<Element>();
public void Add(Element element)
{
_elements.Add(element);
}
public void Add(List<Element> elements)
{
_elements.AddRange(elements);
}
public... | ```c#
using System.Collections.Generic;
namespace MR.AspNet.Deps
{
public class OutputHelper
{
private List<Element> _elements = new List<Element>();
public void Add(Element element)
{
_elements.Add(element);
}
public void Add(List<Element> elements)
{
_elements.AddRange(elements);
}
public... |
42e6e3d9-88e9-426f-8b25-c0a7cc90b88f | {
"language": "C#"
} | ```c#
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNet.Http;
using Microsoft.Net.Http.Headers;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
namespace Glimpse.Server.Web
{
public class MessageHistoryResource : IResource
{
private readonly InMemorySto... | ```c#
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNet.Http;
using Microsoft.Net.Http.Headers;
namespace Glimpse.Server.Web
{
public class MessageHistoryResource : IResource
{
private readonly InMemoryStorage _store;
public MessageHisto... |
c3ce8f1d-2608-4fd2-8255-03bd78501f5e | {
"language": "C#"
} | ```c#
using System.Data.Common;
using System.Management.Automation;
using Npgsql;
namespace InvokeQuery
{
[Cmdlet("Invoke", "PostgreSqlQuery", SupportsTransactions = true, SupportsShouldProcess = true, ConfirmImpact = ConfirmImpact.Low)]
public class InvokePostgreSqlQuery : InvokeQueryBase
{
... | ```c#
using Npgsql;
using System.Data.Common;
using System.Management.Automation;
namespace InvokeQuery
{
[Cmdlet("Invoke", "PostgreSqlQuery", SupportsTransactions = true, SupportsShouldProcess = true, ConfirmImpact = ConfirmImpact.Low)]
public class InvokePostgreSqlQuery : InvokeQueryBase
{
... |
99e0ad88-2ff9-4e0f-bc1f-10badea3b0cb | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using ICSharpCode.SharpZipLib.Tar;
namespace AppHarbor
{
public static class CompressionExtensions
{
public static void ToTar(this DirectoryInfo sourceDirectory, Stream output, string[] excludedDirectoryNames)
{
var arc... | ```c#
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using ICSharpCode.SharpZipLib.Tar;
namespace AppHarbor
{
public static class CompressionExtensions
{
public static void ToTar(this DirectoryInfo sourceDirectory, Stream output, string[] excludedDirectoryNames)
{
var arc... |
f1eff7f5-95a3-4209-9a72-4da96045ad9a | {
"language": "C#"
} | ```c#
using System;
using System.IO;
namespace Hangman {
public class Hangman {
public static void Main(string[] args) {
var wordGenerator = new RandomWord();
var word = wordGenerator.Word();
var game = new Game(word);
var width = Math.Min(81, Console.WindowWidth);
string titleText... | ```c#
using System;
using System.IO;
namespace Hangman {
public class Hangman {
public static void Main(string[] args) {
var wordGenerator = new RandomWord();
var word = wordGenerator.Word();
var game = new Game(word);
var width = Math.Min(81, Console.WindowWidth);
string titleText... |
9df10930-f288-4278-b56f-86bccd8c6fd0 | {
"language": "C#"
} | ```c#
using System;
using System.IO;
using System.Windows.Forms;
namespace osu_StreamCompanion.Code.Misc
{
class FileChecker
{
private string[] _requiredFiles = new[] { "SQLite.Interop.dll", "System.Data.SQLite.dll" };
private string caption = "StreamCompanion Error";
private string er... | ```c#
using System;
using System.IO;
using System.Windows.Forms;
namespace osu_StreamCompanion.Code.Misc
{
class FileChecker
{
private string[] _requiredFiles = new string[0];
private string caption = "StreamCompanion Error";
private string errorMessage =
"It seems that you... |
b268441d-186a-4635-a2cd-846ec2d6f2fe | {
"language": "C#"
} | ```c#
// 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 MessagePack;
using Newtonsoft.Json;
namespace osu.Game.Online.Rooms
{
/// <summary>
/// The local availability information about a cert... | ```c#
// 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 MessagePack;
using Newtonsoft.Json;
namespace osu.Game.Online.Rooms
{
/// <summary>
/// The local availability information about a cert... |
aed8cb11-643b-4507-9bc2-1d0a4651072c | {
"language": "C#"
} | ```c#
using System;
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.PhantomJS;
using OpenQA.Selenium.Chrome;
namespace Protractor.Samples.Basic
{
[TestFixture]
public class BasicTests
{
private IWebDriver driver;
[SetUp]
public void SetUp()
{
... | ```c#
using System;
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.PhantomJS;
using OpenQA.Selenium.Chrome;
namespace Protractor.Samples.Basic
{
[TestFixture]
public class BasicTests
{
private IWebDriver driver;
[SetUp]
public void SetUp()
{
... |
9e8f6f22-7945-40c0-9f87-82bcae3a3cfb | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace Stripe.Infrastructure
{
internal class SourceConverter : JsonConverter
{
public override bool CanConvert(Type objectType)
{
throw new NotImplementedException();
... | ```c#
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace Stripe.Infrastructure
{
internal class SourceConverter : JsonConverter
{
public override bool CanConvert(Type objectType)
{
throw new NotImplementedException();
... |
a2345cd6-bc21-4139-8ec8-2e2a34e38424 | {
"language": "C#"
} | ```c#
using System;
namespace Hangman {
public class Table {
public int Width;
public int Spacing;
public Row[] Rows;
public Table(int width, int spacing, Row[] rows) {
Width = width;
Spacing = spacing;
Rows = rows;
}
public string Draw() {
return "Hello World";
... | ```c#
using System;
using System.Collections.Generic;
using System.Text;
namespace Hangman {
public class Table {
public int Width;
public int Spacing;
public Row[] Rows;
public Table(int width, int spacing, Row[] rows) {
Width = width;
Spacing = spacing;
Rows = rows;
}
pu... |
9619c3ce-b163-4a08-adeb-0826792a9077 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
namespace MotivateMe.Web
{
public class MvcApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
namespace MotivateMe.Web
{
public class MvcApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
... |
51fc172d-8f34-4485-b7f3-ad3a9fa9a02e | {
"language": "C#"
} | ```c#
//
// IMarkdownViewBackend.cs
//
// Author:
// Jérémie Laval <jeremie.laval@xamarin.com>
//
// Copyright (c) 2012 Xamarin, Inc.
using System;
namespace Xwt.Backends
{
[Flags]
enum MarkdownInlineStyle
{
Italic,
Bold,
Monospace
}
public interface IMarkdownViewBackend : IWidgetBackend
{
object ... | ```c#
//
// IMarkdownViewBackend.cs
//
// Author:
// Jérémie Laval <jeremie.laval@xamarin.com>
//
// Copyright (c) 2012 Xamarin, Inc.
using System;
namespace Xwt.Backends
{
[Flags]
enum MarkdownInlineStyle
{
Italic,
Bold,
Monospace
}
public interface IMarkdownViewBackend : IWidgetBackend
{
object ... |
11e52b9b-773a-421e-a632-30a55816b75d | {
"language": "C#"
} | ```c#
#region License
//
// Copyright (c) 2013, Kooboo team
//
// Licensed under the BSD License
// See the file LICENSE.txt for details.
//
#endregion
using Kooboo.CMS.Sites.Extension.ModuleArea;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using Koobo... | ```c#
#region License
//
// Copyright (c) 2013, Kooboo team
//
// Licensed under the BSD License
// See the file LICENSE.txt for details.
//
#endregion
using Kooboo.CMS.Sites.Extension.ModuleArea;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using Koobo... |
2e11dcc7-172d-4b25-8ded-969881c031e3 | {
"language": "C#"
} | ```c#
using MultiMiner.Blockchain.Data;
using MultiMiner.ExchangeApi;
using MultiMiner.ExchangeApi.Data;
using MultiMiner.Utility.Net;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Net;
using System.Text;
namespace MultiMiner.Blockchain
{
public class ApiContext : IApiContext... | ```c#
using MultiMiner.Blockchain.Data;
using MultiMiner.ExchangeApi;
using MultiMiner.ExchangeApi.Data;
using MultiMiner.Utility.Net;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Net;
using System.Text;
namespace MultiMiner.Blockchain
{
public class ApiContext : IApiContext... |
8c0b3a03-a431-4f6e-b1c1-cafcde5bbb36 | {
"language": "C#"
} | ```c#
using System;
namespace OpenMagic.Extensions
{
public static class LazyExtensions
{
public static void DisposeValueIfCreated<T>(Lazy<T> obj) where T : IDisposable
{
if (obj.IsValueCreated)
{
obj.Value.Dispose();
}
}
}
}```
... | ```c#
using System;
namespace OpenMagic.Extensions
{
public static class LazyExtensions
{
public static void DisposeValueIfCreated<T>(this Lazy<T> obj) where T : IDisposable
{
if (obj.IsValueCreated)
{
obj.Value.Dispose();
}
}
}
}... |
549432fd-a550-4bb0-991b-6701e13522a8 | {
"language": "C#"
} | ```c#
using LogicalShift.Reason.Api;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
namespace LogicalShift.Reason.Tests
{
[TestFixture]
public class Truthiness
{
[Test]
public void TrueIsTrue()
{
Assert.IsTrue(Equals(Literal.Tr... | ```c#
using LogicalShift.Reason.Api;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
namespace LogicalShift.Reason.Tests
{
[TestFixture]
public class Truthiness
{
[Test]
public void TrueIsTrue()
{
Assert.IsTrue(Equals(Literal.Tr... |
864d63b1-4a0c-4df4-9deb-d9f282c34de7 | {
"language": "C#"
} | ```c#
using System.Net.Http;
namespace Mindscape.Raygun4Net.WebApi
{
public class RaygunWebApiDelegatingHandler : DelegatingHandler
{
public const string RequestBodyKey = "Raygun.RequestBody";
protected override async System.Threading.Tasks.Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, ... | ```c#
using System.Linq;
using System.Net.Http;
namespace Mindscape.Raygun4Net.WebApi
{
public class RaygunWebApiDelegatingHandler : DelegatingHandler
{
public const string RequestBodyKey = "Raygun.RequestBody";
protected override async System.Threading.Tasks.Task<HttpResponseMessage> SendAsync(HttpReque... |
b852f4d8-08d5-42e6-a5e9-c468e2b51022 | {
"language": "C#"
} | ```c#
using NUnit.Framework;
using RealmNet;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace IntegrationTests.Shared
{
[TestFixture]
public class StandAloneObjectTests
{
private Person _person;
[SetUp]
public void Se... | ```c#
using NUnit.Framework;
using RealmNet;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace IntegrationTests.Shared
{
[TestFixture]
public class StandAloneObjectTests
{
private Person _person;
[SetUp]
public void Se... |
a9c0ed69-4a1f-4bf4-a6db-31895eb5870a | {
"language": "C#"
} | ```c#
// 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.Threading.Tasks;
using Core2D.Editor;
using Core2D.Interfaces;
using Core2D.Wpf.Windows;
using Microsoft.Win32;
namespace Core2D.... | ```c#
// 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.Threading.Tasks;
using Core2D.Editor;
using Core2D.Interfaces;
using Core2D.Wpf.Windows;
using Microsoft.Win32;
namespace Core2D.... |
fae2c7bf-b21d-45d0-83af-72d772e8b584 | {
"language": "C#"
} | ```c#
using System;
namespace Huxley.Models {
public class DelaysResponse {
public DateTime GeneratedAt { get; set; }
public string LocationName { get; set; }
public string Crs { get; set; }
public string FilterLocationName { get; set; }
// Yes this is a typo but it... | ```c#
/*
Huxley - a JSON proxy for the UK National Rail Live Departure Board SOAP API
Copyright (C) 2015 James Singleton
* http://huxley.unop.uk
* https://github.com/jpsingleton/Huxley
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public Lic... |
80ba960f-901f-4a0e-b04f-2015eb89d620 | {
"language": "C#"
} | ```c#
using System;
using System.Web.Mvc;
using NinjaHive.Contract.Commands;
using NinjaHive.Contract.DTOs;
using NinjaHive.Contract.Queries;
using NinjaHive.Core;
using NinjaHive.WebApp.Services;
namespace NinjaHive.WebApp.Controllers
{
public class SkillsController : Controller
{
private readonly IQ... | ```c#
using System;
using System.Web.Mvc;
using NinjaHive.Contract.Commands;
using NinjaHive.Contract.DTOs;
using NinjaHive.Contract.Queries;
using NinjaHive.Core;
using NinjaHive.WebApp.Services;
namespace NinjaHive.WebApp.Controllers
{
public class SkillsController : Controller
{
private readonly IQ... |
4cde6f61-9867-4b8e-b5f4-62b06f9bb463 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ChamberLib
{
public class Overrides
{
public LightingData? Lighting;
public IMaterial Material;
public IShaderProgram ShaderProgram;
public IShaderStage VertexShader;
p... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ChamberLib
{
public class Overrides
{
public LightingData? Lighting;
public IMaterial Material;
public IShaderProgram ShaderProgram;
public IShaderStage VertexShader;
p... |
330d17cc-716b-4175-9565-f67921eefd70 | {
"language": "C#"
} | ```c#
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Collections.Generic;
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Rulesets.Osu.UI... | ```c#
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Collections.Generic;
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Testing.In... |
fc7a8371-a97d-4312-9a45-617ca379ee68 | {
"language": "C#"
} | ```c#
using System;
using System.Runtime.InteropServices;
using EnvDTE;
using EnvDTE80;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;
namespace CopyAsPathCommand
{
[PackageRegistration(UseManagedResourcesOnly = true)]
[ProvideMenuResource("Menus.ctmenu", 1)]
[InstalledPro... | ```c#
using System;
using System.Runtime.InteropServices;
using EnvDTE;
using EnvDTE80;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;
namespace CopyAsPathCommand
{
[PackageRegistration(UseManagedResourcesOnly = true)]
[ProvideMenuResource("Menus.ctmenu", 1)]
[InstalledPro... |
d98e966a-1869-4e87-a988-8bcab42c3a4e | {
"language": "C#"
} | ```c#
namespace Mappy
{
using System;
using System.ComponentModel;
using System.Reactive.Linq;
using System.Reactive.Subjects;
public static class ExtensionMethods
{
public static IObservable<TField> PropertyAsObservable<TSource, TField>(this TSource source, Func<TSource, TFie... | ```c#
namespace Mappy
{
using System;
using System.ComponentModel;
using System.Reactive.Linq;
using System.Reactive.Subjects;
public static class ExtensionMethods
{
public static BehaviorSubject<TField> PropertyAsObservable<TSource, TField>(this TSource source, Func<TSource, ... |
e1cbb2f6-9635-43b2-bd2a-50cc5897c8e7 | {
"language": "C#"
} | ```c#
// 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.IO;
namespace osu.Framework.Platform
{
/// <summary>
/// A <see cref="FileStream"/> which always flushes to disk on disposal.
/// </summar... | ```c#
// 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.IO;
namespace osu.Framework.Platform
{
/// <summary>
/// A <see cref="FileStream"/> which always flushes to disk on disposal.
/// </summar... |
305e34ee-7cb1-4884-9a97-bc441219dd8c | {
"language": "C#"
} | ```c#
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: AssemblyTit... | ```c#
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: AssemblyTit... |
9e60275b-e1fc-45b4-8a2c-a86931dcfbfe | {
"language": "C#"
} | ```c#
using System;
using Xunit;
using Xunit.Extensions;
namespace SemVer.Tests
{
public class LooseMode
{
[Theory]
[InlineData("=1.2.3", "1.2.3")]
[InlineData("v 1.2.3", "1.2.3")]
[InlineData("1.2.3alpha", "1.2.3-alpha")]
// SemVer spec is ambiguous about whether 01 in ... | ```c#
using System;
using Xunit;
using Xunit.Extensions;
namespace SemVer.Tests
{
public class LooseMode
{
[Theory]
[InlineData("=1.2.3", "1.2.3")]
[InlineData("v 1.2.3", "1.2.3")]
[InlineData("1.2.3alpha", "1.2.3-alpha")]
// SemVer spec is ambiguous about whether 01 in ... |
bf67e130-8996-4b25-a662-19f5130d4e09 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using Sharper.C.Control;
namespace Sharper.C.Data
{
using static TrampolineModule;
public static class EnumerableModule
{
public static B FoldLeft<A, B>(this IEnumerable<A> e, B x, Func<B, A, B> f)
=>
e.Aggregate(x, f);
pu... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using Sharper.C.Control;
namespace Sharper.C.Data
{
using static TrampolineModule;
public static class EnumerableModule
{
public static B FoldLeft<A, B>(this IEnumerable<A> e, B x, Func<B, A, B> f)
=>
e.Aggregate(x, f);
pu... |
ee5fb256-e153-4296-9767-6c1a5e3ed995 | {
"language": "C#"
} | ```c#
using System;
using System.CodeDom;
using System.Linq;
using Microsoft.CSharp;
namespace Ludiq.Reflection.Editor
{
public static class Extensions
{
// Used to print pretty type names for primitives
private static CSharpCodeProvider csharp = new CSharpCodeProvider();
/// <summary>
/// Returns the name... | ```c#
using System;
using System.CodeDom;
using System.Linq;
using System.Text.RegularExpressions;
using Microsoft.CSharp;
namespace Ludiq.Reflection.Editor
{
public static class Extensions
{
// Used to print pretty type names for primitives
private static CSharpCodeProvider csharp = new CSharpCodeProvider();
... |
3b68b27f-a893-462b-83fc-75f0ac99c03a | {
"language": "C#"
} | ```c#
using System.Reflection;
using System.Runtime.CompilerServices;
[assembly: AssemblyTitle("Affecto Authentication Server")]
[assembly: AssemblyProduct("Affecto Authentication Server")]
[assembly: AssemblyCompany("Affecto")]
[assembly: AssemblyVersion("2.1.0.0")]
[assembly: AssemblyFileVersion("2.1.0.0")]
[assem... | ```c#
using System.Reflection;
using System.Runtime.CompilerServices;
[assembly: AssemblyTitle("Affecto Authentication Server")]
[assembly: AssemblyProduct("Affecto Authentication Server")]
[assembly: AssemblyCompany("Affecto")]
[assembly: AssemblyVersion("2.1.0.0")]
[assembly: AssemblyFileVersion("2.1.0.0")]
[assem... |
2d5ce9d0-1b0d-4eb8-86b6-891a499a0d92 | {
"language": "C#"
} | ```c#
using System.Collections.Generic;
using System.Security.Cryptography;
namespace BloomFilter
{
class ExampleUsage
{
static void Main(string[] args)
{
//standard usage using SHA1 hashing
using (var bf = new BloomFilter<string>(MaxItems: 1000, FalsePositiveProbabilit... | ```c#
using System.Collections.Generic;
using System.Security.Cryptography;
namespace BloomFilter
{
class ExampleUsage
{
static void Main(string[] args)
{
//standard usage using SHA1 hashing
using (var bf = new BloomFilter<string>(MaxItems: 1000, FalsePositiveProbabilit... |
ad40f89e-c719-4f9d-851d-44c521d8159e | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Windows.Media.Imaging;
using KyleHughes.AboutDialog.WPF.Properties;
namespace KyleHughes.AboutDialog.WPF
{
/// <summary>
/// A class for extracting data from an Assembly.
/// </summary>
internal sealed class DesignVersionable : IVe... | ```c#
using System;
using System.Collections.Generic;
using System.Windows.Media.Imaging;
using KyleHughes.AboutDialog.WPF.Properties;
namespace KyleHughes.AboutDialog.WPF
{
/// <summary>
/// A class for extracting data from an Assembly.
/// </summary>
internal sealed class DesignVersionable : IVe... |
3e024eb7-e257-475d-b88d-04d2fec3d610 | {
"language": "C#"
} | ```c#
using System;
using Rooijakkers.MeditationTimer.Data.Contracts;
namespace Rooijakkers.MeditationTimer.Data
{
/// <summary>
/// Stores settings data in local settings storage
/// </summary>
public class Settings : ISettings
{
private const string TIME_TO_GET_READY_IN_SECONDS_STORAGE =... | ```c#
using System;
using Rooijakkers.MeditationTimer.Data.Contracts;
namespace Rooijakkers.MeditationTimer.Data
{
/// <summary>
/// Stores settings data in local settings storage
/// </summary>
public class Settings : ISettings
{
private const string TIME_TO_GET_READY_IN_SECONDS_STORAGE =... |
155a16ea-a138-4f08-9d2c-a50692121796 | {
"language": "C#"
} | ```c#
using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("NModbus4")]
[assembly: AssemblyProduct("NModbus4")]
[assembly: AssemblyCompany("Maxwe11")]
[assembly: AssemblyCopyright("Licensed under MIT License.")]
[assembly:... | ```c#
using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("NModbus4")]
[assembly: AssemblyProduct("NModbus4")]
[assembly: AssemblyCompany("Maxwe11")]
[assembly: AssemblyCopyright("Licensed under MIT License.")]
[assembly:... |
97ffebcf-e099-45a2-9126-933c5faddad9 | {
"language": "C#"
} | ```c#
#load nuget:https://www.myget.org/F/cake-contrib/api/v2?package=Cake.Recipe&prerelease
Environment.SetVariableNames();
BuildParameters.SetParameters(context: Context,
buildSystem: BuildSystem,
sourceDirectoryPath: "./",
title: "... | ```c#
#load nuget:https://www.myget.org/F/cake-contrib/api/v2?package=Cake.Recipe&prerelease
Environment.SetVariableNames();
BuildParameters.SetParameters(context: Context,
buildSystem: BuildSystem,
sourceDirectoryPath: "./",
title: "... |
f5eb5bab-d8fb-4151-9acd-8517de89b510 | {
"language": "C#"
} | ```c#
namespace Bakery.Security
{
using System;
public static class RandomExtensions
{
public static Byte[] GetBytes(this IRandom random, Int32 count)
{
if (count <= 0)
throw new ArgumentOutOfRangeException(nameof(count));
var buffer = new Byte[count];
for (var i = 0; i < count; i++... | ```c#
namespace Bakery.Security
{
using System;
public static class RandomExtensions
{
public static Byte[] GetBytes(this IRandom random, Int32 count)
{
if (count <= 0)
throw new ArgumentOutOfRangeException(nameof(count));
var buffer = new Byte[count];
for (var i = 0; i < count; i++... |
a98fbba5-a714-4e0a-8528-48eb0f971366 | {
"language": "C#"
} | ```c#
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: AssemblyTit... | ```c#
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: AssemblyTit... |
5a6e077a-1a53-4113-b8af-bb4cc413d463 | {
"language": "C#"
} | ```c#
// 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.Shared.Descriptors;
using SmugMug.v2.Authentication;
using SmugMugShared;
using System.Collections.Generic;
using System.Diagnostics;
namespac... | ```c#
// 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.Shared.Descriptors;
using SmugMug.v2.Authentication;
using SmugMugShared;
using System.Collections.Generic;
using System.Diagnostics;
namespac... |
105dd355-b566-41d3-b268-39d95c82ac35 | {
"language": "C#"
} | ```c#
using System;
using System.IO;
using System.Net.Http;
using System.Threading.Tasks;
using Discord;
using Discord.Commands;
using Serilog;
namespace Modix.Modules
{
[Name("Fun"), Summary("A bunch of miscellaneous, fun commands")]
public class FunModule : ModuleBase
{
[Command("jumbo"), Summar... | ```c#
using System;
using System.IO;
using System.Net.Http;
using System.Threading.Tasks;
using Discord;
using Discord.Commands;
using Serilog;
namespace Modix.Modules
{
[Name("Fun"), Summary("A bunch of miscellaneous, fun commands")]
public class FunModule : ModuleBase
{
[Command("jumbo"), Summar... |
18cb2bee-2413-4871-9449-15d7b9ccc160 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.IO;
using Cake.Core;
using Cake.Core.Configuration;
using Cake.Frosting;
using Cake.NuGet;
public class Program : IFrostingStartup
{
public static int Main(string[] args)
{
// Create the host.
var host = new CakeHo... | ```c#
using System;
using System.Collections.Generic;
using System.IO;
using Cake.Core;
using Cake.Core.Configuration;
using Cake.Frosting;
using Cake.NuGet;
public class Program : IFrostingStartup
{
public static int Main(string[] args)
{
// Create the host.
var host = new CakeHo... |
1289433b-a556-4c1f-a31a-77790e12f018 | {
"language": "C#"
} | ```c#
using Aggregates.Internal;
using NServiceBus;
using NServiceBus.Unicast;
using NServiceBus.Unicast.Messages;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Aggregates.Extensions
{
public static class BusExtensions
{
p... | ```c#
using Aggregates.Internal;
using NServiceBus;
using NServiceBus.Unicast;
using NServiceBus.Unicast.Messages;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Aggregates.Extensions
{
public static class BusExtensions
{
p... |
f1375235-33fe-42cb-bc88-0b74e1391e49 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
namespace NUnitTestDemo
{
public class SimpleTests
{
[Test]
public void TestSucceeds()
{
Assert.That(2 + 2, Is.EqualTo(4));
}
[Test, ExpectedException(typeof(App... | ```c#
using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
namespace NUnitTestDemo
{
public class SimpleTests
{
[Test]
public void TestSucceeds()
{
Assert.That(2 + 2, Is.EqualTo(4));
}
[Test]
public void TestSucc... |
a5197a13-429f-4267-8c1a-295e08767ac5 | {
"language": "C#"
} | ```c#
using System;
namespace StrangerData.Utils
{
internal static class RandomValues
{
public static object ForColumn(TableColumnInfo columnInfo)
{
switch (columnInfo.ColumnType)
{
case ColumnType.String:
// generates a random string... | ```c#
using System;
namespace StrangerData.Utils
{
internal static class RandomValues
{
public static object ForColumn(TableColumnInfo columnInfo)
{
try
{
return GenerateForColumn(columnInfo);
}
catch (Exception ex)
{
... |
92042c60-2f2f-4e13-b487-9c7f8b75441e | {
"language": "C#"
} | ```c#
namespace Stranne.VasttrafikNET.Models
{
/// <summary>
/// Describes a coordinate in WGS84 decimal
/// </summary>
public class Coordinate
{
/// <summary>
/// Latitude in WGS84 decimal form
/// </summary>
public double Latitude { get; set; }
/// <summar... | ```c#
namespace Stranne.VasttrafikNET.Models
{
/// <summary>
/// Describes a coordinate in WGS84 decimal
/// </summary>
public class Coordinate
{
/// <summary>
/// Latitude in WGS84 decimal form
/// </summary>
public double Latitude { get; set; }
/// <summar... |
83a68774-4982-4fd3-af00-2db489bc9d8f | {
"language": "C#"
} | ```c#
using System;
using System.Linq;
namespace Rock.Messaging.Routing
{
public class AppDomainTypeLocator : ITypeLocator
{
private readonly IMessageParser _messageParser;
private readonly AppDomain _appDomain;
public AppDomainTypeLocator(IMessageParser messageParser, AppDomain appDo... | ```c#
using System;
using System.Linq;
using Rock.Reflection;
namespace Rock.Messaging.Routing
{
public class AppDomainTypeLocator : ITypeLocator
{
private readonly IMessageParser _messageParser;
private readonly AppDomain _appDomain;
public AppDomainTypeLocator(IMessageParser message... |
a01d3544-3eb6-41ae-b836-73a8f0e0cde6 | {
"language": "C#"
} | ```c#
using Microsoft.AspNetCore.Mvc.Filters;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace BTCPayServer.Filters
{
public class XFrameOptionsAttribute : Attribute, IActionFilter
{
public XFrameOptionsAttribute(string value)
{
... | ```c#
using Microsoft.AspNetCore.Mvc.Filters;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace BTCPayServer.Filters
{
public class XFrameOptionsAttribute : Attribute, IActionFilter
{
public XFrameOptionsAttribute(string value)
{
... |
f6857d08-d90d-4ec8-9d17-07b743aa3ac3 | {
"language": "C#"
} | ```c#
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated from a template.
//
// Manual changes to this file may cause unexpected behavior in your application.
// Manual changes to this file will be overwritten if the code is regene... | ```c#
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated from a template.
//
// Manual changes to this file may cause unexpected behavior in your application.
// Manual changes to this file will be overwritten if the code is regene... |
53851c5c-8375-4329-b537-9c30979665ce | {
"language": "C#"
} | ```c#
using System;
using System.Threading;
using NUnit.Framework;
namespace JustSaying.TestingFramework
{
public static class Patiently
{
public static void VerifyExpectation(Action expression)
{
VerifyExpectation(expression, 5.Seconds());
}
public st... | ```c#
using System;
using System.Threading;
using NUnit.Framework;
namespace JustSaying.TestingFramework
{
public static class Patiently
{
public static void VerifyExpectation(Action expression)
{
VerifyExpectation(expression, 5.Seconds());
}
public st... |
345d26b1-8893-4d65-8d30-66f7656bf7d0 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading.Tasks;
namespace MediaManager.Media
{
public abstract class MediaExtractorBase : IMediaExtractor
{
public virtual async Task<IMediaItem> CreateMediaItem(string url)
{
va... | ```c#
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading.Tasks;
namespace MediaManager.Media
{
public abstract class MediaExtractorBase : IMediaExtractor
{
public virtual async Task<IMediaItem> CreateMediaItem(string url)
{
va... |
92e785af-59ab-4e56-8b10-2d616969f1c5 | {
"language": "C#"
} | ```c#
@model IEnumerable<alert_roster.web.Models.Message>
@{
ViewBag.Title = "Messages";
}
<div class="jumbotron">
<h1>@ViewBag.Title</h1>
</div>
@foreach (var message in Model)
{
<div class="row">
<div class="col-md-4">
<h2>
<script>var d = moment.utc('@message.PostedDat... | ```c#
@model IEnumerable<alert_roster.web.Models.Message>
@{
ViewBag.Title = "Messages";
}
<div class="jumbotron">
<h1>@ViewBag.Title</h1>
</div>
@foreach (var message in Model)
{
<div class="row">
<div class="col-md-4">
<fieldset>
<legend>
<script... |
ef40dba3-6225-4476-b01b-95931578aa2c | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace LodViewProvider {
public enum AggregationType {
Min = 0,
Max = 1,
Sum = 2,
Count = 3,
Average = 4,
// group by
// order by
}
public class Aggregation : ICondition {
public string Variable { get;... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace LodViewProvider {
public enum AggregationType {
Min = 0,
Max = 1,
Sum = 2,
Count = 3,
Average = 4,
// group by
// order by
}
public class Aggregation : ICondition {
public string Variable { get;... |
e7103f11-5da9-4985-be6a-f609f4b2d6c1 | {
"language": "C#"
} | ```c#
using BatteryCommander.Web.Models;
using BatteryCommander.Web.Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Threading.Tasks;
namespace BatteryCommander.Web.Controllers
{
[Authorize, ApiExplorerSettings(IgnoreApi = true)]
public class SSDCo... | ```c#
using BatteryCommander.Web.Models;
using BatteryCommander.Web.Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Linq;
using System.Threading.Tasks;
namespace BatteryCommander.Web.Controllers
{
[Authorize, ApiExplorerSettings(IgnoreApi = true)]
public class ... |
a889a5ab-d1da-4b44-8eab-d55a1f95b9a6 | {
"language": "C#"
} | ```c#
namespace LiteNetLibManager
{
public class WebSocketTransportFactory : BaseTransportFactory
{
public override bool CanUseWithWebGL { get { return false; } }
public override ITransport Build()
{
return new WebSocketTransport();
}
}
}
```
Add check is trans... | ```c#
namespace LiteNetLibManager
{
public class WebSocketTransportFactory : BaseTransportFactory
{
public override bool CanUseWithWebGL { get { return true; } }
public override ITransport Build()
{
return new WebSocketTransport();
}
}
}
``` |
f8f3e9e4-f777-418d-84c8-60ee10e98504 | {
"language": "C#"
} | ```c#
using System.IO;
using System.Linq;
using NuGet;
namespace NuGetGallery
{
public class WebMatrixPackageCurator : AutomaticPackageCurator
{
public override void Curate(
Package galleryPackage,
IPackage nugetPackage)
{
var curatedFeed = GetService<ICurat... | ```c#
using System.IO;
using System.Linq;
using NuGet;
namespace NuGetGallery
{
public class WebMatrixPackageCurator : AutomaticPackageCurator
{
public override void Curate(
Package galleryPackage,
IPackage nugetPackage)
{
var curatedFeed = GetService<ICurat... |
6d4de8ec-9b72-49c6-80fc-bffeee484d82 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
namespace NHibernate.Test.Linq.ByMethod
{
[TestFixture]
public class AnyTests : LinqTestCase
{
[Test]
public void AnySublist()
{
var orders = db.Order... | ```c#
using System.Linq;
using NUnit.Framework;
namespace NHibernate.Test.Linq.ByMethod
{
[TestFixture]
public class AnyTests : LinqTestCase
{
[Test]
public void AnySublist()
{
var orders = db.Orders.Where(o => o.OrderLines.Any(ol => ol.Quantity == 5)).ToList();
Assert.AreEqual(61, orders.C... |
f719ac52-b1e3-42ef-a047-3d6d6bb0ec8b | {
"language": "C#"
} | ```c#
namespace testproj
{
using System;
using JetBrains.dotMemoryUnit;
using NUnit.Framework;
[TestFixture]
public class UnitTest1
{
[Test]
public void TestMethod1()
{
dotMemory.Check(
memory =>
{
var st... | ```c#
namespace testproj
{
using System;
using System.Collections.Generic;
using JetBrains.dotMemoryUnit;
using NUnit.Framework;
[TestFixture]
public class UnitTest1
{
[Test]
public void TestMethod1()
{
var strs = new List<string>();
var me... |
ca18436b-4010-4191-830b-df079335bc95 | {
"language": "C#"
} | ```c#
using System;
using System.IO;
using System.Security.Cryptography;
namespace Tutorial
{
class Program
{
static void Main(string[] args)
{
if (args.Length != 2)
{
Console.WriteLine("You must provide the name of a file to read and the nam... | ```c#
using System;
using System.IO;
using System.Security.Cryptography;
namespace Tutorial
{
class Program
{
static void Main(string[] args)
{
if (args.Length != 2)
{
Console.WriteLine("You must provide the name of a file to read and the nam... |
d878c080-0fa7-4477-a322-f2525ca27990 | {
"language": "C#"
} | ```c#
// 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 NUnit.Framework;
using osu.Framework.Graphics.Primitives;
using osuTK;
using System;
using System.Collections;
using System.Collections.Generic;
using System... | ```c#
// 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 NUnit.Framework;
using osu.Framework.Graphics.Primitives;
using osuTK;
using System;
using System.Collections;
using System.Collections.Generic;
using System... |
f8739b3a-285d-47bd-b3e3-9a2c426efc39 | {
"language": "C#"
} | ```c#
using Foundation;
using Internationalization.Core.Helpers;
namespace Internationalization.Touch.Helpers
{
public class AppInfo : IAppInfo
{
public string CurrentLanguage => NSLocale.CurrentLocale.CountryCode.ToLower();
}
}```
Fix code to return LanguageCode not CountryCode | ```c#
using Foundation;
using Internationalization.Core.Helpers;
namespace Internationalization.Touch.Helpers
{
public class AppInfo : IAppInfo
{
public string CurrentLanguage
{
get
{
return NSLocale.CurrentLocale.LanguageCode.ToLower();
}
}
... |
e26d2694-7b48-4ec7-b2a9-170e122d08be | {
"language": "C#"
} | ```c#
using System.Net;
using System.Net.Sockets;
using System.Text;
namespace NMaier.SimpleDlna.Server.Ssdp
{
internal sealed class Datagram
{
public readonly IPEndPoint EndPoint;
public readonly string Message;
public readonly bool Sticky;
public Datagram(IPEndPoint aEndPoint, string aMessag... | ```c#
using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
using NMaier.SimpleDlna.Utilities;
namespace NMaier.SimpleDlna.Server.Ssdp
{
internal sealed class Datagram : Logging
{
public readonly IPEndPoint EndPoint;
public readonly string Message;
public readonly bool Sticky;
... |
352354b8-938c-4e52-a397-e2085824b7ac | {
"language": "C#"
} | ```c#
// 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.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Input.Events;
usin... | ```c#
// 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.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Input.Events;
usin... |
6cbb887b-eab4-48c3-82b3-13ff9b3b641a | {
"language": "C#"
} | ```c#
using UnityEngine;
using System.Collections;
using System;
public class LightDiminuer : MonoBehaviour {
public float intensity = 15;
public float intensityRate = 0.001F;
public float ambientIntensity = 3;
public float torchNoiseRange = 1;
private GameObject player;
private Light playerLight;
private Li... | ```c#
using UnityEngine;
using System.Collections;
using System;
public class LightDiminuer : MonoBehaviour {
public float intensity = 15;
public float intensityRate = 0.001F;
public float ambientIntensity = 3;
public float torchNoiseRange = 1;
public bool lightOn = false;
private GameObject player;
private ... |
2db1fb6c-1a5b-497e-b4e4-f46e93b7324b | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
public class MultipleDelegate
{
private readonly Dictionary<int, Func<int, int>> _delegates = new Dictionary<int, Func<int, int>>();
private Type _typeOf;
private int _pos = 0;
public int Suscribe(Func<int, int> item)
{
_delegates.Add(... | ```c#
using System;
using System.Collections.Generic;
using UnityEngine;
public class MultipleDelegate
{
private readonly List<Func<int, int>> _delegates = new List<Func<int, int>>();
private Type _typeOf;
private int _pos = 0;
public int Suscribe(Func<int, int> item)
{
_delegates.Add(ite... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.