doc_id stringlengths 36 36 | metadata dict | input stringlengths 28 4.3k | output stringlengths 11 5.45k |
|---|---|---|---|
0658d353-17c5-4f94-8768-68691af91d55 | {
"language": "C#"
} | ```c#
using System;
using UnityEngine;
public static class InputInterceptor
{
static InputInterceptor()
{
Type abstractControlsType = ReflectionHelper.FindType("AbstractControls");
_inputSystems = Resources.FindObjectsOfTypeAll(abstractControlsType);
}
public static void EnableInput()... | ```c#
using System;
using UnityEngine;
public static class InputInterceptor
{
static InputInterceptor()
{
Type abstractControlsType = ReflectionHelper.FindType("AbstractControls");
_inputSystems = Resources.FindObjectsOfTypeAll(abstractControlsType);
}
public static void EnableInput()... |
93832606-906e-4871-b529-3733a3888cea | {
"language": "C#"
} | ```c#
using System;
using System.ComponentModel;
using System.Reflection;
namespace CertiPay.Payroll.Common
{
public static class ExtensionMethods
{
/// <summary>
/// Returns the display name from the description attribute on the enumeration, if available.
/// Otherwise returns the ToS... | ```c#
using System;
using System.ComponentModel;
using System.Reflection;
namespace CertiPay.Payroll.Common
{
public static class ExtensionMethods
{
/// <summary>
/// Round the decimal to the given number of decimal places using the given method of rounding.
/// By default, this is 2 d... |
5d998286-677d-47a8-a27d-625102faf7ae | {
"language": "C#"
} | ```c#
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.UI;
using osu.Game.Screens.Play;
namespace ... | ```c#
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.UI;
using osu.Game.Screens.Play;
namespace ... |
513a062e-715f-4add-8da0-d63e4e8bcc58 | {
"language": "C#"
} | ```c#
using System;
using System.Diagnostics;
using System.IO;
using System.Threading;
using Serilog;
using Serilog.Core;
namespace Titan.Logging
{
public class LogCreator
{
public static DirectoryInfo LogDirectory = new DirectoryInfo(Environment.CurrentDirectory +
... | ```c#
using System;
using System.Diagnostics;
using System.IO;
using System.Threading;
using Serilog;
using Serilog.Core;
namespace Titan.Logging
{
public class LogCreator
{
private static DirectoryInfo _logDir = new DirectoryInfo(Environment.CurrentDirectory +
... |
5db78554-1521-4c32-9ec1-70e04425e5f9 | {
"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.Collections.Generic;
using osu.Framework.Input.Bindings;
namespace osu.Framework.Input
{
internal class FrameworkActionContainer : KeyBindingCont... | ```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.Collections.Generic;
using osu.Framework.Input.Bindings;
namespace osu.Framework.Input
{
internal class FrameworkActionContainer : KeyBindingCont... |
caec558f-c048-44ea-9120-eb838555a17a | {
"language": "C#"
} | ```c#
using System;
using System.Web;
using Cassette;
namespace Precompiled
{
/// <summary>
/// An example implementation of Cassette.IUrlModifier.
///
/// </summary>
public class CdnUrlModifier : IUrlModifier
{
public string Modify(string url)
{
// Th... | ```c#
using System;
using System.Web;
using Cassette;
namespace Precompiled
{
/// <summary>
/// An example implementation of Cassette.IUrlModifier.
/// </summary>
public class CdnUrlModifier : IUrlModifier
{
readonly string prefix;
public CdnUrlModifier(HttpContextBase... |
74d688e7-3770-45d3-947c-1d12a3ddd804 | {
"language": "C#"
} | ```c#
@model Microsoft.eShopOnContainers.WebMVC.ViewModels.Pagination.PaginationInfo
<div class="esh-pager">
<div class="container">
<article class="esh-pager-wrapper row">
<nav>
<a class="esh-pager-item esh-pager-item--navigable @Model.Previous"
id="Previ... | ```c#
@model Microsoft.eShopOnContainers.WebMVC.ViewModels.Pagination.PaginationInfo
<div class="esh-pager">
<div class="container">
<article class="esh-pager-wrapper row">
<nav>
<a class="esh-pager-item esh-pager-item--navigable @Model.Previous"
id="Previou... |
4d24799c-56c4-464b-9bb2-1547debcf218 | {
"language": "C#"
} | ```c#
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Duplicati.Library.Main;
using NUnit.Framework;
namespace Duplicati.UnitTest
{
[TestFixture]
public class RepairHandlerTests : BasicSetupHelper
{
public override void SetUp()
{
base.SetUp();
... | ```c#
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Duplicati.Library.Main;
using NUnit.Framework;
namespace Duplicati.UnitTest
{
[TestFixture]
public class RepairHandlerTests : BasicSetupHelper
{
public override void SetUp()
{
base.SetUp();
... |
99700bcb-769e-4ee6-8b97-ea3588a69104 | {
"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 Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Presenters;
using System;
using System.Collections.Generic;
namespace Core2D.Avalonia.Prese... | ```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 Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Presenters;
using System;
using System.Collections.Generic;
namespace Core2D.Avalonia.Prese... |
1a8ee63c-11bf-4c6f-8f14-6454ff472348 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using Microsoft.Framework.DependencyInjection;
using System.Threading.Tasks;
namespace Glimpse.Web
{
public class MasterRequestRuntime
{
private readonly IDiscoverableCollection<IRequestRuntime> _requestRuntimes;
private readonly IDiscovera... | ```c#
using System;
using System.Collections.Generic;
using Microsoft.Framework.DependencyInjection;
using System.Threading.Tasks;
namespace Glimpse.Web
{
public class MasterRequestRuntime
{
private readonly IDiscoverableCollection<IRequestRuntime> _requestRuntimes;
private readonly IDiscovera... |
69b11cf1-e9f9-4a44-81b2-f9a076539c5d | {
"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... |
5cacb4fd-5572-4c70-96c2-5599b9a8c0d4 | {
"language": "C#"
} | ```c#
using System;
using System.Threading.Tasks;
using SFA.DAS.Reservations.Api.Types.Configuration;
namespace SFA.DAS.Reservations.Api.Types
{
public class ReservationHelper : IReservationHelper
{
private readonly ReservationsClientApiConfiguration _config;
public ReservationHelper(Reservat... | ```c#
using System;
using System.Threading.Tasks;
using SFA.DAS.Reservations.Api.Types.Configuration;
namespace SFA.DAS.Reservations.Api.Types
{
public class ReservationHelper : IReservationHelper
{
private readonly ReservationsClientApiConfiguration _config;
public ReservationHelper(Reservat... |
46264a2b-08c0-4125-b721-d96a4350a026 | {
"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... |
729e4867-4241-4b06-807e-93fcc9d94e2c | {
"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.Net.Http;
using osu.Framework.IO.Network;
using osu.Game.Online.API;
namespace osu.Game.Online.Rooms
{
public class JoinRoomRequest : APIRequest
... | ```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.Net.Http;
using osu.Framework.IO.Network;
using osu.Game.Online.API;
namespace osu.Game.Online.Rooms
{
public class JoinRoomRequest : APIRequest
... |
4f270ae3-88ca-4cbd-8367-0df37daeb738 | {
"language": "C#"
} | ```c#
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using Vidly.Models;
namespace Vidly.Controllers
{
public class CustomersController : Controller
{
public ActionResult Index()
{
var customers = GetCustomers();
return View(customers);
... | ```c#
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using Vidly.Models;
namespace Vidly.Controllers
{
public class CustomersController : Controller
{
private ApplicationDbContext _context;
public CustomersController()
{
_context = new Applicati... |
27b57c9d-8054-4e51-9f53-d5f89858e0da | {
"language": "C#"
} | ```c#
// Copyright (c) Microsoft Corporation. All rights reserved.
// Welcome to the Utilities code base. This _README.cs file is your table of contents.
//
// You will notice that the code is littered with code: qualifiers. If you install the 'hyperAddin' for
// Visual Studio, these qualifiers turn into hyperlinks... | ```c#
// Copyright (c) Microsoft Corporation. All rights reserved.
// Welcome to the Utilities code base. This _README.cs file is your table of contents.
//
// You will notice that the code is littered with code: qualifiers. If you install the 'hyperAddin' for
// Visual Studio, these qualifiers turn into hyperlinks... |
2ad9c31b-c47b-4627-8a48-7b4077ecd0fe | {
"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.Linq;
using osu.Game.Beatmaps.ControlPoints;
namespace osu.Game.Beatmaps.Formats
{
/// <summary>
/// A <see cref="LegacyBeatmapDecoder"/> buil... | ```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.Linq;
using osu.Game.Beatmaps.ControlPoints;
namespace osu.Game.Beatmaps.Formats
{
/// <summary>
/// A <see cref="LegacyBeatmapDecoder"/> buil... |
6a453ca5-7888-4686-96d3-e18eaf2f0d78 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using Duality;
using PythonScripting.Resources;
using IronPython.Hosting;
using Microsoft.Scripting.Hosting;
using IronPython.Compiler;
namespace PythonScripting
{
public class ScriptExecutor : Component, ICmpInitializable
{
public C... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using Duality;
using PythonScripting.Resources;
using IronPython.Hosting;
using IronPython.Runtime;
using IronPython.Compiler;
using Microsoft.Scripting;
using Microsoft.Scripting.Hosting;
namespace PythonScripting
{
public class ScriptExecu... |
693c0abe-320d-42be-988c-23376397053a | {
"language": "C#"
} | ```c#
using UnityEngine;
using System.Collections;
public class PlayerMovement : MonoBehaviour
{
public float speed = 6f;
Vector3 movement;
Rigidbody rb;
float cameraRayLength = 100;
int floorMask;
void Awake()
{
floorMask = LayerMask.GetMask ("Floor");
rb = GetComponent<Rigidbody> ();
}
void FixedUpd... | ```c#
using UnityEngine;
using System.Collections;
public class PlayerMovement : MonoBehaviour
{
public float speed = 6f;
public float jumpSpeed = 8.0F;
public float gravity = 20.0F;
private Vector3 moveDirection = Vector3.zero;
private CharacterController cc;
private float cameraRayLength = 100;
private int ... |
35479634-9089-4825-aecb-594d716a108a | {
"language": "C#"
} | ```c#
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using LegoSharp;
using System.Linq;
using System.Reflection;
using System.IO.MemoryMappedFiles;
namespace LegoSharpTest
{
[TestClass]
public class ReadmeTe... | ```c#
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using LegoSharp;
using System.Linq;
using System.Reflection;
using System.IO.MemoryMappedFiles;
namespace LegoSharpTest
{
[TestClass]
public class ReadmeTe... |
63fe5244-973c-4ed8-a89e-1b32a5f6eb1a | {
"language": "C#"
} | ```c#
using System;
namespace Terraria_Server.Messages
{
public class SummonSkeletronMessage : IMessage
{
public Packet GetPacket()
{
return Packet.SUMMON_SKELETRON;
}
public void Process(int start, int length, int num, int whoAmI, byte[] readBuffer, byte bufferDat... | ```c#
using System;
namespace Terraria_Server.Messages
{
public class SummonSkeletronMessage : IMessage
{
public Packet GetPacket()
{
return Packet.SUMMON_SKELETRON;
}
public void Process(int start, int length, int num, int whoAmI, byte[] readBuffer, byte bufferDat... |
5a357c3a-5da9-4976-9068-4196211f7a82 | {
"language": "C#"
} | ```c#
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using osu.Framework.Audio.Track;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Game.Beatmaps.ControlPoints;
using osu.G... | ```c#
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using osu.Framework.Audio.Track;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Game.Beatmaps.ControlPoints;
using osu.G... |
3d815317-36e4-4a6c-b85a-10541e9121fc | {
"language": "C#"
} | ```c#
using System;
using System.ComponentModel;
using System.Windows;
using DesktopWidgets.Classes;
using Xceed.Wpf.Toolkit.PropertyGrid.Attributes;
namespace DesktopWidgets.Actions
{
public abstract class ActionBase
{
[PropertyOrder(0)]
[DisplayName("Delay")]
public TimeSpan Delay { ... | ```c#
using System;
using System.ComponentModel;
using System.Windows;
using DesktopWidgets.Classes;
using DesktopWidgets.Helpers;
using Xceed.Wpf.Toolkit.PropertyGrid.Attributes;
namespace DesktopWidgets.Actions
{
public abstract class ActionBase
{
[PropertyOrder(0)]
[DisplayName("Delay")]
... |
d392b09c-2579-41d5-9941-f5fdd0c289e0 | {
"language": "C#"
} | ```c#
using Xamarin.Forms;
namespace AppShell.Mobile.Views
{
[ContentProperty("ShellContent")]
public partial class ShellView : ContentView
{
public static readonly BindableProperty ShellContentProperty = BindableProperty.Create<ShellView, View>(d => d.ShellContent, null, propertyChanged: ShellCo... | ```c#
using Xamarin.Forms;
namespace AppShell.Mobile.Views
{
[ContentProperty("ShellContent")]
public partial class ShellView : ContentView
{
public static readonly BindableProperty ShellContentProperty = BindableProperty.Create<ShellView, View>(d => d.ShellContent, null, propertyChanged: ShellCo... |
8ac5bd42-1b40-401a-a592-c870a8863bcc | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Linq;
namespace Meowtrix.osuAMT.Training.DataGenerator
{
class OszArchive : Archive, IDisposable
{
public ZipArchive archive;
private FileInfo fileinfo;
public OszArchive(... | ```c#
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Linq;
namespace Meowtrix.osuAMT.Training.DataGenerator
{
class OszArchive : Archive, IDisposable
{
public ZipArchive archive;
private FileInfo fileinfo;
public OszArchive(... |
534e29e7-51a5-4f64-a29e-b5e2e9c24cff | {
"language": "C#"
} | ```c#
using System.Net.Http.Formatting;
using System.Web.Http.ModelBinding;
using Umbraco.Core;
using Umbraco.Web.Models.Trees;
using Umbraco.Web.Mvc;
using Umbraco.Web.Trees;
using Umbraco.Web.WebApi.Filters;
namespace uSync8.BackOffice.Controllers.Trees
{
[Tree(Constants.Applications.Settings, uSync.Trees.uSyn... | ```c#
using System.Net.Http.Formatting;
using System.Web.Http.ModelBinding;
using Umbraco.Core;
using Umbraco.Web.Models.Trees;
using Umbraco.Web.Mvc;
using Umbraco.Web.Trees;
using Umbraco.Web.WebApi.Filters;
namespace uSync8.BackOffice.Controllers.Trees
{
[Tree(Constants.Applications.Settings, uSync.Trees.uSyn... |
272ee457-90cb-43e8-bbdd-6a83ec9ecf4a | {
"language": "C#"
} | ```c#
using RethinkDb.DatumConverters;
namespace RethinkDb.Newtonsoft.Configuration
{
public class NewtonSerializer : AggregateDatumConverterFactory
{
public NewtonSerializer() : base(
PrimitiveDatumConverterFactory.Instance,
TupleDatumConverterFactory.Instance,
Ano... | ```c#
using RethinkDb.DatumConverters;
namespace RethinkDb.Newtonsoft.Configuration
{
public class NewtonSerializer : AggregateDatumConverterFactory
{
public NewtonSerializer() : base(
PrimitiveDatumConverterFactory.Instance,
TupleDatumConverterFactory.Instance,
Ano... |
4d7fbf78-912c-424e-b10a-44edfe6beaca | {
"language": "C#"
} | ```c#
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using ExRam.Gremlinq.Core.Projections;
using ExRam.Gremlinq.Core.Steps;
namespace ExRam.Gremlinq.Core
{
public static class EnumerableExtensions
{
public static Traversal ToTraversal(this IEnum... | ```c#
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using ExRam.Gremlinq.Core.Projections;
using ExRam.Gremlinq.Core.Steps;
namespace ExRam.Gremlinq.Core
{
public static class EnumerableExtensions
{
public static Traversal ToTraver... |
108e5b47-2d5a-4054-a54d-6dcefc7195cf | {
"language": "C#"
} | ```c#
using System.Collections.Generic;
using HarryPotterUnity.Cards.Generic;
using HarryPotterUnity.Tween;
using UnityEngine;
namespace HarryPotterUnity.Utils
{
public static class GameManager {
public const int PreviewLayer = 9;
public const int CardLayer = 10;
public const int ValidCho... | ```c#
using System.Collections.Generic;
using HarryPotterUnity.Cards.Generic;
using HarryPotterUnity.Tween;
using UnityEngine;
namespace HarryPotterUnity.Utils
{
public static class GameManager {
public const int PREVIEW_LAYER = 9;
public const int CARD_LAYER = 10;
public const int VALID_... |
b3f6a20c-e0ee-4494-a98d-d01cfa47eca3 | {
"language": "C#"
} | ```c#
using System;
namespace Table {
public class Table {
public int Width;
public int Spacing;
public Table(int width, int spacing) {
Width = width;
Spacing = spacing;
}
}
}
```
Make the namespace uniform accross the project | ```c#
using System;
namespace Hangman {
public class Table {
public int Width;
public int Spacing;
public Table(int width, int spacing) {
Width = width;
Spacing = spacing;
}
}
}
``` |
64dd0a83-068b-4a39-b917-a9651738edec | {
"language": "C#"
} | ```c#
using System;
using Mono.VisualC.Interop;
using Mono.VisualC.Interop.ABI;
namespace Qt {
// Will be internal; public for testing
public static class Libs {
public static CppLibrary QtCore = null;
public static CppLibrary QtGui = null;
static Libs ()
... | ```c#
using System;
using Mono.VisualC.Interop;
using Mono.VisualC.Interop.ABI;
namespace Qt {
// Will be internal; public for testing
public static class Libs {
public static CppLibrary QtCore = null;
public static CppLibrary QtGui = null;
static Libs ()
... |
aad3436e-f942-4f6e-ae82-7ec6decbbdef | {
"language": "C#"
} | ```c#
@using RightpointLabs.ConferenceRoom.Domain
@model IEnumerable<RightpointLabs.ConferenceRoom.Domain.Models.Entities.DeviceEntity>
@{
var buildings = (Dictionary<string, string>)ViewBag.Buildings;
var rooms = (Dictionary<string, string>)ViewBag.Rooms;
}
<p>
@Html.ActionLink("Create New", "Create")
</... | ```c#
@using RightpointLabs.ConferenceRoom.Domain
@model IEnumerable<RightpointLabs.ConferenceRoom.Domain.Models.Entities.DeviceEntity>
@{
var buildings = (Dictionary<string, string>)ViewBag.Buildings;
var rooms = (Dictionary<string, string>)ViewBag.Rooms;
}
<p>
@Html.ActionLink("Create New", "Create")
</... |
28d596d3-2e6e-4282-8db8-341d99598643 | {
"language": "C#"
} | ```c#
// Copyright © 2010-2014 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
using System;
using System.Windows.Interop;
using System.Windows.Media;
using System.Windows.Media.Imaging;
namespace CefSharp.Wpf.Renderin... | ```c#
// Copyright © 2010-2014 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
using System;
using System.Windows.Interop;
using System.Windows.Media;
using System.Windows.Media.Imaging;
namespace CefSharp.Wpf.Renderin... |
62835331-5916-40fb-8475-72d2d10cc809 | {
"language": "C#"
} | ```c#
using System;
using System.Reflection;
namespace AdoNetProfiler
{
/// <summary>
/// The factory to create the object of <see cref="IProfiler"/>.
/// </summary>
public class AdoNetProfilerFactory
{
// ConstructorInfo is faster than Func<IProfiler> when invoking.
private static... | ```c#
using System;
using System.Reflection;
using System.Threading;
namespace AdoNetProfiler
{
/// <summary>
/// The factory to create the object of <see cref="IProfiler"/>.
/// </summary>
public class AdoNetProfilerFactory
{
// ConstructorInfo is faster than Func<IProfiler> when invoking... |
a79fb848-b83f-4f1e-8fa5-b01883aae5cf | {
"language": "C#"
} | ```c#
using KenticoInspector.Core.Models;
using System;
using System.Collections.Generic;
namespace KenticoInspector.Core
{
public abstract class AbstractReport : IReport
{
public string Codename => GetCodename(this.GetType());
public static string GetCodename(Type reportType) {
r... | ```c#
using KenticoInspector.Core.Models;
using System;
using System.Collections.Generic;
namespace KenticoInspector.Core
{
public abstract class AbstractReport<T> : IReport, IWithMetadata<T> where T : new()
{
public string Codename => GetCodename(this.GetType());
public static string GetCode... |
2280c9f2-775b-4cb0-8095-514ac0294fee | {
"language": "C#"
} | ```c#
using System;
using System.Web;
using System.Web.Routing;
namespace Cassette
{
public class ModuleRequestHandler<T> : IHttpHandler
where T : Module
{
public ModuleRequestHandler(IModuleContainer<T> moduleContainer, RequestContext requestContext)
{
this.modu... | ```c#
using System;
using System.Web;
using System.Web.Routing;
namespace Cassette.Web
{
public class ModuleRequestHandler<T> : IHttpHandler
where T : Module
{
public ModuleRequestHandler(IModuleContainer<T> moduleContainer, RequestContext requestContext)
{
this.... |
a4488031-b015-49c2-a512-d124e260267d | {
"language": "C#"
} | ```c#
// The code is new, but the idea is from http://wiki.tcl.tk/9563
using System;
using System.Runtime.InteropServices;
namespace Irule
{
public class TclInterp : IDisposable
{
[DllImport("libtcl.dylib")]
protected static extern IntPtr Tcl_CreateInterp();
[DllImport("libtcl.dylib")... | ```c#
// The code is new, but the idea is from http://wiki.tcl.tk/9563
using System;
using System.Runtime.InteropServices;
namespace Irule
{
public class TclInterp : IDisposable
{
[DllImport("tcl8.4")]
protected static extern IntPtr Tcl_CreateInterp();
[DllImport("tcl8.4")]
pr... |
91cd15c8-ba30-407e-bb18-fc3a5a7b9333 | {
"language": "C#"
} | ```c#
using System;
using Engine.cgimin.material.simpletexture;
using Engine.cgimin.object3d;
using Engine.cgimin.texture;
using OpenTK;
namespace Mugo
{
class PizzaModel : ClonedObject<PizzaModelInternal>, ITunnelSegementElementModel
{
private static readonly SimpleTextureMaterial material = new SimpleTextureMat... | ```c#
using System;
using Engine.cgimin.material.simpletexture;
using Engine.cgimin.object3d;
using Engine.cgimin.texture;
using OpenTK;
namespace Mugo
{
class PizzaModel : ClonedObject<PizzaModelInternal>, ITunnelSegementElementModel
{
private static readonly SimpleTextureMaterial material = new SimpleTextureMat... |
783b9081-c37b-4185-9642-27ae5cd96997 | {
"language": "C#"
} | ```c#
/*Problem 9. Sum of n Numbers
Write a program that enters a number n and after that enters more n numbers and calculates and prints their sum.
Note: You may need to use a for-loop.
Examples:
numbers sum
3 90
20
60
10
5 6.5
2
-1
-0.5
4
2
1 1
1
*/
using System;... | ```c#
/*Problem 9. Sum of n Numbers
Write a program that enters a number n and after that enters more n numbers and calculates and prints their sum.
Note: You may need to use a for-loop.
Examples:
numbers sum
3 90
20
60
10
5 6.5
2
-1
-0.5
4
2
1 1
1
*/
using System;... |
140cba8b-34fc-4169-b302-6d1faf39f1cf | {
"language": "C#"
} | ```c#
using System;
using System.Linq;
using AutoFixture.Xunit2;
using Shouldly;
using Xunit;
namespace Lloyd.AzureMailGateway.Models.Tests
{
public class EMailBuilderTests
{
//[Fact]
//public void BuilderShouldReturnNonNullEMailInstance()
//{
// // Arrange
// var... | ```c#
using System;
using System.Linq;
using AutoFixture.Xunit2;
using Shouldly;
using Xunit;
namespace Lloyd.AzureMailGateway.Models.Tests
{
public class EMailBuilderTests
{
[Fact]
public void BuildShouldThrowOnInvalidState()
{
// Arrange
var builder = new EMai... |
5972e32f-4a28-4c4b-927f-ed2db5cfacd8 | {
"language": "C#"
} | ```c#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RemiCover_UmbrellaBehaviour : MonoBehaviour {
public float verticalPosition;
// Use this for initialization
void Start () {
Cursor.visible = false;
}
// Update is called once per frame
void U... | ```c#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RemiCover_UmbrellaBehaviour : MonoBehaviour {
public float verticalPosition;
// Use this for initialization
void Start () {
Cursor.visible = false;
}
// Update is called once per frame
void U... |
f470d1b1-548e-4f64-acd1-b82cd4520da7 | {
"language": "C#"
} | ```c#
using System.Collections.Generic;
using Mond.Compiler.Expressions;
namespace Mond.Compiler.Parselets
{
class ObjectParselet : IPrefixParselet
{
public Expression Parse(Parser parser, Token token)
{
var values = new List<KeyValuePair<string, Expression>>();
while ... | ```c#
using System.Collections.Generic;
using Mond.Compiler.Expressions;
namespace Mond.Compiler.Parselets
{
class ObjectParselet : IPrefixParselet
{
public Expression Parse(Parser parser, Token token)
{
var values = new List<KeyValuePair<string, Expression>>();
while ... |
a7f5c8f9-e311-40ea-a283-b5614031c0bf | {
"language": "C#"
} | ```c#
using System;
using System.IO;
using System.Text;
namespace YGOSharp.Network.Utils
{
public static class BinaryExtensions
{
public static void WriteUnicode(this BinaryWriter writer, string text, int len)
{
byte[] unicode = Encoding.Unicode.GetBytes(text);
... | ```c#
using System;
using System.IO;
using System.Text;
namespace YGOSharp.Network.Utils
{
public static class BinaryExtensions
{
public static void WriteUnicode(this BinaryWriter writer, string text, int len)
{
byte[] unicode = Encoding.Unicode.GetBytes(text);
... |
9b66d03b-0e98-4de0-85d5-0829d8949fae | {
"language": "C#"
} | ```c#
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SyncTrayzor.SyncThing.Api
{
public class ItemStartedEventData
{
[JsonProperty("item")]
public string Item { get; set; }
[JsonPrope... | ```c#
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SyncTrayzor.SyncThing.Api
{
public class ItemStartedEventDetails
{
[JsonProperty("Name")]
public string Name { get; set; }
[JsonPr... |
31da7a13-bd2e-4443-85bd-3a1bf63bdea1 | {
"language": "C#"
} | ```c#
using System;
namespace osu.Game.Online.RealtimeMultiplayer
{
public class NotJoinedRoomException : Exception
{
public NotJoinedRoomException()
: base("This user has not yet joined a multiplayer room.")
{
}
}
}```
Add missing final newline in file | ```c#
using System;
namespace osu.Game.Online.RealtimeMultiplayer
{
public class NotJoinedRoomException : Exception
{
public NotJoinedRoomException()
: base("This user has not yet joined a multiplayer room.")
{
}
}
}
``` |
320fc936-f658-4445-be1c-b64d8e8add92 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Windows.Forms;
namespace MusicRandomizer
{
public partial class NewPlaylistForm : Form
{
public String name;
public NewPlaylistForm()
{
InitializeComponent(... | ```c#
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Windows.Forms;
namespace MusicRandomizer
{
public partial class NewPlaylistForm : Form
{
public String name;
public NewPlaylistForm()
{
InitializeComponent(... |
db850fa3-735f-417a-9e91-350d194cc68c | {
"language": "C#"
} | ```c#
using System;
using System.ComponentModel;
using DesktopWidgets.WidgetBase.Settings;
namespace DesktopWidgets.Widgets.PictureSlideshow
{
public class Settings : WidgetSettingsBase
{
public Settings()
{
Width = 384;
Height = 216;
}
[Category("Gener... | ```c#
using System;
using System.ComponentModel;
using DesktopWidgets.WidgetBase.Settings;
namespace DesktopWidgets.Widgets.PictureSlideshow
{
public class Settings : WidgetSettingsBase
{
public Settings()
{
Width = 384;
Height = 216;
}
[Category("Gener... |
276a071d-a253-4223-8a2d-f5970f14697a | {
"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.Game.Beatmaps;
using osu.Game.Beatmaps.ControlPoints;
namespace osu.Game.Rulesets.Taiko.Objects.Drawables
{
/// <summary>
/// A hit used specific... | ```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.Game.Beatmaps;
using osu.Game.Beatmaps.ControlPoints;
namespace osu.Game.Rulesets.Taiko.Objects.Drawables
{
/// <summary>
/// A hit used specific... |
d0c5ae27-608e-4b38-8a12-a76bbc8de2ee | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
namespace Working_with_images
{
/// <summary>
/// The UIApplicationDelegate for the application. This class is responsible for launching the
/// User Interface of the application, as... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
namespace Working_with_images
{
/// <summary>
/// The UIApplicationDelegate for the application. This class is responsible for launching the
/// User Interface of the application, as... |
fe2e08f7-1f7b-4dec-9dd9-a302390e9e32 | {
"language": "C#"
} | ```c#
using UnityEngine;
using System.Collections;
public sealed class HUD : MonoBehaviour {
private int frameCount = 0;
private float dt = 0.0F;
private float fps = 0.0F;
private float updateRate = 4.0F;
void Start () {
}
void Update () {
frameCount++;
dt += Time.deltaTime;
if (dt > 1.0F / updateRate... | ```c#
using UnityEngine;
using System.Collections;
public sealed class HUD : MonoBehaviour {
private int FrameCount = 0;
private float DeltaTime = 0.0F;
private float FPS = 0.0F;
private float UpdateRate = 5.0F;
void Start () {
}
void Update () {
FrameCount++;
DeltaTime += Time.deltaTime;
if (DeltaTim... |
7538430e-7de1-4cf1-af4d-4945166a294d | {
"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.Collections.Generic;
using JetBrains.Annotations;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers... | ```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.Collections.Generic;
using JetBrains.Annotations;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers... |
77fd7504-aa73-4f52-aed7-e3e63be20437 | {
"language": "C#"
} | ```c#
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Http;
using System;
using System.Net.WebSockets;
using System.Threading;
using System.Threading.Tasks;
namespace SampleApp
{
public class Startup
{
public void Configure(IApplicationBuilder app)
{
app.Run(async context =>... | ```c#
using System;
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Http;
namespace SampleApp
{
public class Startup
{
public void Configure(IApplicationBuilder app)
{
app.Run(async context =>
{
Console.WriteLine("{0} {1}{2}{3}",
... |
0f4d3b78-d266-4484-9566-d3874b35bcc7 | {
"language": "C#"
} | ```c#
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
using System.Collections.Generic;
using osu.Framework.Event;
using osu.Framework.Input.Handlers;
using osu.Framework.Platform;
using OpenTK;
namespace ... | ```c#
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
using System.Collections.Generic;
using osu.Framework.Event;
using osu.Framework.Input.Handlers;
using osu.Framework.Platform;
using OpenTK;
namespace ... |
648e4f01-1056-45a5-bf2b-4ae683750ab3 | {
"language": "C#"
} | ```c#
using System;
using System.Linq;
using Autofac;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
namespace Zermelo.App.UWP.Schedule
{
public sealed partial class ScheduleView : Page
{
public ScheduleView()
{
this.InitializeComponent();
Navigation... | ```c#
using System;
using System.Linq;
using Autofac;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
namespace Zermelo.App.UWP.Schedule
{
public sealed partial class ScheduleView : Page
{
public ScheduleView()
{
this.InitializeComponent();
Navigation... |
494ee753-b1f7-4ac1-a12d-797ef57b9c5c | {
"language": "C#"
} | ```c#
/*
* Copyright (c) Dominick Baier, Brock Allen. All rights reserved.
* see license
*/
using System.Collections.Generic;
namespace Thinktecture.IdentityServer.WsFed.Models
{
public class RelyingParty
{
public string Name { get; set; }
public bool Enabled { get; set; }
public ... | ```c#
/*
* Copyright (c) Dominick Baier, Brock Allen. All rights reserved.
* see license
*/
using System.Collections.Generic;
using System.Security.Cryptography.X509Certificates;
namespace Thinktecture.IdentityServer.WsFed.Models
{
public class RelyingParty
{
public string Name { get; set; }
... |
ddd2e896-bdd7-4a83-9af9-93521dceaee8 | {
"language": "C#"
} | ```c#
namespace Umbraco.Core.Models.Entities
{
/// <summary>
/// Represents the path of a tree entity.
/// </summary>
public class TreeEntityPath
{
/// <summary>
/// Gets or sets the identifier of the entity.
/// </summary>
public int Id { get; set; }
/// <s... | ```c#
namespace Umbraco.Core.Models.Entities
{
/// <summary>
/// Represents the path of a tree entity.
/// </summary>
public class TreeEntityPath
{
/// <summary>
/// Gets or sets the identifier of the entity.
/// </summary>
public int Id { get; set; }
/// <s... |
64af8040-4de9-4691-87f1-8fe54bead198 | {
"language": "C#"
} | ```c#
// Copyright (c) to owners found in https://github.com/AArnott/pinvoke/blob/master/COPYRIGHT.md. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
namespace PInvoke
{
using System.Runtime.InteropServices;
/// <content>
///... | ```c#
// Copyright (c) to owners found in https://github.com/AArnott/pinvoke/blob/master/COPYRIGHT.md. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
namespace PInvoke
{
using System.Runtime.InteropServices;
/// <content>
///... |
458aabb3-aa97-4760-a286-6657cd9eb229 | {
"language": "C#"
} | ```c#
@{
ViewData["Title"] = "List of Articles I've Written";
}
<h1 id="page_title">Articles I've written</h1>
<div class="centered_wrapper">
<input type="text" class="search" placeholder="Filter by title/tag">
<article>
<p class="date">Monday Aug 28</p>
<h2><a href="#">Change Kestrel defa... | ```c#
@model IEnumerable<ArticleModel>
@{
ViewData["Title"] = "List of Articles I've Written";
}
<h1 id="page_title">Articles I've written</h1>
<div class="centered_wrapper">
<input type="text" class="search" placeholder="Filter by title/tag">
@foreach (var article in Model)
{
<article>
<... |
9d023900-6b2b-4261-b2b5-b6d77dd7e41b | {
"language": "C#"
} | ```c#
using System;
using System.Numerics;
namespace DynamixelServo.Quadruped
{
public class BasicQuadrupedGaitEngine : QuadrupedGaitEngine
{
private const int Speed = 10;
private const int MaxForward = 5;
private const int MinForward = -5;
private const int LegDistance = 15;... | ```c#
using System;
using System.Numerics;
namespace DynamixelServo.Quadruped
{
public class BasicQuadrupedGaitEngine : QuadrupedGaitEngine
{
private const int Speed = 12;
private int _currentIndex;
private readonly Vector3[] _positions =
{
new Vector3(-5, 5, 3),
... |
c7ab911b-17d7-4eeb-8445-9dbd061186dd | {
"language": "C#"
} | ```c#
namespace AnimalHope.Web
{
using System.Web;
using System.Web.Mvc;
public class FilterConfig
{
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
}
}
}
```
Handle correctly the special HTML ... | ```c#
namespace AnimalHope.Web
{
using System.Web;
using System.Web.Mvc;
public class FilterConfig
{
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
filters.Add(new ValidateInputAttribute(false)... |
9ecc8fa6-35a6-44c0-9310-6ae7fc5d60bc | {
"language": "C#"
} | ```c#
using System.Diagnostics;
using CommonBotLibrary.Interfaces.Models;
using RedditSharp.Things;
namespace CommonBotLibrary.Services.Models
{
[DebuggerDisplay("{Url, nq}")]
public class RedditResult : IWebpage
{
public RedditResult(Post post)
{
Title = post.Title;
... | ```c#
using System.Diagnostics;
using CommonBotLibrary.Interfaces.Models;
using RedditSharp.Things;
namespace CommonBotLibrary.Services.Models
{
[DebuggerDisplay("{Url, nq}")]
public class RedditResult : IWebpage
{
public RedditResult(Post post)
{
Title = post.Title;
... |
f84dc12f-2ea2-4a9d-816e-ea451b3cc91f | {
"language": "C#"
} | ```c#
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Threading;
... | ```c#
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Threading;
... |
5228c057-a7f4-43fe-881a-f51fd6322aea | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Castle.Windsor;
namespace AppHarbor
{
class Program
{
static void Main(string[] args)
{
var container = new WindsorContainer()
.Install(new AppHarborInstaller());
var commandDispatcher = container.Resolv... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Castle.Windsor;
namespace AppHarbor
{
class Program
{
static void Main(string[] args)
{
var container = new WindsorContainer()
.Install(new AppHarborInstaller());
var commandDispatcher = container.Resolv... |
77a74f58-1c65-4356-a484-c9ff23bd4914 | {
"language": "C#"
} | ```c#
using System;
using System.Linq;
using System.Windows.Forms;
using NBi.UI.Genbi.Presenter;
namespace NBi.UI.Genbi.View.TestSuiteGenerator
{
public partial class SettingsControl : UserControl
{
public SettingsControl()
{
InitializeComponent();
}
... | ```c#
using System;
using System.Linq;
using System.Windows.Forms;
using NBi.UI.Genbi.Presenter;
namespace NBi.UI.Genbi.View.TestSuiteGenerator
{
public partial class SettingsControl : UserControl
{
public SettingsControl()
{
InitializeComponent();
}
... |
4f9e1859-6881-4afa-a1b1-442ea59dc606 | {
"language": "C#"
} | ```c#
using System;
using Microsoft.MixedReality.Toolkit;
using Microsoft.MixedReality.Toolkit.Input;
using UnityEngine;
// Simple example script that subscribes to primary pointer changes and applies a cursor highlight to the current one.
public class PrimaryPointerHandlerExample : MonoBehaviour
{
public GameObj... | ```c#
using Microsoft.MixedReality.Toolkit;
using Microsoft.MixedReality.Toolkit.Input;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Examples.Demos
{
// Simple example script that subscribes to primary pointer changes and applies a cursor highlight to the current one.
public class PrimaryPointe... |
57db1f0e-bfe0-4bcc-bdb5-a0d0e8308b7b | {
"language": "C#"
} | ```c#
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace Mollie.Api.Models.Payment {
[JsonConverter(typeof(StringEnumConverter))]
public enum PaymentMethod {
[EnumMember(Value = "ideal")] Ideal,
[EnumMember(Value = "creditcard")] CreditCard,
... | ```c#
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace Mollie.Api.Models.Payment {
[JsonConverter(typeof(StringEnumConverter))]
public enum PaymentMethod {
[EnumMember(Value = "ideal")] Ideal,
[EnumMember(Value = "creditcard")] CreditCard,
... |
31962425-8b09-4454-8b6a-6f41be1f4022 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.HttpsPolicy;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Dep... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.HttpsPolicy;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Dep... |
e082d2c8-3db6-49ec-96d3-89b2e1394eeb | {
"language": "C#"
} | ```c#
@{
var ownerName = Environment.GetEnvironmentVariable("WEBSITE_OWNER_NAME") ?? "";
var subscriptionId = ownerName;
var resourceGroup = Environment.GetEnvironmentVariable("WEBSITE_RESOURCE_GROUP") ?? "";
var siteName = Environment.GetEnvironmentVariable("WEBSITE_SITE_NAME") ?? "";
var inde... | ```c#
@{
var ownerName = Environment.GetEnvironmentVariable("WEBSITE_OWNER_NAME") ?? "";
var subscriptionId = ownerName;
var resourceGroup = Environment.GetEnvironmentVariable("WEBSITE_RESOURCE_GROUP") ?? "";
var siteName = Environment.GetEnvironmentVariable("WEBSITE_SITE_NAME") ?? "";
var hostName ... |
20f60aa4-9f3b-4359-b499-6d571a0eef61 | {
"language": "C#"
} | ```c#
using System.Numerics;
namespace DynamixelServo.Quadruped
{
public static class Vector3Extensions
{
public static Vector3 Normal(this Vector3 vector)
{
return Vector3.Normalize(vector);
}
public static bool Similar(this Vector3 a, Vector3 b, float marginOfErr... | ```c#
using System.Numerics;
namespace DynamixelServo.Quadruped
{
public static class Vector3Extensions
{
public static Vector3 Normal(this Vector3 vector)
{
return Vector3.Normalize(vector);
}
public static bool Similar(this Vector3 a, Vector3 b, float marginOfErr... |
6b5257c3-3313-4c82-993b-7937fd5a2ff6 | {
"language": "C#"
} | ```c#
using System;
using System.Diagnostics;
namespace Spiffy.Monitoring
{
public static class Behavior
{
static Action<Level, string> _loggingAction;
/// <summary>
/// Whether or not to remove newline characters from logged values.
/// </summary>
/// <returns>
... | ```c#
using System;
using System.Diagnostics;
namespace Spiffy.Monitoring
{
public static class Behavior
{
static Action<Level, string> _loggingAction;
/// <summary>
/// Whether or not to remove newline characters from logged values.
/// </summary>
/// <returns>
... |
2f020d6c-12dd-4c13-97b6-9316ae5b8a7c | {
"language": "C#"
} | ```c#
//Copyright (c) 2016 Artem A. Mavrin and other contributors
using UnrealBuildTool;
public class DialogueSystem : ModuleRules
{
public DialogueSystem(TargetInfo Target)
{
PrivateIncludePaths.AddRange(
new string[] {"DialogueSystem/Private"});
PublicDependencyModuleNames.AddRange(
... | ```c#
//Copyright (c) 2016 Artem A. Mavrin and other contributors
using UnrealBuildTool;
public class DialogueSystem : ModuleRules
{
public DialogueSystem(TargetInfo Target)
{
PrivateIncludePaths.AddRange(
new string[] {"DialogueSystem/Private"});
PublicDependencyModuleNames.AddRange(
... |
52006a6d-7c65-45c1-b600-f7bdc2e88eb2 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using Newtonsoft.Json.Linq;
namespace Microsoft.TemplateEngine.Orchestrator.RunnableProjects.ValueForms
{
public class DefaultSafeNamespaceValueFormModel : IValueForm
{
public DefaultSafeNamespaceValueFormModel(... | ```c#
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using Newtonsoft.Json.Linq;
namespace Microsoft.TemplateEngine.Orchestrator.RunnableProjects.ValueForms
{
public class DefaultSafeNamespaceValueFormModel : IValueForm
{
public DefaultSafeNamespaceValueFormModel(... |
e1e34957-3e34-453c-ae16-8a3292af60dc | {
"language": "C#"
} | ```c#
using System.Collections.Generic;
namespace SFA.DAS.EmployerApprenticeshipsService.Domain.Configuration
{
public class EmployerApprenticeshipsServiceConfiguration
{
public CompaniesHouseConfiguration CompaniesHouse { get; set; }
public EmployerConfiguration Employer { get; set; }
... | ```c#
using System.Collections.Generic;
namespace SFA.DAS.EmployerApprenticeshipsService.Domain.Configuration
{
public class EmployerApprenticeshipsServiceConfiguration
{
public CompaniesHouseConfiguration CompaniesHouse { get; set; }
public EmployerConfiguration Employer { get; set; }
... |
c9747cca-9c64-4ec9-91cd-9aba4081b851 | {
"language": "C#"
} | ```c#
namespace TestMoya.Runner.Runners
{
using System;
using System.Reflection;
using Moq;
using Moya.Attributes;
using Moya.Models;
using Moya.Runner.Runners;
using Xunit;
public class TimerDecoratorTests
{
private readonly Mock<ITestRunner> testRunnerMock;
privat... | ```c#
using System.Threading;
namespace TestMoya.Runner.Runners
{
using System;
using System.Reflection;
using Moq;
using Moya.Attributes;
using Moya.Models;
using Moya.Runner.Runners;
using Xunit;
public class TimerDecoratorTests
{
private readonly Mock<ITestRunner> testR... |
5498b3b2-f11e-485e-abe4-a5eca482e49c | {
"language": "C#"
} | ```c#
@using CGO.Web.Models
@model IEnumerable<SideBarSection>
<div class="span3">
<div class="well sidebar-nav">
<ul class="nav nav-list">
@foreach (var sideBarSection in Model)
{
<li class="nav-header">@sideBarSection.Title</li>
foreach (var link i... | ```c#
@using CGO.Web.Models
@model IEnumerable<SideBarSection>
<div class="col-lg-3">
<div class="well">
<ul class="nav nav-stacked">
@foreach (var sideBarSection in Model)
{
<li class="navbar-header">@sideBarSection.Title</li>
foreach (var link in s... |
1a70820a-27ad-4607-a93b-450296b55be9 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Threading;
namespace Leeroy
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
static void Main(string[] args)
{
if (arg... | ```c#
using System;
using System.Linq;
using System.Runtime.InteropServices;
using System.ServiceProcess;
using System.Threading;
using System.Threading.Tasks;
namespace Leeroy
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
static void Main(string[] args)... |
a69e0add-61e9-4db8-b272-228ec966185d | {
"language": "C#"
} | ```c#
//
// DefaultDirectoryResolver.cs
//
// Copyright (c) 2017 Couchbase, 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/lic... | ```c#
//
// DefaultDirectoryResolver.cs
//
// Copyright (c) 2017 Couchbase, 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/lic... |
b463196f-9910-4ff3-b98e-e1c7fde45614 | {
"language": "C#"
} | ```c#
using System;
using System.IO;
using Manos;
//
// This the default StaticContentModule that comes with all Manos apps
// if you do not wish to serve any static content with Manos you can
// remove its route handler from <YourApp>.cs's constructor and delete
// this file.
//
// All Content placed on the ... | ```c#
using System;
using System.IO;
using Manos;
//
// This the default StaticContentModule that comes with all Manos apps
// if you do not wish to serve any static content with Manos you can
// remove its route handler from <YourApp>.cs's constructor and delete
// this file.
//
// All Content placed on the ... |
f3bd3a7e-d8ee-471f-8342-4281430764a7 | {
"language": "C#"
} | ```c#
using Grpc.Core;
using System;
namespace MagicOnion
{
public class ReturnStatusException : Exception
{
public StatusCode StatusCode { get; private set; }
public string Detail { get; private set; }
public ReturnStatusException(StatusCode statusCode, string detail)
{
... | ```c#
using Grpc.Core;
using System;
namespace MagicOnion
{
public class ReturnStatusException : Exception
{
public StatusCode StatusCode { get; private set; }
public string Detail { get; private set; }
public ReturnStatusException(StatusCode statusCode, string detail)
: ba... |
944f8142-5321-45f8-a546-2dce3bc3462d | {
"language": "C#"
} | ```c#
// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCo... | ```c#
// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCo... |
cdac58ee-7c22-46f4-8670-88ca082808c9 | {
"language": "C#"
} | ```c#
namespace Bumblebee.Interfaces
{
public interface ITextField : IElement, IHasText
{
TCustomResult EnterText<TCustomResult>(string text) where TCustomResult : IBlock;
TCustomResult AppendText<TCustomResult>(string text) where TCustomResult : IBlock;
}
public interface ITextField<o... | ```c#
namespace Bumblebee.Interfaces
{
public interface ITextField : IElement, IHasText
{
TCustomResult EnterText<TCustomResult>(string text) where TCustomResult : IBlock;
TCustomResult AppendText<TCustomResult>(string text) where TCustomResult : IBlock;
}
public interface ITextField<o... |
8a70d1c6-43bd-4817-ac7b-2ce0223ec4f8 | {
"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.ComponentModel;
namespace osu.Game.Screens.Select.Filter
{
public enum SortMode
{
[Description("Artist")]
Artist,
[D... | ```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.ComponentModel;
namespace osu.Game.Screens.Select.Filter
{
public enum SortMode
{
[Description("Artist")]
Artist,
[D... |
591dcd06-7ffc-4d6d-b4b8-1c933936c0a5 | {
"language": "C#"
} | ```c#
//-----------------------------------------------------------------------
// <copyright file="AssemblyInfo.Shared.cs" company="SonarSource SA and Microsoft Corporation">
// Copyright (c) SonarSource SA and Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the ... | ```c#
//-----------------------------------------------------------------------
// <copyright file="AssemblyInfo.Shared.cs" company="SonarSource SA and Microsoft Corporation">
// Copyright (c) SonarSource SA and Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the ... |
8f4c0fb3-5e13-46ee-9214-4cb67dfb2a10 | {
"language": "C#"
} | ```c#
using System.Collections;
using System.Windows.Forms;
namespace GUI.Controls
{
internal class TreeViewFileSorter : IComparer
{
public int Compare(object x, object y)
{
var tx = x as TreeNode;
var ty = y as TreeNode;
var folderx = tx.ImageKey == @"_fol... | ```c#
using System.Collections;
using System.Windows.Forms;
namespace GUI.Controls
{
internal class TreeViewFileSorter : IComparer
{
public int Compare(object x, object y)
{
var tx = x as TreeNode;
var ty = y as TreeNode;
var folderx = tx.Tag is TreeViewFold... |
b25a0d2a-fb65-4ee2-b186-072a29475838 | {
"language": "C#"
} | ```c#
using System;
using System.Net.Http;
using System.Threading.Tasks;
using Ecom.Hal.JSON;
using Newtonsoft.Json;
namespace Ecom.Hal
{
public class HalClient
{
public HalClient(Uri endpoint)
{
Client = new HttpClient {BaseAddress = endpoint};
}
public T Parse<T>(string content)
{
... | ```c#
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using Ecom.Hal.JSON;
using Newtonsoft.Json;
namespace Ecom.Hal
{
public class HalClient
{
public HalClient(Uri endpoint)
{
Client = new HttpClient {BaseAddress = endpoint};... |
f25e5701-90ec-4298-aa39-30f7577bf283 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Caliburn.Micro;
namespace SharpGraphEditor.Models
{
public class ZoomManager : PropertyChangedBase
{
public int MaxZoom { get; } = 2;
public double CurrentZoom { get; private set; }
p... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Caliburn.Micro;
namespace SharpGraphEditor.Models
{
public class ZoomManager : PropertyChangedBase
{
public double MaxZoom { get; } = 2;
public double CurrentZoom { get; private set; }
... |
01c98532-dc2e-4921-b5f6-686ff6e66226 | {
"language": "C#"
} | ```c#
using BatteryCommander.Web.Services;
using FluentScheduler;
using SendGrid.Helpers.Mail;
using System;
using System.Collections.Generic;
namespace BatteryCommander.Web.Jobs
{
public class SqliteBackupJob : IJob
{
private const String Recipient = "mattgwagner+backup@gmail.com"; // TODO Make this ... | ```c#
using BatteryCommander.Web.Services;
using FluentScheduler;
using SendGrid.Helpers.Mail;
using System;
using System.Collections.Generic;
namespace BatteryCommander.Web.Jobs
{
public class SqliteBackupJob : IJob
{
private const String Recipient = "mattgwagner+backup@gmail.com"; // TODO Make this ... |
c6d50ac3-1083-4296-9fce-62025945eefe | {
"language": "C#"
} | ```c#
using RestSharp;
namespace PivotalTrackerDotNet
{
public abstract class AAuthenticatedService
{
protected readonly string m_token;
protected RestClient RestClient;
protected AAuthenticatedService(string token)
{
m_token = token;
RestClie... | ```c#
using RestSharp;
namespace PivotalTrackerDotNet
{
using System;
public abstract class AAuthenticatedService
{
protected readonly string m_token;
protected RestClient RestClient;
protected AAuthenticatedService(string token)
{
m_token = token;
... |
bb75d7e1-d63f-4c32-b75f-871ebefa398d | {
"language": "C#"
} | ```c#
#load nuget:?package=Cake.Recipe&version=1.0.0
Environment.SetVariableNames();
BuildParameters.SetParameters(
context: Context,
buildSystem: BuildSystem,
sourceDirectoryPath: "./src",
title: "TfsUrlParser",
repositoryOwner: "bbtsoftware",
repositoryName: "TfsUrlParser",
appVeyorAcco... | ```c#
#load nuget:?package=Cake.Recipe&version=1.0.0
Environment.SetVariableNames();
BuildParameters.SetParameters(
context: Context,
buildSystem: BuildSystem,
sourceDirectoryPath: "./src",
title: "TfsUrlParser",
repositoryOwner: "bbtsoftware",
repositoryName: "TfsUrlParser",
appVeyorAcco... |
1aa9aa3b-615f-4d06-97dc-808888b6cdf2 | {
"language": "C#"
} | ```c#
/*
* Programmed by Umut Celenli umut@celenli.com
*/
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace MimeBank
{
/// <summary>
/// This is the main class to check the file mime type
/// Header list is loaded once
/// </summary>
publ... | ```c#
/*
* Programmed by Umut Celenli umut@celenli.com
*/
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace MimeBank
{
/// <summary>
/// This is the main class to check the file mime type
/// Header list is loaded once
/// </summary>
public class MimeCh... |
8daabd08-600c-43dd-bcb6-1f3defe8ca88 | {
"language": "C#"
} | ```c#
#if !(LESSTHAN_NET40 || NETSTANDARD1_0)
using System.Runtime.CompilerServices;
#endif
namespace System.Threading
{
public class MonitorEx
{
#if !(LESSTHAN_NET40 || NETSTANDARD1_0)
[MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
#endif
public static void Enter(object obj, ref bool lo... | ```c#
#if !(LESSTHAN_NET40 || NETSTANDARD1_0)
using System.Runtime.CompilerServices;
#endif
namespace System.Threading
{
public static class MonitorEx
{
#if !(LESSTHAN_NET40 || NETSTANDARD1_0)
[MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
#endif
public static void Enter(object obj, ref ... |
4e428138-72ea-45ca-a44a-51b4f05a960e | {
"language": "C#"
} | ```c#
namespace Nancy
{
using System.Collections.Generic;
using System.IO;
public interface ISerializer
{
/// <summary>
/// Whether the serializer can serialize the content type
/// </summary>
/// <param name="contentType">Content type to serialize</param>
... | ```c#
namespace Nancy
{
using System.Collections.Generic;
using System.IO;
public interface ISerializer
{
/// <summary>
/// Whether the serializer can serialize the content type
/// </summary>
/// <param name="contentType">Content type to serialise</param>
... |
8705d51d-2abe-4d17-91d7-6c4a6f017f78 | {
"language": "C#"
} | ```c#
using Microsoft.EntityFrameworkCore;
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate;
using Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork;
using System;
using System.Threading.Tasks;
namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.... | ```c#
using Microsoft.EntityFrameworkCore;
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate;
using Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork;
using Ordering.Domain.Exceptions;
using System;
using System.Threading.Tasks;
namespace Microsoft.eShopOnContainers... |
75960f72-bf78-4913-bcfb-2d6e5af405d2 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace XiboClient.Control
{
class WatchDogManager
{
public static void Start()
{
// Check to see if the WatchDog EXE... | ```c#
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace XiboClient.Control
{
class WatchDogManager
{
public static void Start()
{
// Check to see if the WatchDog EXE... |
bc7d6482-923d-4c91-8c28-21d20c96c9de | {
"language": "C#"
} | ```c#
using System.Linq;
using System.Windows.Forms;
using Bloom.Api;
namespace Bloom.web.controllers
{
class KeybordingConfigApi
{
public void RegisterWithServer(EnhancedImageServer server)
{
server.RegisterEndpointHandler("keyboarding/useLongPress", (ApiRequest request) =>
{
//detect if some keyboa... | ```c#
using System;
using System.Linq;
using System.Windows.Forms;
using Bloom.Api;
namespace Bloom.web.controllers
{
class KeybordingConfigApi
{
public void RegisterWithServer(EnhancedImageServer server)
{
server.RegisterEndpointHandler("keyboarding/useLongPress", (ApiRequest request) =>
{
try
{
... |
7dd3f308-ef22-49f9-99d1-1eaeb7753bf2 | {
"language": "C#"
} | ```c#
using System;
using System.IO;
using System.Reflection;
using Newtonsoft.Json.Linq;
namespace Noobot.Core.Configuration
{
public class ConfigReader : IConfigReader
{
private JObject _currentJObject;
private readonly string _configLocation;
private readonly object _lock = new obje... | ```c#
using System;
using System.IO;
using System.Reflection;
using Newtonsoft.Json.Linq;
namespace Noobot.Core.Configuration
{
public class ConfigReader : IConfigReader
{
private JObject _currentJObject;
private readonly string _configLocation;
private readonly object _lock = new obje... |
57e629f8-fd56-421d-a599-287607827c60 | {
"language": "C#"
} | ```c#
using System;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using Microsoft.Phone.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Media;
using Windows.Storage;
using System.Diagnostics;
using System.IO;
namespace WPCordovaClassLib.Cordova.Commands
{
... | ```c#
using System;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using Microsoft.Phone.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Media;
using Windows.Storage;
using System.Diagnostics;
using System.IO;
namespace WPCordovaClassLib.Cordova.Commands
{
... |
c524a2f7-7450-4071-9514-5b02376429bc | {
"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.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Overlays;
using... | ```c#
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using o... |
4209c579-fb0f-45ab-a795-cfb7c1a18e5d | {
"language": "C#"
} | ```c#
using System;
using Microsoft.AspNetCore.Builder;
using Criteo.Profiling.Tracing;
using Criteo.Profiling.Tracing.Utils;
namespace Criteo.Profiling.Tracing.Middleware
{
public static class TracingMiddleware
{
public static void UseTracing(this IApplicationBuilder app, string serviceName)
{... | ```c#
using System;
using Microsoft.AspNetCore.Builder;
using Criteo.Profiling.Tracing;
using Criteo.Profiling.Tracing.Utils;
using Microsoft.AspNetCore.Http.Extensions;
namespace Criteo.Profiling.Tracing.Middleware
{
public static class TracingMiddleware
{
public static void UseTracing(this IApplicati... |
80cb0c90-3ff1-4769-bf9d-d083c3744470 | {
"language": "C#"
} | ```c#
namespace Translatable.TranslationTest
{
public class MainWindowTranslation : ITranslatable
{
private IPluralBuilder PluralBuilder { get; set; } = new DefaultPluralBuilder();
public string Title { get; private set; } = "Main window title";
public string SampleText { get; private... | ```c#
namespace Translatable.TranslationTest
{
public class MainWindowTranslation : ITranslatable
{
protected IPluralBuilder PluralBuilder { get; set; } = new DefaultPluralBuilder();
public string Title { get; protected set; } = "Main window title";
public string SampleText { get; pro... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.