doc_id stringlengths 36 36 | metadata dict | input stringlengths 28 4.3k | output stringlengths 11 5.45k |
|---|---|---|---|
3fa9f089-2e1b-499e-9859-ce7ac5cd78b4 | {
"language": "C#"
} | ```c#
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Networking;
public static class UnityUtils
{
/// <summary>
/// Is any of the keys UP?
/// </summary>
/// <param name="keys"></param>
/// <returns></returns>
public static bool IsAnyKeyUp(KeyCode[] keys)
{
foreac... | ```c#
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Networking;
public static class UnityUtils
{
public static bool IsAnyKeyUp(KeyCode[] keys)
{
foreach (KeyCode key in keys)
{
if (Input.GetKeyUp(key))
return true;
}
return false;
... |
1c442177-f808-4aec-82bf-f1ed1966a103 | {
"language": "C#"
} | ```c#
<h1 class="heading-xlarge">Enter your security code</h1>
<form method="post">
@Html.AntiForgeryToken()
<fieldset>
<legend class="visuallyhidden">Enter your security code</legend>
<div class="form-group">
<label class="form-label-bold" for="SecurityCode">Enter secur... | ```c#
@model SFA.DAS.EmployerUsers.Web.Models.OrchestratorResponse<SFA.DAS.EmployerUsers.Web.Models.ConfirmChangeEmailViewModel>
<h1 class="heading-xlarge">Enter your security code</h1>
<form method="post">
@Html.AntiForgeryToken()
<fieldset>
<legend class="visuallyhidden">Enter your secur... |
add0ec67-e507-4a41-b493-2b506843772f | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Text;
namespace Serilog.Sinks.MSSqlServer.Tests
{
class TestPropertiesColumnFiltering
{
}
}
```
Test for properties column filtering | ```c#
using Dapper;
using FluentAssertions;
using System.Data.SqlClient;
using Xunit;
namespace Serilog.Sinks.MSSqlServer.Tests
{
[Collection("LogTest")]
public class TestPropertiesColumnFiltering
{
internal class PropertiesColumns
{
public string Properties { get; set; }
... |
cef6fcdd-27f5-4504-8129-3c43577233c8 | {
"language": "C#"
} | ```c#
namespace NerdBank.GitVersioning.CloudBuildServices
{
using System;
using System.Collections.Generic;
using System.IO;
using Nerdbank.GitVersioning;
internal class GitHubActions : ICloudBuild
{
public bool IsApplicable => Environment.GetEnvironmentVariable("GITHUB_ACTIONS") == "t... | ```c#
namespace NerdBank.GitVersioning.CloudBuildServices
{
using System;
using System.Collections.Generic;
using System.IO;
using Nerdbank.GitVersioning;
internal class GitHubActions : ICloudBuild
{
public bool IsApplicable => Environment.GetEnvironmentVariable("GITHUB_ACTIONS") == "t... |
03ce84b9-3cc2-4d18-8d8f-ef3d840b5c4c | {
"language": "C#"
} | ```c#
// Copyright 2015 Coinprism, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or... | ```c#
// Copyright 2015 Coinprism, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or... |
53cce33e-3a66-41cc-ae38-461188b39391 | {
"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.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Test2d;
namespace Test2d
{
///... | ```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.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Test2d;
namespace Test2d
{
///... |
e1215316-3459-49f9-acf7-19cb2fa79ee9 | {
"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 osu.Framework.Input.StateChanges;
using osu.Framework.Input.States;
using osu.Framework.Platform;
using osu.Framework.Statistics;
using Veldrid;
using TKKey =... | ```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 osu.Framework.Input.StateChanges;
using osu.Framework.Input.States;
using osu.Framework.Platform;
using osu.Framework.Statistics;
using Veldrid;
using TKKey =... |
fbaadc03-593a-4418-ac9e-1916709cc59f | {
"language": "C#"
} | ```c#
using CertiPay.Common.Logging;
using CertiPay.Common.WorkQueue;
using System.Threading;
using System.Threading.Tasks;
namespace CertiPay.Common.Notifications
{
/// <summary>
/// Sends notifications to the background worker queue for async processing and retries
/// </summary>
public partial clas... | ```c#
using CertiPay.Common.Logging;
using CertiPay.Common.WorkQueue;
using System.Threading;
using System.Threading.Tasks;
namespace CertiPay.Common.Notifications
{
/// <summary>
/// Sends notifications to the background worker queue for async processing and retries
/// </summary>
public partial clas... |
c11b80af-02f4-4ee9-8324-6011572be5a4 | {
"language": "C#"
} | ```c#
using NUnit.Framework;
namespace Atata.Tests
{
public class ControlTests : UITestFixture
{
[Test]
public void Control_DragAndDrop_UsingDragAndDropUsingScriptBehavior()
{
Go.To<DragAndDropPage>().
DropContainer.Items.Should.BeEmpty().
... | ```c#
using NUnit.Framework;
namespace Atata.Tests
{
public class ControlTests : UITestFixture
{
[Test]
public void Control_DragAndDrop_UsingDomEvents()
{
Go.To<DragAndDropPage>().
DropContainer.Items.Should.BeEmpty().
DragItems.It... |
f1416b11-5511-4119-8325-73fdb3340539 | {
"language": "C#"
} | ```c#
namespace TensorSharp.Operations
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
public class DivideIntegerIntegerOperation : IBinaryOperation<int, int, int>
{
public Tensor<int> Evaluate(Tensor<int> tensor1, Tensor<int> tensor2)
... | ```c#
namespace TensorSharp.Operations
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
public class DivideIntegerIntegerOperation : IBinaryOperation<int, int, int>
{
public Tensor<int> Evaluate(Tensor<int> tensor1, Tensor<int> tensor2)
... |
67804742-0946-4777-b768-2b502942ad65 | {
"language": "C#"
} | ```c#
// Copyright (c) MarinAtanasov. All rights reserved.
// Licensed under the MIT License (MIT). See License.txt in the project root for license information.
//
using AppBrix.Configuration;
using System;
using System.Linq;
using System.Threading;
namespace AppBrix.Web.Client.Configuration
{
public sealed class ... | ```c#
// Copyright (c) MarinAtanasov. All rights reserved.
// Licensed under the MIT License (MIT). See License.txt in the project root for license information.
//
using AppBrix.Configuration;
using System;
using System.Linq;
using System.Threading;
namespace AppBrix.Web.Client.Configuration
{
public sealed class ... |
7ad2dd3a-1e07-437a-adde-e6de41cffc8b | {
"language": "C#"
} | ```c#
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading;
u... | ```c#
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading;
u... |
bba2c105-91d2-4dc0-821f-375ee53c8758 | {
"language": "C#"
} | ```c#
using System.Linq;
using System.Web.Http;
using System.Web.Http.OData;
using NuGet.Lucene.Web.Models;
using NuGet.Lucene.Web.Util;
namespace NuGet.Lucene.Web.Controllers
{
/// <summary>
/// OData provider for Lucene based NuGet package repository.
/// </summary>
public class PackagesODataControl... | ```c#
using System.Linq;
using System.Net.Http;
using System.Web.Http;
using System.Web.Http.OData;
using NuGet.Lucene.Web.Models;
using NuGet.Lucene.Web.Util;
namespace NuGet.Lucene.Web.Controllers
{
/// <summary>
/// OData provider for Lucene based NuGet package repository.
/// </summary>
public cla... |
a9b264ba-9303-4424-ba6a-fe010343a6ea | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Threading;
using Lokad.Cqrs.Build.Client;
using Lokad.Cqrs.Build.Engine;
using Lokad.Cqrs.Core.Dispatch.Events;
using Microsoft.WindowsAzure;
using NUnit.Framework;
using System.Linq;
namespace Lokad.Cqrs... | ```c#
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Threading;
using Lokad.Cqrs.Build.Client;
using Lokad.Cqrs.Build.Engine;
using Lokad.Cqrs.Core.Dispatch.Events;
using Microsoft.WindowsAzure;
using NUnit.Framework;
using System.Linq;
namespace Lokad.Cqrs... |
d88404be-0aaa-419b-9bff-8facee064642 | {
"language": "C#"
} | ```c#
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34003
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-ge... | ```c#
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-ge... |
331f94d3-0590-40cb-831a-de68163ad92a | {
"language": "C#"
} | ```c#
using UnityEngine;
using System;
using HutongGames.PlayMaker;
using TooltipAttribute = HutongGames.PlayMaker.TooltipAttribute;
using BCP.SimpleJSON;
/// <summary>
/// Custom PlayMaker action for MPF that sends a Trigger BCP command to MPF.
/// </summary>
[ActionCategory("BCP")]
[Tooltip("Sends 'text_input_high_... | ```c#
using UnityEngine;
using System;
using HutongGames.PlayMaker;
using TooltipAttribute = HutongGames.PlayMaker.TooltipAttribute;
using BCP.SimpleJSON;
/// <summary>
/// Custom PlayMaker action for MPF that sends a Trigger BCP command to MPF.
/// </summary>
[ActionCategory("BCP")]
[Tooltip("Sends 'text_input_high_... |
addefed2-7675-4402-80c1-bd191e2d7af5 | {
"language": "C#"
} | ```c#
using Nito;
using System.Collections;
using System.Net.NetworkInformation;
using UnityEngine;
namespace TrailAdvanced.PointSource {
public abstract class AbstractPointSource : MonoBehaviour {
public int maxPoints = 1000;
protected Deque<Vector3> points;
protected int minimumFreeCapacity = 10;
public... | ```c#
using Nito;
using System.Collections;
using System.Net.NetworkInformation;
using UnityEngine;
namespace TrailAdvanced.PointSource {
public abstract class AbstractPointSource : MonoBehaviour {
public int maxPoints = 1000;
protected Deque<Vector3> points;
protected int minimumFreeCapacity = 10;
public... |
23629572-8bd2-49a3-8760-6ed9404cc8dc | {
"language": "C#"
} | ```c#
namespace Pigeon.Pipelines
{
using System;
using Sitecore.Diagnostics;
public class SetEmailSubject:PigeonPipelineProcessor
{
public override void Process(PigeonPipelineArgs args)
{
Assert.IsNotNull(args,"args != null");
args.Subject = $"[Pigeon] {System.... | ```c#
namespace Pigeon.Pipelines
{
using System;
using Sitecore.Diagnostics;
public class SetEmailSubject:PigeonPipelineProcessor
{
public override void Process(PigeonPipelineArgs args)
{
Assert.IsNotNull(args,"args != null");
args.Subject = $"[Pigeon] {System.... |
66ffb3e7-d67e-4caf-bdde-aaf05016b3bc | {
"language": "C#"
} | ```c#
// -----------------------------------------------------------------------
// <copyright file="AddInstrumentInteractiveBrokersWindow.xaml.cs" company="">
// Copyright 2016 Alexander Soffronow Pagonidis
// </copyright>
// -----------------------------------------------------------------------
using MahApps.Metro... | ```c#
// -----------------------------------------------------------------------
// <copyright file="AddInstrumentInteractiveBrokersWindow.xaml.cs" company="">
// Copyright 2016 Alexander Soffronow Pagonidis
// </copyright>
// -----------------------------------------------------------------------
using MahApps.Metro... |
523c05d3-cacc-4d14-9aa3-faf05cbeae70 | {
"language": "C#"
} | ```c#
namespace StyleCop.Analyzers.Helpers
{
using System.Threading.Tasks;
internal static class SpecializedTasks
{
internal static Task CompletedTask { get; } = Task.FromResult(default(VoidResult));
private sealed class VoidResult
{
private VoidResult()
{
... | ```c#
namespace StyleCop.Analyzers.Helpers
{
using System.Threading.Tasks;
internal static class SpecializedTasks
{
internal static Task CompletedTask { get; } = Task.FromResult(default(VoidResult));
private struct VoidResult
{
}
}
}
``` |
24299ea5-24d9-4c19-8b1b-495356eb9b7c | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
namespace InfiniMap
{
public class Map
{
public IDictionary<Tuple<int, int>, Chunk> Chunks;
private int _chunkWidth;
private int _chunkHeight;
public Map(int chunkHeight, int chunkWidth)
{
_chunkHeight =... | ```c#
using System;
using System.Collections.Generic;
namespace InfiniMap
{
public class Map
{
public IDictionary<Tuple<int, int>, Chunk> Chunks;
private int _chunkWidth;
private int _chunkHeight;
public Map(int chunkHeight, int chunkWidth)
{
_chunkHeight =... |
778ccdd5-6290-4eb4-bb44-d35717ba3372 | {
"language": "C#"
} | ```c#
using System.Web.Mvc;
using Orchard.Environment.Configuration;
namespace Orchard.MultiTenancy.Extensions {
public static class UrlHelperExtensions {
public static string Tenant(this UrlHelper urlHelper, ShellSettings tenantShellSettings) {
return string.Format(
"ht... | ```c#
using System.Web.Mvc;
using Orchard.Environment.Configuration;
namespace Orchard.MultiTenancy.Extensions {
public static class UrlHelperExtensions {
public static string Tenant(this UrlHelper urlHelper, ShellSettings tenantShellSettings) {
//info: (heskew) might not keep the port i... |
229e4370-d3ec-4ef2-bd73-34caea08b3d7 | {
"language": "C#"
} | ```c#
namespace DeepEquals
{
using System.Collections;
public class DeepComparison
{
public static IEqualityComparer CreateComparer()
{
return new ComparisonComparer(Create());
}
public static CompositeComparison Create()
{
var root = new CompositeComparison();
root.AddRange(
new DefaultCo... | ```c#
namespace DeepEquals
{
using System.Collections;
public class DeepComparison
{
public static IEqualityComparer CreateComparer()
{
return new ComparisonComparer(Create());
}
public static CompositeComparison Create()
{
var root = new CompositeComparison();
root.AddRange(
new DefaultCo... |
f508e399-29ed-4f18-b96b-4ffba58e6a20 | {
"language": "C#"
} | ```c#
using System.Collections.Generic;
using System.Threading.Tasks;
namespace SparkPost
{
public interface IRecipientLists
{
/// <summary>
/// Creates a recipient list.
/// </summary>
/// <param name="recipientList">The properties of the recipientList to create.</param>
... | ```c#
using System.Collections.Generic;
using System.Threading.Tasks;
namespace SparkPost
{
public interface IRecipientLists
{
/// <summary>
/// Creates a recipient list.
/// </summary>
/// <param name="recipientList">The properties of the recipientList to create.</param>
... |
719210a4-8a4a-4ce8-864e-e03c744b0f8d | {
"language": "C#"
} | ```c#
@model dynamic
@using Umbraco.Web.Templates
@{
var embedValue = string.Empty;
try {
embedValue = Model.value.preview;
} catch(Exception ex) {
embedValue = Model.value;
}
}
<div class="video-wrapper">
@Html.Raw(embedValue)
</div>
```
Use DetectIsJson string extension as opposed ... | ```c#
@model dynamic
@using Umbraco.Web.Templates
@{
string embedValue = Convert.ToString(Model.value);
embedValue = embedValue.DetectIsJson() ? Model.value.preview : Model.value;
}
<div class="video-wrapper">
@Html.Raw(embedValue)
</div>
``` |
5dc42dac-d87d-4ef5-9228-ea9374422ed0 | {
"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.Diagnostics;
using System.Diagnostics.CodeAnalysis;
namespace osu.Framework.Extensions.ObjectExtensions
{
/// <summary>
/// Extensions that ap... | ```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.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using NUnit.Framework;
namespace osu.Framework.Extensions.ObjectExtensions
{
/// <summary>
... |
2e165f3f-871c-4fcc-b297-c35ff2400ef8 | {
"language": "C#"
} | ```c#
using System.Collections.Generic;
using DapperTesting.Core.Model;
namespace DapperTesting.Core.Data
{
public interface IUserRepository
{
void Create(User user);
void Delete(User user);
User Get(int id);
User Get(string email);
List<User> GetAll();
void Up... | ```c#
using System.Collections.Generic;
using DapperTesting.Core.Model;
namespace DapperTesting.Core.Data
{
public interface IUserRepository
{
void Create(User user);
void Delete(int id);
User Get(int id);
User Get(string email);
List<User> GetAll();
void Updat... |
af9a9766-7040-4380-b708-15c278c4a603 | {
"language": "C#"
} | ```c#
using UnityEditor;
using UnityEngine;
namespace Alensia.Core.I18n
{
[CustomPropertyDrawer(typeof(TranslatableText))]
public class TranslatableTextPropertyDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
v... | ```c#
using UnityEditor;
using UnityEngine;
using static UnityEditor.EditorGUI;
namespace Alensia.Core.I18n
{
[CustomPropertyDrawer(typeof(TranslatableText))]
public class TranslatableTextPropertyDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUICo... |
1bc15197-f65c-44f6-826c-46b6aaf3edc5 | {
"language": "C#"
} | ```c#
using UnityEditor;
using System.Collections;
public class OSVRUnityBuild {
static void build() {
string[] assets = {
"Assets/OSVRUnity",
"Assets/Plugins"
};
AssetDatabase.ExportPackage(assets,
"OSVR-Unity.unitypackage",
ExportPackageOptio... | ```c#
using UnityEditor;
using System.Collections;
public class OSVRUnityBuild {
static void build() {
string[] assets = {
"Assets/OSVRUnity",
"Assets/Plugins"
};
AssetDatabase.ExportPackage(assets,
"OSVR-Unity.unitypackage",
ExportPackageOptio... |
56927a9a-abe8-4c36-8fa6-d7f7933c5b74 | {
"language": "C#"
} | ```c#
using ImplicitNullability.Plugin.Tests;
using JetBrains.Application.BuildScript.Application.Zones;
using JetBrains.ReSharper.TestFramework;
using JetBrains.TestFramework;
using JetBrains.TestFramework.Application.Zones;
using NUnit.Framework;
[assembly: RequiresSTA]
namespace ImplicitNullability.Plugin.Tests
{... | ```c#
using JetBrains.Application.BuildScript.Application.Zones;
using JetBrains.ReSharper.TestFramework;
using JetBrains.TestFramework;
using JetBrains.TestFramework.Application.Zones;
using NUnit.Framework;
[assembly: RequiresSTA]
namespace ImplicitNullability.Plugin.Tests
{
[ZoneDefinition]
public interfa... |
32ecf986-1a89-45f1-9873-f424adfb6a97 | {
"language": "C#"
} | ```c#
using System.Data;
using System.Threading;
using Evolve.Driver;
using Xunit;
namespace Evolve.Core.Test.Driver
{
public class CoreReflectionBasedDriverTest
{
[Fact(DisplayName = "MicrosoftDataSqliteDriver_works")]
public void MicrosoftDataSqliteDriver_works()
{
var dri... | ```c#
using System.Data;
using System.Threading;
using Evolve.Driver;
using Xunit;
namespace Evolve.Core.Test.Driver
{
public class CoreReflectionBasedDriverTest
{
[Fact(DisplayName = "MicrosoftDataSqliteDriver_works")]
public void MicrosoftDataSqliteDriver_works()
{
var dri... |
c97a6f8c-0ae3-4fa5-8d86-8b14c7ad413a | {
"language": "C#"
} | ```c#
using System;
using Newtonsoft.Json.Linq;
namespace Chronological
{
public class DataType
{
public string TimeSeriesInsightsType { get; }
internal DataType(string dataType)
{
TimeSeriesInsightsType = dataType;
}
internal JProperty ToJProperty()
... | ```c#
using System;
using Newtonsoft.Json.Linq;
namespace Chronological
{
public class DataType
{
public string TimeSeriesInsightsType { get; }
internal DataType(string dataType)
{
TimeSeriesInsightsType = dataType;
}
internal JProperty ToJProperty()
... |
b5322848-b712-4d44-9355-bba02766c480 | {
"language": "C#"
} | ```c#
using System;
interface IFlyable
{
void Fly();
string Name { get; }
}
class Bird : IFlyable
{
public Bird() { }
public string Name => "Bird";
public void Fly()
{
Console.WriteLine("Chirp");
}
}
class Plane : IFlyable
{
public Plane() { }
public string Name => "Pla... | ```c#
using System;
interface IFlyable
{
void Fly();
string Name { get; }
}
class Bird : IFlyable
{
public Bird()
{
Name = "Bird";
}
public string Name { get; private set; }
public void Fly()
{
Console.WriteLine("Chirp");
}
}
class Plane : IFlyable
{
public P... |
aa379432-dfac-4c9a-9163-6583289c2573 | {
"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 Microsoft.VisualStudio.Shell;
// Add binding redirects for each assembly we ship in VS. This is required so that these assemblies show
// ... | ```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 Microsoft.VisualStudio.Shell;
// Add binding redirects for each assembly we ship in VS. This is required so that these assemblies show
// ... |
7e53a22f-b390-4fda-95b2-50c65e45fc27 | {
"language": "C#"
} | ```c#
using System;
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
namespace IronAHK
{
partial class Program
{
const bool debug =
#if DEBUG
true
#else
false
#endif
;
[Conditional("DEBUG"), DllImport("kernel32.dll")]
static extern void AllocConsole();... | ```c#
using System;
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
namespace IronAHK
{
partial class Program
{
const bool debug =
#if DEBUG
true
#else
false
#endif
;
[Conditional("DEBUG"), DllImport("kernel32.dll")]
static extern void AllocConsole();... |
f16a9c5e-1584-4b62-8e6f-7ee23ad5b821 | {
"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 osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Screens.Play.HUD;
using osuTK;
namespace osu.Game.Skin... | ```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 osu.Framework.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Screens.Play.HUD;
using osuTK;
namespace osu.Game.Skinning
{
public class LegacyS... |
a79aed3c-0187-46a9-a431-eeb2b63c74a2 | {
"language": "C#"
} | ```c#
using System.Collections.Generic;
using BrightstarDB.EntityFramework;
namespace BrightstarDB.Samples.EntityFramework.FoafCore
{
[Entity("http://xmlns.com/foaf/0.1/Person")]
public interface IPerson
{
[Identifier("http://www.brightstardb.com/people/")]
string Id { get; }
[Pro... | ```c#
using System.Collections.Generic;
using BrightstarDB.EntityFramework;
namespace BrightstarDB.Samples.EntityFramework.FoafCore
{
[Entity("http://xmlns.com/foaf/0.1/Person")]
public interface IPerson
{
[Identifier("http://www.brightstardb.com/people/")]
string Id { get; }
[Pro... |
447d7966-e0c3-4f91-86f8-c9424c270651 | {
"language": "C#"
} | ```c#
namespace Nancy.Testing.Tests
{
using System.IO;
using System.Linq;
using System.Text;
using Nancy;
using Nancy.Tests;
using Xunit;
public class BrowserResponseBodyWrapperFixture
{
[Fact]
public void Should_contain_response_body()
{
... | ```c#
namespace Nancy.Testing.Tests
{
using System.IO;
using System.Linq;
using System.Text;
using Nancy;
using Nancy.Tests;
using Xunit;
public class BrowserResponseBodyWrapperFixture
{
[Fact]
public void Should_contain_response_body()
{
... |
63ab889c-31d3-4f0c-b3aa-9bdde4300b26 | {
"language": "C#"
} | ```c#
#region Using
using System;
using NUnit.Framework;
#endregion
namespace PortableExtensions.Testing
{
[TestFixture]
public partial class StringExTest
{
[TestCase]
public void SubstringRightSafeTestCase()
{
var actual = "testabc".SubstringRightSafe( 3 );
... | ```c#
#region Using
using System;
using NUnit.Framework;
#endregion
namespace PortableExtensions.Testing
{
[TestFixture]
public partial class StringExTest
{
[TestCase]
public void SubstringRightSafeTestCase()
{
var actual = "testabc".SubstringRightSafe( 3 );
... |
e7bba033-eab6-4c87-a246-a6494237139d | {
"language": "C#"
} | ```c#
using Newtonsoft.Json.Linq;
using Xunit;
using DevLab.JmesPath.Expressions;
using DevLab.JmesPath.Utils;
namespace jmespath.net.tests.Expressions
{
public class JmesPathSubExpressionTest
{
[Fact]
public void JmesPathSubExpression_identifier()
{
const string... | ```c#
using Newtonsoft.Json.Linq;
using Xunit;
using DevLab.JmesPath.Expressions;
using DevLab.JmesPath.Utils;
namespace jmespath.net.tests.Expressions
{
public class JmesPathSubExpressionTest
{
/*
* http://jmespath.org/specification.html#subexpressions
*
* searc... |
b0aa1c65-e26c-46c3-8533-cedc2e69b486 | {
"language": "C#"
} | ```c#
using System.Collections.Generic;
using WalletWasabi.Crypto.Groups;
namespace System.Linq
{
public static class Extensions
{
public static GroupElement Sum(this IEnumerable<GroupElement> groupElements) =>
groupElements.Aggregate(GroupElement.Infinity, (ge, acc) => ge + acc);
}
}
```
Add triple variant o... | ```c#
using System.Collections.Generic;
using WalletWasabi.Helpers;
using WalletWasabi.Crypto.Groups;
namespace System.Linq
{
public static class Extensions
{
public static GroupElement Sum(this IEnumerable<GroupElement> groupElements) =>
groupElements.Aggregate(GroupElement.Infinity, (ge, acc) => ge + acc);
... |
86d3cef2-1c1b-49a4-8102-546bbbd19034 | {
"language": "C#"
} | ```c#
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="MeasurementGroupExtensions.cs" company="Catel development team">
// Copyright (c) 2008 - 2016 Catel development team. All rights reserved.
// </copyright>
// -------------... | ```c#
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="MeasurementGroupExtensions.cs" company="Catel development team">
// Copyright (c) 2008 - 2016 Catel development team. All rights reserved.
// </copyright>
// -------------... |
da8e2b3d-89d6-42c4-a924-2e464857c47d | {
"language": "C#"
} | ```c#
using System;
using System.Linq;
using Android.OS;
using Android.Util;
using Android.Views;
using Android.Widget;
using Toggl.Joey.UI.Adapters;
using ListFragment = Android.Support.V4.App.ListFragment;
namespace Toggl.Joey.UI.Fragments
{
public class RecentTimeEntriesListFragment : ListFragment
{
... | ```c#
using System;
using System.Linq;
using Android.OS;
using Android.Util;
using Android.Views;
using Android.Widget;
using Toggl.Joey.UI.Adapters;
using ListFragment = Android.Support.V4.App.ListFragment;
namespace Toggl.Joey.UI.Fragments
{
public class RecentTimeEntriesListFragment : ListFragment
{
... |
02200591-9e81-4c3e-99dd-8a075bc8a5da | {
"language": "C#"
} | ```c#
using System.Threading.Tasks;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Queue;
namespace AzureStorage.Queue
{
public class AzureQueue<T> : IAzureQueue<T> where T : class
{
private readonly CloudQueue _queue;
public AzureQueue(string conectionString, str... | ```c#
using System.Threading.Tasks;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Queue;
namespace AzureStorage.Queue
{
public class AzureQueue<T> : IAzureQueue<T> where T : class
{
private readonly CloudQueue _queue;
public AzureQueue(string conectionString, str... |
6afb25ba-e939-4fd8-aafe-26058c9809e2 | {
"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 osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Effects;
using... | ```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 osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Effects;
using... |
eff581d7-0148-411c-b969-046065ee0e35 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text.RegularExpressions;
using System.Web;
namespace Bonobo.Git.Server
{
public class UsernameUrl
{
//to allow support for email addresses as user names, only encode/decode user name if it... | ```c#
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text.RegularExpressions;
using System.Web;
namespace Bonobo.Git.Server
{
public class UsernameUrl
{
//to allow support for email addresses as user names, only encode/decode user name if it... |
b0f7eb13-0cda-4461-8a98-6b8099c154ef | {
"language": "C#"
} | ```c#
@{
ViewBag.Title = "ManageUserCards";
}
@model JustPressPlay.ViewModels.ManageUserCardsViewModel
<div id="adminBody">
<div class="row wide">
<div class="large-3 columns">
@{ Html.RenderPartial("_AdminNavigation"); }
</div>
<div class="large-9 columns">
... | ```c#
@{
ViewBag.Title = "ManageUserCards";
}
@model JustPressPlay.ViewModels.ManageUserCardsViewModel
<div id="adminBody">
<div class="row wide">
<div class="large-3 columns">
@{ Html.RenderPartial("_AdminNavigation"); }
</div>
<div class="large-9 columns">
... |
4d5e7977-963b-4a6b-a05f-3809846bbec5 | {
"language": "C#"
} | ```c#
using Titan.Sharecode;
using Xunit;
namespace TitanTest
{
public class ShareCodeDecoderTest
{
[Fact]
public void TestDecoder()
{
if(ShareCode.Decode("CSGO-727c4-5oCG3-PurVX-sJkdn-LsXfE").MatchID == 3208347562318757960)
{
Assert.True(true, ... | ```c#
using Titan.MatchID.Sharecode;
using Xunit;
namespace TitanTest
{
public class ShareCodeDecoderTest
{
[Fact]
public void TestDecoder()
{
if(ShareCode.Decode("CSGO-727c4-5oCG3-PurVX-sJkdn-LsXfE").MatchID == 3208347562318757960)
{
Assert.Tru... |
2d2047b2-8503-452f-a380-5b477897f9e7 | {
"language": "C#"
} | ```c#
using Eurofurence.App.Server.Services.Abstractions.Lassie;
using Newtonsoft.Json;
using System.Collections.Generic;
using System.Net.Http;
using System.Threading.Tasks;
namespace Eurofurence.App.Server.Services.Lassie
{
public class LassieApiClient : ILassieApiClient
{
private class DataResponse... | ```c#
using Eurofurence.App.Server.Services.Abstractions.Lassie;
using Newtonsoft.Json;
using System.Collections.Generic;
using System.Net.Http;
using System.Threading.Tasks;
namespace Eurofurence.App.Server.Services.Lassie
{
public class LassieApiClient : ILassieApiClient
{
private class DataResponse... |
599640a2-69b9-4f3d-855d-75b8b8db8190 | {
"language": "C#"
} | ```c#
namespace TraktApiSharp.Tests.Enums
{
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using TraktApiSharp.Enums;
[TestClass]
public class TraktAccessTokenGrantTypeTests
{
[TestMethod]
public void TestTraktAccessTokenGrantTypeHasMembers()
... | ```c#
namespace TraktApiSharp.Tests.Enums
{
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Newtonsoft.Json;
using TraktApiSharp.Enums;
[TestClass]
public class TraktAccessTokenGrantTypeTests
{
class TestObject
{
[JsonConverter(... |
9b181074-9739-4bef-bea5-38024f43c587 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using AttributeRouting;
namespace NServiceMVC.Examples.HelloWorld.Controllers
{
public class ArraySampleController : ServiceController
{
//
// GET: /ArraySample/
... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using AttributeRouting;
namespace NServiceMVC.Examples.HelloWorld.Controllers
{
public class ArraySampleController : ServiceController
{
//
// GET: /ArraySample/
... |
524224e2-3125-409d-a5b4-9f66f359be80 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Twitch.Rest
{
public class TwitchRestClientConfig
{
public string BaseUrl { get; set; } = "https://api.twitch.tv/kraken/";
public uint ClientId { get; set; }
}
}
```
Remove Cli... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace NTwitch.Rest
{
public class TwitchRestClientConfig
{
public string BaseUrl { get; set; } = "https://api.twitch.tv/kraken/";
}
}
``` |
339a8357-4e8e-40dc-8ed5-67712941c8ae | {
"language": "C#"
} | ```c#
using Xunit;
namespace Microsoft.TemplateEngine.Cli.UnitTests
{
public class PrecedenceSelectionTests : EndToEndTestBase
{
[Theory(DisplayName = nameof(VerifyTemplateContent))]
[InlineData("mvc", "MvcNoAuthTest.json", "MvcFramework20Test.json")]
[InlineData("mvc -au individual", "... | ```c#
using Xunit;
namespace Microsoft.TemplateEngine.Cli.UnitTests
{
public class PrecedenceSelectionTests : EndToEndTestBase
{
[Theory(DisplayName = nameof(VerifyTemplateContent))]
[InlineData("mvc -f netcoreapp2.0", "MvcNoAuthTest.json", "MvcFramework20Test.json")]
[InlineData("mvc -... |
f3441417-1c1a-4c47-a191-abb9773f6cc3 | {
"language": "C#"
} | ```c#
namespace Microsoft.ApplicationInsights.Extensibility.AggregateMetrics
{
using System.Globalization;
using Microsoft.ApplicationInsights.DataContracts;
using Microsoft.ApplicationInsights.Extensibility.Implementation;
internal static class MetricTelemetryExtensions
{
internal static... | ```c#
namespace Microsoft.ApplicationInsights.Extensibility.AggregateMetrics
{
using System.Globalization;
using Microsoft.ApplicationInsights.DataContracts;
using Microsoft.ApplicationInsights.Extensibility.Implementation;
internal static class MetricTelemetryExtensions
{
internal static... |
b79af2f2-e4b2-4cff-a358-42628db0edb8 | {
"language": "C#"
} | ```c#
using ClosedXML.Excel;
using NUnit.Framework;
using System.IO;
namespace ClosedXML_Tests.Excel.Saving
{
[TestFixture]
public class SavingTests
{
[Test]
public void CanSuccessfullySaveFileMultipleTimes()
{
using (var wb = new XLWorkbook())
{
... | ```c#
using ClosedXML.Excel;
using NUnit.Framework;
using System.Globalization;
using System.IO;
using System.Threading;
namespace ClosedXML_Tests.Excel.Saving
{
[TestFixture]
public class SavingTests
{
[Test]
public void CanSuccessfullySaveFileMultipleTimes()
{
using (... |
306e2d79-3c2d-424e-bb5b-f6fc3a82dede | {
"language": "C#"
} | ```c#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
public class DatingSimDialogueController : MonoBehaviour
{
public float introTextDelay;
[Tooltip("If set to >0 will slow down or speed up text advance to complete it in this time")]
public float introTextForc... | ```c#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
public class DatingSimDialogueController : MonoBehaviour
{
public float introTextDelay;
[Tooltip("If set to >0 will slow down or speed up text advance to complete it in this time")]
public float introTextForc... |
94fb5719-e59a-4831-ba18-44b505556353 | {
"language": "C#"
} | ```c#
// Copyright (c) SimControl e.U. - Wilhelm Medetz. See LICENSE.txt in the project root for more information.
#if false
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
// TODO: CR
namespace SimControl.Reactive
{
//public class ObservedStat... | ```c#
// Copyright (c) SimControl e.U. - Wilhelm Medetz. See LICENSE.txt in the project root for more information.
#if false
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
// TODO: CR
namespace SimControl.Reactive
{
//public class ObservedStat... |
0f7f0912-56b1-4699-a6ad-294a05dd6f08 | {
"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;
using osu.Game.Online.Multiplayer;
using osu.Game.Rulesets.Osu;
using osu.Game.Screens.Multi;
using osu.Game.Te... | ```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;
using osu.Game.Online.Multiplayer;
using osu.Game.Rulesets.Osu;
using osu.Game.Screens.Multi;
using osu.Game.Te... |
569b169a-61fb-47bc-8d57-bd537f21e8b6 | {
"language": "C#"
} | ```c#
using System.IO;
using System.Net;
using System.Text;
using CefSharp;
using TweetLib.Browser.Interfaces;
using TweetLib.Browser.Request;
namespace TweetDuck.Browser.Adapters {
internal sealed class CefSchemeResourceVisitor : ISchemeResourceVisitor<IResourceHandler> {
public static CefSchemeResourceVisitor Ins... | ```c#
using System;
using System.IO;
using System.Net;
using CefSharp;
using TweetLib.Browser.Interfaces;
using TweetLib.Browser.Request;
namespace TweetDuck.Browser.Adapters {
internal sealed class CefSchemeResourceVisitor : ISchemeResourceVisitor<IResourceHandler> {
public static CefSchemeResourceVisitor Instance... |
233a9477-e3c1-4e1a-8d86-898078e75552 | {
"language": "C#"
} | ```c#
using System;
using CQRS.Light.Contracts;
using Newtonsoft.Json;
namespace CQRS.Light.Core
{
public class JsonSerializationStrategy : ISerializationStrategy
{
public string Serialize(object @object)
{
return JsonConvert.SerializeObject(@object);
}
public obje... | ```c#
using System;
using CQRS.Light.Contracts;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace CQRS.Light.Core
{
public class JsonSerializationStrategy : ISerializationStrategy
{
private readonly JsonS... |
47c75229-87ef-41a7-8f28-0e5741fd1ca2 | {
"language": "C#"
} | ```c#
// Copyright (c) The Perspex Project. All rights reserved.
// Licensed under the MIT license. See licence.md file in the project root for full license information.
using System;
using System.Globalization;
using OmniXaml.TypeConversion;
using Perspex.Media.Imaging;
namespace Perspex.Markup.Xaml.Converters
{
... | ```c#
// Copyright (c) The Perspex Project. All rights reserved.
// Licensed under the MIT license. See licence.md file in the project root for full license information.
using System;
using System.Globalization;
using OmniXaml.TypeConversion;
using Perspex.Media.Imaging;
using Perspex.Platform;
namespace Perspex.Mark... |
15ae689d-7e1c-4079-a95a-bed2a378ea9a | {
"language": "C#"
} | ```c#
using System;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using NLog.Extensions.Logging;
namespace ConsoleExample
{
class Program
{
static void Main(string[] args)
{
var servicesProvider = BuildDi();
var runner = servicesPro... | ```c#
using System;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using NLog.Extensions.Logging;
namespace ConsoleExample
{
class Program
{
static void Main(string[] args)
{
var servicesProvider = BuildDi();
var runner = servicesPro... |
f772b200-e244-4bdc-b58c-a56c0a06faf3 | {
"language": "C#"
} | ```c#
using UnrealBuildTool;
using System.IO;
public class OSVRClientKit : ModuleRules
{
private string ModulePath
{
get { return Path.GetDirectoryName(RulesCompiler.GetModuleFilename(this.GetType().Name)); }
}
public OSVRClientKit(TargetInfo Target)
{
Type = ModuleTy... | ```c#
using UnrealBuildTool;
using System.IO;
public class OSVRClientKit : ModuleRules
{
private string ModulePath
{
get { return Path.GetDirectoryName(RulesCompiler.GetModuleFilename(this.GetType().Name)); }
}
public OSVRClientKit(TargetInfo Target)
{
Type = ModuleTy... |
f9cc3850-4bff-43da-8aa6-f0042d52bc82 | {
"language": "C#"
} | ```c#
namespace TraktApiSharp.Objects.Basic
{
using System.Collections.Generic;
public class TraktPaginationListResult<ListItem>
{
public IEnumerable<ListItem> Items { get; set; }
public int? Page { get; set; }
public int? Limit { get; set; }
public int? PageCount { get;... | ```c#
namespace TraktApiSharp.Objects.Basic
{
using System.Collections.Generic;
/// <summary>
/// Represents results of requests supporting pagination.<para />
/// Contains the current page, the item limitation per page, the total page count, the total item count
/// and can also contain the total... |
eb7add0e-66c7-47cd-9899-40e4e197ae17 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using Xunit;
namespace Nether.Web.IntegrationTests.Identity
{
public class UserApiTests : WebTestBase
{
private HttpClient _client;
//[Fact]
... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using Xunit;
namespace Nether.Web.IntegrationTests.Identity
{
public class UserApiTests : WebTestBase
{
private HttpClient _client;
[Fact]
pu... |
c947382f-746f-4b74-8667-7a109d9bf3ed | {
"language": "C#"
} | ```c#
using CommandLine;
using NadekoBot.Core.Common;
namespace NadekoBot.Core.Modules.Games.Common.Trivia
{
public class TriviaOptions : INadekoCommandOptions
{
[Option('p', "pokemon", Required = false, Default = false, HelpText = "Whether it's 'Who's that pokemon?' trivia.")]
public bool IsP... | ```c#
using CommandLine;
using NadekoBot.Core.Common;
namespace NadekoBot.Core.Modules.Games.Common.Trivia
{
public class TriviaOptions : INadekoCommandOptions
{
[Option('p', "pokemon", Required = false, Default = false, HelpText = "Whether it's 'Who's that pokemon?' trivia.")]
public bool IsP... |
104c2955-b55d-4c3f-bf21-b34e05c7405f | {
"language": "C#"
} | ```c#
namespace Stripe
{
using System.Collections.Generic;
using Newtonsoft.Json;
public class PaymentIntentCreateOptions : PaymentIntentSharedOptions
{
[JsonProperty("capture_method")]
public string CaptureMethod { get; set; }
[JsonProperty("confirm")]
public bool? Con... | ```c#
namespace Stripe
{
using System.Collections.Generic;
using Newtonsoft.Json;
public class PaymentIntentCreateOptions : PaymentIntentSharedOptions
{
[JsonProperty("capture_method")]
public string CaptureMethod { get; set; }
[JsonProperty("confirm")]
public bool? Con... |
f27963a6-c639-4e99-a85f-54c8929614d0 | {
"language": "C#"
} | ```c#
using System;
using System.Linq;
namespace Orleankka.Cluster
{
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
static class ServiceCollectionExtensions
{
public static void Decorate<T>(this IServiceCollection services, Func<T, T... | ```c#
using System;
using System.Linq;
namespace Orleankka.Cluster
{
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
static class ServiceCollectionExtensions
{
public static void Decorate<T>(this IServiceCollection services, Func<T, T... |
f175eadf-e462-49e9-9a86-56890032d438 | {
"language": "C#"
} | ```c#
using Humanizer.Bytes;
namespace Humanizer
{
public static class ByteSizeExtensions
{
public static ByteSize Bits(this long val)
{
return ByteSize.FromBits(val);
}
public static ByteSize Bytes(this double val)
{
return ByteSize.FromBytes(v... | ```c#
using Humanizer.Bytes;
namespace Humanizer
{
public static class ByteSizeExtensions
{
/// <summary>
/// Use value as a quantity of bits
/// </summary>
/// <param name="val"></param>
/// <returns></returns>
public static ByteSize Bits(this long val)
... |
83bdfec3-56b8-4c0f-b07e-b2ebc74eb5c1 | {
"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 osu.Framework.Graphics;
using osu.Game.Rulesets.UI;
using osuTK;
namespace osu.Game.Rulesets.Mania.UI
{
public class ManiaPlayfieldAdjustmentContainer : ... | ```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 osu.Framework.Graphics;
using osu.Game.Rulesets.UI;
namespace osu.Game.Rulesets.Mania.UI
{
public class ManiaPlayfieldAdjustmentContainer : PlayfieldAdju... |
75431550-41a1-43c7-ac8a-8e9a3e0cf687 | {
"language": "C#"
} | ```c#
using System;
using System.Threading;
using System.Threading.Tasks;
using WebSocket.Portable.Interfaces;
namespace WebSocket.Portable.Internal
{
internal static class DataLayerExtensions
{
public static Task<byte[]> ReadAsync(this IDataLayer layer, int length, CancellationToken cancellationToken)... | ```c#
using System.Threading;
using System.Threading.Tasks;
using WebSocket.Portable.Interfaces;
namespace WebSocket.Portable.Internal
{
internal static class DataLayerExtensions
{
public static Task<byte[]> ReadAsync(this IDataLayer layer, int length, CancellationToken cancellationToken)
{
... |
d7db740f-8517-4857-83b9-b3f3c654ee9a | {
"language": "C#"
} | ```c#
#region License
//-----------------------------------------------------------------------
// <copyright>
// The MIT License (MIT)
//
// Copyright (c) 2014 Kirk S Woll
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "S... | ```c#
#region License
//-----------------------------------------------------------------------
// <copyright>
// The MIT License (MIT)
//
// Copyright (c) 2014 Kirk S Woll
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "S... |
50e46560-0d33-4ab9-bb6e-e872c773a851 | {
"language": "C#"
} | ```c#
namespace Moya.Utility
{
using System;
using Exceptions;
using Extensions;
using Runners;
public class Guard
{
public static void IsMoyaAttribute(Type type)
{
if (!Reflection.TypeIsMoyaAttribute(type))
{
throw new MoyaException("{0}... | ```c#
namespace Moya.Utility
{
using System;
using Exceptions;
using Extensions;
using Runners;
public class Guard
{
public static void IsMoyaAttribute(Type type)
{
if (!Reflection.TypeIsMoyaAttribute(type))
{
throw new MoyaException("{0}... |
8d45d097-cbf7-45cd-aad2-9f854f379c66 | {
"language": "C#"
} | ```c#
using LegoSharp;
using System;
using System.Threading.Tasks;
using System.Collections.Generic;
namespace Scraper
{
class Scraper
{
static async Task Main(string[] args)
{
foreach (var entry in await (new FacetScraper<ProductSearchQuery, ProductSearchResult>(new List<ProductSe... | ```c#
using LegoSharp;
using System;
using System.Threading.Tasks;
using System.Collections.Generic;
namespace Scraper
{
class Scraper
{
static async Task Main(string[] args)
{
foreach (var entry in await (new FacetScraper<ProductSearchQuery, ProductSearchResult>(new List<ProductSe... |
624083ba-c96c-4e3f-b60e-5fccf50ac6b1 | {
"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 osu.Framework.Graphics;
using osu.Framework.Bindables;
using osu.Game.Graphics.UserInterface;
using osu.Game.Rulesets;
using osu.Game.Users;
namespace osu.G... | ```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 osu.Framework.Graphics;
using osu.Framework.Bindables;
using osu.Game.Graphics.UserInterface;
using osu.Game.Rulesets;
using osu.Game.Users;
namespace osu.G... |
818658b8-43e8-4563-9d28-5df87e4b9838 | {
"language": "C#"
} | ```c#
using System.Collections.Concurrent;
using LunaClient.Base;
using LunaClient.Base.Interface;
using LunaCommon.Message.Data.Vessel;
using LunaCommon.Message.Interface;
namespace LunaClient.Systems.VesselFlightStateSys
{
public class VesselFlightStateMessageHandler : SubSystem<VesselFlightStateSystem>, IMessa... | ```c#
using System.Collections.Concurrent;
using LunaClient.Base;
using LunaClient.Base.Interface;
using LunaCommon.Message.Data.Vessel;
using LunaCommon.Message.Interface;
namespace LunaClient.Systems.VesselFlightStateSys
{
public class VesselFlightStateMessageHandler : SubSystem<VesselFlightStateSystem>, IMessa... |
8fd85ce0-8baf-4231-a7b6-f9a37fc6e589 | {
"language": "C#"
} | ```c#
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Composition;
using Microsoft.CodeAnalysis.Host;
using Microsoft.CodeAnalysis.Host.Mef;
namespace Microsoft.CodeAnalysis.Experiments
{
... | ```c#
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Composition;
using Microsoft.CodeAnalysis.Host;
using Microsoft.CodeAnalysis.Host.Mef;
namespace Microsoft.CodeAnalysis.Experiments
{
... |
7309c62e-2270-431b-9b9c-69b1c3b5e316 | {
"language": "C#"
} | ```c#
// Copyright © 2010-2014 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;
namespace CefSharp
{
[Flags]
public enum DragOperationsMask : uint
{
None = 0,
Copy = 1,
... | ```c#
// Copyright © 2010-2014 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;
namespace CefSharp
{
[Flags]
public enum DragOperationsMask : uint
{
None = 0,
Copy = 1,
... |
e8eca604-64c1-4b71-9fab-921edcfdf382 | {
"language": "C#"
} | ```c#
// Copyright (c) Microsoft Open Technologies, Inc. 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.Threading.Tasks;
using Microsoft.AspNet.Http;
namespace Microsoft.AspNet.Builder.Extensions
{
///... | ```c#
// Copyright (c) Microsoft Open Technologies, Inc. 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.Threading.Tasks;
using Microsoft.AspNet.Http;
using Microsoft.Framework.Internal;
namespace Microsoft... |
18db8c59-2373-4c51-8484-37fa5f32c75c | {
"language": "C#"
} | ```c#
namespace StudentSystem.Data.Migrations
{
using System;
using System.Data.Entity;
using System.Data.Entity.Migrations;
using System.Linq;
public sealed class Configuration : DbMigrationsConfiguration<ApplicationDbContext>
{
public Configuration()
{
this.Automat... | ```c#
namespace StudentSystem.Data.Migrations
{
using System;
using System.Data.Entity;
using System.Data.Entity.Migrations;
using System.Linq;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.EntityFramework;
using StudentSystem.Models;
public sealed class Configuration... |
281d1de3-ef05-48a6-8e98-31797241f566 | {
"language": "C#"
} | ```c#
using System;
using Microsoft.Win32;
namespace PlexServiceCommon {
public static class PlexDirHelper {
/// <summary>
/// Returns the full path and filename of the plex media server executable
/// </summary>
/// <returns></returns>
public static string GetPlexDataDir()
{
var result = string.Empty;... | ```c#
using System;
using System.IO;
using Microsoft.Win32;
namespace PlexServiceCommon {
public static class PlexDirHelper {
/// <summary>
/// Returns the full path and filename of the plex media server executable
/// </summary>
/// <returns></returns>
public static string GetPlexDataDir()
{
var resul... |
ff3dfdb2-d8da-410a-9bf0-39e96013d7e5 | {
"language": "C#"
} | ```c#
using System.Globalization;
namespace GoldenAnvil.Utility
{
public static class StringUtility
{
public static string FormatInvariant(this string format, params object[] args)
{
return string.Format(CultureInfo.InvariantCulture, format, args);
}
}
}
```
Add Join extension for strings | ```c#
using System.Collections.Generic;
using System.Globalization;
using System.Text;
namespace GoldenAnvil.Utility
{
public static class StringUtility
{
public static string FormatInvariant(this string format, params object[] args)
{
return string.Format(CultureInfo.InvariantCulture, format, args);
}
... |
7b9de915-0f65-4cee-9ac3-1f76f4d83e39 | {
"language": "C#"
} | ```c#
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.ServiceModel;
using Infrastructure.Common;
using Xunit;
public static class UpnE... | ```c#
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.ServiceModel;
using Infrastructure.Common;
using Xunit;
public static class UpnE... |
c3b81bce-a8e3-4d0c-845e-27fdfd0d2f2a | {
"language": "C#"
} | ```c#
using System;
using System.IO;
using System.Net.Http;
using System.Net.Mime;
using System.Threading.Tasks;
namespace Dotnet.Script.Core
{
public class ScriptDownloader
{
public async Task<string> Download(string uri)
{
const string plainTextMediaType = "text/plain";
... | ```c#
using System;
using System.IO;
using System.Net.Http;
using System.Net.Mime;
using System.Threading.Tasks;
namespace Dotnet.Script.Core
{
public class ScriptDownloader
{
public async Task<string> Download(string uri)
{
const string plainTextMediaType = "text/plain";
... |
5937b0d0-daee-44b2-8270-f64bd1133165 | {
"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.
namespace osu.Framework.Input.Bindings
{
/// <summary>
/// A binding of a <see cref="Bindings.KeyCombination"/> to an action.
/// </summary>
public ... | ```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.
namespace osu.Framework.Input.Bindings
{
/// <summary>
/// A binding of a <see cref="Bindings.KeyCombination"/> to an action.
/// </summary>
public ... |
f5d5fefe-6deb-425a-9bc4-ec4d384a4913 | {
"language": "C#"
} | ```c#
using Microsoft.Owin;
using Microsoft.Owin.Security;
using Microsoft.Owin.Security.Provider;
namespace Auth0.Owin
{
/// <summary>
/// Context passed when the redirect_uri is generated during the token exchange.
/// </summary>
public class Auth0CustomizeTokenExchangeRedirectUriContext : BaseCont... | ```c#
using Microsoft.Owin;
using Microsoft.Owin.Security;
using Microsoft.Owin.Security.Provider;
namespace Auth0.Owin
{
/// <summary>
/// Context passed when the redirect_uri is generated during the token exchange.
/// </summary>
public class Auth0CustomizeTokenExchangeRedirectUriContext : BaseCont... |
29e1b581-c3c3-43fe-ac05-edf5d19a459a | {
"language": "C#"
} | ```c#
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using Xunit;
namespace System.Reflection.PortableExecutable.Tests
{
public class PEHeaderBuilderTests
... | ```c#
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using Xunit;
namespace System.Reflection.PortableExecutable.Tests
{
public class PEHeaderBuilderTests
... |
f94c8920-9b49-4844-b0a0-a92e47bc2e36 | {
"language": "C#"
} | ```c#
using Dolstagis.Web.Auth;
using Dolstagis.Web.Lifecycle;
using Dolstagis.Web.Lifecycle.ResultProcessors;
using Dolstagis.Web.Sessions;
using Dolstagis.Web.Static;
using Dolstagis.Web.Views;
namespace Dolstagis.Web
{
internal class CoreServices : Feature
{
public CoreServices()
... | ```c#
using Dolstagis.Web.Auth;
using Dolstagis.Web.Http;
using Dolstagis.Web.Lifecycle;
using Dolstagis.Web.Lifecycle.ResultProcessors;
using Dolstagis.Web.Sessions;
using Dolstagis.Web.Static;
using Dolstagis.Web.Views;
namespace Dolstagis.Web
{
internal class CoreServices : Feature
{
pu... |
e1e7da15-52fa-496c-b991-2084f41a2cc1 | {
"language": "C#"
} | ```c#
using System.Linq;
using NUnit.Framework;
using Umbraco.Core;
using Umbraco.Web.UI.JavaScript;
namespace Umbraco.Tests.Web.AngularIntegration
{
[TestFixture]
public class JsInitializationTests
{
[Test]
public void Get_Default_Init()
{
var init = JsInitialization.... | ```c#
using System.Linq;
using NUnit.Framework;
using Umbraco.Core;
using Umbraco.Web.UI.JavaScript;
namespace Umbraco.Tests.Web.AngularIntegration
{
[TestFixture]
public class JsInitializationTests
{
[Test]
public void Get_Default_Init()
{
var init = JsInitialization.... |
971b3906-9818-499d-b5c7-7ab3bfeb3fcb | {
"language": "C#"
} | ```c#
using System.Web;
using System.Web.Optimization;
using wwwplatform.Models;
using wwwplatform.Models.Support;
namespace wwwplatform
{
public class BundleConfig
{
// For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
public static void RegisterBundles(Bun... | ```c#
using System.Web;
using System.Web.Optimization;
using wwwplatform.Models;
using wwwplatform.Models.Support;
namespace wwwplatform
{
public class BundleConfig
{
// For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
public static void RegisterBundles(Bun... |
728db528-e200-4911-a14f-fb479144d0ff | {
"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.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Textures;
using osu.Game.Graphics;
using osuTK;
n... | ```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.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Textures;
using osu.Game.Graphics;
using osuTK;
n... |
56c7ddcf-2939-4ba0-b154-22f91645b11e | {
"language": "C#"
} | ```c#
using System;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Threading.Tasks;
using Dapper;
using SFA.DAS.EAS.Domain.Configuration;
using SFA.DAS.EAS.Domain.Data.Repositories;
using SFA.DAS.EAS.Domain.Models.UserProfile;
using SFA.DAS.Sql.Client;
using SFA.DAS.NLog.Logger;... | ```c#
using System;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Threading.Tasks;
using Dapper;
using SFA.DAS.EAS.Domain.Configuration;
using SFA.DAS.EAS.Domain.Data.Repositories;
using SFA.DAS.EAS.Domain.Models.UserProfile;
using SFA.DAS.Sql.Client;
using SFA.DAS.NLog.Logger;... |
374dc982-6616-47ba-ab36-d82d166ab1cd | {
"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.
#nullable enable
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using osu.Game.Rulesets.Scoring;
using osu.Game.Scoring;
namespace osu.Gam... | ```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.
#nullable enable
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using osu.Game.Rulesets.Scoring;
using osu.Game.Scoring;
namespace osu.Gam... |
b3fc4363-e81a-41d0-a993-ca4d74519901 | {
"language": "C#"
} | ```c#
using System;
using System.Threading.Tasks;
using Windows.ApplicationModel;
using Windows.System;
namespace EarTrumpet.Services
{
public static class WhatsNewDisplayService
{
internal static void ShowIfAppropriate()
{
if (App.HasIdentity())
{
var c... | ```c#
using System;
using System.Threading.Tasks;
using Windows.ApplicationModel;
using Windows.System;
namespace EarTrumpet.Services
{
public static class WhatsNewDisplayService
{
internal static void ShowIfAppropriate()
{
if (App.HasIdentity())
{
var c... |
c0149141-e3c5-40e0-b45c-c69c1b6eade5 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using CIV.Ccs;
using CIV.Common;
namespace CIV.Hml
{
class BoxFormula : HmlLabelFormula
{
protected override string BuildRepr() => $"[{String.Join(",", Label)}]{Inner}";
protected override bool CheckStrategy(IEnumerable<... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using CIV.Common;
namespace CIV.Hml
{
class BoxFormula : HmlLabelFormula
{
protected override string BuildRepr() => $"[{String.Join(",", Label)}]{Inner}";
protected override bool CheckStrategy(IEnumerable<IProcess> proce... |
a8503388-dd75-4457-b5f9-1a10733d870e | {
"language": "C#"
} | ```c#
using System;
namespace RightpointLabs.Pourcast.Infrastructure.Persistence.Repositories
{
using System.Collections.Generic;
using System.Linq;
using RightpointLabs.Pourcast.Domain.Models;
using RightpointLabs.Pourcast.Domain.Repositories;
using RightpointLabs.Pourcast.Infrastructure.Persist... | ```c#
using System;
namespace RightpointLabs.Pourcast.Infrastructure.Persistence.Repositories
{
using System.Collections.Generic;
using System.Linq;
using RightpointLabs.Pourcast.Domain.Models;
using RightpointLabs.Pourcast.Domain.Repositories;
using RightpointLabs.Pourcast.Infrastructure.Persist... |
8acb694a-1c03-4114-b58b-311cb358fe10 | {
"language": "C#"
} | ```c#
@model PagedList.IPagedList<AstroPhotoGallery.Models.Category>
@using PagedList.Mvc;
@using System.Linq;
@{
ViewBag.Title = "List";
}
<link href="~/Content/PagedList.css" rel="stylesheet" />
<div class="container">
<h2 class="text-center">Browse by categories</h2>
<br/>
@foreach (var category in... | ```c#
@model PagedList.IPagedList<AstroPhotoGallery.Models.Category>
@using PagedList.Mvc;
@using System.Linq;
@{
ViewBag.Title = "List";
}
<link href="~/Content/PagedList.css" rel="stylesheet" />
<div class="container">
<h2 class="text-center">Browse by categories</h2>
<br/>
@foreach (var category in... |
e6c30767-4c07-4ae7-b56b-e424d51f8c9e | {
"language": "C#"
} | ```c#
using System;
using Aliencube.EntityContextLibrary.Interfaces;
using FluentAssertions;
using NUnit.Framework;
namespace Aliencube.EntityContextLibrary.Tests
{
[TestFixture]
public class DbContextFactoryTest
{
private IDbContextFactory _factory;
[SetUp]
public void Init()
... | ```c#
using System;
using Aliencube.EntityContextLibrary.Interfaces;
using FluentAssertions;
using NUnit.Framework;
namespace Aliencube.EntityContextLibrary.Tests
{
/// <summary>
/// This represents the test entity for the <see cref="DbContextFactory{TContext}" /> class.
/// </summary>
[TestFixture... |
c37ef965-944a-4a5d-96a0-7e3132f98604 | {
"language": "C#"
} | ```c#
@using SFA.DAS.EmployerApprenticeshipsService.Web
@using SFA.DAS.EmployerApprenticeshipsService.Web.Models
@model dynamic
@{
var viewModel = Model as OrchestratorResponse;
}
@if (viewModel?.FlashMessage != null)
{
<div class="grid-row">
<div class="column-full">
<div class="@vie... | ```c#
@using SFA.DAS.EmployerApprenticeshipsService.Web
@using SFA.DAS.EmployerApprenticeshipsService.Web.Models
@model dynamic
@{
var viewModel = Model as OrchestratorResponse;
}
@if (!string.IsNullOrEmpty(viewModel?.FlashMessage?.Message))
{
<div class="grid-row">
<div class="column-full">
... |
7bfcc58a-def3-48b2-9816-11b521b9f67c | {
"language": "C#"
} | ```c#
namespace Ploeh.AutoFixture
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using Kernel;
public class LambdaExpressionGenerator : ISpecimenBuilder
{
public object Create(object request, ISpecimenContext context)
{
... | ```c#
namespace Ploeh.AutoFixture
{
using System;
using System.Linq;
using System.Linq.Expressions;
using Kernel;
public class LambdaExpressionGenerator : ISpecimenBuilder
{
public object Create(object request, ISpecimenContext context)
{
var requestType = request a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.