doc_id stringlengths 36 36 | metadata dict | input stringlengths 28 4.3k | output stringlengths 11 5.45k |
|---|---|---|---|
d9862d65-6509-4973-a53a-7efaa11bb662 | {
"language": "C#"
} | ```c#
using System;
using System.IO;
using System.Reflection;
using NServiceBus;
using NServiceBus.Settings;
static class ScriptLocation
{
public static string FindScriptDirectory(ReadOnlySettings settings)
{
var currentDirectory = GetCurrentDirectory(settings);
return Path.Combine(currentDire... | ```c#
using System;
using System.IO;
using System.Reflection;
using NServiceBus;
using NServiceBus.Settings;
static class ScriptLocation
{
const string ScriptFolder = "NServiceBus.Persistence.Sql";
public static string FindScriptDirectory(ReadOnlySettings settings)
{
var currentDirectory = GetCur... |
c32ffcbc-e168-40fd-a931-b8f9011e2732 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Rhaeo.Mvvm
{
public class ObservableObject
{
}
}```
Implement extracting the property name | ```c#
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ObservableObject.cs" company="Rhaeo">
// Licenced under the MIT licence.
// </copyright>
// <summary>
// Defines the ObservableObject type.
// </summary>
// ------------... |
99a5f6af-e169-41f2-a0d9-b67c5135eab4 | {
"language": "C#"
} | ```c#
// https://www.reddit.com/r/dailyprogrammer/comments/3n55f3/20150930_challenge_234_intermediate_red_squiggles/
//
// Your challenge today is to implement a real time spell checker and indicate where you would throw the red squiggle. For your dictionary use /usr/share/dict/words
//
using System;
using System.Col... | ```c#
// https://www.reddit.com/r/dailyprogrammer/comments/3n55f3/20150930_challenge_234_intermediate_red_squiggles/
//
// Your challenge today is to implement a real time spell checker and indicate where you would throw the red squiggle. For your dictionary use /usr/share/dict/words
//
using System;
using System.Col... |
9421d5dc-55bd-4e1b-99e5-b90bf91c72ef | {
"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 Android.App;
using Android.OS;
using Android.Content.PM;
using Android.Views;
namespace SampleGame.Android
{
[Activity(Label = "SampleGame", ... | ```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 Android.App;
using Android.OS;
using Android.Content.PM;
using Android.Views;
using System;
using Android.Runtime;
using Android.Content.Res;
nam... |
96808a15-4893-4cfe-9270-cd9734dd808f | {
"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... |
9c12c34b-c46e-47d4-8f9a-5c1fb0a95f5b | {
"language": "C#"
} | ```c#
// Copyright (c) 2016-2017 Nicolas Musset. All rights reserved.
// This file is licensed under the MIT license.
// See the LICENSE.md file in the project root for more information.
using System;
using System.Windows.Documents;
using Markdig.Annotations;
using Markdig.Syntax.Inlines;
using Markdig.Wpf;
namespace... | ```c#
// Copyright (c) 2016-2017 Nicolas Musset. All rights reserved.
// This file is licensed under the MIT license.
// See the LICENSE.md file in the project root for more information.
using System;
using System.Windows.Documents;
using Markdig.Annotations;
using Markdig.Syntax.Inlines;
using Markdig.Wpf;
namespace... |
27c3ab60-50ca-49f2-8cd7-21188be5b6b5 | {
"language": "C#"
} | ```c#
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using Newtonsoft.Json;
namespace Swashbuckle.Swagger.Application
{
public class SwaggerSerializerFactory
{
internal static JsonSerializer Create(IOptions<MvcJsonOptions> mvcJsonOptions)
{
// TODO: Should this... | ```c#
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using Newtonsoft.Json;
namespace Swashbuckle.Swagger.Application
{
public class SwaggerSerializerFactory
{
internal static JsonSerializer Create(IOptions<MvcJsonOptions> mvcJsonOptions)
{
// TODO: Should this... |
ce24d6f1-9e81-431b-aa40-7530b958e2b8 | {
"language": "C#"
} | ```c#
using Ninject;
using Ninject.Modules;
using Ninject.Web.Common;
using Raven.Client;
using Raven.Client.Embedded;
namespace CGO.Web.NinjectModules
{
public class RavenModule : NinjectModule
{
public override void Load()
{
Kernel.Bind<IDocumentStore>().ToMethod(_ => Initialise... | ```c#
using Ninject;
using Ninject.Modules;
using Ninject.Web.Common;
using Raven.Client;
using Raven.Client.Embedded;
namespace CGO.Web.NinjectModules
{
public class RavenModule : NinjectModule
{
public override void Load()
{
Kernel.Bind<IDocumentStore>().ToMethod(_ => Initialise... |
b53effa8-cada-4b8a-88cd-1a1f6b7524cc | {
"language": "C#"
} | ```c#
using Conventional.Conventions;
namespace Pirac.Conventions
{
internal class ViewConvention : Convention
{
public ViewConvention()
{
Must.HaveNameEndWith("View").BeAClass();
Should.BeAConcreteClass();
BaseName = t => t.Name.Substring(0, t.Name.Length... | ```c#
using System;
using Conventional.Conventions;
namespace Pirac.Conventions
{
internal class ViewConvention : Convention
{
public ViewConvention()
{
Must.Pass(t => t.IsClass && (t.Name.EndsWith("View") || t.Name == "MainWindow"), "Name ends with View or is named MainWindow");
... |
e725301f-ba51-4c69-8114-f6eb1adc2c0b | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.IO;
using Cake.Core;
using Cake.Core.Configuration;
using Cake.Frosting;
using Cake.NuGet;
public class Program : IFrostingStartup
{
public static int Main(string[] args)
{
// Create the host.
var host = new CakeHo... | ```c#
using System;
using System.Collections.Generic;
using System.IO;
using Cake.Core;
using Cake.Core.Configuration;
using Cake.Frosting;
using Cake.NuGet;
public class Program : IFrostingStartup
{
public static int Main(string[] args)
{
// Create the host.
var host = new CakeHo... |
78665c1c-d05a-4df3-8d39-fe68a77ca3af | {
"language": "C#"
} | ```c#
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
*
* 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... | ```c#
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
*
* 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... |
2ff18159-a1a4-419c-a42c-c24e3aa21a5e | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace Kyru.Core
{
class Config
{
internal readonly string storeDirectory;
internal Config() {
storeDirectory = Path.Combine(System.Windows.Forms.Applicatio... | ```c#
using System;
using System.IO;
namespace Kyru.Core
{
internal sealed class Config
{
internal string storeDirectory;
internal Config()
{
storeDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Kyru", "objects");
}
}
}``` |
432b5494-c2b7-4dcd-9a58-298a18d34054 | {
"language": "C#"
} | ```c#
using System;
using System.IO;
using Mango;
//
// This the default StaticContentModule that comes with all Mango apps
// if you do not wish to serve any static content with Mango 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 Mango;
//
// This the default StaticContentModule that comes with all Mango apps
// if you do not wish to serve any static content with Mango you can
// remove its route handler from <YourApp>.cs's constructor and delete
// this file.
//
// All Content placed on the ... |
5a64561d-8cc0-4e95-8e39-29afe6208c2c | {
"language": "C#"
} | ```c#
using System;
using Mono.Addins;
using Mono.Addins.Description;
[assembly:Addin (
"${ProjectName}",
Namespace = "${ProjectName}",
Version = "1.0"
)]
[assembly:AddinName ("${ProjectName}")]
[assembly:AddinCategory ("${ProjectName}")]
[assembly:AddinDescription ("${ProjectName}")]
[assembly:AddinAuthor ("${A... | ```c#
using System;
using Mono.Addins;
using Mono.Addins.Description;
[assembly:Addin (
"${ProjectName}",
Namespace = "${ProjectName}",
Version = "1.0"
)]
[assembly:AddinName ("${ProjectName}")]
[assembly:AddinCategory ("IDE extensions")]
[assembly:AddinDescription ("${ProjectName}")]
[assembly:AddinAuthor ("${A... |
e85fc94d-0483-41f4-b610-c78cb8a420a0 | {
"language": "C#"
} | ```c#
using Nancy;
using Owin;
namespace Bbl.KnockoutJs
{
public class Startup
{
public void Configuration(IAppBuilder app)
{
app.UseNancy();
}
}
public class IndexModule : NancyModule
{
public IndexModule()
{
Get["/"] = parameters =... | ```c#
using System.IO;
using System.Linq;
using System.Web.Hosting;
using Nancy;
using Owin;
namespace Bbl.KnockoutJs
{
public class Startup
{
public void Configuration(IAppBuilder app)
{
app.UseNancy();
}
}
public class IndexModule : NancyModule
{
priv... |
1bc70bcc-a769-4a8c-bf46-5c96dd8bd9d8 | {
"language": "C#"
} | ```c#
using System;
using System.Diagnostics;
using System.IO;
namespace dotnet_new2
{
public class ProjectCreator
{
public bool CreateProject(string name, string path, Template template)
{
Directory.CreateDirectory(path);
foreach (var file in template.Files)
... | ```c#
using System;
using System.Diagnostics;
using System.IO;
namespace dotnet_new2
{
public class ProjectCreator
{
public bool CreateProject(string name, string path, Template template)
{
Directory.CreateDirectory(path);
if (Directory.GetFileSystemEntries(path).Lengt... |
b035d27a-2aa6-4e97-b262-da7d330ffafa | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
namespace SteamIrcBot
{
class ServiceDispatcher
{
static ServiceDispatcher _instance = new ServiceDispatcher();
public static ServiceDis... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
namespace SteamIrcBot
{
class ServiceDispatcher
{
static ServiceDispatcher _instance = new ServiceDispatcher();
public static ServiceDis... |
f8dfaed9-9dfe-431e-a53c-f3d6ff2e9246 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
namespace Monacs.Core.Unit
{
///<summary>
/// Extensions for <see cref="Result<Unit>" /> type.
///</summary>
public static class Result
{
///<summary>
/// Creates successful <see cref="Result<Unit>" />.
... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
namespace Monacs.Core.Unit
{
///<summary>
/// Extensions for <see cref="Result{Unit}" /> type.
///</summary>
public static class Result
{
///<summary>
/// Creates successful <see cref="Result{Unit}" />.
... |
1918f7be-31e4-450d-b533-d475a0a27c29 | {
"language": "C#"
} | ```c#
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("ProviderModel")]
[assembly: AssemblyDescription("An improvment over the bundled .NET provider model")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Enrique Alejandro Allegretta")]
[assembly: AssemblyPro... | ```c#
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("ProviderModel")]
[assembly: AssemblyDescription("An improvment over the bundled .NET provider model")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Enrique Alejandro Allegretta")]
[assembly: AssemblyPro... |
ef209820-f8c1-4205-8e48-ed653a8c12bc | {
"language": "C#"
} | ```c#
using SOVND.Lib;
using System.IO;
namespace SOVND.Server
{
public class ServerMqttSettings : IMQTTSettings
{
public string Broker { get { return "104.131.87.42"; } }
public int Port { get { return 8883; } }
public string Username
{
get { return File.ReadAllTe... | ```c#
using SOVND.Lib;
using System.IO;
namespace SOVND.Server
{
public class ServerMqttSettings : IMQTTSettings
{
public string Broker { get { return "104.131.87.42"; } }
public int Port { get { return 2883; } }
public string Username
{
get { return File.ReadAllTe... |
ec8ab3d1-320d-431b-8929-bc1e398787af | {
"language": "C#"
} | ```c#
using System;
using System.IO;
using GLib;
using Hyena;
using TagLib.Image;
using TagLib.Xmp;
namespace FSpot.Utils
{
public static class SidecarXmpExtensions
{
/// <summary>
/// Parses the XMP file identified by resource and replaces the XMP
/// tag of file by the parsed da... | ```c#
using System;
using System.IO;
using GLib;
using Hyena;
using TagLib.Image;
using TagLib.Xmp;
namespace FSpot.Utils
{
public static class SidecarXmpExtensions
{
/// <summary>
/// Parses the XMP file identified by resource and replaces the XMP
/// tag of file by the parsed da... |
17401f9a-0f44-4e7f-93c0-f4ecf1948a2d | {
"language": "C#"
} | ```c#
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Collections.Generic;
using NUnit.Framework;
using osu.Framework.Screens;
using osu.Game.Screens.Multi;
using osu.Game.Screens.Multi.Loun... | ```c#
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Collections.Generic;
using NUnit.Framework;
using osu.Framework.Screens;
using osu.Game.Screens.Multi;
using osu.Game.Screens.Multi.Loun... |
3fa20f93-21a2-4bc8-b8d0-b48774aeecdc | {
"language": "C#"
} | ```c#
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.CompilerService... | ```c#
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.CompilerService... |
d592d503-a7a3-46de-b607-0614ae00715c | {
"language": "C#"
} | ```c#
using System;
using System.Linq;
using Android.OS;
using Android.Util;
using Android.Views;
using Android.Widget;
using Toggl.Joey.UI.Adapters;
using ListFragment = Android.Support.V4.App.ListFragment;
namespace Toggl.Joey.UI.Fragments
{
public class RecentTimeEntriesListFragment : ListFragment
{
... | ```c#
using System;
using System.Linq;
using Android.OS;
using Android.Util;
using Android.Views;
using Android.Widget;
using Toggl.Joey.UI.Adapters;
using ListFragment = Android.Support.V4.App.ListFragment;
namespace Toggl.Joey.UI.Fragments
{
public class RecentTimeEntriesListFragment : ListFragment
{
... |
555ea92c-4fe1-411d-a9dd-2fc05250b958 | {
"language": "C#"
} | ```c#
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Orchard.Hosting;
using Orchard.Web;
namespace Orchard.Console
{
public class Program
{
public static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseIISIntegration()
.Use... | ```c#
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Orchard.Hosting;
using Orchard.Web;
namespace Orchard.Console
{
public class Program
{
public static void Main(string[] args)
{
var currentDirectory = Directory.GetCurrentDirectory();
var host = new WebHo... |
da0326ed-8db9-47f0-ae56-9cff17980dce | {
"language": "C#"
} | ```c#
namespace TensorSharp.Operations
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
public class AddIntegerIntegerOperation : IBinaryOperation<int, int, int>
{
public Tensor<int> Evaluate(Tensor<int> tensor1, Tensor<int> tensor2)
... | ```c#
namespace TensorSharp.Operations
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
public class AddIntegerIntegerOperation : IBinaryOperation<int, int, int>
{
public Tensor<int> Evaluate(Tensor<int> tensor1, Tensor<int> tensor2)
... |
9d1cc2a7-672d-43a9-9750-c5a4f5c1bcef | {
"language": "C#"
} | ```c#
namespace SharpMath.Geometry
{
public static class VectorExtensions
{
public static T Negate<T>(this Vector vector) where T : Vector, new()
{
var resultVector = new T();
for (uint i = 0; i < vector.Dimension; ++i)
resultVector[i] = -vector[i];
... | ```c#
using SharpMath.Geometry.Exceptions;
namespace SharpMath.Geometry
{
public static class VectorExtensions
{
public static T Negate<T>(this Vector vector) where T : Vector, new()
{
var resultVector = new T();
if (vector.Dimension != resultVector.Dimension)
... |
55372b33-5813-474b-abc0-064590a549f7 | {
"language": "C#"
} | ```c#
// Copyright 2009 Alp Toker <alp@atoker.com>
// This software is made available under the MIT License
// See COPYING for details
using System;
using NUnit.Framework;
using NDesk.DBus;
namespace NDesk.DBus.Tests
{
[TestFixture]
public class SignatureTest
{
[Test]
public void Parse ()
{
string sigText... | ```c#
// Copyright 2009 Alp Toker <alp@atoker.com>
// This software is made available under the MIT License
// See COPYING for details
using System;
using NUnit.Framework;
using NDesk.DBus;
namespace NDesk.DBus.Tests
{
[TestFixture]
public class SignatureTest
{
[Test]
public void Parse ()
{
string sigText... |
88858e5e-fd73-415b-bb44-98810eb6da07 | {
"language": "C#"
} | ```c#
<h2>What is dotnet signals?</h2>
.NET Signals is a community driven link aggregator for the sharing of knowledge in the .NET community. Our focus is to give the .NET community a place to post ideas and
knowledge as voted by the community while avoiding the clutter found in traditional sources.
<h2>Posts</h2>
<ul... | ```c#
@{
ViewData["Title"] = "Guidelines";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<section>
<h2>What is dotnet signals?</h2>
.NET Signals is a community driven link aggregator for the sharing of knowledge in the .NET community. Our focus is to give the .NET community a place to post ideas and
... |
ac2e7ea8-9287-48a9-b311-1f418029bb73 | {
"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.Reflection;
using System.Runtime.CompilerServices;
//[assembly: AssemblyVersion("0.0.0.*")]
[assembly: AssemblyTitle ("NDesk.DBus")]
[assembly: AssemblyDescription ("D-Bu... | ```c#
// Copyright 2006 Alp Toker <alp@atoker.com>
// This software is made available under the MIT License
// See COPYING for details
using System.Reflection;
using System.Runtime.CompilerServices;
//[assembly: AssemblyVersion("0.0.0.*")]
[assembly: AssemblyTitle ("NDesk.DBus")]
[assembly: AssemblyDescription ("D-Bu... |
ac6620b8-f369-4d59-9682-6bc656c06a0e | {
"language": "C#"
} | ```c#
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Collections.Generic;
using osu.Game.Online.Chat;
namespace osu.Game.Online.API.Requests
{
public class GetUpdatesResponse
{
public L... | ```c#
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Collections.Generic;
using Newtonsoft.Json;
using osu.Game.Online.Chat;
namespace osu.Game.Online.API.Requests
{
public class GetUpdatesResponse... |
ea3e4987-2f5e-4a62-acb8-8634e72a75d0 | {
"language": "C#"
} | ```c#
using System;
using ColossalFramework;
using ColossalFramework.Plugins;
using ICities;
using ModTools.Utils;
using UnityEngine;
namespace ModTools
{
public sealed class ModToolsMod : IUserMod
{
public const string ModToolsName = "ModTools";
public static GameObject MainWindowObject;
... | ```c#
using System;
using ColossalFramework;
using ColossalFramework.Plugins;
using ICities;
using ModTools.Utils;
using UnityEngine;
namespace ModTools
{
public sealed class ModToolsMod : IUserMod
{
public const string ModToolsName = "ModTools";
public static GameObject MainWindowObject;
... |
2c37e677-4a7d-432a-8707-dc108ec3691c | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NTST.ScriptLinkService.Objects;
namespace ScriptLinkCore
{
public partial class ScriptLink
{
/// <summary>
/// Used set required fields
/// </summary>
... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ScriptLinkCore.Objects;
namespace ScriptLinkCore
{
public partial class ScriptLink
{
/// <summary>
/// Used set required fields
/// </summary>
/// <par... |
08f86d20-b6c3-4972-8bdc-ae76c41e42f6 | {
"language": "C#"
} | ```c#
using System;
namespace InfluxDB.Net.Collector.Console
{
static class Program
{
private static InfluxDb _client;
static void Main(string[] args)
{
if (args.Length != 3)
{
//url: http://128.199.43.107:8086
//username: r... | ```c#
using System;
using System.Diagnostics;
using InfluxDB.Net.Models;
namespace InfluxDB.Net.Collector.Console
{
static class Program
{
private static InfluxDb _client;
static void Main(string[] args)
{
if (args.Length != 3)
{
//url: htt... |
c3e39239-8bb4-4ca9-8ffd-f2eda744d444 | {
"language": "C#"
} | ```c#
// Copyright 2021 Maintainers of NUKE.
// Distributed under the MIT License.
// https://github.com/nuke-build/nuke/blob/master/LICENSE
using System;
using System.Linq;
using Nuke.Common.Tooling;
namespace Nuke.Common.Tools.Unity
{
public partial class UnityBaseSettings
{
public override Action<... | ```c#
// Copyright 2021 Maintainers of NUKE.
// Distributed under the MIT License.
// https://github.com/nuke-build/nuke/blob/master/LICENSE
using System;
using System.Linq;
using Nuke.Common.Tooling;
using Nuke.Common.Utilities;
namespace Nuke.Common.Tools.Unity
{
public partial class UnityBaseSettings
{
... |
0962615c-c952-4440-a7ac-8781048aed27 | {
"language": "C#"
} | ```c#
using UnityEngine;
using System.Collections;
public class Nanobot : MonoBehaviour, TimestepManager.TimestepListener {
BulletGridGenerator currentLevel;
public NanobotSchematic schematic;
public int price;
public string id;
// Use this for initialization
void Start() {
currentLevel = ... | ```c#
using UnityEngine;
using System.Collections;
public class Nanobot : MonoBehaviour, TimestepManager.TimestepListener {
BulletGridGenerator currentLevel;
public NanobotSchematic schematic;
public int price;
public string id;
// Use this for initialization
void Start() {
currentLevel = ... |
470b09a4-017b-4d08-bad5-74bd4b7789f5 | {
"language": "C#"
} | ```c#
namespace SimpleLogger.Logging.Formatters
{
internal class DefaultLoggerFormatter : ILoggerFormatter
{
public string ApplyFormat(LogMessage logMessage)
{
return string.Format("{0:dd.MM.yyyy HH:mm}: {1} ln: {2} [{3} -> {4}()]: {5}",
logMessage.DateTi... | ```c#
namespace SimpleLogger.Logging.Formatters
{
internal class DefaultLoggerFormatter : ILoggerFormatter
{
public string ApplyFormat(LogMessage logMessage)
{
return string.Format("{0:dd.MM.yyyy HH:mm}: {1} [line: {2} {3} -> {4}()]: {5}",
logMessage.DateT... |
b9ccbd19-ff01-4590-9d23-71a1da18495b | {
"language": "C#"
} | ```c#
using System.IO;
using System.Reflection;
using NServiceBus.Persistence.Sql.ScriptBuilder;
static class ResourceReader
{
static Assembly assembly = typeof(ResourceReader).GetTypeInfo().Assembly;
public static string ReadResource(BuildSqlDialect sqlDialect, string prefix)
{
var text = $"NSer... | ```c#
using System.IO;
using System.Reflection;
using NServiceBus.Persistence.Sql.ScriptBuilder;
static class ResourceReader
{
static Assembly assembly = typeof(ResourceReader).GetTypeInfo().Assembly;
public static string ReadResource(BuildSqlDialect sqlDialect, string prefix)
{
var text = $"NSer... |
21b207d0-c32b-4754-bade-e8d88b363a73 | {
"language": "C#"
} | ```c#
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"]–FAV Rocks</title>
<link rel="shortcut icon" href="~/favicon.ico" />
<environment names="Development">
<link rel="stylesheet" href=... | ```c#
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"]–FAV Rocks</title>
<link rel="shortcut icon" href="~/favicon.ico" />
<environment names="Development">
<link rel="styl... |
592eb5ca-69aa-4e6f-9346-91a48acba5f2 | {
"language": "C#"
} | ```c#
using System.IO;
using Autofac.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Hosting;
namespace Neo4jManager.Host
{
public class Program
{
public static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseKestrel()
.Conf... | ```c#
using System.IO;
using System.Net;
using Autofac.Extensions.DependencyInjection;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
namespace Neo4jManager.Host
{
public class Program
{
public static void Main(string[] args)
{
var host = WebHost.CreateDefaultBuild... |
70d7e6a3-c590-4516-a411-cd55b00c3215 | {
"language": "C#"
} | ```c#
/*
* Copyright 2012 Xamarin, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or ... | ```c#
/*
* Copyright 2012 Xamarin, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or ... |
e09b7e40-e0f1-4eb1-a6d7-12194c457d3e | {
"language": "C#"
} | ```c#
using System;
using OpenTK.Graphics.OpenGL;
using System.Diagnostics;
using ChamberLib.Content;
namespace ChamberLib.OpenTK
{
public class ShaderStage : IShaderStage
{
public ShaderStage(ShaderContent content)
: this(content.Source, content.Type, content.Name)
{
}
... | ```c#
using System;
using OpenTK.Graphics.OpenGL;
using System.Diagnostics;
using ChamberLib.Content;
using _OpenTK = global::OpenTK;
namespace ChamberLib.OpenTK
{
public class ShaderStage : IShaderStage
{
public ShaderStage(ShaderContent content)
: this(content.Source, content.Type, conte... |
8e9f50dd-f8c2-41fa-ac66-2883afae33f9 | {
"language": "C#"
} | ```c#
namespace Espera.Network
{
public enum ResponseStatus
{
Success,
PlaylistEntryNotFound,
Unauthorized,
MalformedRequest,
NotFound,
NotSupported,
Rejected,
Fatal
}
}```
Add a wrong password status | ```c#
namespace Espera.Network
{
public enum ResponseStatus
{
Success,
PlaylistEntryNotFound,
Unauthorized,
MalformedRequest,
NotFound,
NotSupported,
Rejected,
Fatal,
WrongPassword
}
}``` |
426ff2f5-e03e-4322-ad24-4703ea15b5d8 | {
"language": "C#"
} | ```c#
using System.Web;
using System.Web.Optimization;
namespace Quiz.Web
{
public class BundleConfig
{
// For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new Sc... | ```c#
using System.Web;
using System.Web.Optimization;
namespace Quiz.Web
{
public class BundleConfig
{
// For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new Sc... |
06bdc5e4-046b-4885-9ef8-df997154d220 | {
"language": "C#"
} | ```c#
using System.Linq;
namespace HundredDoors
{
public static class HundredDoors
{
/// <summary>
/// Solves the 100 Doors problem
/// </summary>
/// <returns>An array with 101 values, each representing a door (except 0). True = open</returns>
public static bool[] Solve()
{
// Create our array with ... | ```c#
using System.Linq;
namespace HundredDoors
{
public static class HundredDoors
{
/// <summary>
/// Solves the 100 Doors problem
/// </summary>
/// <returns>An array with 101 values, each representing a door (except 0). True = open</returns>
public static bool[] Solve()
{
// Create our array with ... |
99a61aaf-3876-4979-8f14-d6e6aa53fd7e | {
"language": "C#"
} | ```c#
namespace Espera.Network
{
public enum NetworkSongSource
{
Local = 0,
Youtube = 1,
Remote = 2
}
}```
Rename that to avoid confusion | ```c#
namespace Espera.Network
{
public enum NetworkSongSource
{
Local = 0,
Youtube = 1,
Mobile = 2
}
}``` |
362bc351-0508-4e99-a63a-bb49da2d487d | {
"language": "C#"
} | ```c#
@model IEnumerable<GiveCRM.Models.Member>
@foreach (var member in Model)
{
<a href="javascript:AddDonation(@member.Id);">@member.FirstName @member.LastName @member.PostalCode</a><br />
}```
Remove page styling from Ajax search results. | ```c#
@model IEnumerable<GiveCRM.Models.Member>
@{
Layout = null;
}
@foreach (var member in Model)
{
<p style="margin:0; padding:0;"><a href="javascript:AddDonation(@member.Id);">@member.FirstName @member.LastName @member.PostalCode</a></p>
}``` |
6be45221-2157-4a2f-a8c2-8f7914ab9c6d | {
"language": "C#"
} | ```c#
using Microsoft.AspNet.Abstractions;
namespace KWebStartup
{
public class Startup
{
public void Configuration(IBuilder app)
{
app.Run(async context =>
{
context.Response.ContentType = "text/plain";
await context.Response.WriteAsync("... | ```c#
using Microsoft.AspNet;
using Microsoft.AspNet.Abstractions;
namespace KWebStartup
{
public class Startup
{
public void Configuration(IBuilder app)
{
app.Run(async context =>
{
context.Response.ContentType = "text/plain";
await conte... |
fb50b09f-63ef-4cba-afd7-fa43c583650f | {
"language": "C#"
} | ```c#
using System.Net.Http.Formatting;
using System.Web.Http;
using System.Web.Http.Dispatcher;
using Pablo.Gallery.Logic;
using Pablo.Gallery.Logic.Filters;
using System.Web.Http.Controllers;
using Pablo.Gallery.Logic.Selectors;
namespace Pablo.Gallery
{
public static class WebApiConfig
{
public static void Reg... | ```c#
using System.Net.Http.Formatting;
using System.Web.Http;
using System.Web.Http.Dispatcher;
using Pablo.Gallery.Logic;
using Pablo.Gallery.Logic.Filters;
using System.Web.Http.Controllers;
using Pablo.Gallery.Logic.Selectors;
namespace Pablo.Gallery
{
public static class WebApiConfig
{
public static void Reg... |
5f795f0f-89bb-41db-ba77-9e81a622310a | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.IO;
using TwitchLib;
using TwitchLib.TwitchClientClasses;
using System.Net;
namespace JefBot.Commands
{
internal class CoinPluginCommand : IPluginCommand
{
public string PluginName => "Coin";
public string Command => "coin";
... | ```c#
using System;
using System.Collections.Generic;
using System.IO;
using TwitchLib;
using TwitchLib.TwitchClientClasses;
using System.Net;
namespace JefBot.Commands
{
internal class CoinPluginCommand : IPluginCommand
{
public string PluginName => "Coin";
public string Command => "coin";
... |
c2550dc0-14ea-4bc9-b57b-7f700c0ee11a | {
"language": "C#"
} | ```c#
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Framework.Desktop;
using osu.Framework.Desktop.Platform;
using osu.Framework.Platform;
using osu.Game.Modes;
using osu.Game.Modes.Ca... | ```c#
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Framework.Desktop;
using osu.Framework.Desktop.Platform;
using osu.Framework.Platform;
using osu.Game.Modes;
using osu.Game.Modes.Ca... |
a17d23b9-033e-40f5-8665-f27abbea36ef | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Text;
namespace Contentful.Core.Models.Management
{
/// <summary>
/// Represents the different types available for a <see cref="Field"/>.
/// </summary>
public class SystemFieldTypes
{
/// <summary>
/// Short text.
... | ```c#
using System;
using System.Collections.Generic;
using System.Text;
namespace Contentful.Core.Models.Management
{
/// <summary>
/// Represents the different types available for a <see cref="Field"/>.
/// </summary>
public class SystemFieldTypes
{
/// <summary>
/// Short text.
... |
63a0e6bc-ae1a-4511-b9bf-cda5d43ead35 | {
"language": "C#"
} | ```c#
@model IEnumerable<APFT>
<h2>Units @Html.ActionLink("Add New", "New", "APFT", null, new { @class = "btn btn-default" })</h2>
<table class="table table-striped">
<thead>
<tr>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var model in Model)
... | ```c#
@model IEnumerable<APFT>
<h2>Units @Html.ActionLink("Add New", "New", "APFT", null, new { @class = "btn btn-default" })</h2>
<table class="table table-striped">
<thead>
<tr>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var model in Model)
{
<tr... |
f53256d7-bb69-4083-8b69-ebc9d504baaa | {
"language": "C#"
} | ```c#
using System;
using System.Runtime.CompilerServices;
namespace Mindscape.Raygun4Net
{
public static class APM
{
[ThreadStatic]
private static bool _enabled = false;
[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
public static void Enable()
{
_enabled... | ```c#
using System;
using System.Runtime.CompilerServices;
namespace Mindscape.Raygun4Net
{
public static class APM
{
[ThreadStatic]
private static bool _enabled = false;
[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
public static void Enable()
{
_enabled... |
10ac7175-9ff3-4f27-957b-daa60bf51eef | {
"language": "C#"
} | ```c#
using System;
namespace Tgstation.Server.Api.Rights
{
/// <summary>
/// Rights for <see cref="Models.ConfigurationFile"/>
/// </summary>
[Flags]
public enum ConfigurationRights : ulong
{
/// <summary>
/// User has no rights
/// </summary>
None = 0,
/// <summary>
/// User may read files
/// <... | ```c#
using System;
namespace Tgstation.Server.Api.Rights
{
/// <summary>
/// Rights for <see cref="Models.ConfigurationFile"/>
/// </summary>
[Flags]
public enum ConfigurationRights : ulong
{
/// <summary>
/// User has no rights
/// </summary>
None = 0,
/// <summary>
/// User may read files
/// <... |
07a1893f-f87b-4bf3-a2a4-08020a7f01e6 | {
"language": "C#"
} | ```c#
using System;
using System.IO;
using System.Linq;
namespace DotVVM.Compiler
{
public static class Program
{
private static readonly string[] HelpOptions = new string[] {
"--help", "-h", "-?", "/help", "/h", "/?"
};
public static bool TryRun(FileInfo assembly, Director... | ```c#
using System;
using System.IO;
using System.Linq;
namespace DotVVM.Compiler
{
public static class Program
{
private static readonly string[] HelpOptions = new string[] {
"--help", "-h", "-?", "/help", "/h", "/?"
};
public static bool TryRun(FileInfo assembly, Director... |
acb6fdc2-643c-43a1-b0de-8455b5a2b4e1 | {
"language": "C#"
} | ```c#
namespace FALM.Housekeeping.Constants
{
/// <summary>
/// HkConstants
/// </summary>
public class HkConstants
{
/// <summary>
/// Application
/// </summary>
public class Application
{
/// <summary>Name of the Application</summary>
... | ```c#
namespace FALM.Housekeeping.Constants
{
/// <summary>
/// HkConstants
/// </summary>
public class HkConstants
{
/// <summary>
/// Application
/// </summary>
public class Application
{
/// <summary>Name of the Application</summary>
... |
7909b1c0-e36f-48bf-bb88-7dc68912a36a | {
"language": "C#"
} | ```c#
@using Cats.Models.Hubs
@using Cats.Web.Hub.Helpers
@using Telerik.Web.Mvc.UI
@{
var usr = @Html.GetCurrentUser();
var mdl = new CurrentUserModel(usr);
}
<div align="right">
@{
string title = "";
if(ViewBag.Title != null)
{
title = ViewBag.Title;
}
... | ```c#
@using Cats.Models.Hubs
@using Cats.Web.Hub.Helpers
@using Telerik.Web.Mvc.UI
@{
var usr = @Html.GetCurrentUser();
var mdl = new CurrentUserModel(usr);
}
<div align="right">
@{
string title = "";
if(ViewBag.Title != null)
{
title = ViewBag.Title;
}
... |
11a5e922-8e4b-42da-a3ff-56b499f8b329 | {
"language": "C#"
} | ```c#
@{
Layout = null;
}
<div class="container" style="padding-top: 50px;">
<div class="container">
<div class="panel panel-default">
<div class="panel-body">
<table class="table table-striped table-bordered table-hover">
<thead>
... | ```c#
@{
Layout = null;
}
<div class="container" style="padding-top: 50px;">
<div class="container">
<table class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th></th>
<th... |
535a353b-1227-4ca6-a1de-b0fc13e0b1dc | {
"language": "C#"
} | ```c#
using System.Collections;
using UnityEngine;
using UnityEngine.Networking;
public abstract class GameMessageBase : MessageBase
{
public GameObject NetworkObject;
public GameObject[] NetworkObjects;
protected IEnumerator WaitFor(NetworkInstanceId id)
{
int tries = 0;
while ((NetworkObject = ClientScene.... | ```c#
using System.Collections;
using UnityEngine;
using UnityEngine.Networking;
public abstract class GameMessageBase : MessageBase
{
public GameObject NetworkObject;
public GameObject[] NetworkObjects;
protected IEnumerator WaitFor(NetworkInstanceId id)
{
if (id.IsEmpty())
{
Debug.LogError($"{this} tri... |
422cdb07-54cb-4127-9ac1-252ac6b2747e | {
"language": "C#"
} | ```c#
using Microsoft.Owin;
using Owin;
[assembly: OwinStartupAttribute(typeof(DancingGoat.Startup))]
namespace DancingGoat
{
public partial class Startup
{
public void Configuration(IAppBuilder app)
{
}
}
}```
Set TLS 1.2 as the default potocol | ```c#
using Microsoft.Owin;
using Owin;
using System.Net;
[assembly: OwinStartupAttribute(typeof(DancingGoat.Startup))]
namespace DancingGoat
{
public partial class Startup
{
public void Configuration(IAppBuilder app)
{
// .NET Framework 4.6.1 and lower does not support TLS 1.2 as... |
917a0b64-f721-4602-87e0-fa740079e6f4 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using Cosmos.Build.Common;
using Cosmos.TestRunner.Core;
namespace Cosmos.TestRunner.Full
{
public class DefaultEngineConfiguration : IEngineConfiguration
{
public virtual int AllowedSecondsInKernel => 6000;
public virtual IEnumerable<Run... | ```c#
using System;
using System.Collections.Generic;
using Cosmos.Build.Common;
using Cosmos.TestRunner.Core;
namespace Cosmos.TestRunner.Full
{
public class DefaultEngineConfiguration : IEngineConfiguration
{
public virtual int AllowedSecondsInKernel => 6000;
public virtual IEnumerable<Run... |
1e5913ca-2ac5-423d-b925-808708c5e49c | {
"language": "C#"
} | ```c#
using Moya.Extensions;
using Xunit;
namespace TestMoya.Extensions
{
public class StringExtensionsTests
{
[Fact]
public void StringExtensionsFormatWithWorksWithWorksWithStrings()
{
const string Expected = "Hello world!";
var actual = "{0} {1}".FormatWith("... | ```c#
namespace TestMoya.Extensions
{
using Moya.Extensions;
using Xunit;
public class StringExtensionsTests
{
[Fact]
public void StringExtensionsFormatWithWorksWithWorksWithStrings()
{
const string Expected = "Hello world!";
var actual = "{0} {1}".Form... |
eac641e5-152a-425f-8d08-bb046a80cec0 | {
"language": "C#"
} | ```c#
using NBitcoin;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NTumbleBit.BouncyCastle.Security
{
internal class SecureRandom : Random
{
public SecureRandom()
{
}
public override int Next()
{
return RandomUtils.GetInt... | ```c#
using NBitcoin;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NTumbleBit.BouncyCastle.Security
{
internal class SecureRandom : Random
{
public SecureRandom()
{
}
public override int Next()
{
return RandomUtils.GetInt... |
fc93d716-98b6-4502-9d06-0206cb19c2c1 | {
"language": "C#"
} | ```c#
@model LoginOrRegisterViewModel
@using (Html.BeginForm("Login", "Account", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post,
new { @class="form-signin", @role="form"}))
{
<div class="form-group">
@Html.ValidationSummary(true)
</div>
<h2 class="form-signin-heading dark">Meld u als... | ```c#
@model LoginOrRegisterViewModel
@using (Html.BeginForm("Login", "Account", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post,
new { @class="form-signin", @role="form"}))
{
<div class="form-group">
@Html.ValidationSummary(true)
</div>
<h2 class="form-signin-heading dark">Meld u als... |
e0bc88e2-9910-49d3-ad48-cc47321bc41c | {
"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 BenchmarkDotNet.Attributes;
using osu.Framework.Bindables;
namespace osu.Framework.Benchmarks
{
public class BenchmarkBindableInstantiation... | ```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 BenchmarkDotNet.Attributes;
using osu.Framework.Bindables;
namespace osu.Framework.Benchmarks
{
public class BenchmarkBindableInstantiation... |
d96a5478-3ac2-453c-b55c-2d104a1f5bdc | {
"language": "C#"
} | ```c#
using Newtonsoft.Json;
namespace SyncTrayzor.Syncthing.ApiClient
{
[JsonConverter(typeof(DefaultingStringEnumConverter))]
public enum EventType
{
Unknown,
Starting,
StartupComplete,
Ping,
DeviceDiscovered,
DeviceConnected,
DeviceDisconnected,
... | ```c#
using Newtonsoft.Json;
namespace SyncTrayzor.Syncthing.ApiClient
{
[JsonConverter(typeof(DefaultingStringEnumConverter))]
public enum EventType
{
Unknown,
Starting,
StartupComplete,
Ping,
DeviceDiscovered,
DeviceConnected,
DeviceDisconnected,
... |
1538cea5-cf44-4590-9ee5-f31487608529 | {
"language": "C#"
} | ```c#
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Diagnostics;
using System.IO;
using System.Collections.Sp... | ```c#
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Diagnostics;
using System.IO;
using System.Collections.Sp... |
19df8759-95e5-419a-a3e5-4649a13106e8 | {
"language": "C#"
} | ```c#
using System;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace NQuery.UnitTests
{
[TestClass]
public class SelectStarTests
{
[TestMethod]
public void Binder_DisallowsSelectStarWithoutTables()
{
var syntaxTree = SyntaxTree.ParseQuer... | ```c#
using System;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace NQuery.UnitTests
{
[TestClass]
public class SelectStarTests
{
[TestMethod]
public void SelectStar_Disallowed_WhenNoTablesSpecified()
{
var syntaxTree = SyntaxTree.Parse... |
d5f05693-211e-4247-8b2d-ff6f7b359a66 | {
"language": "C#"
} | ```c#
using System;
using System.Linq;
using Nancy;
namespace Okanshi.Dashboard
{
public class SettingsModule : NancyModule
{
public SettingsModule(IConfiguration configuration)
{
Get["/settings"] = p =>
{
var servers = configuration.GetAll().ToArray();
return View["settings.html", servers];
};... | ```c#
using System;
using System.Linq;
using Nancy;
namespace Okanshi.Dashboard
{
public class SettingsModule : NancyModule
{
public SettingsModule(IConfiguration configuration)
{
Get["/settings"] = p =>
{
var servers = configuration.GetAll().ToArray();
return View["settings.html", servers];
};... |
ba719897-3485-4d60-a6ca-efc99918e6cf | {
"language": "C#"
} | ```c#
@if (Model.DiscountedPrice != Model.Price) {
<b class="inactive-price" style="text-decoration:line-through" title="@T("Was ${0}", Model.Price)">$@Model.Price</b>
<b class="discounted-price" title="@T("Now ${0}", Model.DiscountedPrice)">$@Model.DiscountedPrice</b>
<span class="discount-comment">@Mo... | ```c#
@if (Model.DiscountedPrice != Model.Price)
{
<b class="inactive-price" style="text-decoration:line-through" title="@T("Was {0}", Model.Price.ToString("c"))">@Model.Price.ToString("c")</b>
<b class="discounted-price" title="@T("Now {0}", Model.DiscountedPrice.ToString("c"))">@Model.DiscountedPrice.ToSt... |
c13de7ea-b26c-4c1e-846a-f9bc2f715740 | {
"language": "C#"
} | ```c#
using S22.Xmpp.Client;
using S22.Xmpp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using S22.Xmpp.Im;
namespace XmppConsole
{
class Program
{
static void Main(string[] args)
{
try
{
... | ```c#
using S22.Xmpp.Client;
using S22.Xmpp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using S22.Xmpp.Im;
namespace XmppConsole
{
class Program
{
static void Main(string[] args)
{
try
{
... |
54f60631-590a-43b3-bceb-bc3dac9fd654 | {
"language": "C#"
} | ```c#
<div class="container">
<header class="container">
<h1>Sweet Water Revolver</h1>
</header>
</div>```
Remove the container class from the header, because it was redundant with its containing div. | ```c#
<div class="container">
<header>
<h1>Sweet Water Revolver</h1>
</header>
</div>``` |
ba0017f4-f0a4-4546-bc04-77228fc68bd7 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
namespace PickemApp
{
// Note: For instructions on enabling IIS6 or IIS7 classic mode,
// visit http://go.microsoft.... | ```c#
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using PickemApp.Models;
using PickemApp.Migrations;
namespace PickemApp
{
// Note: For instruct... |
31860e40-6a1c-423a-8fde-19213667aa99 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
namespace Portfolio
{
public class MvcApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
... | ```c#
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
namespace Portfolio
{
public class MvcApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
FilterConfig.RegisterGlobalFil... |
4c89451f-4825-401a-b7b3-dc3f2d5ee7ea | {
"language": "C#"
} | ```c#
using System;
using DemoDistributor.Endpoints.FileSystem;
using DemoDistributor.Endpoints.Sharepoint;
using Delivered;
namespace DemoDistributor
{
internal class Program
{
private static void Main(string[] args)
{
//Configure the distributor
var distributor = new ... | ```c#
using System;
using DemoDistributor.Endpoints.FileSystem;
using DemoDistributor.Endpoints.Sharepoint;
using Delivered;
namespace DemoDistributor
{
internal class Program
{
private static void Main(string[] args)
{
//Configure the distributor
var distributor = new ... |
1547c84f-f0e1-4fdb-801b-7ec97873b813 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Battlezeppelins.Models;
namespace Battlezeppelins.Controllers
{
public abstract class BaseController : Controller
{
private static List<Player> playerList = new List<Player... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Battlezeppelins.Models;
namespace Battlezeppelins.Controllers
{
public abstract class BaseController : Controller
{
private static List<Player> playerList = new List<Player... |
d55cb77c-cd2c-4e37-9a7d-27969754e471 | {
"language": "C#"
} | ```c#
using System.Windows.Controls;
namespace PlantUmlEditor.View
{
public partial class DiagramEditorView : UserControl
{
public DiagramEditorView()
{
InitializeComponent();
}
}
}
```
Maintain focus on the text editor after saving. | ```c#
using System;
using System.Windows.Controls;
namespace PlantUmlEditor.View
{
public partial class DiagramEditorView : UserControl
{
public DiagramEditorView()
{
InitializeComponent();
ContentEditor.IsEnabledChanged += ContentEditor_IsEnabledChanged;
}
void Cont... |
2b597cda-26dc-4694-81a4-d877e2362203 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using Caliburn.Micro;
namespace SharpGraphEditor.ViewModels
{
public class TextViewerViewModel : PropertyChangedBase
{
private string _text;
private bool _canCopy;
private ... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using Caliburn.Micro;
namespace SharpGraphEditor.ViewModels
{
public class TextViewerViewModel : PropertyChangedBase
{
private string _text;
private bool _canCopy;
private ... |
c6502f91-5e31-4a7a-bd95-850bb25f896b | {
"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 UIKit;
namespace osu.iOS
{
public class Application
{
public static void Main(string[] args)
{
UIApplication.Main(args, ... | ```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 UIKit;
namespace osu.iOS
{
public class Application
{
public static void Main(string[] args)
{
UIApplication.Main(args, ... |
9d563bc9-27b7-4fc0-a1eb-c6e3f0b0e682 | {
"language": "C#"
} | ```c#
using System.Collections;
using System.Collections.Generic;
using System.Web;
namespace Mindscape.Raygun4Net.Breadcrumbs
{
internal class HttpBreadcrumbStorage : IRaygunBreadcrumbStorage
{
private const string ItemsKey = "Raygun.Breadcrumbs.Storage";
public IEnumerator<RaygunBreadcrumb> GetEnumerat... | ```c#
using System.Collections;
using System.Collections.Generic;
using System.Web;
namespace Mindscape.Raygun4Net.Breadcrumbs
{
internal class HttpBreadcrumbStorage : IRaygunBreadcrumbStorage
{
private const string ItemsKey = "Raygun.Breadcrumbs.Storage";
public IEnumerator<RaygunBreadcrumb> GetEnumerat... |
315e0453-a548-4ddd-a80d-2f04da5c7822 | {
"language": "C#"
} | ```c#
using RimWorld;
using Verse;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MTW_AncestorSpirits
{
class RoomRoleWorker_ShrineRoom : RoomRoleWorker
{
public override float GetScore(Room room)
{
// I don't know if there should b... | ```c#
using RimWorld;
using Verse;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MTW_AncestorSpirits
{
class RoomRoleWorker_ShrineRoom : RoomRoleWorker
{
public override float GetScore(Room room)
{
// I don't know if there should b... |
8e788b9d-86db-4af7-953e-195c45255e71 | {
"language": "C#"
} | ```c#
// Original Work Copyright (c) Ethan Moffat 2014-2016
// This file is subject to the GPL v2 License
// For additional details, see the LICENSE file
using EOLib.Data.Protocol;
using Microsoft.Practices.Unity;
namespace EOLib.Net.Translators
{
public class PacketTranslatorContainer : IDependencyContainer
{
p... | ```c#
// Original Work Copyright (c) Ethan Moffat 2014-2016
// This file is subject to the GPL v2 License
// For additional details, see the LICENSE file
using EOLib.Data.Login;
using EOLib.Data.Protocol;
using Microsoft.Practices.Unity;
namespace EOLib.Net.Translators
{
public class PacketTranslatorContainer : IDe... |
312c7974-6e6f-49fd-9e5e-e4a3ca2e1f7a | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using Yio.Utilities;
namespace Yio
{
pu... | ```c#
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using Yio.Utilities;
namespace Yio
{
pu... |
16645dd4-f734-42fc-b447-f18f13b2a916 | {
"language": "C#"
} | ```c#
using System;
namespace MarcelloDB.Helpers
{
internal class DataHelper
{
internal static void CopyData(
Int64 sourceAddress,
byte[] sourceData,
Int64 targetAddress,
byte[] targetData)
{
var lengthToCopy = sourceData.Length;
... | ```c#
using System;
namespace MarcelloDB.Helpers
{
internal class DataHelper
{
internal static void CopyData(
Int64 sourceAddress,
byte[] sourceData,
Int64 targetAddress,
byte[] targetData)
{
Int64 lengthToCopy = sourceData.Length;
... |
190d8ee2-5f1d-46f2-b300-a39db46bb2bc | {
"language": "C#"
} | ```c#
using System.Html.Media;
using System.Runtime.CompilerServices;
namespace System.Html {
public partial class Navigator {
[InlineCode("(navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozUserMedia || navigator.msGetUserMedia)({params}, {onsuccess})")]
public static void GetUserMedia(Media... | ```c#
using System.Html.Media;
using System.Runtime.CompilerServices;
namespace System.Html {
public partial class Navigator {
[InlineCode("(navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia).call(navigator, {params}, {onsuccess})")]
public static void... |
bc6ae7fd-e92a-41cf-ae67-d1de3bebafb3 | {
"language": "C#"
} | ```c#
using System;
using System.IO;
using System.Collections;
namespace DeviceMetadataInstallTool
{
/// <summary>
/// see https://support.microsoft.com/en-us/kb/303974
/// </summary>
class MetadataFinder
{
public System.Collections.Generic.List<String> Files = new System.Collections.Gener... | ```c#
using System;
using System.IO;
using System.Collections;
namespace DeviceMetadataInstallTool
{
class Program
{
static void Main(string[] args)
{
var files = new System.Collections.Generic.List<String>();
//Console.WriteLine("Args size is {0}", args.Length);
... |
9847159d-ad29-45d3-8e11-6530c8f32bcc | {
"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
namespace osu.Framework.Platform.Linux
{
using Native;
public class LinuxGameHost : DesktopGameHost
{
internal LinuxGameHost(string... | ```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 osu.Framework.Platform.Linux.Native;
namespace osu.Framework.Platform.Linux
{
public class LinuxGameHost : DesktopGameHost
{
inte... |
e09aa5c3-cd00-46f6-8092-b8c304d918e5 | {
"language": "C#"
} | ```c#
using System.IO;
using OpenSage.Network;
namespace OpenSage.Data.Sav
{
internal static class GameStateMap
{
internal static void Load(SaveFileReader reader, Game game)
{
reader.ReadVersion(2);
var mapPath1 = reader.ReadAsciiString();
var mapPath2 = re... | ```c#
using System.IO;
using OpenSage.Network;
namespace OpenSage.Data.Sav
{
internal static class GameStateMap
{
internal static void Load(SaveFileReader reader, Game game)
{
reader.ReadVersion(2);
var mapPath1 = reader.ReadAsciiString();
var mapPath2 = re... |
9a967d24-9c19-4887-bc0a-18e7fec78a83 | {
"language": "C#"
} | ```c#
namespace Papyrus
{
public static class EBookExtensions
{
}
}
```
Add extension to verify mimetype. | ```c#
using System;
using System.Threading.Tasks;
using Windows.Storage;
namespace Papyrus
{
public static class EBookExtensions
{
public static async Task<bool> VerifyMimetypeAsync(this EBook ebook)
{
var mimetypeFile = await ebook._rootFolder.GetItemAsync("mimetype");
... |
095ded39-92db-4152-878c-b908a356b220 | {
"language": "C#"
} | ```c#
using System.Collections.Generic;
using System.Net;
using AppGet.Http;
using NLog;
namespace AppGet.PackageRepository
{
public class AppGetServerClient : IPackageRepository
{
private readonly IHttpClient _httpClient;
private readonly Logger _logger;
private readonly HttpRequestBu... | ```c#
using System.Collections.Generic;
using System.Net;
using AppGet.Http;
using NLog;
namespace AppGet.PackageRepository
{
public class AppGetServerClient : IPackageRepository
{
private readonly IHttpClient _httpClient;
private readonly Logger _logger;
private readonly HttpRequestBu... |
7a0d051e-543e-4249-95f3-6a122013bc13 | {
"language": "C#"
} | ```c#
using NUnit.Framework;
using System.Collections.Generic;
namespace FunWithNewtonsoft
{
[TestFixture]
public class ListTests
{
[Test]
public void Deserialize_PartialList_ReturnsList()
{
// Assemble
string json = @"
{'Number':'1','Letter'... | ```c#
using Newtonsoft.Json;
using NUnit.Framework;
using System.Collections.Generic;
namespace FunWithNewtonsoft
{
[TestFixture]
public class ListTests
{
[Test]
public void DeserializeObject_JsonList_ReturnsList()
{
// Assemble
string json = @"
... |
1f456308-20f2-4d10-a882-77a6f0523efd | {
"language": "C#"
} | ```c#
using System.Collections.Generic;
using System.Linq;
using GekkoAssembler.IntermediateRepresentation;
namespace GekkoAssembler.Optimizers
{
public class IRMultiUnitOptimizer : IOptimizer
{
public IRCodeBlock Optimize(IRCodeBlock block)
{
var units = block.Units;
... | ```c#
using System.Collections.Generic;
using System.Linq;
using GekkoAssembler.IntermediateRepresentation;
namespace GekkoAssembler.Optimizers
{
public class IRMultiUnitOptimizer : IOptimizer
{
public IRCodeBlock Optimize(IRCodeBlock block)
{
var units = block.Units;
... |
dd58a4b4-e3e1-4f99-b0b6-e438a0931d1f | {
"language": "C#"
} | ```c#
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using osu.Framework.Graphics.Sprites;
using osu.Game.Overlays.Dialog;
namespace osu.Game.Collections
{
public class DeleteCollectionDialog : Popu... | ```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 Humanizer;
using osu.Framework.Graphics.Sprites;
using osu.Game.Overlays.Dialog;
namespace osu.Game.Collections
{
public class DeleteCollec... |
2d4f6db2-347a-47f8-b537-c489c181a141 | {
"language": "C#"
} | ```c#
using UnityEngine;
public class Planet : MonoBehaviour {
[SerializeField]
private float _radius;
public float Radius {
get { return _radius; }
set { _radius = value; }
}
public float Permieter {
get { return 2 * Mathf.PI * Radius; }
}
public void SampleOrbi... | ```c#
using UnityEngine;
public class Planet : MonoBehaviour {
[SerializeField]
private float _radius;
public float Radius {
get { return _radius; }
set { _radius = value; }
}
public float Permieter {
get { return 2 * Mathf.PI * Radius; }
}
public void SampleOrbi... |
9becbced-833b-495e-9417-295dd720640c | {
"language": "C#"
} | ```c#
using System;
namespace ExternalTemplates
{
/// <summary>
/// Default generator options.
/// </summary>
public class GeneratorOptions : IGeneratorOptions
{
/// <summary>
/// Gets the path relative to the web root where the templates are stored.
/// Default is "/Content/templates".
/// </summary>
... | ```c#
using System;
namespace ExternalTemplates
{
/// <summary>
/// Default generator options.
/// </summary>
public class GeneratorOptions : IGeneratorOptions
{
/// <summary>
/// Gets the path relative to the web root where the templates are stored.
/// Default is "/Content/templates".
/// </summary>
... |
254affdd-bb13-4502-81dd-f07fab3b55e3 | {
"language": "C#"
} | ```c#
using FluentMigrator.Runner.Generators.Generic;
namespace FluentMigrator.Runner.Generators.MySql
{
public class MySqlQuoter : GenericQuoter
{
public override string OpenQuote { get { return "`"; } }
public override string CloseQuote { get { return "`"; } }
public override strin... | ```c#
using FluentMigrator.Runner.Generators.Generic;
namespace FluentMigrator.Runner.Generators.MySql
{
public class MySqlQuoter : GenericQuoter
{
public override string OpenQuote { get { return "`"; } }
public override string CloseQuote { get { return "`"; } }
public override strin... |
544a13a7-ccec-4f62-ac03-15acfae99d95 | {
"language": "C#"
} | ```c#
using System;
using Dominion.Rules;
using Dominion.Rules.Activities;
using Dominion.Rules.CardTypes;
namespace Dominion.Cards.Actions
{
public class Chancellor : Card, IActionCard
{
public Chancellor() : base(3)
{
}
public void Play(TurnContext context)
... | ```c#
using System;
using Dominion.Rules;
using Dominion.Rules.Activities;
using Dominion.Rules.CardTypes;
namespace Dominion.Cards.Actions
{
public class Chancellor : Card, IActionCard
{
public Chancellor() : base(3)
{
}
public void Play(TurnContext context)
... |
f9c42ae7-716b-433a-9ad8-afd1211d750b | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Specialized;
using Xunit;
namespace GV.AspNet.Configuration.ConfigurationManager.UnitTests
{
public class AppSettingsConfigurationProviderTests
{
[Theory]
[InlineData("Key1", "Value1")]
[InlineData("Key2", "Value2")]
public void LoadsKeyValuePairsFromA... | ```c#
using System;
using System.Collections.Specialized;
using Microsoft.Extensions.Configuration;
using Xunit;
namespace GV.AspNet.Configuration.ConfigurationManager.UnitTests
{
public class AppSettingsConfigurationProviderTests
{
public class Load
{
[Theory]
[InlineData("", "Value")]
[I... |
69630bdb-763d-436a-bb3f-c78c882a79b6 | {
"language": "C#"
} | ```c#
using System.Linq;
using Bugsnag.Payload;
using Xunit;
namespace Bugsnag.Tests.Payload
{
public class ExceptionTests
{
[Fact]
public void CorrectNumberOfExceptions()
{
var exception = new System.Exception("oh noes!");
var exceptions = new Exceptions(exception, 5);
Assert.Singl... | ```c#
using System.Linq;
using System.Threading.Tasks;
using Bugsnag.Payload;
using Xunit;
namespace Bugsnag.Tests.Payload
{
public class ExceptionTests
{
[Fact]
public void CorrectNumberOfExceptions()
{
var exception = new System.Exception("oh noes!");
var exceptions = new Exceptions(exce... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.