doc_id stringlengths 36 36 | metadata dict | input stringlengths 28 4.3k | output stringlengths 11 5.45k |
|---|---|---|---|
354b866e-2540-496c-a285-e20dc0731461 | {
"language": "C#"
} | ```c#
using Newtonsoft.Json;
using System.ComponentModel.DataAnnotations;
namespace TheCollection.Business.Tea
{
[JsonConverter(typeof(SearchableConverter))]
public class Bag
{
[Key]
[JsonProperty(PropertyName = "id")]
public string Id { get; set; }
[Searchable]
... | ```c#
using Newtonsoft.Json;
using System.ComponentModel.DataAnnotations;
namespace TheCollection.Business.Tea
{
[JsonConverter(typeof(SearchableConverter))]
public class Bag
{
[Key]
[JsonProperty(PropertyName = "id")]
public string Id { get; set; }
[JsonProperty(Pr... |
c56585e6-599e-4e46-be5f-7e92fbae9862 | {
"language": "C#"
} | ```c#
using System;
using System.Threading;
namespace Lurchsoft.ParallelWorkshop.Ex05DatedSerial.PossibleSolution
{
public class LazyDatedSerial
{
private Lazy<ThreadSafeSerial> serial = new Lazy<ThreadSafeSerial>(LazyThreadSafetyMode.ExecutionAndPublication);
public string GetNextSerial()
... | ```c#
using System;
using System.Threading;
namespace Lurchsoft.ParallelWorkshop.Ex05DatedSerial.PossibleSolution
{
public class LazyDatedSerial
{
private Lazy<ThreadSafeSerial> serial = new Lazy<ThreadSafeSerial>
(() => new ThreadSafeSerial(DateTime.Now.ToShortDateString()), LazyThreadSafe... |
d55e08bd-ba9f-45f5-9377-e074bc8ee730 | {
"language": "C#"
} | ```c#
// Copyright 2017 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by ... | ```c#
// Copyright 2017 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by ... |
433de84c-b7d6-48c1-aa19-8627924d5e59 | {
"language": "C#"
} | ```c#
using System.IO;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
namespace ContosoUniversity
{
public class Program
{
public static void Main(string[] args)
{
BuildWebHost(args).Run(... | ```c#
using System.IO;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
namespace ContosoUniversity
{
public class Program
{
public static void Main(string[] args)
{
CreateWebHostBuilder(ar... |
4a3ad118-f678-4117-be8b-8291dd5d2d89 | {
"language": "C#"
} | ```c#
using System.Collections.Generic;
using System.Linq;
using Mirage.Urbanization.ZoneStatisticsQuerying;
using System.Collections.Immutable;
namespace Mirage.Urbanization.Simulation.Persistence
{
public class PersistedCityStatisticsCollection
{
private ImmutableQueue<PersistedCityStatisticsWithFina... | ```c#
using System.Collections.Generic;
using System.Linq;
using Mirage.Urbanization.ZoneStatisticsQuerying;
using System.Collections.Immutable;
namespace Mirage.Urbanization.Simulation.Persistence
{
public class PersistedCityStatisticsCollection
{
private ImmutableQueue<PersistedCityStatisticsWithFina... |
d04ce38e-6b12-4252-8b0e-2bc2a14b71f9 | {
"language": "C#"
} | ```c#
using System;
using System.IO;
using System.Net;
namespace SimpleWAWS.Authentication
{
public static class AuthUtilities
{
public static string GetContentFromUrl(string url)
{
var request = (HttpWebRequest)WebRequest.Create(url);
using (var response = request.GetR... | ```c#
using System;
using System.IO;
using System.Net;
namespace SimpleWAWS.Authentication
{
public static class AuthUtilities
{
public static string GetContentFromUrl(string url, string method="GET", bool jsonAccept = false, bool addGitHubHeaders = false, string AuthorizationHeader ="")
{
... |
d1b5896c-11e3-425a-97b7-b6a5450e3e05 | {
"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... |
e434b448-a3f9-4158-84c6-9ae65e64cdcd | {
"language": "C#"
} | ```c#
using UnityEngine;
using System.Collections;
public class SpawnController : MonoBehaviour {
public GameObject enemiesFolder;
public GameObject originalEnemy;
public int enemiesToSpawn;
private int enemiesSpawned;
void Start () {
enemiesSpawned = 0;
InvokeRepeating("SpawnEnemy", 0, 2f)... | ```c#
using UnityEngine;
using System.Collections;
public class SpawnController : MonoBehaviour {
public GameObject enemiesFolder;
public GameObject originalEnemy;
public int enemiesToSpawn;
public float spawnInterval;
private int enemiesSpawned;
void Start () {
enemiesSpawned = 0;
InvokeRepeat... |
67e6dc06-150b-4b50-a7cf-301f209a5053 | {
"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... |
122e14eb-f592-4915-a641-caa9dd837443 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
namespace Shippo {
[JsonObject (MemberSerialization.OptIn)]
public class Batch : ShippoId {
[JsonProperty (PropertyName = "object_status")]
public string ObjectStatus { get; set; }
[JsonProperty (PropertyName ... | ```c#
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
namespace Shippo {
[JsonObject (MemberSerialization.OptIn)]
public class Batch : ShippoId {
[JsonProperty (PropertyName = "object_status")]
public string ObjectStatus { get; set; }
[JsonProperty (PropertyName ... |
4aded1bc-8e11-4d83-9055-0d4c19647de1 | {
"language": "C#"
} | ```c#
using UnityEditor;
using UnityEditor.Build;
#if UNITY_2018_1_OR_NEWER
using UnityEditor.Build.Reporting;
#endif
using UnityEngine;
using System.Collections.Generic;
class TeakPreProcessDefiner :
#if UNITY_2018_1_OR_NEWER
IPreprocessBuildWithReport
#else
IPreprocessBuild
#endif
{
public int callbackO... | ```c#
using UnityEditor;
using UnityEditor.Build;
#if UNITY_2018_1_OR_NEWER
using UnityEditor.Build.Reporting;
#endif
using UnityEngine;
using System.Collections.Generic;
class TeakPreProcessDefiner :
#if UNITY_2018_1_OR_NEWER
IPreprocessBuildWithReport
#else
IPreprocessBuild
#endif
{
public int callbackO... |
e196e876-fb2d-4914-a74e-7cc505cfa943 | {
"language": "C#"
} | ```c#
using System;
using System.IO;
namespace Kfstorm.BingWallpaper
{
public static class Constants
{
public static string DataPath
{
get
{
string path = Path.Combine(Environment.GetFolderPath(
Environment.SpecialFolder.ApplicationDa... | ```c#
using System;
using System.IO;
namespace Kfstorm.BingWallpaper
{
public static class Constants
{
public static string DataPath
{
get
{
string path = Path.Combine(Environment.GetFolderPath(
Environment.SpecialFolder.ApplicationDa... |
bb004b18-b9ab-477d-87bf-8fdefad00d83 | {
"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.Runtime.Remoting.Messaging;
using System.Security;
namespace System.Diagnostics
{
// this co... | ```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.Runtime.Remoting;
using System.Runtime.Remoting.Messaging;
using System.Security;
namespace Syst... |
6ad0bd54-c6b7-4b3a-8e1b-2cab06c644dc | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using NDesk.Options;
using Sep.Git.Tfs.Core;
using StructureMap;
namespace Sep.Git.Tfs.Commands
{
[Pluggable("pull")]
[Description("pull [options]")]
[RequiresValidGitRepository]
public class Pull : GitTfsCommand
{
... | ```c#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using NDesk.Options;
using Sep.Git.Tfs.Core;
using StructureMap;
namespace Sep.Git.Tfs.Commands
{
[Pluggable("pull")]
[Description("pull [options]")]
[RequiresValidGitRepository]
public class Pull : GitTfsCommand
{
... |
e0603df4-2277-4ee8-98df-1bda739eabf3 | {
"language": "C#"
} | ```c#
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using NUnit.Framework;
using osu.Game.Screens.Multi;
namespace osu.Game.Tests.Visual
{
[TestFixture]
public class TestCaseMultiScreen : OsuTestCase
{... | ```c#
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using NUnit.Framework;
using osu.Game.Screens.Multi;
namespace osu.Game.Tests.Visual
{
[TestFixture]
public class TestCaseMultiScreen : OsuTestCase
{... |
969b25a4-94f4-40ea-88eb-e15f3fa47003 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Text;
namespace osu.Game.Graphics
{
public class DrawableJoinDate : DrawableDate
{
private readonly DateTimeOffset date;
public DrawableJoinDate(DateTimeOffset date) : base(date)
{
this.date = date;
... | ```c#
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using System.Collections.Generic;
using System.Text;
namespace osu.Game.Graphics
{
public class DrawableJoinDate : DrawableDate
{
p... |
6cce24f2-16af-4f71-9106-87b74f763461 | {
"language": "C#"
} | ```c#
using Xunit;
using System;
using Cake.Core.IO;
using Cake.Xamarin.Build;
namespace Cake.Xamarin.Build.Tests.Fakes
{
public class DownloadFileTests : TestFixtureBase
{
[Fact]
public void Download_FacebookSDK ()
{
var url = "https://origincache.facebook.com/developers/resourc... | ```c#
using System;
using Cake.Core.IO;
using Cake.Xamarin.Build;
using NUnit.Framework;
namespace Cake.Xamarin.Build.Tests.Fakes
{
public class DownloadFileTests : TestFixtureBase
{
[Test]
public void Download_FacebookSDK ()
{
var url = "https://origincache.facebook.com/develope... |
68c303aa-0b71-454d-a03e-4430f74232c6 | {
"language": "C#"
} | ```c#
using UnityEngine;
namespace Extensions
{
/// <summary>
/// Extension methods for UnityEngine.NetworkPlayer.
/// </summary>
public static class NetworkPlayerExtensions
{
/// <summary>
/// Gets the numeric index of the network player.
/// </summary>
/// <param n... | ```c#
#if !UNITY_WEBGL
using UnityEngine;
namespace Extensions
{
/// <summary>
/// Extension methods for UnityEngine.NetworkPlayer.
/// </summary>
public static class NetworkPlayerExtensions
{
/// <summary>
/// Gets the numeric index of the network player.
/// </summary>
... |
37eb95b4-c90d-462a-af91-63499ef29796 | {
"language": "C#"
} | ```c#
using System.Linq;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using AngleSharp;
using AngleSharp.Parser.Html;
namespace WebDriverManager.DriverConfigs.Impl
{
public class FirefoxConfig : IDriverConfig
{
public virtual string GetName()
... | ```c#
using System.Linq;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using AngleSharp;
using AngleSharp.Parser.Html;
namespace WebDriverManager.DriverConfigs.Impl
{
public class FirefoxConfig : IDriverConfig
{
public virtual string GetName()
... |
8ba3e17c-f600-4eef-b303-bd1232a15795 | {
"language": "C#"
} | ```c#
using UnityEngine;
using System.Collections;
public class Wall : MonoBehaviour {
public Sprite dmgSprite;
public int hp = 4;
public AudioClip chopSound1;
public AudioClip chopSound2;
//hit points for the wall.
private SpriteRenderer spriteRenderer; //Store a component reference to the attached S... | ```c#
using UnityEngine;
using System.Collections;
public class Wall : MonoBehaviour {
public Sprite dmgSprite;
public int hp = 4;
public AudioClip chopSound1;
public AudioClip chopSound2;
//hit points for the wall.
private SpriteRenderer spriteRenderer; //Store a component reference to the attached S... |
40684308-956b-4c6d-8958-2bffa2d15fa0 | {
"language": "C#"
} | ```c#
using System;
using System.Linq;
public static class ReflectionHelper
{
public static Type FindType(string fullName)
{
return AppDomain.CurrentDomain.GetAssemblies().SelectMany(a => a.GetTypes()).FirstOrDefault(t => t.FullName.Equals(fullName));
}
public static Type FindType(string full... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
public static class ReflectionHelper
{
public static Type FindType(string fullName)
{
return AppDomain.CurrentDomain.GetAssemblies().SelectMany(a => a.GetSafeTypes()).FirstOrDefault(t => t.FullName != nul... |
e9a2a81d-7cc7-4185-9cfe-319203ef3528 | {
"language": "C#"
} | ```c#
using System.Collections.Generic;
using JoinRpg.DataModel;
using JoinRpg.Services.Interfaces;
namespace JoinRpg.Services.Impl.ClaimProblemFilters
{
internal class BrokenClaimsAndCharacters : IClaimProblemFilter
{
public IEnumerable<ClaimProblem> GetProblems(Project project, Claim claim)
{
if (... | ```c#
using System.Collections.Generic;
using JoinRpg.DataModel;
using JoinRpg.Services.Interfaces;
namespace JoinRpg.Services.Impl.ClaimProblemFilters
{
internal class BrokenClaimsAndCharacters : IClaimProblemFilter
{
public IEnumerable<ClaimProblem> GetProblems(Project project, Claim claim)
{
if (... |
17b8498a-e74b-475a-90ff-8c4474fc1ab8 | {
"language": "C#"
} | ```c#
using AppSettingsByConvention;
using FluentAssertions;
using NUnit.Framework;
namespace AppSettingsByConventionTests
{
[TestFixture]
public class WhenAnalyzingExportedTypes
{
[Test]
public void ShouldMatchWhitelist()
{
var whiteList = new []
{
... | ```c#
using System.Linq;
using AppSettingsByConvention;
using FluentAssertions;
using NUnit.Framework;
namespace AppSettingsByConventionTests
{
[TestFixture]
public class WhenAnalyzingExportedTypes
{
[Test]
public void ShouldMatchWhitelist()
{
var whiteList = new []
... |
2a493c9d-9f65-4d4a-b7bd-1a452f2d42cd | {
"language": "C#"
} | ```c#
using System;
using SFML.Graphics;
using SFML.Window;
using Point = SadRogue.Primitives.Point;
using SFMLMouse = SFML.Window.Mouse;
namespace SadConsole.Host
{
public class Mouse : SadConsole.Input.IMouseState
{
private int _mouseWheelValue;
private RenderWindow _window;
public ... | ```c#
using System;
using SFML.Graphics;
using SFML.Window;
using Point = SadRogue.Primitives.Point;
using SFMLMouse = SFML.Window.Mouse;
namespace SadConsole.Host
{
public class Mouse : SadConsole.Input.IMouseState
{
private int _mouseWheelValue;
private RenderWindow _window;
public ... |
6bf1d737-1679-4717-b554-1beae44529ef | {
"language": "C#"
} | ```c#
using Glimpse;
using Microsoft.Framework.ConfigurationModel;
using Microsoft.Framework.DependencyInjection;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using System.Collections.Generic;
namespace Glimpse
{
public class GlimpseServices
{
public static IEnumerable<IServiceDescripto... | ```c#
using Glimpse;
using Microsoft.Framework.ConfigurationModel;
using Microsoft.Framework.DependencyInjection;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using System.Collections.Generic;
using System;
using System.Reflection;
namespace Glimpse
{
public class GlimpseServices
{
publ... |
b10e8586-e832-430b-b7c4-368a780b56ee | {
"language": "C#"
} | ```c#
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections;
using System.Collections.Generic;
namespace System.IO
{
// Abstract Iterator, borrowed from Linq. Used in anticipatio... | ```c#
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections;
using System.Collections.Generic;
namespace System.IO
{
// Abstract Iterator, borrowed from Linq. Used in anticipatio... |
70719e62-c9f4-42b2-bd7e-1597a071f605 | {
"language": "C#"
} | ```c#
using Microsoft.SharePoint.Client;
namespace IonFar.SharePoint.Migration
{
/// <summary>
/// Base class for code-based migrations.
/// </summary>
public abstract class Migration : IMigration
{
public abstract void Up(ClientContext clientContext, IUpgradeLog logger);
public v... | ```c#
using Microsoft.SharePoint.Client;
namespace IonFar.SharePoint.Migration
{
/// <summary>
/// Base class for code-based migrations.
/// </summary>
public abstract class Migration : IMigration
{
public abstract void Up(ClientContext clientContext, IUpgradeLog logger);
protecte... |
a0bae6ce-0e2a-49be-89ee-933d445257e9 | {
"language": "C#"
} | ```c#
using System;
using System.ServiceModel;
using HelloIndigo;
namespace Host
{
class Program
{
static void Main()
{
using (
var host = new ServiceHost(typeof (HelloIndigoService),
new Uri("http://localhost:8000/HelloIndigo")))
{
... | ```c#
using System;
using System.ServiceModel;
using HelloIndigo;
namespace Host
{
class Program
{
static void Main()
{
// A side effect (although perhaps documented) of supplying
// a Uri to the ServiceHost contstructor is that this Uri
// becomes the bas... |
c41e02c0-b038-4870-8bab-4a20379fe657 | {
"language": "C#"
} | ```c#
using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;
namespace PX.Api.ContractBased.Maintenance.Cli.Utils
{
static class Sorter
{
public static void Sort(this XDocument original)
{
XElement root = original.Elements().Single();
XNa... | ```c#
using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;
namespace PX.Api.ContractBased.Maintenance.Cli.Utils
{
static class Sorter
{
public static void Sort(this XDocument original)
{
XElement root = original.Elements().Single();
XNa... |
2ce57f67-0cf3-4963-aa75-dc9c0d0c0bfc | {
"language": "C#"
} | ```c#
@model IEnumerable<BatteryCommander.Common.Models.Qualification>
@using BatteryCommander.Common.Models;
@{
ViewBag.Title = "Qualifications";
}
<h2>@ViewBag.Title</h2>
<p>
@Html.ActionLink("Add New", "New")
</p>
<table class="table table-striped">
<tr>
<th>
@Html.DisplayNameFor... | ```c#
@model IEnumerable<BatteryCommander.Common.Models.Qualification>
@using BatteryCommander.Common.Models;
@{
ViewBag.Title = "Qualifications";
}
<h2>@ViewBag.Title</h2>
<p>
@Html.ActionLink("Add New", "New")
</p>
<table class="table table-striped">
<tr>
<th>
@Html.DisplayNameFor... |
5fdb5a2c-c9bb-4188-be2b-e950530bfaee | {
"language": "C#"
} | ```c#
namespace NSec.Cryptography
{
public enum KeyBlobFormat
{
None,
}
}
```
Add raw key blob formats | ```c#
namespace NSec.Cryptography
{
public enum KeyBlobFormat
{
None = 0,
// --- Secret Key Formats ---
RawSymmetricKey = -1,
RawPrivateKey = -2,
// --- Public Key Formats ---
RawPublicKey = 1,
}
}
``` |
21ef9d3d-0a75-492e-86e7-87a5152dbec8 | {
"language": "C#"
} | ```c#
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System.Threading;
using System;
namespace CloudFoundry.Controllers
{
public class HomeController : Controller
{
private readonly ILogger _logger;
public HomeController(ILogger<HomeController> logger)
{
... | ```c#
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System.Threading;
using System;
namespace CloudFoundry.Controllers
{
public class HomeController : Controller
{
private readonly ILogger _logger;
private readonly Random _random;
public HomeController(ILog... |
246cf079-257b-4732-bcce-ac4f984f8138 | {
"language": "C#"
} | ```c#
using System;
using System.Configuration;
using System.Linq;
using Autofac;
using Autofac.Integration.Mvc;
using BookSleeve;
namespace Compilify.Web.Infrastructure.DependencyInjection
{
public class RedisModule : Module
{
protected override void Load(ContainerBuilder builder)
... | ```c#
using System;
using System.Configuration;
using System.Linq;
using Autofac;
using Autofac.Integration.Mvc;
using BookSleeve;
namespace Compilify.Web.Infrastructure.DependencyInjection
{
public class RedisModule : Module
{
protected override void Load(ContainerBuilder builder)
... |
919c59ec-684d-4023-ad25-4f70d255d8a4 | {
"language": "C#"
} | ```c#
using JetBrains.ReSharper.Plugins.Unity.Yaml.Psi.DeferredCaches.AssetHierarchy.References;
namespace JetBrains.ReSharper.Plugins.Unity.Yaml.Psi.DeferredCaches.AssetHierarchy.Elements
{
public interface IScriptComponentHierarchy : IHierarchyElement
{
ExternalReference ScriptReference { get; }
... | ```c#
using JetBrains.ReSharper.Plugins.Unity.Yaml.Psi.DeferredCaches.AssetHierarchy.References;
namespace JetBrains.ReSharper.Plugins.Unity.Yaml.Psi.DeferredCaches.AssetHierarchy.Elements
{
public interface IScriptComponentHierarchy : IComponentHierarchy
{
ExternalReference ScriptReference { get; }
... |
63464325-fbac-44c2-99f9-0f9bfe506883 | {
"language": "C#"
} | ```c#
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* Copyright (c) 2015, MPL Ali Taheri Moghaddar ali.taheri.m@gmail.com
*/
namespace Pablo.Graphics
{... | ```c#
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* Copyright (c) 2015, MPL Ali Taheri Moghaddar ali.taheri.m@gmail.com
*/
namespace Pablo.Graphics
{... |
0ce7b609-d08c-4d35-8c8c-4bb2dc6fb804 | {
"language": "C#"
} | ```c#
/* ****************************************************************************
*
* Copyright (c) Microsoft Corporation.
*
* This source code is subject to terms and conditions of the Microsoft Public License. A
* copy of the license can be found in the License.html file at the root of this distribution. I... | ```c#
/* ****************************************************************************
*
* Copyright (c) Microsoft Corporation.
*
* This source code is subject to terms and conditions of the Microsoft Public License. A
* copy of the license can be found in the License.html file at the root of this distribution. I... |
83b45a21-7edf-467c-9833-6db4810d8cf6 | {
"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.Game.Tests.Visual
{
public class TestCaseRateAdjustedBeatmap : ScreenTestCase
{
protected override void Update()
{
... | ```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.Game.Tests.Visual
{
/// <summary>
/// Test case which adjusts the beatmap's rate to match any speed adjustments in visual tests.
/// </sum... |
6608af48-d902-4831-9918-8c53bbf373a2 | {
"language": "C#"
} | ```c#
using System;
using Android.Runtime;
namespace AI.XamarinSDK.Android
{
public class Utils
{
public Utils ()
{
}
public static bool IsManagedException(Exception exception){
// TODO: Check exception type (java.lang., android.) or exception source (entry assembly name) to determine whether the except... | ```c#
using System;
using Android.Runtime;
namespace AI.XamarinSDK.Android
{
public class Utils
{
public static readonly string[] JAVA_EXCEPTION_PREFIXES = {"java.lang.", "android."};
public static bool IsManagedException(Exception exception){
string exceptionType = exception.GetBaseException ().GetType ().... |
a6d0fea8-00f2-44f7-9be4-2efb9f7a8bec | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
namespace WienerLinien.Api
{
public class DefaultHttpClient : IHttpClient
{
public async Task<string... | ```c#
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
namespace WienerLinien.Api
{
public class DefaultHttpClient : IHttpClient
{
public... |
9ef31ab6-bf60-4566-ae0a-96b085cf126e | {
"language": "C#"
} | ```c#
using System.IO;
using System.Net.Http;
using System.Threading.Tasks;
namespace LtiLibrary.Core.Extensions
{
internal static class HttpExtensions
{
public static async Task<HttpResponseMessage> GetResponseAsync(this HttpRequestMessage message, bool allowAutoRedirect = false)
{
... | ```c#
using System;
using System.IO;
using System.Net.Http;
using System.Threading.Tasks;
namespace LtiLibrary.Core.Extensions
{
internal static class HttpExtensions
{
public static async Task<HttpResponseMessage> GetResponseAsync(this HttpRequestMessage message, bool allowAutoRedirect = false)
... |
077b64b8-68e0-4576-b334-13e1cf94cb12 | {
"language": "C#"
} | ```c#
//-----------------------------------------------------------------------
// <copyright file="DataPortalMethodCache.cs" company="Marimer LLC">
// Copyright (c) Marimer LLC. All rights reserved.
// Website: https://cslanet.com
// </copyright>
// <summary>Gets a reference to the DataPortal_Create method fo... | ```c#
//-----------------------------------------------------------------------
// <copyright file="DataPortalMethodCache.cs" company="Marimer LLC">
// Copyright (c) Marimer LLC. All rights reserved.
// Website: https://cslanet.com
// </copyright>
//-------------------------------------------------------------... |
628a503c-4911-4735-847c-9ced43ac80a5 | {
"language": "C#"
} | ```c#
/*
Copyright (C) 2016 Anki Universal Team <ankiuniversal@outlook.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later vers... | ```c#
/*
Copyright (C) 2016 Anki Universal Team <ankiuniversal@outlook.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later vers... |
c1b0c4eb-6e27-42a4-9f88-87a23ceec7c1 | {
"language": "C#"
} | ```c#
using Microsoft.Data.Entity;
using Microsoft.Data.Entity.Infrastructure;
using Microsoft.Data.Entity.Metadata;
using System;
using System.Configuration;
using System.Linq;
namespace CycleSales.CycleSalesModel
{
public class CycleSalesContext : DbContext
{
public CycleSalesContext()
... | ```c#
using Microsoft.Data.Entity;
using Microsoft.Data.Entity.Infrastructure;
using Microsoft.Data.Entity.Metadata;
using System;
using System.Configuration;
using System.Linq;
namespace CycleSales.CycleSalesModel
{
public class CycleSalesContext : DbContext
{
public CycleSalesContext()
... |
fa1882a3-57e5-47cf-ac9f-75f01983ca61 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using Prometheus.Advanced.DataContracts;
namespace Prometheus.Advanced
{
public class DefaultCollectorRegistry : ICollectorRegistry
{
public readonly static DefaultCollectorRegistry Instance = new DefaultCollectorRegistry();
... | ```c#
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using Prometheus.Advanced.DataContracts;
namespace Prometheus.Advanced
{
public class DefaultCollectorRegistry : ICollectorRegistry
{
public readonly static DefaultCollectorRegistry Instance = new DefaultCollect... |
653c9885-06b8-40d2-8779-a765985ff7e6 | {
"language": "C#"
} | ```c#
using System;
using System.Threading.Tasks;
using Bit.Core.Contracts;
using Bit.Core.Models;
using System.Diagnostics;
namespace Bit.Owin.Implementations
{
public class DebugLogStore : ILogStore
{
private readonly IContentFormatter _formatter;
public DebugLogStore(IContentFormatter form... | ```c#
#define DEBUG
using System;
using System.Threading.Tasks;
using Bit.Core.Contracts;
using Bit.Core.Models;
using System.Diagnostics;
namespace Bit.Owin.Implementations
{
public class DebugLogStore : ILogStore
{
private readonly IContentFormatter _formatter;
public DebugLogStore(IContent... |
9b232693-ab3f-43de-9189-5d68735482fe | {
"language": "C#"
} | ```c#
using System;
using System.Threading.Tasks;
namespace ConsoleApplication
{
public class Program
{
const int NumThreads = 2;
public static void Main(string[] args)
{
Console.WriteLine($"Starting {NumThreads} threads.");
Task[] workers = new Task[NumThread... | ```c#
using System;
using System.Threading.Tasks;
namespace ConsoleApplication
{
public class Program
{
static int NumThreads = 2;
public static void Main(string[] args)
{
if(args.Length >= 1)
{
NumThreads = Convert.ToInt32(args[0]);
... |
7ca2151a-9adc-4100-8259-b7d84166bfd7 | {
"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 Microsoft.CodeAnalysis.Options;
namespace Microsoft.CodeAnalysis.Shared.Options
{
/// <summary>
/// options to indicate whether a certain... | ```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 Microsoft.CodeAnalysis.Options;
namespace Microsoft.CodeAnalysis.Shared.Options
{
/// <summary>
/// options to indicate whether a certain... |
d68283f6-0543-45f0-aab2-6df009f3051a | {
"language": "C#"
} | ```c#
using System.Configuration;
using System.DirectoryServices.AccountManagement;
using System.Threading.Tasks;
using Umbraco.Core.Models.Identity;
namespace Umbraco.Core.Security
{
public class ActiveDirectoryBackOfficeUserPasswordChecker : IBackOfficeUserPasswordChecker
{
public Task<BackOfficeUse... | ```c#
using System.Configuration;
using System.DirectoryServices.AccountManagement;
using System.Threading.Tasks;
using Umbraco.Core.Models.Identity;
namespace Umbraco.Core.Security
{
public class ActiveDirectoryBackOfficeUserPasswordChecker : IBackOfficeUserPasswordChecker
{
public virtual string Act... |
5844c687-8ba4-4dc7-be75-c909cc680568 | {
"language": "C#"
} | ```c#
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.Immutable;
using Abp.Data;
namespace Abp.RealTime
{
public class InMemoryOnlineClientStore : IOnlineClientStore
{
/// <summary>
/// Online clients.
/// </summary>
protected Con... | ```c#
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.Immutable;
using Abp.Data;
namespace Abp.RealTime
{
public class InMemoryOnlineClientStore : IOnlineClientStore
{
/// <summary>
/// Online clients.
/// </summary>
protected Con... |
32311f3f-ee3c-45cc-b7ef-efbe81343ad5 | {
"language": "C#"
} | ```c#
using System.Linq;
using Avalonia.Data;
using Avalonia.Styling;
using Avalonia.UnitTests;
using Xunit;
namespace Avalonia.Markup.Xaml.UnitTests
{
public class SetterTests : XamlTestBase
{
[Fact]
public void Setter_Should_Work_Outside_Of_Style_With_SetterTargetType_Attribute()
{
... | ```c#
using System.Linq;
using Avalonia.Data;
using Avalonia.Styling;
using Avalonia.UnitTests;
using Xunit;
namespace Avalonia.Markup.Xaml.UnitTests
{
public class SetterTests : XamlTestBase
{
[Fact]
public void Setter_Should_Work_Outside_Of_Style_With_SetterTargetType_Attribute()
{
... |
a912707d-7448-4958-98a5-be0dd1cfd7dc | {
"language": "C#"
} | ```c#
using IL2CPU.API;
using IL2CPU.API.Attribs;
using System;
using System.Diagnostics;
using Cosmos.Core;
namespace Cosmos.Core_Plugs.System.Diagnostics
{
[Plug(Target = typeof(global::System.Diagnostics.Stopwatch))]
public class StopwatchImpl
{
public static long GetTimestamp()
{
... | ```c#
using IL2CPU.API;
using IL2CPU.API.Attribs;
using System;
using System.Diagnostics;
using Cosmos.Core;
namespace Cosmos.Core_Plugs.System.Diagnostics
{
[Plug(Target = typeof(global::System.Diagnostics.Stopwatch))]
public class StopwatchImpl
{
public static long GetTimestamp()
{
... |
12f810e4-d7da-4824-9cd1-3dcb34bbf175 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MiningRigRentalsApi.Converters;
using Newtonsoft.Json;
namespace MiningRigRentalsApi.ObjectModel
{
public class MyRentals
{
public MyRentalsRecords[] records;
}
public class MyRentalsRecords
{
public int id;
p... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MiningRigRentalsApi.Converters;
using Newtonsoft.Json;
namespace MiningRigRentalsApi.ObjectModel
{
public class MyRentals
{
public MyRentalsRecords[] records;
}
public class MyRentalsRecords
{
public int id;
p... |
d2e39f0e-18d5-4cae-be86-af0581f2eb29 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Diploms.Core;
namespace Diploms.WebUI.Controllers
{
[Route("api/[controller]")]
public class DepartmentsController : Controller
{
private readonly IRepository... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Diploms.Core;
namespace Diploms.WebUI.Controllers
{
[Route("api/[controller]")]
public class DepartmentsController : Controller
{
private readonly IRepository... |
f2d522e1-7c81-42a2-b34d-30aaa6cf0cb3 | {
"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.Allocation;
namespace osu.Game.Tournament.Screens.Showcase
{
public class ShowcaseScreen : BeatmapInfoScreen
{
[BackgroundDepen... | ```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.Allocation;
using osu.Framework.Graphics;
using osu.Game.Tournament.Components;
namespace osu.Game.Tournament.Screens.Showcase
{
public cla... |
a1889374-8856-4639-8ed4-614b400149d7 | {
"language": "C#"
} | ```c#
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using Microsoft.MixedReality.Toolkit.Utilities.Editor;
using System;
using UnityEditor;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Editor
{
internal class MRTKVersionPopup : EditorWindow
{
private static... | ```c#
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using Microsoft.MixedReality.Toolkit.Utilities.Editor;
using System;
using UnityEditor;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Editor
{
internal class MRTKVersionPopup : EditorWindow
{
private static... |
2c544006-54e1-41f2-bac9-5d0e1db383e7 | {
"language": "C#"
} | ```c#
using SimpleMigrations;
namespace Migrations
{
[Migration(5, "Add source track plays index")]
public class AddSourceTrackPlaysIndex : Migration
{
protected override void Up()
{
Execute(@"
CREATE INDEX IF NOT EXISTS idx_source_track_plays_id_btree ON source_... | ```c#
using SimpleMigrations;
namespace Migrations
{
[Migration(5, "Add source track plays index")]
public class AddSourceTrackPlaysIndex : Migration
{
protected override void Up()
{
Execute(@"
CREATE INDEX IF NOT EXISTS idx_source_track_plays_id_btree ON source_... |
6de9a53e-267a-4c26-a710-68682f9951b7 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Im... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Im... |
c10cc058-061b-4af4-b9b4-50af60d99441 | {
"language": "C#"
} | ```c#
using Microsoft.AspNetCore.Mvc;
namespace LtiLibrary.AspNet.Outcomes.v1
{
public class ImsxXmlMediaTypeResult : ObjectResult
{
public ImsxXmlMediaTypeResult(object value) : base(value)
{
Formatters.Add(new ImsxXmlMediaTypeOutputFormatter());
}
}
}
```
Add comment... | ```c#
using Microsoft.AspNetCore.Mvc;
namespace LtiLibrary.AspNet.Outcomes.v1
{
/// <summary>
/// Use to attach a specific XML formatter to controller results. For example,
/// <code>public ImsxXmlMediaTypeResult Post([ModelBinder(BinderType = typeof(ImsxXmlMediaTypeModelBinder))] imsx_POXEnvelopeType req... |
074141c7-1053-47db-8d7b-5b04d6ea5b00 | {
"language": "C#"
} | ```c#
using System;
using System.Drawing;
using System.Linq;
using NUnit.Framework;
using Palaso.UI.WindowsForms;
namespace PalasoUIWindowsForms.Tests.FontTests
{
[TestFixture]
public class FontHelperTests
{
[SetUp]
public void SetUp()
{
// setup code goes here
}
[TearDown]
public void TearDown()
... | ```c#
using System;
using System.Drawing;
using NUnit.Framework;
using Palaso.UI.WindowsForms;
namespace PalasoUIWindowsForms.Tests.FontTests
{
[TestFixture]
public class FontHelperTests
{
[SetUp]
public void SetUp()
{
// setup code goes here
}
[TearDown]
public void TearDown()
{
// tear down... |
6dda87ba-43fa-42bb-b5c3-cf360102455e | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using Census.Core;
using Census.Core.Interfaces;
using Census.UmbracoObject;
using umbraco.cms.businesslogic.datatype;
using umbraco.cms.businesslogic.web;
using umbraco.interfaces;
namespace Census.UmbracoObj... | ```c#
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using Census.Core;
using Census.Core.Interfaces;
using Census.UmbracoObject;
using umbraco.cms.businesslogic.datatype;
using umbraco.cms.businesslogic.web;
using umbraco.interfaces;
namespace Census.UmbracoObj... |
04b083ad-f8ac-417a-9ccc-966cf08cff1e | {
"language": "C#"
} | ```c#
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Threading.Tasks;
using ChessVariantsTraining.DbRepositories;
namespace ChessVariantsTraining.ViewModels
{
public class CommentSorter
{
ICommentVoteRepository voteRepo;
IUserRepository ... | ```c#
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Threading.Tasks;
using ChessVariantsTraining.DbRepositories;
namespace ChessVariantsTraining.ViewModels
{
public class CommentSorter
{
ICommentVoteRepository voteRepo;
IUserRepository ... |
83f9dec8-c476-42d7-8c6f-4c1d4e44ab3d | {
"language": "C#"
} | ```c#
namespace Umbraco.Core.Models
{
/// <summary>
/// Represents the type of a property group.
/// </summary>
public enum PropertyGroupType : short
{
/// <summary>
/// Display as a group (using a header).
/// </summary>
Group = 0,
/// <summary>
/// ... | ```c#
namespace Umbraco.Core.Models
{
/// <summary>
/// Represents the type of a property group.
/// </summary>
public enum PropertyGroupType : short
{
/// <summary>
/// Display property types in a group.
/// </summary>
Group = 0,
/// <summary>
/// Di... |
dbde95ee-1fca-4949-a8b5-be95d609c189 | {
"language": "C#"
} | ```c#
using UnityEngine;
using UnityEngine.Events;
public class World : Planet {
private UnityEvent onPlanetHit = new UnityEvent();
private Lives lives;
private void Awake() {
lives = GetComponent<Lives>();
}
private void OnCollisionEnter( Collision other ) {
onPlanetHit.Invoke(... | ```c#
using UnityEngine;
using UnityEngine.Events;
public class World : Planet {
private UnityEvent onPlanetHit = new UnityEvent();
private Lives lives;
private void Awake() {
lives = GetComponent<Lives>();
}
private void OnCollisionEnter( Collision other ) {
if( other.transform... |
dbdc3c2d-88f4-49db-9723-fc2e0666254f | {
"language": "C#"
} | ```c#
using System;
using System.Diagnostics;
using Microsoft.Languages.Editor;
using Microsoft.Languages.Editor.Controller;
namespace Microsoft.VisualStudio.R.Package.Plots {
internal sealed class PlotWindowCommandController : ICommandTarget {
private PlotWindowPane _pane;
public PlotWindowComma... | ```c#
using System;
using System.Diagnostics;
using Microsoft.Languages.Editor;
using Microsoft.Languages.Editor.Controller;
namespace Microsoft.VisualStudio.R.Package.Plots {
internal sealed class PlotWindowCommandController : ICommandTarget {
private PlotWindowPane _pane;
public PlotWindowComma... |
75bc0714-eb13-4586-817d-feac5144493e | {
"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.ComponentModel.Composition;
using Microsoft.VisualStudio.LanguageServer.Client;
using Microsoft.... | ```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.ComponentModel.Composition;
using Microsoft.VisualStudio.LanguageServer.Client;
using Microsoft.... |
bfcb4a36-26f1-460e-a02b-e0d51645e4f5 | {
"language": "C#"
} | ```c#
namespace TraktApiSharp.Extensions
{
using System;
using System.Linq;
public static class StringExtensions
{
private static readonly char[] DelimiterChars = { ' ', ',', '.', ':', ';', '\n', '\t' };
public static string FirstToUpper(this string value)
{
if (st... | ```c#
namespace TraktApiSharp.Extensions
{
using System;
using System.Linq;
/// <summary>Provides helper methods for strings.</summary>
public static class StringExtensions
{
private static readonly char[] DelimiterChars = { ' ', ',', '.', ':', ';', '\n', '\t' };
/// <summary>Conv... |
3670b052-8278-43ac-9b65-7b66f335ebab | {
"language": "C#"
} | ```c#
using Atata;
using NUnit.Framework;
namespace AtataSamples.NetCore.NUnit
{
public class SignInTests : UITestFixture
{
[Test]
public void NetCoreNUnit_SignIn()
{
Go.To<SignInPage>().
Email.Set("admin@mail.com").
Password.Set("abc123").
... | ```c#
using Atata;
using NUnit.Framework;
namespace AtataSamples.NetCore.NUnit
{
public class SignInTests : UITestFixture
{
[Test]
public void NetCoreNUnit_SignIn()
{
Go.To<SignInPage>().
Email.Set("admin@mail.com").
Password.Set("abc123").
... |
9e388871-0400-4c98-bb84-0e0b71c99043 | {
"language": "C#"
} | ```c#
using System;
using NUnit.Framework;
using Entelect.Extensions;
namespace Entelect.Tests.Strings
{
[TestFixture]
public class StringExtensionsTests
{
[Test]
public void ContainsIgnoringCase()
{
var doesContain = "asd".Contains("S",StringComparison.OrdinalIgnoreCase... | ```c#
using System;
using NUnit.Framework;
using Entelect.Extensions;
namespace Entelect.Tests.Strings
{
[TestFixture]
public class StringExtensionsTests
{
[Test]
public void ContainsIgnoringCase()
{
var doesContain = "asd".Contains("S",StringComparison.OrdinalIgnoreCase... |
cd66ee74-7b1e-40d7-a2a9-600254f78a5a | {
"language": "C#"
} | ```c#
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated... | ```c#
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated... |
d579d741-e479-4362-b774-7a90d7b28a5f | {
"language": "C#"
} | ```c#
using System;
using Kudu.Contracts;
using Kudu.Core.Infrastructure;
namespace Kudu.Core.Performance
{
public class NullProfiler : IProfiler
{
public static IProfiler Instance = new NullProfiler();
private NullProfiler()
{
}
public IDisposable Step(string value)
... | ```c#
using System;
using Kudu.Contracts;
using Kudu.Core.Infrastructure;
namespace Kudu.Core.Performance
{
public class NullProfiler : IProfiler
{
public static IProfiler Instance = new NullProfiler();
private NullProfiler()
{
}
public IDisposable Step(string value)
... |
f2c912d6-ae35-4a2c-8b96-bcfdfb1a05fa | {
"language": "C#"
} | ```c#
using Microsoft.WindowsAzure.Mobile.Service;
namespace ZUMOAPPNAMEService.DataObjects
{
public class TodoItem : TableData
{
public string Text { get; set; }
public bool Complete { get; set; }
}
}```
Split out extensions for Entity Framework, Azure Storage, and Mongo. These are now ... | ```c#
using Microsoft.WindowsAzure.Mobile.Service;
namespace ZUMOAPPNAMEService.DataObjects
{
public class TodoItem : EntityData
{
public string Text { get; set; }
public bool Complete { get; set; }
}
}``` |
128d7d07-61b9-4846-9938-91cf867ad673 | {
"language": "C#"
} | ```c#
using System;
namespace ChatRelay
{
class Program
{
private static readonly Relay relay = new Relay();
static void Main()
{
AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionTrapper;
Run();
}
public static void Run()
... | ```c#
using System;
namespace ChatRelay
{
class Program
{
private static readonly Relay relay = new Relay();
static void Main()
{
AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionTrapper;
Run();
}
public static void Run()
... |
2c7df005-c4d2-45f5-a960-b5e00bb1811c | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Data.SqlClient;
using Store.Models;
using Store.Storage.Data;
namespace Store.Storage.SqlServer {
public class Client {
public Client(DBContext _dbContext) {
var fac = new Factory<SqlConnection>();
... | ```c#
using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Data.SqlClient;
using Store.Models;
using Store.Storage.Data;
namespace Store.Storage.SqlServer {
public class Client {
public Client(DBContext _dbContext) {
var fac = new Factory<SqlConnection>();
... |
71af886a-b554-4d33-9467-0c113d8dd214 | {
"language": "C#"
} | ```c#
using System;
using AppKit;
using Foundation;
namespace UselessExceptions
{
public partial class ViewController : NSViewController
{
public ViewController (IntPtr handle) : base (handle)
{
}
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
// Do any additional setup after loading ... | ```c#
using System;
using AppKit;
using Foundation;
namespace UselessExceptions
{
public partial class ViewController : NSViewController
{
public ViewController (IntPtr handle) : base (handle)
{
}
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
throw new Exception ("USELESS");
// D... |
6061feff-1c17-4f08-8a38-590816f5f9a2 | {
"language": "C#"
} | ```c#
/*
Copyright 2014 Daniel Cazzulino
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
*/
namespace OctoFlow
{
using CLAP;
... | ```c#
/*
Copyright 2014 Daniel Cazzulino
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
*/
namespace OctoFlow
{
using CLAP;
... |
8e0d7b4c-3ffc-41b1-b9dd-ac659e4b2096 | {
"language": "C#"
} | ```c#
using System;
using System.Linq;
using MilpManager.Abstraction;
namespace MilpManager.Implementation.CompositeConstraints
{
public class SOS2Calculator : ICompositeConstraintCalculator
{
public IVariable Set(IMilpManager milpManager, CompositeConstraintType type, ICompositeConstraintParameters p... | ```c#
using System;
using System.Linq;
using MilpManager.Abstraction;
namespace MilpManager.Implementation.CompositeConstraints
{
public class SOS2Calculator : ICompositeConstraintCalculator
{
public IVariable Set(IMilpManager milpManager, CompositeConstraintType type, ICompositeConstraintParameters p... |
8fd91418-1de8-4cb1-8e1e-c8d6750856af | {
"language": "C#"
} | ```c#
using System;
namespace Evolve.Test.Utilities
{
public class CassandraDockerContainer
{
private DockerContainer _container;
public string Id => _container.Id;
public string ExposedPort => "9042";
public string HostPort => "9042";
public string ClusterName => "evo... | ```c#
using System;
namespace Evolve.Test.Utilities
{
public class CassandraDockerContainer
{
private DockerContainer _container;
public string Id => _container.Id;
public string ExposedPort => "9042";
public string HostPort => "9042";
public string ClusterName => "evo... |
d9d85df7-9486-4fd7-a1cb-7366f86539a0 | {
"language": "C#"
} | ```c#
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* d... | ```c#
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* d... |
ce490303-9b6d-43c6-be44-9a56b2577d6c | {
"language": "C#"
} | ```c#
namespace Xamarin.Forms.OAuth.Providers
{
public sealed class TrelloOAuthProvider : OAuthProvider
{
private const string _redirectUrl = "https://trelloResponse.com";
public TrelloOAuthProvider(string clientId, string clientSecret, params string[] scopes)
: base(new OAuth... | ```c#
using System.Collections.Generic;
namespace Xamarin.Forms.OAuth.Providers
{
public sealed class TrelloOAuthProvider : OAuthProvider
{
private const string _redirectUrl = "https://trelloResponse.com";
public TrelloOAuthProvider(string clientId, string clientSecret, params string[] ... |
f8f204ec-beb9-465b-9a06-25e819b67824 | {
"language": "C#"
} | ```c#
// Compile with:
// docker run --rm -v "$PWD":/var/task lambci/lambda:build-dotnetcore2.0 dotnet publish -c Release -o pub
// Run with:
// docker run --rm -v "$PWD"/pub:/var/task lambci/lambda:dotnetcore2.0 test::test.Function::FunctionHandler "some"
using System;
using System.Collections.Generic;
using System.... | ```c#
// Compile with:
// docker run --rm -v "$PWD":/var/task lambci/lambda:build-dotnetcore2.0 dotnet publish -c Release -o pub
// Run with:
// docker run --rm -v "$PWD"/pub:/var/task lambci/lambda:dotnetcore2.0 test::test.Function::FunctionHandler "some"
using Amazon.Lambda.Core;
[assembly: LambdaSerializer(typeof... |
38997fcd-e779-40c6-a30e-28efddc3f34b | {
"language": "C#"
} | ```c#
using System;
using System.Text;
using System.Security.Cryptography;
namespace Gibe.DittoProcessors.Processors
{
public class StringToMd5HashAttribute : TestableDittoProcessorAttribute
{
public override object ProcessValue()
{
if (Value == null) throw new NullReferenceException();
var stringValue =... | ```c#
using System;
using System.Text;
using System.Security.Cryptography;
namespace Gibe.DittoProcessors.Processors
{
public class StringToMd5HashAttribute : TestableDittoProcessorAttribute
{
public override object ProcessValue()
{
if (Value == null) throw new NullReferenceException();
var stringValue =... |
bf5c9a34-c712-45e0-a366-28cbea618982 | {
"language": "C#"
} | ```c#
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//-------... | ```c#
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//-------... |
4fd2854d-db1f-4f7f-8d4f-db13ed663941 | {
"language": "C#"
} | ```c#
/*
** Project ShiftDrive
** (C) Mika Molenkamp, 2016.
*/
using System.Collections.Generic;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Audio;
namespace ShiftDrive {
/// <summary>
/// A simple static container, for holding game assets like textures and meshes.
/// </summar... | ```c#
/*
** Project ShiftDrive
** (C) Mika Molenkamp, 2016.
*/
using System.Collections.Generic;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Audio;
namespace ShiftDrive {
/// <summary>
/// A simple static container, for holding game assets like textures and meshes.
/// </summar... |
73b12ac5-5ea6-4ccc-a910-d5d6b1b1983e | {
"language": "C#"
} | ```c#
// Copyright (c) 2016 Nicolas Musset. All rights reserved.
// This file is licensed under the MIT license.
// See the LICENSE.md file in the project root for more information.
using Markdig.Syntax;
namespace Markdig.Renderers.Xaml
{
/// <summary>
/// A XAML renderer for a <see cref="QuoteBlock"/>.
... | ```c#
// Copyright (c) 2016 Nicolas Musset. All rights reserved.
// This file is licensed under the MIT license.
// See the LICENSE.md file in the project root for more information.
using Markdig.Syntax;
namespace Markdig.Renderers.Xaml
{
/// <summary>
/// A XAML renderer for a <see cref="QuoteBlock"/>.
... |
76108d83-6f26-4044-ae26-2f3d77842112 | {
"language": "C#"
} | ```c#
namespace OpcMockTests
{
internal class OpcMockProtocol
{
}
}```
Introduce a Protocol class for better encapsulation | ```c#
using System;
using System.Collections.Generic;
namespace OpcMock
{
public class OpcMockProtocol
{
private List<ProtocolLine> lines;
public OpcMockProtocol()
{
lines = new List<ProtocolLine>();
}
public List<ProtocolLine> Lines
{
... |
82cfb721-9f68-455c-b6fd-09edfdc59cbb | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Text;
using GraphQL.Types;
using Snowflake.Model.Game.LibraryExtensions;
namespace Snowflake.Support.Remoting.GraphQL.Types.Model
{
public class GameFileExtensionGraphType : ObjectGraphType<IGameFileExtension>
{
public GameFileExtensio... | ```c#
using System;
using System.Collections.Generic;
using System.Text;
using GraphQL.Types;
using Snowflake.Model.Game.LibraryExtensions;
namespace Snowflake.Support.Remoting.GraphQL.Types.Model
{
public class GameFileExtensionGraphType : ObjectGraphType<IGameFileExtension>
{
public GameFileExtensio... |
1b2cb8ea-8f34-47a3-a2a1-07998ca422b7 | {
"language": "C#"
} | ```c#
using Autofac;
using Microsoft.Owin.FileSystems;
using Microsoft.Owin.StaticFiles;
using NuGet.Lucene.Web;
using NuGet.Lucene.Web.Formatters;
using Owin;
namespace Klondike.SelfHost
{
class SelfHostStartup : Klondike.Startup
{
private readonly SelfHostSettings selfHostSettings;
public S... | ```c#
using Autofac;
using Microsoft.Owin.FileSystems;
using Microsoft.Owin.StaticFiles;
using NuGet.Lucene.Web;
using NuGet.Lucene.Web.Formatters;
using Owin;
namespace Klondike.SelfHost
{
class SelfHostStartup : Klondike.Startup
{
private readonly SelfHostSettings selfHostSettings;
public S... |
2a6439ec-38d8-45d6-9dc8-4ed8cffd0188 | {
"language": "C#"
} | ```c#
using System;
namespace Konsola.Parser
{
/// <summary>
/// Configures the options when parsing args and binding them to a context.
/// </summary>
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
public class ContextOptionsAttribute : Attribute
{
/// <summary>
/// Gets... | ```c#
using System;
namespace Konsola.Parser
{
/// <summary>
/// Configures the options when parsing args and binding them to a context.
/// </summary>
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
public class ContextOptionsAttribute : Attribute
{
/// <summary>
/// Gets... |
d3baaf89-5843-4650-8bc6-8c0342798ddb | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Windows.Data;
namespace NuGet.Dialog.PackageManagerUI
{
public class StringCollectionsToStringConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureI... | ```c#
using System;
using System.Collections.Generic;
using System.Windows.Data;
namespace NuGet.Dialog.PackageManagerUI
{
public class StringCollectionsToStringConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo ... |
838764cd-1c28-48a1-8fbf-0095330f642a | {
"language": "C#"
} | ```c#
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
namespace Dangl.WebDocumentation.Models
{
public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
{
public ApplicationDbContext(DbContextOpti... | ```c#
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Metadata.Internal;
namespace Dangl.WebDocumentation.Models
{
public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
... |
debc10f9-46f7-49e1-ba93-01c74ca3709e | {
"language": "C#"
} | ```c#
using System.Web.Http;
using Newtonsoft.Json;
namespace WebApiTestApplication.Controllers
{
public class MegaClass : AnotherClass
{
public int Something { get; set; }
}
public class Chain1<T1, T2>
{
public T1 Value11 { get; set; }
public T2 Value12 { get; set; }
... | ```c#
using System.Web.Http;
using Newtonsoft.Json;
namespace WebApiTestApplication.Controllers
{
public class MegaClass : AnotherClass
{
public int Something { get; set; }
}
public class Chain1<T>
{
public T Value { get; set; }
}
public class Chain1<T1, T2>
{
... |
d62486a1-5838-49e1-b2a7-a4fbf2bc5c75 | {
"language": "C#"
} | ```c#
// -----------------------------------------------------------------------
// <copyright file="GeometryImpl.cs" company="Steven Kirk">
// Copyright 2014 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
namespace Perspex.... | ```c#
// -----------------------------------------------------------------------
// <copyright file="GeometryImpl.cs" company="Steven Kirk">
// Copyright 2014 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
namespace Perspex.... |
6d05a6d1-5074-4bca-b902-e1c86846a266 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Reflection;
namespace WindowsAzure.Table.Extensions
{
internal static class TypeExtentions
{
private static readonly HashSet<Type> _supportedEntityPropertyTypes = new HashSet<Type>
{
typeof(long),
typeof... | ```c#
using System;
using System.Collections.Generic;
using System.Reflection;
namespace WindowsAzure.Table.Extensions
{
internal static class TypeExtentions
{
private static readonly HashSet<Type> _supportedEntityPropertyTypes = new HashSet<Type>
{
typeof(long),
typeof... |
10dda975-8a4b-4eb5-b59b-38eafa2f968c | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using JetBrains.Application;
using JetBrains.Metadata.Utils;
using JetBrains.ReSharper.Psi.ExtensionsAPI.ExternalAnnotations;
using JetBrains.TestFramework.Utils;
using JetBrains.Util;
namespace JetBrains.ReSharper.Plugins.Unity.Tests
{
[ShellComponent]
pu... | ```c#
using System;
using System.Collections.Generic;
using JetBrains.Application;
using JetBrains.Metadata.Utils;
using JetBrains.ReSharper.Psi.ExtensionsAPI.ExternalAnnotations;
using JetBrains.TestFramework.Utils;
using JetBrains.Util;
namespace JetBrains.ReSharper.Plugins.Unity.Tests
{
[ShellComponent]
pu... |
ff70b496-6058-42e6-a9fa-a6216550be54 | {
"language": "C#"
} | ```c#
using System.Collections.Generic;
using System.Linq;
using Thinktecture.IdentityServer.Core;
using Thinktecture.IdentityServer.Core.Models;
namespace Thinktecture.IdentityServer.Host.Config
{
public class Scopes
{
public static IEnumerable<Scope> Get()
{
return new[]
... | ```c#
using System.Collections.Generic;
using System.Linq;
using Thinktecture.IdentityServer.Core;
using Thinktecture.IdentityServer.Core.Models;
namespace Thinktecture.IdentityServer.Host.Config
{
public class Scopes
{
public static IEnumerable<Scope> Get()
{
return new[]
... |
0c2cbf8e-62f8-44fd-ab9c-1cfbea10fa0b | {
"language": "C#"
} | ```c#
public class BuildVersion
{
public GitVersion GitVersion { get; private set; }
public string Version { get; private set; }
public string Milestone { get; private set; }
public string SemVersion { get; private set; }
public string GemVersion { get; private set; }
public string VsixVersion {... | ```c#
public class BuildVersion
{
public GitVersion GitVersion { get; private set; }
public string Version { get; private set; }
public string Milestone { get; private set; }
public string SemVersion { get; private set; }
public string GemVersion { get; private set; }
public string VsixVersion {... |
b640a1b2-925b-4ad2-8afe-6b1b21a3d737 | {
"language": "C#"
} | ```c#
using System.Linq;
using System.Threading.Tasks;
using Bugsnag.Payload;
using Xunit;
namespace Bugsnag.Tests.Payload
{
public class ExceptionTests
{
[Fact]
public void CorrectNumberOfExceptions()
{
var exception = new System.Exception("oh noes!");
var exceptions = new Exceptions(exce... | ```c#
using System.Linq;
using System.Threading.Tasks;
using Bugsnag.Payload;
using Xunit;
namespace Bugsnag.Tests.Payload
{
public class ExceptionTests
{
[Fact]
public void CorrectNumberOfExceptions()
{
var exception = new System.Exception("oh noes!");
var exceptions = new Exceptions(exce... |
78e9283c-5c56-4209-888b-184d2ffb858a | {
"language": "C#"
} | ```c#
namespace AngleSharp.Css.ValueConverters
{
using System;
using System.Collections.Generic;
using System.Linq;
using AngleSharp.Dom.Css;
using AngleSharp.Parser.Css;
sealed class FunctionValueConverter<T> : IValueConverter<T>
{
readonly String _name;
readonly IValueCon... | ```c#
namespace AngleSharp.Css.ValueConverters
{
using System;
using System.Collections.Generic;
using System.Linq;
using AngleSharp.Dom.Css;
using AngleSharp.Parser.Css;
sealed class FunctionValueConverter<T> : IValueConverter<T>
{
readonly String _name;
readonly IValueCon... |
2a3f2e10-9bb7-4a9d-83a3-adfd61a43e2f | {
"language": "C#"
} | ```c#
using System;
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("DokanNet.Tests"... | ```c#
using System;
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("DokanNet.Tests"... |
b63d3a31-564c-4cee-8724-4cebf74c9d22 | {
"language": "C#"
} | ```c#
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Linq;
using osu.Framework.Audio.Track;
using osu.Game.Rulesets.Objects.Types;
namespace osu.Game.Beatmaps
{
public partial class WorkingBeatmap
... | ```c#
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Linq;
using osu.Framework.Audio.Track;
using osu.Game.Rulesets.Objects.Types;
namespace osu.Game.Beatmaps
{
public partial class WorkingBeatmap
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.