doc_id stringlengths 36 36 | metadata dict | input stringlengths 28 4.3k | output stringlengths 11 5.45k |
|---|---|---|---|
9a0d4854-de44-4d56-b158-ed4ff43a792e | {
"language": "C#"
} | ```c#
using System;
using Polly.Utilities;
namespace Polly.Retry
{
internal partial class RetryPolicyStateWithSleepDurationProvider : IRetryPolicyState
{
private int _errorCount;
private readonly Func<int, TimeSpan> _sleepDurationProvider;
private readonly Action<Exception, TimeSpan, C... | ```c#
using System;
using Polly.Utilities;
namespace Polly.Retry
{
internal partial class RetryPolicyStateWithSleepDurationProvider : IRetryPolicyState
{
private int _errorCount;
private readonly Func<int, TimeSpan> _sleepDurationProvider;
private readonly Action<Exception, TimeSpan, C... |
348d4823-1d77-4973-919c-77a287b7b7bf | {
"language": "C#"
} | ```c#
using System;
using System.Net.Http;
using System.Threading.Tasks;
namespace Glimpse.Agent
{
public class HttpChannelSender : IChannelSender, IDisposable
{
private readonly HttpClient _httpClient;
private readonly HttpClientHandler _httpHandler;
public HttpChannelSender()
... | ```c#
using System;
using System.Net.Http;
using System.Threading.Tasks;
namespace Glimpse.Agent
{
public class HttpChannelSender : IChannelSender, IDisposable
{
private readonly HttpClient _httpClient;
private readonly HttpClientHandler _httpHandler;
public HttpChannelSender()
... |
81924bfd-7427-475b-916d-55aff8b424bb | {
"language": "C#"
} | ```c#
@inject BowerVersions Bower
@inject SiteOptions Options
@{
ViewBag.Title = ".NET Development Tools";
ViewBag.MetaDescription = ".NET Development Tools for generating GUIDs, machine keys and hashing text.";
var clipboardVersion = Bower["clipboard"];
var toolsUri = Options.ExternalLinks.Api.Absolu... | ```c#
@inject BowerVersions Bower
@inject SiteOptions Options
@{
ViewBag.Title = ".NET Development Tools";
ViewBag.MetaDescription = ".NET Development Tools for generating GUIDs, machine keys and hashing text.";
var clipboardVersion = Bower["clipboard"];
var toolsUri = Options.ExternalLinks.Api.Absolu... |
746aeb70-1636-427b-af65-de08308c9a6e | {
"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.Media;
namespace DotNetKit.Windows.Media
{
public static class VisualTreeModule
{
... | ```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.Media;
namespace DotNetKit.Windows.Media
{
static class VisualTreeModule
{
publ... |
bfdbcf35-846b-448e-a28b-793c1f01c932 | {
"language": "C#"
} | ```c#
using System;
using System.IO;
using System.Windows.Forms;
using System.Windows.Media.Imaging;
using Autodesk.Revit.UI;
namespace AMEE_in_Revit.Addin
{
public class AMEEPanel : IExternalApplication
{
// ExternalCommands assembly path
static string AddInPath = typeof(AMEEPanel).Assembly.L... | ```c#
using System;
using System.IO;
using System.Windows.Forms;
using System.Windows.Media.Imaging;
using Autodesk.Revit.UI;
namespace AMEE_in_Revit.Addin
{
public class AMEEPanel : IExternalApplication
{
// ExternalCommands assembly path
static string AddInPath = typeof(AMEEPanel).Assembly.L... |
9a97c3a0-905d-44b3-a3fe-d0d703291d2f | {
"language": "C#"
} | ```c#
using UnityEngine;
using System.Collections;
public class Hourglass : Trigger {
public Animator cutScene;
public override void Activate() {
UtilControls.Freeze();
cutScene.Play("cutscene");
GameObject.FindGameObjectWithTag("ThingsController").GetComponent<ThingsController>().C... | ```c#
using UnityEngine;
using System.Collections;
public class Hourglass : Trigger {
public GameObject cutsceneObject;
public Animator cutScene;
void Start() {
//cutScene = cutsceneObject.GetComponent<Animator>();
}
public override void Activate() {
UtilControls.Freeze();
... |
613e3eaf-42ca-45f7-9348-47de9f2559da | {
"language": "C#"
} | ```c#
namespace Fixie.Execution.Listeners
{
using System;
using System.IO;
using System.Xml.Linq;
public class ReportListener<TXmlFormat> :
Handler<AssemblyStarted>,
Handler<ClassStarted>,
Handler<CaseCompleted>,
Handler<ClassCompleted>,
Handler<AssemblyCompleted... | ```c#
namespace Fixie.Execution.Listeners
{
using System;
using System.IO;
using System.Xml.Linq;
public class ReportListener<TXmlFormat> :
Handler<AssemblyStarted>,
Handler<ClassStarted>,
Handler<CaseCompleted>,
Handler<ClassCompleted>,
Handler<AssemblyComplete... |
97f72252-7dbe-4dd3-82e6-94bfa3eb49b2 | {
"language": "C#"
} | ```c#
using System.Collections.Generic;
namespace Common.Data
{
public class TemperatureOverlayState
{
public bool CustomRangesEnabled { get; set; } = true;
public List<float> Temperatures => new List<float>
{
Aqua, Turquoise, Blue, Green, Lime, Orange, RedOrange, Red
... | ```c#
using System.Collections.Generic;
namespace Common.Data
{
public class TemperatureOverlayState
{
public bool CustomRangesEnabled { get; set; } = true;
public List<float> Temperatures => new List<float>
{
Aqua, Turquoise, Blue, Green, Lime, Orange, RedOrange, Red
... |
c084d3e0-bcd2-428d-bb22-eedb90f01eb5 | {
"language": "C#"
} | ```c#
using Digirati.IIIF.Model.JsonLD;
using Newtonsoft.Json;
namespace Digirati.IIIF.Model.Types
{
public class Service : JSONLDBase, IService
{
[JsonProperty(Order = 10, PropertyName = "profile")]
public dynamic Profile { get; set; }
[JsonProperty(Order = 11, PropertyName = "label"... | ```c#
using Digirati.IIIF.Model.JsonLD;
using Newtonsoft.Json;
namespace Digirati.IIIF.Model.Types
{
public class Service : JSONLDBase, IService
{
[JsonProperty(Order = 10, PropertyName = "profile")]
public dynamic Profile { get; set; }
[JsonProperty(Order = 11, PropertyName = "label"... |
5a6d3bc9-f697-4944-8e23-08ec532b1666 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using SSMScripter.Runner;
namespace SSMScripter.Config
{
public partial class... | ```c#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using SSMScripter.Runner;
namespace SSMScripter.Config
{
public partial class... |
c9a926cc-5f3b-44db-aea8-6a85f29768fb | {
"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... |
65a23752-5e07-4232-881c-447faabec919 | {
"language": "C#"
} | ```c#
using System;
using System.Data;
using Dapper.FastCrud;
namespace Smooth.IoC.Dapper.Repository.UnitOfWork.Data
{
public class UnitOfWork : DbTransaction, IUnitOfWork
{
public SqlDialect SqlDialect { get; }
private readonly Guid _guid = Guid.NewGuid();
public UnitOfWork(... | ```c#
using System;
using System.Data;
using Dapper.FastCrud;
namespace Smooth.IoC.Dapper.Repository.UnitOfWork.Data
{
public class UnitOfWork : DbTransaction, IUnitOfWork
{
public SqlDialect SqlDialect { get; }
private readonly Guid _guid = Guid.NewGuid();
public UnitOfWork(... |
4e82208f-9ceb-449b-9c36-b2936536c45d | {
"language": "C#"
} | ```c#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Zenject;
public class ScoreCounter : MonoBehaviour
{
[Inject]
public StageStats Stats { get; private set; }
void Start() {
Stats.BallsTotal = Stats.BallsLeft = GetComponentsInChildren<Rigidbody>().Length;
... | ```c#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using Zenject;
public class ScoreCounter : MonoBehaviour
{
[Inject]
public StageStats Stats { get; private set; }
void Start() {
Stats.BallsTotal = Stats.BallsLeft = GetComponen... |
b581524a-7118-4aea-993d-5cbf0350be89 | {
"language": "C#"
} | ```c#
using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
public class ReloadScene : MonoBehaviour {
GlobalControl globalController;
bool allowLevelLoad = true;
void OnEnable()
{
allowLevelLoad = true;
}
// Use this for initialization
public void Relo... | ```c#
using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
public class ReloadScene : MonoBehaviour {
GlobalControl globalController;
bool allowLevelLoad = true;
void OnEnable()
{
allowLevelLoad = true;
}
// Use this for initialization
public void Relo... |
09e3233a-b0e9-4a1e-b865-176bfb84b99b | {
"language": "C#"
} | ```c#
using Nito.AsyncEx;
using Octokit;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Alteridem.GetChanges
{
class Program
{
static int Main(string[] args)
{
var options = new Options();
if (!CommandLine.Parser.Default.ParseArguments(args... | ```c#
using Nito.AsyncEx;
using Octokit;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Alteridem.GetChanges
{
class Program
{
static int Main(string[] args)
{
var options = new Options();
if (!CommandLine.Parser.Default.ParseArguments(args... |
60591f60-7906-43d4-b1bf-82995d84f0ff | {
"language": "C#"
} | ```c#
using System.Collections.Generic;
using System.Linq;
namespace Bugsnag
{
public class Event : Dictionary<string, object>
{
public Event(IConfiguration configuration, System.Exception exception, Severity severity)
{
this["payloadVersion"] = 2;
this["exceptions"] = new Exceptions(exception)... | ```c#
using System.Collections.Generic;
using System.Linq;
namespace Bugsnag
{
public class Event : Dictionary<string, object>
{
public Event(IConfiguration configuration, System.Exception exception, Severity severity)
{
this["payloadVersion"] = 4;
this["exceptions"] = new Exceptions(exception)... |
b87a8dc9-c4dd-4c3a-b366-492c91fa4445 | {
"language": "C#"
} | ```c#
/*
* John.Hall <john.hall@camtechconsultants.com>
* Copyright (c) Cambridge Technology Consultants Ltd. All rights reserved.
*/
using System;
using System.Collections.Generic;
namespace CTC.CvsntGitImporter.Utils
{
/// <summary>
/// Extension methods for IEnumerable.
/// </summary>
static cl... | ```c#
/*
* John.Hall <john.hall@camtechconsultants.com>
* Copyright (c) Cambridge Technology Consultants Ltd. All rights reserved.
*/
using System;
using System.Collections.Generic;
namespace CTC.CvsntGitImporter.Utils
{
/// <summary>
/// Extension methods for IEnumerable.
/// </summary>
static cl... |
c9063681-665c-4b95-b035-dcfc52b8fa90 | {
"language": "C#"
} | ```c#
//-----------------------------------------------------------------------
// <copyright file="ValidatingReceiver.cs" company="Brian Rogers">
// Copyright (c) Brian Rogers. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
namespace CommSample
{... | ```c#
//-----------------------------------------------------------------------
// <copyright file="ValidatingReceiver.cs" company="Brian Rogers">
// Copyright (c) Brian Rogers. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
namespace CommSample
{... |
792a25bb-25c4-402e-a4a6-0c40c791d449 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Ploeh.AutoFixture
{
public static class IFixtureExtensions
{
public static IEnumerable<T> Repeat<T>(this IFixture fixture, Func<T> function)
{
throw new NotImplementedException();
... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Ploeh.AutoFixture
{
public static class IFixtureExtensions
{
public static IEnumerable<T> Repeat<T>(this IFixture fixture, Func<T> function)
{
if (fixture == null)
{
... |
01f1cb0d-a7b5-4234-9863-975e7b62e016 | {
"language": "C#"
} | ```c#
// Copyright 2016 The Noda Time Authors. All rights reserved.
// Use of this source code is governed by the Apache License 2.0,
// as found in the LICENSE.txt file.
using Microsoft.AspNetCore.Mvc;
using NodaTime.TimeZones;
using NodaTime.TzValidate.NodaDump;
using System.IO;
using System.Net;
namespace NodaTime... | ```c#
// Copyright 2016 The Noda Time Authors. All rights reserved.
// Use of this source code is governed by the Apache License 2.0,
// as found in the LICENSE.txt file.
using Microsoft.AspNetCore.Mvc;
using NodaTime.TimeZones;
using NodaTime.TzValidate.NodaDump;
using NodaTime.Web.Models;
using System.IO;
using Syst... |
7a84128d-2a17-4c9c-aeca-145334529dd4 | {
"language": "C#"
} | ```c#
using Autofac;
using Chassis.Features;
using Chassis.Types;
namespace Chassis.Startup
{
public class StartupFeature : Feature
{
public override void RegisterComponents(ContainerBuilder builder, TypePool pool)
{
builder.RegisterType<StartupBootstrapper>()
... | ```c#
using Autofac;
using Chassis.Features;
using Chassis.Types;
namespace Chassis.Startup
{
public class StartupFeature : Feature
{
public override void RegisterComponents(ContainerBuilder builder, TypePool pool)
{
builder.RegisterType<StartupBootstrapper>()
... |
06ce4652-9fe1-4e52-88ff-801131ec04bc | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
namespace CalSync.Infrastructure
{
class Config
{
public int SyncRangeDays { get; private set; }
public string TargetEmailAddress { get; private set; }
pu... | ```c#
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
namespace CalSync.Infrastructure
{
class Config
{
public int SyncRangeDays { get; private set; }
public string TargetEmailAddress { get; private set; }
pu... |
c6ff3d06-b016-4345-a320-5c582d7790cc | {
"language": "C#"
} | ```c#
using System;
using System.Linq;
using System.Web.Mvc;
using FujiyBlog.Core.DomainObjects;
namespace FujiyBlog.Web.Infrastructure
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = true, AllowMultiple = true)]
public class AuthorizePermissionAttribute : AuthorizeAttr... | ```c#
using System;
using System.Linq;
using System.Security.Principal;
using System.Web;
using System.Web.Mvc;
using FujiyBlog.Core.DomainObjects;
using FujiyBlog.Core.Extensions;
namespace FujiyBlog.Web.Infrastructure
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = true... |
6cb63d98-5744-494c-9c0b-f86471870215 | {
"language": "C#"
} | ```c#
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("NowinWebServer")]
[assembly: Assemb... | ```c#
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("Nowin")]
[assembly: AssemblyDescrip... |
909082cc-69c3-41be-a8d0-c6e6e844b44e | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace RichardSzalay.MockHttp.Matchers
{
public class QueryStringMatcher : IMockedRequestMatcher
{
readonly IEnumerable<KeyValuePair<string, string>> values;
public QueryStringMatcher(string querySt... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace RichardSzalay.MockHttp.Matchers
{
public class QueryStringMatcher : IMockedRequestMatcher
{
readonly IEnumerable<KeyValuePair<string, string>> values;
public QueryStringMatcher(string querySt... |
6cff1cc2-8651-4f26-b456-598ff6d95660 | {
"language": "C#"
} | ```c#
using System.Runtime.Serialization;
namespace Omise.Models
{
public enum OffsiteTypes
{
[EnumMember(Value = null)]
None,
[EnumMember(Value = "internet_banking_scb")]
InternetBankingSCB,
[EnumMember(Value = "internet_banking_bbl")]
InternetBankingBBL,
... | ```c#
using System.Runtime.Serialization;
namespace Omise.Models
{
public enum OffsiteTypes
{
[EnumMember(Value = null)]
None,
[EnumMember(Value = "internet_banking_scb")]
InternetBankingSCB,
[EnumMember(Value = "internet_banking_bbl")]
InternetBankingBBL,
... |
f675e058-3b0d-4e53-8526-e2c2c3a2570f | {
"language": "C#"
} | ```c#
using System.IO;
using System.Linq;
using System.Windows.Forms;
using GUI.Utils;
namespace GUI.Types.Viewers
{
public class ByteViewer : IViewer
{
public static bool IsAccepted() => true;
public TabPage Create(VrfGuiContext vrfGuiContext, byte[] input)
{
var tab = new... | ```c#
using System.IO;
using System.Linq;
using System.Windows.Forms;
using GUI.Utils;
namespace GUI.Types.Viewers
{
public class ByteViewer : IViewer
{
public static bool IsAccepted() => true;
public TabPage Create(VrfGuiContext vrfGuiContext, byte[] input)
{
var tab = new... |
a99089cf-a954-4e12-ad91-a93292f9fde9 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Numerics;
namespace ValveResourceFormat.ResourceTypes.ModelAnimation
{
public class Frame
{
public Dictionary<string, FrameBone> Bones { get; }
public Frame()
{
Bones = new Dictionary<string, FrameBone>();
... | ```c#
using System;
using System.Collections.Generic;
using System.Numerics;
namespace ValveResourceFormat.ResourceTypes.ModelAnimation
{
public class Frame
{
public Dictionary<string, FrameBone> Bones { get; }
public Frame()
{
Bones = new Dictionary<string, FrameBone>();
... |
08ac796c-1604-41fe-a3a8-c5c7df5f1cc9 | {
"language": "C#"
} | ```c#
using System;
using Microsoft.Extensions.Options;
namespace Meraki
{
/// <summary>
/// Initialize a <see cref="MerakiDashboardClientSettings"/> object.
/// </summary>
internal class MerakiDashboardClientSettingsSetup : ConfigureOptions<MerakiDashboardClientSettings>
{
/// <summary>
... | ```c#
using System;
using Microsoft.Extensions.Options;
namespace Meraki
{
/// <summary>
/// Initialize a <see cref="MerakiDashboardClientSettings"/> object.
/// </summary>
internal class MerakiDashboardClientSettingsSetup : ConfigureOptions<MerakiDashboardClientSettings>
{
public static r... |
6c64b970-bc87-449b-9681-9d65a9eef0e6 | {
"language": "C#"
} | ```c#
using System.Linq;
using System.Xml.Linq;
namespace Tests.Daterpillar.Helpers
{
public static class ConnectionString
{
private static readonly string _configFile = "database.config.xml";
public static string GetMySQLServerConnectionString()
{
return GetConnectionStri... | ```c#
using System.Configuration;
namespace Tests.Daterpillar.Helpers
{
public static class ConnectionString
{
public static string GetMySQLServerConnectionString()
{
return GetConnectionString("mysql");
}
public static string GetSQLServerConnectionString()
... |
9585275c-ea7e-4a70-ad1a-a23e32b48666 | {
"language": "C#"
} | ```c#
using CefSharp;
namespace TweetDuck.Core.Handling{
class RequestHandlerBrowser : RequestHandler{
public override void OnRenderProcessTerminated(IWebBrowser browserControl, IBrowser browser, CefTerminationStatus status){
browser.Reload();
}
public override CefReturnValue ... | ```c#
using CefSharp;
namespace TweetDuck.Core.Handling{
class RequestHandlerBrowser : RequestHandler{
public override void OnRenderProcessTerminated(IWebBrowser browserControl, IBrowser browser, CefTerminationStatus status){
browser.Reload();
}
public override CefReturnValue ... |
bb264125-ce6c-4502-ba66-f988e5e8e136 | {
"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.Audio;
using osu.Framework.IO.Stores;
using osuTK.Graphics;
namespace osu.Game.Skinning
{
public class DefaultLegacySkin : LegacySkin
{... | ```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.Audio;
using osu.Framework.IO.Stores;
using osuTK.Graphics;
namespace osu.Game.Skinning
{
public class DefaultLegacySkin : LegacySkin
{... |
09c6cfa2-55b0-4420-bb5f-ca5e9bcb153d | {
"language": "C#"
} | ```c#
using MomWorld.DataContexts;
using MomWorld.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace MomWorld.Controllers
{
public class HomeController : Controller
{
private ArticleDb articleDb = new ArticleDb();
pri... | ```c#
using MomWorld.DataContexts;
using MomWorld.Entities;
using MomWorld.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace MomWorld.Controllers
{
public class HomeController : Controller
{
private ArticleDb articleDb ... |
60ada5a1-e251-4090-a973-906c932bddf2 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Merlin.Extensions
{
public static class WeatherExtensions
{
public static void EnableFog(this Weather weather)
{
weather.fogSummer = new MinMax(4f, 54f);
weather.fogWin... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Merlin.Extensions
{
public static class WeatherExtensions
{
public static void EnableFog(this Weather weather)
{
weather.fogSummer = new MinMax(4f, 54f);
weather.fogWin... |
e94cb58c-7d8a-4a21-9900-021237824347 | {
"language": "C#"
} | ```c#
using System;
using NSemble.Core.Nancy;
using NSemble.Modules.ContentPages.Models;
using Raven.Client;
namespace NSemble.Modules.ContentPages
{
public class ContentPagesModule : NSembleModule
{
public static readonly string HomepageSlug = "home";
public ContentPagesModule(IDocumentSessi... | ```c#
using System;
using NSemble.Core.Models;
using NSemble.Core.Nancy;
using NSemble.Modules.ContentPages.Models;
using Raven.Client;
namespace NSemble.Modules.ContentPages
{
public class ContentPagesModule : NSembleModule
{
public static readonly string HomepageSlug = "home";
public Conten... |
5381cf06-a5a3-45f5-bbdd-811f5655124e | {
"language": "C#"
} | ```c#
namespace TensorSharp.Operations
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
public class AddDoubleDoubleOperation : IBinaryOperation<double, double, double>
{
public Tensor<double> Evaluate(Tensor<double> tensor1, Tensor<doubl... | ```c#
namespace TensorSharp.Operations
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
public class AddDoubleDoubleOperation : IBinaryOperation<double, double, double>
{
public Tensor<double> Evaluate(Tensor<double> tensor1, Tensor<doubl... |
f57e3032-db42-4298-b6ed-0019dde1493a | {
"language": "C#"
} | ```c#
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace Portal.CMS.Web.Areas.Admin.ViewModels.SettingManager
{
public class SetupViewModel
{
[Required]
[DisplayName("Website Name")]
public string WebsiteName { get; set; }
[Required]
[D... | ```c#
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace Portal.CMS.Web.Areas.Admin.ViewModels.SettingManager
{
public class SetupViewModel
{
[Required]
[DisplayName("Website Name")]
public string WebsiteName { get; set; }
[Required]
[D... |
59769078-c91e-400d-9109-ca62d0e12cdd | {
"language": "C#"
} | ```c#
using System;
using System.IO;
using System.Linq;
using System.Text;
namespace HandlebarsDotNet.Compiler.Lexer
{
internal class WordParser : Parser
{
private const string validWordStartCharacters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$.@";
public override Token Parse(T... | ```c#
using System;
using System.IO;
using System.Linq;
using System.Text;
namespace HandlebarsDotNet.Compiler.Lexer
{
internal class WordParser : Parser
{
private const string validWordStartCharacters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$.@[]";
public override Token Parse... |
8bcda700-1728-4949-aad5-7bd9f265b360 | {
"language": "C#"
} | ```c#
using System;
using MongoDB.Bson;
using MongoDB.Bson.Serialization;
using MongoDB.Bson.Serialization.IdGenerators;
using MongoDB.Bson.Serialization.Serializers;
using MongoDB.Driver;
using RightpointLabs.ConferenceRoom.Domain.Models;
using RightpointLabs.ConferenceRoom.Infrastructure.Persistence.Models;
namespa... | ```c#
using System;
using MongoDB.Bson;
using MongoDB.Bson.Serialization;
using MongoDB.Bson.Serialization.IdGenerators;
using MongoDB.Bson.Serialization.Serializers;
using MongoDB.Driver;
using RightpointLabs.ConferenceRoom.Domain.Models;
using RightpointLabs.ConferenceRoom.Infrastructure.Persistence.Models;
namespa... |
42d466fb-7fa1-4659-8802-0fa515a9661d | {
"language": "C#"
} | ```c#
using UnityEngine;
public class AttackHandler : MonoBehaviour {
[HideInInspector] public float damage;
[HideInInspector] public float duration;
[HideInInspector] public BoxCollider hitBox;
private float timer = 0f;
void Start() {
hitBox = gameObject.GetComponent<BoxCollider>();
}
void Update()
{
... | ```c#
using UnityEngine;
public class AttackHandler : MonoBehaviour {
[HideInInspector] public float damage;
[HideInInspector] public float duration;
[HideInInspector] public BoxCollider hitBox;
private float timer = 0f;
void Start() {
hitBox = gameObject.GetComponent<BoxCollider>();
}
void Update()
{
... |
b783805a-9735-43a1-9a2d-99eef63acf5a | {
"language": "C#"
} | ```c#
using NUnit.Framework;
using tungsten.core.Elements;
using tungsten.core.Search;
using tungsten.nunit;
namespace tungsten.sampletest
{
[TestFixture]
public class CheckBoxTest : TestBase
{
[Test]
public void Hupp()
{
var window = Desktop.FindFirstChild... | ```c#
using NUnit.Framework;
using tungsten.core.Elements;
using tungsten.core.Search;
using tungsten.nunit;
namespace tungsten.sampletest
{
[TestFixture]
public class CheckBoxTest : TestBase
{
[Test]
public void CheckBoxIsChecked()
{
var window = Desktop.F... |
3a11b3a1-8068-49fc-a266-40a791981eb1 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using Exceptionless.Core.Pipeline;
using Exceptionless.Core.Extensions;
using Exceptionless.Core.Models;
using Microsoft.Extensions.Options;
using Newtonsoft.Json;
using System.IO;
using Newtonsoft.Json.Linq;
using Microsoft.Extensions.Logging;
namespace Exception... | ```c#
using System;
using System.Collections.Generic;
using Exceptionless.Core.Pipeline;
using Exceptionless.Core.Extensions;
using Exceptionless.Core.Models;
using Microsoft.Extensions.Options;
using Newtonsoft.Json;
namespace Exceptionless.Core.Plugins.EventParser {
[Priority(0)]
public class JsonEventParse... |
de877c79-a8f3-4d54-8b38-a2915111c190 | {
"language": "C#"
} | ```c#
namespace elbsms_core
{
internal static class Extensions
{
internal static bool Bit(this byte v, int bit)
{
int mask = 1 << bit;
return (v & mask) == mask;
}
internal static bool Bit(this int v, int bit)
{
int mask = 1 << bit;
... | ```c#
namespace elbsms_core
{
internal static class Extensions
{
internal static bool Bit(this byte v, int bit)
{
int mask = 1 << bit;
return (v & mask) != 0;
}
internal static bool Bit(this int v, int bit)
{
int mask = 1 << bit;
... |
756500d3-4aee-4cbc-a86f-26fc8bd40c18 | {
"language": "C#"
} | ```c#
using System;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using SoundCloud.Api;
using SoundCloud.Api.Entities;
using SoundCloud.Api.Entities.Enums;
using SoundCloud.Api.QueryBuilders;
namespace ConsoleApp
{
internal static class Program
{
priv... | ```c#
using System;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using SoundCloud.Api;
using SoundCloud.Api.Entities;
using SoundCloud.Api.Entities.Enums;
using SoundCloud.Api.QueryBuilders;
namespace ConsoleApp
{
internal static class Program
{
private static async Ta... |
664c0174-f428-442e-9f17-6e5285ec861a | {
"language": "C#"
} | ```c#
using Bugsnag;
using Bugsnag.Clients;
using EarTrumpet.Extensions;
using System;
using System.Diagnostics;
using System.IO;
using Windows.ApplicationModel;
namespace EarTrumpet.Services
{
class ErrorReportingService
{
internal static void Initialize()
{
try
{
#if ... | ```c#
using Bugsnag;
using Bugsnag.Clients;
using EarTrumpet.Extensions;
using EarTrumpet.Misc;
using System;
using System.Diagnostics;
using System.IO;
using Windows.ApplicationModel;
namespace EarTrumpet.Services
{
class ErrorReportingService
{
internal static void Initialize()
{
... |
e0329c84-6b51-4893-ba94-ed16ef56bf3a | {
"language": "C#"
} | ```c#
namespace Kudu.Contracts.Functions
{
public class FunctionTestData
{
// test shows test_data of size 8310000 bytes still delivers as an ARM package
// whereas test_data of size 8388608 bytes fails
public const long PackageMaxSizeInBytes = 8300000;
public long BytesLeftInP... | ```c#
namespace Kudu.Contracts.Functions
{
public class FunctionTestData
{
// ARM has a limit of 8 MB -> 8388608 bytes
// divid by 2 to limit the over all size of test data to half of arm requirement to be safe.
public const long PackageMaxSizeInBytes = 8388608 / 2;
public long... |
09b35da9-b788-4ec9-b46f-d4b19d9a743e | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using MetroTrilithon.Serialization;
namespace TirkxDownloader.Models.Settings
{
public class DownloadingSetting
{
public static SerializableP... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using MetroTrilithon.Serialization;
namespace TirkxDownloader.Models.Settings
{
public class DownloadingSetting
{
public static SerializableP... |
1c124c71-5cd2-4bc2-997f-d6094486dc23 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Serialization;
using NBi.Core.Etl;
using NBi.Xml.Items;
namespace NBi.Xml.Decoration.Command
{
public class EtlRunXml : DecorationCommandXml, IEtlRunCommand
{
[XmlAttribute("server")]
public s... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Serialization;
using NBi.Core.Etl;
using NBi.Xml.Items;
namespace NBi.Xml.Decoration.Command
{
public class EtlRunXml : DecorationCommandXml, IEtlRunCommand
{
[XmlAttribute("server")]
public s... |
753e4d25-829e-4210-8752-a8c732b4f0f7 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
namespace PixelPet.Commands {
internal class GenerateTilemapCmd : CliCommand {
public GenerateTilemapCmd()
: base("Generate-Tilema... | ```c#
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
namespace PixelPet.Commands {
internal class GenerateTilemapCmd : CliCommand {
public GenerateTilemapCmd()
: base("Generate-Tilema... |
3bba9f91-db3a-4e6f-820f-6593a5ce95ac | {
"language": "C#"
} | ```c#
using System.Drawing;
namespace TileSharp.Symbolizers
{
/// <summary>
/// https://github.com/mapnik/mapnik/wiki/TextSymbolizer
/// </summary>
public class TextSymbolizer : Symbolizer
{
public readonly string LabelAttribute;
public readonly PlacementType Placement;
public readonly ContentAlignment Ali... | ```c#
using System.Drawing;
namespace TileSharp.Symbolizers
{
/// <summary>
/// https://github.com/mapnik/mapnik/wiki/TextSymbolizer
/// </summary>
public class TextSymbolizer : Symbolizer
{
public readonly string LabelAttribute;
public readonly PlacementType Placement;
public readonly ContentAlignment Ali... |
74317804-8a1e-4d1a-a453-1eebc4244793 | {
"language": "C#"
} | ```c#
using System.Collections.Generic;
using HarryPotterUnity.Cards.Generic;
using JetBrains.Annotations;
namespace HarryPotterUnity.Cards.Spells.Transfigurations
{
[UsedImplicitly]
public class MiceToSnuffboxes : GenericSpell {
public override List<GenericCard> GetValidTargets()
{
... | ```c#
using System.Collections.Generic;
using HarryPotterUnity.Cards.Generic;
using JetBrains.Annotations;
namespace HarryPotterUnity.Cards.Spells.Transfigurations
{
[UsedImplicitly]
public class MiceToSnuffboxes : GenericSpell {
public override List<GenericCard> GetValidTargets()
{
... |
8754df81-5203-4efb-86f7-58f0bca449a8 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using ProjectMarkdown.Annotations;
namespace ProjectMarkdown.ViewModels
{
public class MainWindowViewM... | ```c#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Documents;
using System.Windows.Input;
using ProjectMarkdown.Annotati... |
63df304a-f93a-45c8-8bdb-105f7c06613c | {
"language": "C#"
} | ```c#
using System;
using System.Globalization;
using Umbraco.Core.Models.PublishedContent;
namespace Umbraco.Core.PropertyEditors.ValueConverters
{
[DefaultPropertyValueConverter]
public class DecimalValueConverter : PropertyValueConverterBase
{
public override bool IsConverter(PublishedPropertyT... | ```c#
using System;
using System.Globalization;
using Umbraco.Core.Models.PublishedContent;
namespace Umbraco.Core.PropertyEditors.ValueConverters
{
[DefaultPropertyValueConverter]
public class DecimalValueConverter : PropertyValueConverterBase
{
public override bool IsConverter(PublishedPropertyT... |
6069f474-0617-491c-bf33-706c92d480c9 | {
"language": "C#"
} | ```c#
using System;
using System.IO;
namespace Hangman {
public class Hangman {
public static void Main(string[] args) {
var game = new Game("HANG THE MAN");
while (true) {
string titleText = File.ReadAllText("title.txt");
Cell[] title = {
new Cell(titleText, Cell.CentreAl... | ```c#
using System;
using System.IO;
namespace Hangman {
public class Hangman {
public static void Main(string[] args) {
var game = new Game("HANG THE MAN");
while (true) {
string titleText = File.ReadAllText("title.txt");
Cell[] title = {
new Cell(titleText, Cell.CentreAl... |
0d38e9aa-0102-402c-8f56-f16145acbed8 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
namespace CatchAllRule
{
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
namespace CatchAllRule
{
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.... |
4aafce99-a332-43ef-8e9a-347a94bca137 | {
"language": "C#"
} | ```c#
using Microsoft.Framework.ConfigurationModel;
using Microsoft.Framework.DependencyInjection;
using System;
namespace Glimpse
{
public static class GlimpseServiceCollectionExtensions
{
public static IServiceCollection AddMvc(this IServiceCollection services)
{
return services.... | ```c#
using Microsoft.Framework.ConfigurationModel;
using Microsoft.Framework.DependencyInjection;
using System;
namespace Glimpse
{
public static class GlimpseServiceCollectionExtensions
{
public static IServiceCollection AddGlimpse(this IServiceCollection services)
{
return servi... |
710537f1-47ff-4841-aa62-16c790c7c07b | {
"language": "C#"
} | ```c#
using HelixToolkit.Wpf.SharpDX.Model.Scene;
using HelixToolkit.Wpf.SharpDX.Render;
using SharpDX;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Markup;
namespace HelixToolkit.Wpf.SharpDX
{
[ContentProperty("Content")]
public class Element3DPresenter : Element3D
{
... | ```c#
using HelixToolkit.Wpf.SharpDX.Model.Scene;
using HelixToolkit.Wpf.SharpDX.Render;
using SharpDX;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Markup;
namespace HelixToolkit.Wpf.SharpDX
{
[ContentProperty("Content")]
public class Element3DPresenter : Element3D
{
... |
18264b16-d769-4674-90ff-49112652d1f2 | {
"language": "C#"
} | ```c#
using System;
using System.Threading.Tasks;
using NSubstitute;
using Octokit.Tests.Helpers;
using Xunit;
namespace Octokit.Tests.Clients
{
/// <summary>
/// Client tests mostly just need to make sure they call the IApiConnection with the correct
/// relative Uri. No need to fake up the response. Al... | ```c#
using System;
using System.Threading.Tasks;
using NSubstitute;
using Octokit.Tests.Helpers;
using Xunit;
namespace Octokit.Tests.Clients
{
/// <summary>
/// Client tests mostly just need to make sure they call the IApiConnection with the correct
/// relative Uri. No need to fake up the response. Al... |
830fce28-76c2-41a1-94d2-e9a29e36069e | {
"language": "C#"
} | ```c#
using System.Reflection;
[assembly: AssemblyCompany("Dimension Data")]
[assembly: AssemblyProduct("Compute as a Service (CaaS) API client.")]
[assembly: AssemblyCopyright("Copyright © Dimension Data 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("1.0.0.0")]
... | ```c#
using System.Reflection;
[assembly: AssemblyCompany("Dimension Data")]
[assembly: AssemblyProduct("Compute as a Service (CaaS) API client.")]
[assembly: AssemblyCopyright("Copyright © Dimension Data 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("1.0.0.0")]
... |
39fb410e-b4ca-4e3b-91ba-0e507d311186 | {
"language": "C#"
} | ```c#
using System.Collections.Generic;
using System.Net.Mail;
namespace StressMeasurementSystem.Models
{
public class Patient
{
#region Structs
public struct Name
{
public string Prefix { get; set; }
public string First { get; set; }
public string ... | ```c#
using System;
using System.Collections.Generic;
using System.Net.Mail;
namespace StressMeasurementSystem.Models
{
public class Patient
{
#region Structs
public struct Name
{
public string Prefix { get; set; }
public string First { get; set; }
... |
97bd5dc7-276a-4b67-8531-e14e4cb238d8 | {
"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 Core2D.Shapes.Interfaces;
namespace Core2D.UnitTests
{
public class TestPointShape : TestBaseShape, IPointShape
{
public double X { ge... | ```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 Core2D.Shapes.Interfaces;
namespace Core2D.UnitTests
{
public class TestPointShape : TestBaseShape, IPointShape
{
public double X { ge... |
56ace251-88b3-4fda-9219-86c9eeda6d66 | {
"language": "C#"
} | ```c#
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System.IO;
using System.Runtime.InteropServices;
using Microsoft.NET.TestFramework;
using Microsoft.NET.TestFramework.Assertions;
usi... | ```c#
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System.IO;
using System.Runtime.InteropServices;
using Microsoft.NET.TestFramework;
using Microsoft.NET.TestFramework.Assertions;
usi... |
48dce5cf-5df6-4d7b-b806-4fbf6b712cc8 | {
"language": "C#"
} | ```c#
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Game.Beatmaps;
using osu.Game.Graphics;
namespace osu.Game.Rulesets.Mods
{
public abstract class ModHardRock : Mod, IApplicab... | ```c#
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Game.Beatmaps;
using osu.Game.Graphics;
namespace osu.Game.Rulesets.Mods
{
public abstract class ModHardRock : Mod, IApplicab... |
b2e79221-80ee-479e-b4b0-4a712ccdd3b6 | {
"language": "C#"
} | ```c#
@using Tracker
@using Tracker.Models
@using Tracker.ViewModels.Account
@using Tracker.ViewModels.Manage
@using Microsoft.AspNet.Identity
@addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers"
```
Update starting solution with correct namespaces. | ```c#
@using ShatteredTemple.LegoDimensions.Tracker
@using ShatteredTemple.LegoDimensions.Tracker.Models
@using ShatteredTemple.LegoDimensions.Tracker.ViewModels.Account
@using ShatteredTemple.LegoDimensions.Tracker.ViewModels.Manage
@using Microsoft.AspNet.Identity
@addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers"
`... |
42b86908-b678-49e6-8a83-6525df5bf562 | {
"language": "C#"
} | ```c#
//
// Copyright (c) Microsoft. 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 applica... | ```c#
//
// Copyright (c) Microsoft. 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 applica... |
5995f07a-606c-44bb-8bf7-bc04cfd1d686 | {
"language": "C#"
} | ```c#
using StockportWebapp.Models;
using StockportWebapp.Parsers;
using StockportWebapp.Utils;
namespace StockportWebapp.ContentFactory
{
public class EventFactory
{
private readonly ISimpleTagParserContainer _simpleTagParserContainer;
private readonly MarkdownWrapper _markdownWrapper;
... | ```c#
using StockportWebapp.Models;
using StockportWebapp.Parsers;
using StockportWebapp.Utils;
namespace StockportWebapp.ContentFactory
{
public class EventFactory
{
private readonly ISimpleTagParserContainer _simpleTagParserContainer;
private readonly MarkdownWrapper _markdownWrapper;
... |
d68c8980-c607-44c4-bff1-84f918c15484 | {
"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.Game.Users;
namespace osu.Game.Online.API
{
public class DummyAPIAccess : IAPIProvider
{
public Bindable<... | ```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.Game.Users;
namespace osu.Game.Online.API
{
public class DummyAPIAccess : IAPIProvider
{
public Bindable<... |
994d8078-a37a-4153-a2c1-4bed69b7bfe1 | {
"language": "C#"
} | ```c#
using System.IO;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Serialization;
using JetBrains.Annotations;
namespace Diadoc.Api
{
public static class XmlSerializerExtensions
{
public static byte[] SerializeToXml<T>(this T @object)
{
var serializer = new XmlSerializer(typeof(T... | ```c#
using System.IO;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Serialization;
using JetBrains.Annotations;
namespace Diadoc.Api
{
public static class XmlSerializerExtensions
{
public static byte[] SerializeToXml<T>(this T @object)
{
var serializer = new XmlSerializer(typeof(T... |
91ddcd7b-f807-4de3-921a-fb573df5216a | {
"language": "C#"
} | ```c#
using System.Reflection;
[assembly: AssemblyTitle("GraphQL")]
[assembly: AssemblyProduct("GraphQL")]
[assembly: AssemblyDescription("GraphQL for .NET")]
[assembly: AssemblyCopyright("Copyright 2015-2016 Joseph T. McBride, et al. All rights reserved.")]
[assembly: AssemblyVersion("0.8.2.0")]
[assembly: AssemblyF... | ```c#
using System;
using System.Reflection;
[assembly: AssemblyTitle("GraphQL")]
[assembly: AssemblyProduct("GraphQL")]
[assembly: AssemblyDescription("GraphQL for .NET")]
[assembly: AssemblyCopyright("Copyright 2015-2016 Joseph T. McBride, et al. All rights reserved.")]
[assembly: AssemblyVersion("0.8.2.0")]
[assem... |
12a822f1-2a1f-4c59-9773-84c40e2e005a | {
"language": "C#"
} | ```c#
using System.Threading.Tasks;
namespace Upload.Security
{
public class ApiKeyValidator : IApiKeyValidator
{
public Task<bool> ValidateAsync(string apiKey)
{
return Task.FromResult(true);
}
}
}
```
Read api key from env setting | ```c#
using System;
using System.Threading.Tasks;
namespace Upload.Security
{
public class ApiKeyValidator : IApiKeyValidator
{
public Task<bool> ValidateAsync(string apiKey)
{
return Task.FromResult(apiKey == Environment.GetEnvironmentVariable("APPSETTING_ApiKey"));
}
}... |
b4993008-9bf9-4746-85f6-ca3f5e3f7396 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.UI;
using BetterNotes.NoteClasses;
namespace BetterNotes.NoteUIObjects
{
public class NoteExpButton : NoteUIObjectBase
{
private NotesExperiment expObject;
private bool highlight;
private void Start(... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.UI;
using BetterNotes.NoteClasses;
namespace BetterNotes.NoteUIObjects
{
public class NoteExpButton : NoteUIObjectBase
{
private NotesExperiment expObject;
private bool highlight;
private void Start(... |
80ca87b4-ca25-4342-bcf2-2ba8e5862930 | {
"language": "C#"
} | ```c#
using System.Collections.Generic;
namespace Esprima
{
public class ErrorHandler : IErrorHandler
{
public IList<ParserException> Errors { get; }
public bool Tolerant { get; set; }
public string Source { get; set; }
public ErrorHandler()
{
Errors = new... | ```c#
using System.Collections.Generic;
namespace Esprima
{
public class ErrorHandler : IErrorHandler
{
public IList<ParserException> Errors { get; }
public bool Tolerant { get; set; }
public string Source { get; set; }
public ErrorHandler()
{
Errors = new... |
fe6a1021-129e-4572-952c-1e58cfdb7404 | {
"language": "C#"
} | ```c#
using System.IO;
using System.Net;
namespace ServiceStack.Text
{
public static class WebRequestExtensions
{
public static string GetJsonFromUrl(this string url)
{
return url.GetStringFromUrl("application/json");
}
public static string GetStringFromUrl(this st... | ```c#
using System;
using System.IO;
using System.Net;
namespace ServiceStack.Text
{
public static class WebRequestExtensions
{
public static string GetJsonFromUrl(this string url)
{
return url.GetStringFromUrl("application/json");
}
public static string GetStringF... |
1823ac9d-169e-4448-b33a-02640116f8cf | {
"language": "C#"
} | ```c#
using Microsoft.Data.Entity;
using System;
using System.IO;
using Windows.Storage;
namespace UnicornPacker.Models
{
public class OrdersContext : DbContext
{
public DbSet<Order> Orders { get; set; }
public DbSet<OrderLine> OrderLines { get; set; }
protected override void OnConfig... | ```c#
using Microsoft.Data.Entity;
using System;
using System.IO;
using Windows.Storage;
namespace UnicornPacker.Models
{
public class OrdersContext : DbContext
{
public DbSet<Order> Orders { get; set; }
public DbSet<OrderLine> OrderLines { get; set; }
protected override void OnConfig... |
f0a1bd18-48b0-407d-811e-78924a6e0c13 | {
"language": "C#"
} | ```c#
using System;
using System.IO;
using System.Text;
namespace ValveResourceFormat.ResourceTypes
{
public class Sound : Blocks.ResourceData
{
private BinaryReader Reader;
private long DataOffset;
private NTRO NTROBlock;
public override void Read(BinaryReader reader, Resourc... | ```c#
using System;
using System.IO;
using System.Text;
namespace ValveResourceFormat.ResourceTypes
{
public class Sound : Blocks.ResourceData
{
private BinaryReader Reader;
private NTRO NTROBlock;
public override void Read(BinaryReader reader, Resource resource)
{
... |
d553842c-fdce-4c2d-b96e-527f5dd50a99 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
namespace IronFoundry.Container
{
public class ContainerHostDependencyHelper
{
const string ContainerHostAssemblyName = "IronFoundry.Container.Host";
readonly Assembly containerH... | ```c#
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
namespace IronFoundry.Container
{
public class ContainerHostDependencyHelper
{
const string ContainerHostAssemblyName = "IronFoundry.Container.Host";
readonly Assembly containerH... |
650f5b88-63e3-40a5-8847-ef2afcecc853 | {
"language": "C#"
} | ```c#
#region
using System.Diagnostics;
using System.IO;
using DesktopWidgets.Classes;
#endregion
namespace DesktopWidgets.Helpers
{
internal static class ProcessHelper
{
public static void Launch(string path, string args = "", string startIn = "",
ProcessWindowStyle style = ProcessWindo... | ```c#
#region
using System.Diagnostics;
using System.IO;
using DesktopWidgets.Classes;
#endregion
namespace DesktopWidgets.Helpers
{
internal static class ProcessHelper
{
public static void Launch(string path, string args = "", string startIn = "",
ProcessWindowStyle style = ProcessWindo... |
ce49d8a4-2364-466d-97e4-44c5265633b6 | {
"language": "C#"
} | ```c#
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace Dbus
{
public partial class Connection
{
private static async Task authenticate(Stream stream)
{
using (var writer = new StreamWriter(stream, Encodi... | ```c#
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace Dbus
{
public partial class Connection
{
private static async Task authenticate(Stream stream)
{
using (var writer = new StreamWriter(stream, Encodi... |
7fd27a02-5c8a-46fe-a2a7-6743c7270c27 | {
"language": "C#"
} | ```c#
// Copyright 2006 Alp Toker <alp@atoker.com>
// This software is made available under the MIT License
// See COPYING for details
using System;
using System.Collections.Generic;
using NDesk.DBus;
using org.freedesktop.DBus;
public class ManagedDBusTestObjects
{
public static void Main ()
{
Bus bus = Bus.Sess... | ```c#
// Copyright 2006 Alp Toker <alp@atoker.com>
// This software is made available under the MIT License
// See COPYING for details
using System;
using System.Collections.Generic;
using NDesk.DBus;
using org.freedesktop.DBus;
public class ManagedDBusTestObjects
{
public static void Main ()
{
Bus bus = Bus.Sess... |
79f9d836-1e09-496f-8417-f91acaba2516 | {
"language": "C#"
} | ```c#
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Sandra")]
[assembly: AssemblyDescription("Hosted on https://github.com/PenguinF/sandra-three")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Sandra")]
[assembly: Assembly... | ```c#
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Sandra")]
[assembly: AssemblyDescription("Hosted on https://github.com/PenguinF/sandra-three")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Sandra")]
[assembly: Assembly... |
06d86ca4-b7ad-474f-91a8-80d50ef19bbd | {
"language": "C#"
} | ```c#
using System;
namespace Mpdn.CustomLinearScaler
{
namespace Example
{
public class Gaussian : ICustomLinearScaler
{
public Guid Guid
{
get { return new Guid("647351FF-7FEC-4EAB-86C7-CE1BEF43EFD4"); }
}
public s... | ```c#
using System;
namespace Mpdn.CustomLinearScaler
{
namespace Example
{
public class Gaussian : ICustomLinearScaler
{
public Guid Guid
{
get { return new Guid("647351FF-7FEC-4EAB-86C7-CE1BEF43EFD4"); }
}
public s... |
10a77916-d6f9-41a0-a1d0-1106967f7001 | {
"language": "C#"
} | ```c#
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
namespace UDBase.Components.Log {
public class Log_Visual_Behaviour : MonoBehaviour {
public Text Text;
public void Init() {
Text.text = "";
}
public void AddMessage(string msg) {
Text.text += msg + "\n";
}
}
}
```
Store mes... | ```c#
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using System.Collections.Generic;
namespace UDBase.Components.Log {
public class Log_Visual_Behaviour : MonoBehaviour {
public Text Text;
List<string> _messages = new List<string>();
public void Init() {
Clear();
}
public void C... |
f71044ae-8ca5-4edd-8c0f-3e2354c2a14b | {
"language": "C#"
} | ```c#
using System;
using System.Linq;
using System.Reflection;
using NUnit.Framework;
[SetUpFixture]
public class SplatModeDetectorSetUp
{
static SplatModeDetectorSetUp()
{
// HACK: Force .NET 4.5 version of Splat to load when executing inside NCrunch
var ncrunchAsms = Environment.GetEnvironm... | ```c#
using System;
using System.Linq;
using System.Reflection;
using NUnit.Framework;
[SetUpFixture]
public class SplatModeDetectorSetUp
{
[OneTimeSetUp]
public void RunBeforeAnyTests()
{
Splat.ModeDetector.Current.SetInUnitTestRunner(true);
}
}``` |
e87a1b8e-5223-405c-90b8-4daaaaafd25d | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.NodeServices;
using Microsoft.AspNetCore.SpaServices.Prerendering;
using Microsoft.Extensions.DependencyInjection.Extensions;
namespace Microsoft.Extensions.DependencyInjection
{
//... | ```c#
using Microsoft.AspNetCore.SpaServices.Prerendering;
namespace Microsoft.Extensions.DependencyInjection
{
/// <summary>
/// Extension methods for setting up prerendering features in an <see cref="IServiceCollection" />.
/// </summary>
public static class PrerenderingServiceCollectionExtensions
... |
e6c16294-2443-4919-b22b-d889aee148eb | {
"language": "C#"
} | ```c#
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("WpfAboutView")]
[assembly: AssemblyDescription("Simple About control with app name, icon, version, and credits")]
[assembly: AssemblyCompany("Daniel Chalmers")]
[assembly: AssemblyProduct("WpfAboutView")]
[assembly: Assembl... | ```c#
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("WpfAboutView")]
[assembly: AssemblyDescription("Simple About control with app name, icon, version, and credits")]
[assembly: AssemblyCompany("Daniel Chalmers")]
[assembly: AssemblyProduct("WpfAboutView")]
[assembly: Assembl... |
ae94aeef-f456-44b6-8bc5-a1452a983abe | {
"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 BenchmarkDotNet.Attributes;
using NUnit.Framework;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Shapes;
using osuTK.Graphics;
namespace osu.Fra... | ```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 BenchmarkDotNet.Attributes;
using NUnit.Framework;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;... |
da7b4c97-a70d-4f34-bb8b-63b0c84b86b4 | {
"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;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Gra... | ```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.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Gra... |
a5f05121-c58c-4509-bd21-2b7699e52585 | {
"language": "C#"
} | ```c#
using EntityCore.DynamicEntity;
using EntityCore.Utils;
using System.Configuration;
using System.Data.Common;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
namespace EntityCore
{
public static class Context
{
public static DynamicEntityContext New(string nameOrConnectionStri... | ```c#
using EntityCore.DynamicEntity;
using EntityCore.Utils;
using System.Data.Common;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Data.Entity.ModelConfiguration.Conventions;
using System.Data.SqlClient;
using System.Linq;
namespace EntityCore
{
public static class Context
... |
dcc771de-3673-4e74-aadc-c1f880fa31fd | {
"language": "C#"
} | ```c#
using System.IO;
using OpenZH.Data.Utilities.Extensions;
namespace OpenZH.Data.Map
{
public sealed class PolygonTrigger
{
public string Name { get; private set; }
public string LayerName { get; private set; }
public uint UniqueId { get; private set; }
public PolygonTrigge... | ```c#
using System;
using System.IO;
using OpenZH.Data.Utilities.Extensions;
namespace OpenZH.Data.Map
{
public sealed class PolygonTrigger
{
public string Name { get; private set; }
public string LayerName { get; private set; }
public uint UniqueId { get; private set; }
public... |
305cc279-7dab-4f01-9f5f-9eb4895e1ac0 | {
"language": "C#"
} | ```c#
using NUnit.Framework;
using Mos6510.Instructions;
namespace Mos6510.Tests.Instructions
{
[TestFixture]
public class InyTests
{
[Test]
public void IncrementsTheValueInRegisterY()
{
const int initialValue = 42;
var model = new ProgrammingModel();
model.GetRegister(RegisterName... | ```c#
using NUnit.Framework;
using Mos6510.Instructions;
namespace Mos6510.Tests.Instructions
{
[TestFixture]
public class InyTests
{
[Test]
public void IncrementsTheValueInRegisterY()
{
const int initialValue = 42;
var model = new ProgrammingModel();
model.GetRegister(RegisterName... |
7739f191-be97-4bca-81fc-fd38cc7bb482 | {
"language": "C#"
} | ```c#
using System;
using System.Reflection;
using System.Security.Permissions;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle("MongoDBDriver")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfigu... | ```c#
using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security.Permissions;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle("MongoDBDriver")]
[assembly: AssemblyDes... |
ea3f2f17-b8a5-4e7a-b069-ac94c7623b1d | {
"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.
namespace Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator.Graph
{
/// <summary>
/// Repres... | ```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.
namespace Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator.Graph
{
/// <summary>
/// Repres... |
f1f69d6d-bd1e-4941-aaa8-0fe5a5e40f5e | {
"language": "C#"
} | ```c#
// ReSharper disable InconsistentNaming
#pragma warning disable
namespace Gu.Wpf.UiAutomation.WindowsAPI
{
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Windows;
[DebuggerDisplay("({X}, {Y})")]
[StructLayout(LayoutKind.Sequential)]
public s... | ```c#
// ReSharper disable InconsistentNaming
#pragma warning disable
namespace Gu.Wpf.UiAutomation.WindowsAPI
{
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Windows;
[DebuggerDisplay("({X}, {Y})")]
[StructLayout(LayoutKind.Sequential)]
public s... |
9d1c875c-0241-46fb-83b9-59fab778aba0 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IPTables.Net.Exceptions;
namespace IPTables.Net.Iptables
{
/// <summary>
/// Data to define the default IPTables tables and chains
/// </summary>
internal class IPTablesTables
{
static interna... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IPTables.Net.Exceptions;
namespace IPTables.Net.Iptables
{
/// <summary>
/// Data to define the default IPTables tables and chains
/// </summary>
internal class IPTablesTables
{
static interna... |
e8dbcf67-a4e8-4a54-94f8-be0cf992fa18 | {
"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.Rulesets.Mods
{
/// <summary>
/// The usage of this mod to determine whether it's playable in such context.
/// </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.Game.Rulesets.Mods
{
/// <summary>
/// The usage of this mod to determine whether it's playable in such context.
/// </summary>
public... |
275721fe-b9db-4c1f-8b08-7475daae8489 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Diagnostics;
namespace MatterHackers.MatterControl.Testing
{
public class TestingDispatch
{
string errorLogFileName = null;
public TestingDispatch()
{
e... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Diagnostics;
namespace MatterHackers.MatterControl.Testing
{
public class TestingDispatch
{
string errorLogFileName = null;
public TestingDispatch()
{
e... |
55689919-e178-4eba-9761-e5b3823e6265 | {
"language": "C#"
} | ```c#
using System;
namespace UnhelpfulDebugger
{
class Program
{
static void Main()
{
string awkward1 = "Foo\\Bar";
string awkward2 = "FindElement";
float awkward3 = 4.9999995f;
Console.WriteLine(awkward1);
PrintString(awkward1);
... | ```c#
using System;
namespace UnhelpfulDebugger
{
class Program
{
static void Main()
{
string awkward1 = "Foo\\Bar";
string awkward2 = "FindElement";
double awkward3 = 4.9999999999999995d;
Console.WriteLine(awkward1);
PrintString(a... |
608330a4-207e-43d5-bcd0-4ec963ecd60b | {
"language": "C#"
} | ```c#
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using Foundation;
using osu.Framework.Input;
namespace osu.Framework.iOS.Input
{
public class IOSTextInput : ITextInputSource
{
priv... | ```c#
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using Foundation;
using osu.Framework.Input;
namespace osu.Framework.iOS.Input
{
public class IOSTextInput : ITextInputSource
{
priv... |
abbd5608-c8ef-4bdf-b4c5-18058951bc17 | {
"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.Events;
using osu.Framework.Input.States;
using osuTK;
namespace osu.Framework.Input.StateChanges
{
/// <summary>
/... | ```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.Events;
using osu.Framework.Input.States;
using osuTK;
namespace osu.Framework.Input.StateChanges
{
/// <summary>
/... |
75d92413-66dc-4c8b-a900-8770b4bcd62a | {
"language": "C#"
} | ```c#
@{
ViewBag.Title = "Employees Overview";
}
<h2>Employees Overview</h2>
You can only see this page if you have the <strong>employee_read</strong> permissions.
```
Hide or show button in sample application | ```c#
@using System.Security.Claims
@{
ViewBag.Title = "Employees Overview";
}
<h2>Employees Overview</h2>
You can only see this page if you have the <strong>employee_read</strong> permissions.
<br/>
<br/>
@if (ClaimsPrincipal.Current.HasClaim(ClaimTypes.Role, "employee_create"))
{
<a href="@Url.Action("C... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.