doc_id stringlengths 36 36 | metadata dict | input stringlengths 28 4.3k | output stringlengths 11 5.45k |
|---|---|---|---|
4e70ffc3-d0e8-4b46-9be9-f68f35bda9c5 | {
"language": "C#"
} | ```c#
// Unzip class usage example
// Written by Alexey Yakovlev <yallie@yandex.ru>
// https://github.com/yallie/unzip
using System;
using System.Linq;
namespace Internals
{
internal struct Program
{
private static void Main(string[] args)
{
if (args.Length < 2)
{
Console.WriteLine("Syntax: unzip Arc... | ```c#
// Unzip class usage example
// Written by Alexey Yakovlev <yallie@yandex.ru>
// https://github.com/yallie/unzip
using System;
using System.Linq;
namespace Internals
{
internal struct Program
{
private static void Main(string[] args)
{
if (args.Length < 2)
{
Console.WriteLine("Syntax: unzip Arc... |
40c6f2c8-0786-46ea-a05e-094b327e64ca | {
"language": "C#"
} | ```c#
using System;
namespace Totem.Tracking
{
/// <summary>
/// A timeline event tracked by an index
/// </summary>
public class TrackedEvent
{
public TrackedEvent(string eventType, long eventPosition, Id userId, DateTime eventWhen, string keyType, string keyValue)
{
EventType = eventType;
EventPosi... | ```c#
using System;
namespace Totem.Tracking
{
/// <summary>
/// A timeline event tracked by an index
/// </summary>
public class TrackedEvent
{
protected TrackedEvent()
{}
public TrackedEvent(string eventType, long eventPosition, Id userId, DateTime eventWhen, string keyType, string keyValue)
... |
6b1211a3-0725-4ecb-982e-c832a9d3183f | {
"language": "C#"
} | ```c#
using NLog;
using NLog.Config;
using NLog.Targets;
namespace CoCo
{
internal static class NLog
{
internal static void Initialize()
{
LoggingConfiguration config = new LoggingConfiguration();
FileTarget fileTarget = new FileTarget("File");
FileTarget fi... | ```c#
using System;
using System.IO;
using NLog;
using NLog.Config;
using NLog.Targets;
namespace CoCo
{
internal static class NLog
{
internal static void Initialize()
{
string appDataLocal = $"{Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)}\\CoCo";
... |
1975162d-997f-4156-abab-1df077f1a168 | {
"language": "C#"
} | ```c#
using System.Diagnostics;
using System.IO;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
namespace Cosmos.Build.Tasks
{
public class CreateGrubConfig: Task
{
[Required]
public string TargetDirectory { get; set; }
[Required]
public string BinName { get... | ```c#
using System.Diagnostics;
using System.IO;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
namespace Cosmos.Build.Tasks
{
public class CreateGrubConfig: Task
{
[Required]
public string TargetDirectory { get; set; }
[Required]
public string BinName { get... |
221fe29c-06a8-44fd-ab8b-fa1fabc4867b | {
"language": "C#"
} | ```c#
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNet.Hosting.Internal;
using Microsoft.Fram... | ```c#
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.IO;
using Microsoft.AspNet.Hosting.Internal;
using Microsoft.Framework.ConfigurationModel;
using Microsoft.Framework.De... |
90f56c6a-2059-4374-9a66-3e30964ad1b5 | {
"language": "C#"
} | ```c#
using System;
using Serilog.Events;
namespace Serilog
{
/// <summary>
/// Extension method 'ForContext' for ILogger.
/// </summary>
public static class ForContextExtension
{
/// <summary>
/// Create a logger that enriches log events with the specified property based on log ev... | ```c#
using System;
using Serilog.Events;
namespace Serilog
{
/// <summary>
/// Extension method 'ForContext' for ILogger.
/// </summary>
public static class ForContextExtension
{
/// <summary>
/// Create a logger that enriches log events with the specified property based on log ev... |
159fb694-1d2d-42a1-957a-3d7408e3430c | {
"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.Extensions;
using osu.Framework.Platform;
namespace osu.Framework.Input
{
public class GameWindowTextInput : ITextInputSourc... | ```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.Extensions;
using osu.Framework.Platform;
namespace osu.Framework.Input
{
public class GameWindowTextInput : ITextInputSourc... |
21920554-8f83-4d51-9ac2-95ef6e360be3 | {
"language": "C#"
} | ```c#
namespace Albireo.Otp.ConsoleApplication
{
using System;
public static class Program
{
public static void Main()
{
Console.Title = "One-Time Password Generator";
}
}
}
```
Fix console application window title | ```c#
namespace Albireo.Otp.ConsoleApplication
{
using System;
public static class Program
{
public static void Main()
{
Console.Title = "C# One-Time Password";
}
}
}
``` |
c246b70b-db2c-4d8c-b69f-20144102fa30 | {
"language": "C#"
} | ```c#
using System;
using System.Security.Cryptography;
using Algorithms.Utils;
namespace Algorithms.Search
{
public class BinarySearch
{
public static int IndexOf<T>(T[] a, T v) where T: IComparable<T>
{
var lo = 0;
var hi = a.Length - 1;
int comparison(T a... | ```c#
using System;
using System.Security.Cryptography;
using Algorithms.Utils;
namespace Algorithms.Search
{
public class BinarySearch
{
public static int IndexOf<T>(T[] a, T v) where T: IComparable<T>
{
var lo = 0;
var hi = a.Length - 1;
int comparison(T a... |
54d8489c-018b-4493-87cb-000361891b8f | {
"language": "C#"
} | ```c#
// -----------------------------------------------------------------------
// <copyright file="ReviewController.cs" company="(none)">
// Copyright © 2015 John Gietzen. All Rights Reserved.
// This source is subject to the MIT license.
// Please see license.md for more information.
// </copyright>
// -----... | ```c#
// -----------------------------------------------------------------------
// <copyright file="ReviewController.cs" company="(none)">
// Copyright © 2015 John Gietzen. All Rights Reserved.
// This source is subject to the MIT license.
// Please see license.md for more information.
// </copyright>
// -----... |
24a33d9a-a98c-4c76-9005-aa9d2ea9c158 | {
"language": "C#"
} | ```c#
using System;
using System.Windows.Forms;
namespace CSharpEx.Forms
{
/// <summary>
/// Control extensions
/// </summary>
public static class ControlEx
{
/// <summary>
/// Invoke action if Invoke is requiered.
/// </summary>
public static void InvokeIfRequired<... | ```c#
using System;
using System.Windows.Forms;
namespace CSharpEx.Forms
{
/// <summary>
/// Control extensions
/// </summary>
public static class ControlEx
{
/// <summary>
/// Invoke action if Invoke is requiered.
/// </summary>
public static void InvokeIfRequired<... |
61da026f-8d84-4d5d-9440-de9085914b4d | {
"language": "C#"
} | ```c#
using System;
using DAQ.Environment;
namespace DAQ.HAL
{
/// <summary>
/// This class represents a GPIB controlled Gigatronics 7100 arbitrary waveform generator. It conforms to the Synth
/// interface.
/// </summary>
class Gigatronics7100Synth : Synth
{
public Gigatr... | ```c#
using System;
using DAQ.Environment;
namespace DAQ.HAL
{
/// <summary>
/// This class represents a GPIB controlled Gigatronics 7100 arbitrary waveform generator. It conforms to the Synth
/// interface.
/// </summary>
public class Gigatronics7100Synth : Synth
{
public... |
8b8ecb7d-fecc-44b7-91dd-9a3754c9726d | {
"language": "C#"
} | ```c#
using System;
using System.Windows.Forms;
namespace ProtoScript.Dialogs
{
class SelectBundleDialog : IDisposable
{
private const string kResourceBundleExtension = ".bun";
private readonly OpenFileDialog m_fileDialog;
public SelectBundleDialog()
{
m_fileDialog = new OpenFileDialog
{
InitialD... | ```c#
using System;
using System.Windows.Forms;
namespace ProtoScript.Dialogs
{
class SelectBundleDialog : IDisposable
{
private const string kResourceBundleExtension = ".zip";
private readonly OpenFileDialog m_fileDialog;
public SelectBundleDialog()
{
m_fileDialog = new OpenFileDialog
{
InitialD... |
7874b54a-0de7-4d54-a91f-3653bbd38dbc | {
"language": "C#"
} | ```c#
namespace ExampleGenerator
{
using OxyPlot;
public static class BindingExamples
{
[Export(@"BindingExamples\Example1")]
public static PlotModel Example1()
{
return null;
}
}
}```
Fix example that caused exception | ```c#
namespace ExampleGenerator
{
using OxyPlot;
public static class BindingExamples
{
[Export(@"BindingExamples\Example1")]
public static PlotModel Example1()
{
return new PlotModel { Title = "TODO" };
}
}
}``` |
51b01828-5c1b-4092-93db-0ab7c2558fc4 | {
"language": "C#"
} | ```c#
using System.Collections.Generic;
using System.Linq;
namespace GoldenAnvil.Utility
{
public static class EnumerableUtility
{
public static IEnumerable<T> Append<T>(this IEnumerable<T> items, T value)
{
foreach (T item in items)
yield return item;
yield return value;
}
public static IEnumera... | ```c#
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
namespace GoldenAnvil.Utility
{
public static class EnumerableUtility
{
public static IEnumerable<T> EmptyIfNull<T>(this IEnumerable<T> items)
{
return items ?? Enumerable.Empty<T>();
}
public static IEnum... |
b96b152e-e6c1-4923-b50b-13ecfd897cc6 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using EvoNet.Controls;
using Graph;
using EvoNet.Map;
namespace EvoNet.Forms
{
public partial ... | ```c#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using EvoNet.Controls;
using Graph;
using EvoNet.Map;
namespace EvoNet.Forms
{
public partial ... |
8584dea3-af99-497c-8cc7-02961a080c08 | {
"language": "C#"
} | ```c#
using System;
using System.Diagnostics;
using System.Threading;
namespace RedGate.AppHost.Client
{
internal class ParentProcessMonitor
{
private readonly Action m_OnParentMissing;
private readonly int m_PollingIntervalInSeconds;
private Thread m_PollingThread;
public Par... | ```c#
using System;
using System.Diagnostics;
using System.Runtime.Remoting.Channels;
using System.Threading;
namespace RedGate.AppHost.Client
{
internal class ParentProcessMonitor
{
private readonly Action m_OnParentMissing;
public ParentProcessMonitor(Action onParentMissing)
{
... |
c92da4e2-8582-4715-ac39-8b41c701cc9b | {
"language": "C#"
} | ```c#
@model IEnumerable<alert_roster.web.Models.Message>
@{
ViewBag.Title = "Messages";
}
<div class="jumbotron">
<h1>@ViewBag.Title</h1>
</div>
@foreach (var message in Model)
{
<div class="row">
<div class="col-md-4">
<fieldset>
<legend>
<script... | ```c#
@model IEnumerable<alert_roster.web.Models.Message>
@{
ViewBag.Title = "Notices";
}
<h2>@ViewBag.Title</h2>
@foreach (var message in Model)
{
<div class="row">
<div class="col-md-5">
<fieldset>
<legend>
Posted <script>var d = moment.utc('@message... |
1f5a876a-561a-4cb0-904a-4560c0aad190 | {
"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;
using osu.Framework.Allocation;
using osu.Framework.Platform;
using osu.Game.Configuration;
using osu.Game.Updater;
namespace osu.Game.Overla... | ```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;
using osu.Framework.Allocation;
using osu.Framework.Platform;
using osu.Game.Configuration;
using osu.Game.Updater;
namespace osu.Game.Overla... |
170baf7c-3071-48b4-a80c-5ac1cbde7b24 | {
"language": "C#"
} | ```c#
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using ZWCloud.DWriteCairo;
namespace DWriteCairoTest
{
[TestClass]
public class UnitTestTextFromat
{
[TestMethod]
public void TestTextFormat()
{
const string fontFamilyName = "SimSun";
... | ```c#
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using ZWCloud.DWriteCairo;
namespace DWriteCairoTest
{
[TestClass]
public class UnitTestTextFromat
{
[TestMethod]
public void TestTextFormat()
{
const string fontFamilyName = "SimSun";
... |
cb0664c0-8db8-4f01-bd9a-49431411d946 | {
"language": "C#"
} | ```c#
@model dynamic
@{
ViewBag.Title = "login";
}
<h2>Log in!</h2>
<form method="POST">
@Html.AntiForgeryToken()
Username: @Html.TextBox("Username")<br/>
Password: @Html.Password("Password")<br/>
Remember me @Html.CheckBox("RememberMe")<br />
<input type="submit" value="Log in"/>
</form>```... | ```c#
@model dynamic
@{
ViewBag.Title = "login";
}
<h2>Log in!</h2>
<form method="POST" role="form" id="loginForm" name="loginForm">
@Html.AntiForgeryToken()
<div class="form-group" ng-class="{'has-error': addForm.name.$invalid && addForm.name.$pristine && submitted}">
<label class="col-sm-2 con... |
08f17aff-10b1-4323-aafe-aae12d77fed8 | {
"language": "C#"
} | ```c#
using System;
using Premotion.Mansion.Core;
using Premotion.Mansion.Core.Scripting.TagScript;
using Premotion.Mansion.Web.Portal.Service;
namespace Premotion.Mansion.Web.Portal.ScriptTags
{
/// <summary>
/// Renders the specified block.
/// </summary>
[ScriptTag(Constants.TagNamespaceUri, "renderBlock")]
p... | ```c#
using System;
using Premotion.Mansion.Core;
using Premotion.Mansion.Core.Scripting.TagScript;
using Premotion.Mansion.Web.Portal.Service;
namespace Premotion.Mansion.Web.Portal.ScriptTags
{
/// <summary>
/// Renders the specified block.
/// </summary>
[ScriptTag(Constants.TagNamespaceUri, "renderBlock")]
p... |
96729444-3049-4da3-9a95-70e9e44f7fd8 | {
"language": "C#"
} | ```c#
namespace Tools.Test.Database.Model.Tasks
{
public class DropDatabaseTask : DatabaseTask
{
private readonly string _connectionString;
public DropDatabaseTask(string connectionString)
: base(connectionString)
{
_connectionString = connectionString;
}
... | ```c#
using System.Data.Entity;
using Infrastructure.DataAccess;
namespace Tools.Test.Database.Model.Tasks
{
public class DropDatabaseTask : DatabaseTask
{
private readonly string _connectionString;
public DropDatabaseTask(string connectionString)
: base(connectionString)
{
... |
fb181c55-31ae-498d-a85d-2d05a8db1e7a | {
"language": "C#"
} | ```c#
//-----------------------------------------------------------------------
// <copyright file="ViewModelBase.cs" company="Marimer LLC">
// Copyright (c) Marimer LLC. All rights reserved.
// Website: http://www.lhotka.net/cslanet/
// </copyright>
// <summary>Base class used to create ViewModel objects... | ```c#
//-----------------------------------------------------------------------
// <copyright file="ViewModelBase.cs" company="Marimer LLC">
// Copyright (c) Marimer LLC. All rights reserved.
// Website: http://www.lhotka.net/cslanet/
// </copyright>
// <summary>Base class used to create ViewModel objects... |
969f76e3-31ea-4cc6-9d72-c4b4aa10fe46 | {
"language": "C#"
} | ```c#
using System;
using XPNet;
namespace XPNet.CLR.Template
{
[XPlanePlugin(
name: "My Plugin",
signature: "you.plugins.name",
description: "Describe your plugin here."
)]
public class Plugin : IXPlanePlugin
{
private readonly IXPlaneApi m_api;
... | ```c#
using System;
using XPNet;
namespace XPNet.CLR.Template
{
[XPlanePlugin(
name: "My Plugin",
signature: "you.plugins.name",
description: "Describe your plugin here."
)]
public class Plugin : IXPlanePlugin
{
private readonly IXPlaneApi m_api;
... |
06349dd4-aafa-45eb-8c23-2a796dd76451 | {
"language": "C#"
} | ```c#
using Newtonsoft.Json;
namespace Alexa.NET.Response
{
public class PlainTextOutputSpeech : IOutputSpeech
{
/// <summary>
/// A string containing the type of output speech to render. Valid types are:
/// - "PlainText" - Indicates that the output speech is defined as plain text.
... | ```c#
using Newtonsoft.Json;
namespace Alexa.NET.Response
{
public class PlainTextOutputSpeech : IOutputSpeech
{
[JsonProperty("type")]
[JsonRequired]
public string Type
{
get { return "PlainText"; }
}
[JsonRequired]
[JsonProperty("text")]
... |
d6014ea7-5571-4078-b111-6b72167fa98c | {
"language": "C#"
} | ```c#
using System.IO;
namespace Nustache.Core
{
public class FileSystemTemplateLocator
{
private readonly string _extension;
private readonly string _directory;
public FileSystemTemplateLocator(string extension, string directory)
{
_extension = extensio... | ```c#
using System.IO;
namespace Nustache.Core
{
public class FileSystemTemplateLocator
{
private readonly string _extension;
private readonly string[] _directories;
public FileSystemTemplateLocator(string extension, params string[] directories)
{
_exten... |
310960ad-7116-4c4c-95c5-c047974b758e | {
"language": "C#"
} | ```c#
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable disable
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Filter;
using osu.Game.Rulesets.Mania.Beatmaps;
using osu.Game.Screens.Select;
using osu.Game.Sc... | ```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.Rulesets.Filter;
using osu.Game.Rulesets.Mania.Beatmaps;
using osu.Game.Screens.Select;
using osu.Game.Screens.Select.Filter... |
fb0fbe8b-ac60-4e57-8693-2d1e8727fb70 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CocosSharp;
namespace tests
{
public class SchedulerAutoremove : SchedulerTestLayer
{
public virtual void onEnter()
{
base.OnEnter();
Schedule(autoremove, 0.5f);
... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CocosSharp;
namespace tests
{
public class SchedulerAutoremove : SchedulerTestLayer
{
private float accum;
public override void OnEnter ()
{
base.OnEnter();
Schedule(autoremove, 0.5... |
e89f04b4-4360-45c0-8ff6-756b56fe1625 | {
"language": "C#"
} | ```c#
/*
Copyright (C) 2018 de4dot@gmail.com
This file is part of Iced.
Iced is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) a... | ```c#
/*
Copyright (C) 2018 de4dot@gmail.com
This file is part of Iced.
Iced is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) a... |
5904c2e4-51b1-4864-9719-361aa8354780 | {
"language": "C#"
} | ```c#
using System;
using System.Runtime.InteropServices;
using System.Windows;
using CoCo.UI;
using CoCo.UI.ViewModels;
using Microsoft.VisualStudio.Shell;
namespace CoCo
{
[PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading =true)]
[ProvideOptionPage(typeof(DialogOption), "CoCo", "C... | ```c#
using System;
using System.Runtime.InteropServices;
using System.Windows;
using CoCo.UI;
using CoCo.UI.ViewModels;
using Microsoft.VisualStudio.Shell;
namespace CoCo
{
[PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)]
[ProvideOptionPage(typeof(DialogOption), "CoCo", "... |
5980b07d-7242-4f10-abaf-132e6cc87d59 | {
"language": "C#"
} | ```c#
using System;
using System.Runtime.CompilerServices;
#if NETFX_CORE
namespace HelixToolkit.UWP.Model
#else
namespace HelixToolkit.Wpf.SharpDX.Model
#endif
{
/// <summary>
/// Render order key
/// </summary>
public struct OrderKey : IComparable<OrderKey>
{
public uint Key;
pu... | ```c#
using System;
using System.Runtime.CompilerServices;
#if NETFX_CORE
namespace HelixToolkit.UWP.Model
#else
namespace HelixToolkit.Wpf.SharpDX.Model
#endif
{
/// <summary>
/// Render order key
/// </summary>
public struct OrderKey : IComparable<OrderKey>
{
public uint Key;
pu... |
108cb021-b523-4563-a1e2-2e9a765224e3 | {
"language": "C#"
} | ```c#
using System;
using System.Diagnostics;
using System.IO;
using DspAdpcm.Lib.Adpcm;
using DspAdpcm.Lib.Adpcm.Formats;
using DspAdpcm.Lib.Pcm;
using DspAdpcm.Lib.Pcm.Formats;
namespace DspAdpcm.Cli
{
public static class DspAdpcmCli
{
public static int Main(string[] args)
{
if (... | ```c#
using System;
using System.Diagnostics;
using System.IO;
using DspAdpcm.Lib.Adpcm;
using DspAdpcm.Lib.Adpcm.Formats;
using DspAdpcm.Lib.Pcm;
using DspAdpcm.Lib.Pcm.Formats;
namespace DspAdpcm.Cli
{
public static class DspAdpcmCli
{
public static int Main(string[] args)
{
if (... |
c0f117ee-53b3-4fd2-b44d-7eb7e1793cc7 | {
"language": "C#"
} | ```c#
using BatteryCommander.Web.Models;
using BatteryCommander.Web.Services;
using Microsoft.Extensions.Options;
using System;
using System.Threading.Tasks;
using Xunit;
namespace BatteryCommander.Tests
{
public class AirTableServiceTests
{
private const String AppKey = "";
private const Str... | ```c#
using BatteryCommander.Web.Models;
using BatteryCommander.Web.Services;
using Microsoft.Extensions.Options;
using System;
using System.Threading.Tasks;
using Xunit;
namespace BatteryCommander.Tests
{
public class AirTableServiceTests
{
private const String AppKey = "";
private const Str... |
9c8f15b8-8f5d-408c-833c-f3b219caeb61 | {
"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.
namespace Microsoft.CodeAnalysis.Test.Extensions
{
public static class SemanticModelExtensions
{
public static IOperation GetOperationI... | ```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.
namespace Microsoft.CodeAnalysis.Test.Extensions
{
public static class SemanticModelExtensions
{
public static IOperation GetOperationI... |
59a1ccda-6c78-45ba-8287-a2bfbd608ecb | {
"language": "C#"
} | ```c#
<?xml version="1.0"?>
<!-- RSS generated by Trac v<?cs var:trac.version ?> on <?cs var:trac.time ?> -->
<rss version="2.0">
<channel><?cs
if:project.name_encoded ?>
<title><?cs var:project.name_encoded ?>: Revisions of <?cs var:log.path ?></title><?cs
else ?>
<title>Revisions of <?cs var:log.path ?><... | ```c#
<?xml version="1.0"?>
<!-- RSS generated by Trac v<?cs var:trac.version ?> on <?cs var:trac.time ?> -->
<rss version="2.0">
<channel><?cs
if:project.name_encoded ?>
<title><?cs var:project.name_encoded ?>: Revisions of <?cs var:log.path ?></title><?cs
else ?>
<title>Revisions of <?cs var:log.path ?><... |
fc9250e0-e53a-47e1-a489-ebf5e85d7082 | {
"language": "C#"
} | ```c#
using System.Reflection;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("CakeMail.RestClient")]
[assembly: AssemblyDescription("CakeMail.RestClien... | ```c#
using System.Reflection;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("CakeMail.RestClient")]
[assembly: AssemblyDescription("CakeMail.RestClien... |
f0f73ffb-a6ed-4775-96e0-36b877a01003 | {
"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 osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Graphics;
using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Mania.Objects.Drawabl... | ```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 osu.Framework.Allocation;
using osu.Game.Graphics;
using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Mania.Objects.Drawables;
using osu.Game.Rulesets.Ma... |
6b838471-c93e-43f0-b45e-823ef68a04be | {
"language": "C#"
} | ```c#
using Microsoft.Framework.ConfigurationModel;
using Microsoft.Framework.DependencyInjection;
using System;
namespace Glimpse
{
public static class GlimpseServerServiceCollectionExtensions
{
public static IServiceCollection RunningServer(this IServiceCollection services)
{
Use... | ```c#
using Microsoft.Framework.ConfigurationModel;
using Microsoft.Framework.DependencyInjection;
using System;
namespace Glimpse
{
public static class GlimpseServerServiceCollectionExtensions
{
public static IServiceCollection RunningServer(this IServiceCollection services)
{
ser... |
3abec1f9-7da2-4c21-b8b0-78af15594191 | {
"language": "C#"
} | ```c#
using UnityEngine;
using System.Collections;
using DG.Tweening;
public class GameInit : MonoBehaviour
{
void Awake()
{
// seed Random with current seconds;
Random.seed = (int)System.DateTime.Now.Ticks;
// initialize DOTween before first use.
DOTween.Init(true, true, LogBehaviour.Verbose).SetCapacity(... | ```c#
using UnityEngine;
using System.Collections;
using DG.Tweening;
using Matcha.Lib;
public class GameInit : MonoBehaviour
{
void Awake()
{
// seed Random with current seconds;
Random.seed = (int)System.DateTime.Now.Ticks;
// initialize DOTween before first use.
DOTween.Init(true, true, LogBehaviour.Ver... |
71ad55b6-709f-4e5d-9b6d-2732484f9bd4 | {
"language": "C#"
} | ```c#
namespace SearchingBinaryTree
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
class BinarySearchTree
{
public Node Root { get; private set; }
public void Add(Node node) {
if(Root!=null)... | ```c#
namespace SearchingBinaryTree
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
class BinarySearchTree
{
public Node Root { get; private set; }
public void Add(Node node) {
if(Root!=null)... |
96db0ae1-4e1c-4524-a04d-71c37bc2a12a | {
"language": "C#"
} | ```c#
using System;
using IonFar.SharePoint.Migration;
using Microsoft.SharePoint.Client;
namespace TestApplication.Migrations
{
[Migration(10001)]
public class ShowTitle : IMigration
{
public void Up(ClientContext clientContext, ILogger logger)
{
clientContext.Load(clientConte... | ```c#
using System;
using IonFar.SharePoint.Migration;
using Microsoft.SharePoint.Client;
namespace TestApplication.Migrations
{
[Migration(10001, true)]
public class ShowTitle : IMigration
{
public void Up(ClientContext clientContext, ILogger logger)
{
clientContext.Load(clien... |
c927fae6-670a-49c7-9372-35544cd68886 | {
"language": "C#"
} | ```c#
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using System;
using System.Text.RegularExpressions;
namespace Microsoft.Azure.WebJobs
{
/// <summary>
/// Attribute used to indicate the name to use for... | ```c#
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using System;
using System.Text.RegularExpressions;
namespace Microsoft.Azure.WebJobs
{
/// <summary>
/// Attribute used to indicate the name to use for... |
cc4bda30-517d-4cd9-8565-014d84001ef9 | {
"language": "C#"
} | ```c#
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
namespace AustinSite
{
public class Startup
{
public Startup(IHostingEnvironment env)
... | ```c#
using AustinSite.Repositories;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
namespace AustinSite
{
public class Startup
{
public Star... |
cf01843b-f8d2-4dda-8dc9-5db531b8b7af | {
"language": "C#"
} | ```c#
using System;
namespace TestUtility
{
public partial class TestAssets
{
private class TestProject : ITestProject
{
private bool _disposed;
public string Name { get; }
public string BaseDirectory { get; }
public string Directory { get; }
... | ```c#
using System;
using System.Threading;
namespace TestUtility
{
public partial class TestAssets
{
private class TestProject : ITestProject
{
private bool _disposed;
public string Name { get; }
public string BaseDirectory { get; }
public stri... |
2ce91086-83f7-42ae-9bad-e96030e98dd8 | {
"language": "C#"
} | ```c#
/*
JustMock Lite
Copyright © 2019 Progress Software 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 copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required... | ```c#
/*
JustMock Lite
Copyright © 2019 Progress Software 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 copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required... |
5ccf340f-5f5d-48f7-987a-db06b2f9c2d0 | {
"language": "C#"
} | ```c#
using System;
using Faithlife.Build;
internal static class Build
{
public static int Main(string[] args) => BuildRunner.Execute(args, build =>
{
build.AddDotNetTargets(
new DotNetBuildSettings
{
DocsSettings = new DotNetDocsSettings
{
GitLogin = new GitLoginInfo("ejball", Environment.GetEn... | ```c#
using System;
using Faithlife.Build;
internal static class Build
{
public static int Main(string[] args) => BuildRunner.Execute(args, build =>
{
build.AddDotNetTargets(
new DotNetBuildSettings
{
DocsSettings = new DotNetDocsSettings
{
GitLogin = new GitLoginInfo("ejball", Environment.GetEn... |
9329eec7-e53f-4b7b-aba6-89b7a79ab1a7 | {
"language": "C#"
} | ```c#
using System.Linq;
using Raven.Client.Indexes;
namespace Raven.TimeZones
{
public class ZoneShapesIndex : AbstractIndexCreationTask<ZoneShape>
{
public ZoneShapesIndex()
{
Map = shapes => from shape in shapes
select new
... | ```c#
using System.Linq;
using Raven.Abstractions.Indexing;
using Raven.Client.Indexes;
namespace Raven.TimeZones
{
public class ZoneShapesIndex : AbstractIndexCreationTask<ZoneShape>
{
public ZoneShapesIndex()
{
Map = shapes => from shape in shapes
... |
0219bff1-2cbc-4040-a7ce-c1dcb5123a3e | {
"language": "C#"
} | ```c#
using System;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using EnumsNET;
using Microsoft.Extensions.FileProviders;
namespace SJP.Schematic.Reporting.Html
{
internal class TemplateProvider : ITemplateProvider
{
public string GetTemplate(ReportTemplate template... | ```c#
using System;
using System.IO;
using System.Linq;
using System.Reflection;
using EnumsNET;
using Microsoft.Extensions.FileProviders;
namespace SJP.Schematic.Reporting.Html
{
internal class TemplateProvider : ITemplateProvider
{
public string GetTemplate(ReportTemplate template)
{
... |
70a5bc5b-8b61-488e-b288-a813dd4070b6 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Text;
namespace Alexa.NET.Management.Package
{
public enum ImportStatus
{
FAILED,
IN_PROGRESS,
SUCCEEEDED
}
}
```
Fix import status succeeded spelling error | ```c#
using System;
using System.Collections.Generic;
using System.Text;
namespace Alexa.NET.Management.Package
{
public enum ImportStatus
{
FAILED,
IN_PROGRESS,
SUCCEEDED
}
}
``` |
4eba8c84-ed92-48d6-bf3d-0b41764005e5 | {
"language": "C#"
} | ```c#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class UnlockCursorOnStart : MonoBehaviour
{
void Start()
{
Invoke("unlockCursor", .1f);
}
void unlockCursor()
{
Cursor.lockState = GameController.DefaultCursorMode;
}
}
```
Make curso... | ```c#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class UnlockCursorOnStart : MonoBehaviour
{
[SerializeField]
bool forceOnUpdate = true;
void Start()
{
Invoke("unlockCursor", .1f);
}
void unlockCursor()
{
Cursor.lockState = GameC... |
2311b718-d029-4432-9fee-20f0237773f9 | {
"language": "C#"
} | ```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... | ```c#
@if (Model.DiscountedPrice != Model.Price)
{
<b class="inactive-price" style="text-decoration:line-through" title="@T("Was {0:c}", Model.Price)">@Model.Price.ToString("c")</b>
<b class="discounted-price" title="@T("Now {0:c}", Model.DiscountedPrice)">@Model.DiscountedPrice.ToString("c")</b>
<span... |
f15e50d4-ff2b-42b4-abba-af462771238a | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using RabbitMQ.Client;
using RabbitMQ.Client.Framing;
namespace RawRabbit.Common
{
public interface IBasicPropertiesProvider
{
IBasicProperties GetProperties<TMessage>(Action<IBasicProperties> custom = null);
}
public class BasicPropertiesProvider : IBasicP... | ```c#
using System;
using System.Collections.Generic;
using RabbitMQ.Client;
using RabbitMQ.Client.Framing;
using RawRabbit.Configuration;
namespace RawRabbit.Common
{
public interface IBasicPropertiesProvider
{
IBasicProperties GetProperties<TMessage>(Action<IBasicProperties> custom = null);
}
public class Ba... |
d8cc177d-cfbd-4ebd-8139-8c2ed8866fe0 | {
"language": "C#"
} | ```c#
#region Using
using System;
using System.Numerics;
using Emotion.Graphics.Objects;
using Emotion.Primitives;
#endregion
namespace Emotion.Plugins.ImGuiNet
{
public static class ImGuiExtensions
{
public static Tuple<Vector2, Vector2> GetImGuiUV(this Texture t, Rectangle? uv = null)
{
... | ```c#
#region Using
using System;
using System.Numerics;
using Emotion.Graphics;
using Emotion.Graphics.Objects;
using Emotion.Primitives;
using ImGuiNET;
#endregion
namespace Emotion.Plugins.ImGuiNet
{
public static class ImGuiExtensions
{
public static Tuple<Vector2, Vector2> GetImGuiUV(this Textu... |
ee3815e3-1c87-43fe-9782-a9ea63a864a2 | {
"language": "C#"
} | ```c#
namespace AngleSharp.Core.Tests.Library
{
using AngleSharp.Core.Tests.Mocks;
using AngleSharp.Dom.Html;
using AngleSharp.Extensions;
using NUnit.Framework;
using System;
using System.Threading.Tasks;
[TestFixture]
public class PageImportTests
{
[Test]
public a... | ```c#
namespace AngleSharp.Core.Tests.Library
{
using AngleSharp.Core.Tests.Mocks;
using AngleSharp.Dom.Html;
using AngleSharp.Extensions;
using NUnit.Framework;
using System;
using System.Threading.Tasks;
[TestFixture]
public class PageImportTests
{
[Test]
public a... |
25473fea-d345-428b-a99c-845589bde2cf | {
"language": "C#"
} | ```c#
@model PagedList.IPagedList<DynThings.Data.Models.Endpoint>
<table class="table striped hovered border bordered">
<thead>
<tr>
<th>Title</th>
<th>Type</th>
<th>GUID</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var item in Model... | ```c#
@model PagedList.IPagedList<DynThings.Data.Models.Endpoint>
<table class="table striped hovered border bordered">
<thead>
<tr>
<th>Title</th>
<th>Type</th>
<th>Device</th>
<th>Thing</th>
<th></th>
</tr>
</thead>
<tbody>
... |
bee1e696-968f-4f66-aaef-547125ae2000 | {
"language": "C#"
} | ```c#
using LiteDB;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.FileProviders;
namespace TIKSN.Data.LiteDB
{
/// <summary>
/// Create LiteDB database
/// </summary>
public class LiteDbDatabaseProvider : ILiteDbDatabaseProvider
{
private readonly IConfigurationRo... | ```c#
using LiteDB;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.FileProviders;
namespace TIKSN.Data.LiteDB
{
/// <summary>
/// Create LiteDB database
/// </summary>
public class LiteDbDatabaseProvider : ILiteDbDatabaseProvider
{
private readonly IConfiguration _... |
fa3988cc-a6a9-4c4d-999f-1d39700d034a | {
"language": "C#"
} | ```c#
/*
* SDB - Mono Soft Debugger Client
* Copyright 2013 Alex Rønne Petersen
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) an... | ```c#
/*
* SDB - Mono Soft Debugger Client
* Copyright 2013 Alex Rønne Petersen
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) an... |
11bc27ea-8bf1-449f-a8a1-a4a95986ec07 | {
"language": "C#"
} | ```c#
using System.Diagnostics;
namespace Cams
{
public static class VideoConverter
{
public static bool CodecCopy(string inputFile, string outputFile)
{
return Run($"-y -i {inputFile} -codec copy {outputFile}");
}
public static bool Concat(string listFilePath, string outputFile)
{
return Run($"-y ... | ```c#
using System.Diagnostics;
namespace Cams
{
public static class VideoConverter
{
public static bool CodecCopy(string inputFile, string outputFile)
{
return Run($"-y -i {inputFile} -codec copy {outputFile}");
}
public static bool Concat(string listFilePath, string outputFile)
{
return Run($"-y ... |
95e17268-0152-4878-bdec-bbaf5fe2e659 | {
"language": "C#"
} | ```c#
using System;
namespace $safeprojectname$
{
public class Program
{
public static void Main()
{
}
}
}
```
Update application template with working code to prevent the main thread from exiting | ```c#
using System;
namespace $safeprojectname$
{
public class Program
{
public static void Main()
{
// Insert your code below this line
// The main() method has to end with this infinite loop.
// Do not use the NETMF style : Thread.Sleep(Timeout.Infinite)
while (tru... |
2d2b113f-2ef8-4e08-a4c2-3243a670579e | {
"language": "C#"
} | ```c#
namespace PcscDotNet
{
public class PcscConnection
{
public PcscContext Context { get; private set; }
public IPcscProvider Provider { get; private set; }
public string ReaderName { get; private set; }
public PcscConnection(PcscContext context, string readerName)
... | ```c#
using System;
namespace PcscDotNet
{
public class PcscConnection : IDisposable
{
public PcscContext Context { get; private set; }
public SCardHandle Handle { get; private set; }
public bool IsConnect => Handle.HasValue;
public bool IsDisposed { get; private set; } = fal... |
7b36d4e6-d352-4a8b-96e7-59f4f39321f4 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using Castle.Core;
namespace Orchard.Caching {
public class DefaultCacheHolder : ICacheHolder {
private readonly IDictionary<CacheKey, object> _caches = new Dictionary<CacheKey, object>();
class CacheKey : Pair<Type, Pair<Type, Type>> {... | ```c#
using System;
using System.Collections.Concurrent;
namespace Orchard.Caching {
public class DefaultCacheHolder : ICacheHolder {
private readonly ConcurrentDictionary<CacheKey, object> _caches = new ConcurrentDictionary<CacheKey, object>();
class CacheKey : Tuple<Type, Type, Type> {
... |
3ed825f4-a4b0-4ad6-82e7-c738938daa4f | {
"language": "C#"
} | ```c#
using System;
using System.Linq;
namespace Gherkin.AstGenerator
{
class Program
{
static int Main(string[] args)
{
if (args.Length < 1)
{
Console.WriteLine("Usage: Gherkin.AstGenerator.exe test-feature-file.feature");
re... | ```c#
using System;
using System.Linq;
namespace Gherkin.AstGenerator
{
class Program
{
static int Main(string[] args)
{
if (args.Length < 1)
{
Console.WriteLine("Usage: Gherkin.AstGenerator.exe test-feature-file.feature");
re... |
c3a01de1-272b-45bb-b552-8de06e4473e0 | {
"language": "C#"
} | ```c#
using Content.Client.Utility;
using Robust.Client.Graphics;
using Robust.Client.Interfaces.ResourceManagement;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.IoC;
namespace Content.Client.UserInterface
{
/// <summary>
/// The status effects display ... | ```c#
using Content.Client.Utility;
using Robust.Client.Graphics;
using Robust.Client.Interfaces.ResourceManagement;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.IoC;
namespace Content.Client.UserInterface
{
/// <summary>
/// The status effects display ... |
097bedaa-40c6-463d-85cc-115e2bc00346 | {
"language": "C#"
} | ```c#
using System;
namespace RapidCore.Locking
{
/// <summary>
/// When implemented in a downstream locker provider, this instance contains a handle to the underlying lock instance
/// </summary>
public interface IDistributedAppLock : IDisposable
{
/// <summary>
/// The name of the... | ```c#
using System;
namespace RapidCore.Locking
{
/// <summary>
/// When implemented in a downstream locker provider, this instance contains a handle to the underlying lock instance
/// </summary>
public interface IDistributedAppLock : IDisposable
{
/// <summary>
/// The name of the... |
5fccb709-f2c0-4842-8862-39616f3961ee | {
"language": "C#"
} | ```c#
/* Empiria Extensions ****************************************************************************************
* *
* Module : Cognitive Services Component : Service provider ... | ```c#
/* Empiria Extensions ****************************************************************************************
* *
* Module : Cognitive Services Component : Service provider ... |
1f3f0b35-85ff-446a-90e0-c5ff334bbf83 | {
"language": "C#"
} | ```c#
// Copyright(c) 2017 Google 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(c) 2017 Google 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... |
b1a5d08d-3e40-4861-a519-1ca286864e81 | {
"language": "C#"
} | ```c#
using TAP;
using System;
using System.Net;
public class TAPCfgTest {
private static void Main(string[] args) {
EthernetDevice dev = new EthernetDevice();
dev.Start("Device name");
Console.WriteLine("Got device name: {0}", dev.DeviceName);
dev.MTU = 1280;
dev.SetAddress(IPAddress.Parse("192.168.1.1"),... | ```c#
using TAP;
using System;
using System.Net;
public class TAPCfgTest {
private static void Main(string[] args) {
EthernetDevice dev = new EthernetDevice();
dev.Start("Device name");
Console.WriteLine("Got device name: {0}", dev.DeviceName);
dev.MTU = 1280;
dev.SetAddress(IPAddress.Parse("192.168.1.1"),... |
ee69b63f-d7d0-4495-b3fa-9bf2e1f22b13 | {
"language": "C#"
} | ```c#
using System;
using System.Threading.Tasks;
using System.IO;
using System.Net;
using Newtonsoft.Json;
namespace apod_api
{
public sealed class APOD_API
{
public APOD_API()
{
date = DateTime.Today;
}
public void sendRequest()
{
generateURL()... | ```c#
using System;
using System.Threading.Tasks;
using System.IO;
using System.Net;
using Newtonsoft.Json;
namespace apod_api
{
public sealed class APOD_API
{
public APOD_API()
{
date = DateTime.Today;
}
public void sendRequest()
{
generateURL()... |
57bee3d2-379d-4733-8d92-8dc11abb17a1 | {
"language": "C#"
} | ```c#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SoundSpawn : MonoBehaviour
{
public AudioSource audioSource;
//We need to handle this manually to prevent multiple requests grabbing sound pool items in the same frame
public bool isPlaying = false;
private float wai... | ```c#
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SoundSpawn : MonoBehaviour
{
public AudioSource audioSource;
//We need to handle this manually to prevent multiple requests grabbing sound pool items in the same frame
public bool isPlaying = false;
pri... |
47dc86b7-b813-4878-bc10-e105dfd7b720 | {
"language": "C#"
} | ```c#
// Copyright 2014 Ron Griffin, ...
//
// 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 ... | ```c#
// Copyright 2014 Ron Griffin, ...
//
// 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 ... |
2fcaf52b-e7cd-4aea-aa28-9cc56d105b08 | {
"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.Platform;
using osu.Game.Configuration;
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.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Platform;
using osu.Game;
using osu.Game.Configura... |
30e1c097-c21c-4cac-a7c6-ac892d542a20 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
namespace Eco.Variables
{
public class PublicIpVariable : IVariableProvider
{
string _lastIp;
DateTime _lastUpdate;
public Dictionary<string, Fun... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
namespace Eco.Variables
{
public class PublicIpVariable : IVariableProvider
{
string _lastIp;
DateTime _lastUpdate;
public Dictionary<string, Fun... |
1639cf56-cfa3-44e0-a2d2-bdc5f7ee4c04 | {
"language": "C#"
} | ```c#
using System.IO;
using Xunit;
namespace TfsHipChat.Tests
{
public class TfsIdentityTests
{
[Fact]
public void Url_ShouldReturnTheServerUrl_WhenDeserializedByValidXml()
{
const string serverUrl = "http://some-tfs-server.com";
const string tfsIden... | ```c#
using System.IO;
using Xunit;
namespace TfsHipChat.Tests
{
public class TfsIdentityTests
{
[Fact]
public void Url_ShouldReturnTheServerUrl_WhenDeserializedUsingValidXml()
{
const string serverUrl = "http://some-tfs-server.com";
const string tfsI... |
12a617cd-f2a4-4304-8267-91b628253d24 | {
"language": "C#"
} | ```c#
namespace LoadTests
{
using System;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
using EasyConsole;
using SqlStreamStore.Streams;
public class ReadAll : LoadTest
{
protected override async Task RunAsync(CancellationToken ct)
{
... | ```c#
namespace LoadTests
{
using System;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
using EasyConsole;
using SqlStreamStore.Streams;
public class ReadAll : LoadTest
{
protected override async Task RunAsync(CancellationToken ct)
{
... |
e20e0a03-51c3-483d-9f22-19fa71d51c0b | {
"language": "C#"
} | ```c#
using System;
using System.Threading.Tasks;
using static System.Console;
namespace AsyncLambda
{
class Program
{
static async Task Main()
{
WriteLine("Started");
try
{
Process(async () =>
{
await Task... | ```c#
using System;
using System.Threading.Tasks;
using static System.Console;
namespace AsyncLambda
{
class Program
{
static async Task Main()
{
WriteLine("Started");
try
{
Process(async () =>
{
await Task... |
098e65d3-13ed-46f5-8c5a-38840bce1eba | {
"language": "C#"
} | ```c#
// Copyright (c) The Avalonia Project. All rights reserved.
// Licensed under the MIT license. See licence.md file in the project root for full license information.
using Avalonia.Visuals.Media.Imaging;
namespace Avalonia.Media
{
public class RenderOptions
{
/// <summary>
/// Defines t... | ```c#
// Copyright (c) The Avalonia Project. All rights reserved.
// Licensed under the MIT license. See licence.md file in the project root for full license information.
using Avalonia.Visuals.Media.Imaging;
namespace Avalonia.Media
{
public class RenderOptions
{
/// <summary>
/// Defines t... |
32b0f9c7-3200-4099-8c61-f65811a89e9e | {
"language": "C#"
} | ```c#
using System.Drawing;
using System.Windows;
namespace NetSparkle.TestAppWPF
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
private Sparkle _sparkle;
public MainWindow()
{
... | ```c#
using System.Drawing;
using System.Windows;
namespace NetSparkle.TestAppWPF
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
private Sparkle _sparkle;
public MainWindow()
{
... |
6cb30cd6-0c82-4e90-a1c0-2db95538f0aa | {
"language": "C#"
} | ```c#
using System;
namespace AutoQueryable.Models.Enums
{
[Flags]
public enum ClauseType : short
{
Select = 1 << 1,
Top = 1 << 2,
Take = 1 << 3,
Skip = 1 << 4,
OrderBy = 1 << 5,
OrderByDesc = 1 << 6,
Include = 1 << 7,
GroupBy = 1 << 8,
... | ```c#
using System;
namespace AutoQueryable.Models.Enums
{
[Flags]
public enum ClauseType : short
{
Select = 1 << 1,
Top = 1 << 2,
Take = 1 << 3,
Skip = 1 << 4,
OrderBy = 1 << 5,
OrderByDesc = 1 << 6,
GroupBy = 1 << 8,
First = 1 << 9,
... |
bd0ac1dd-73ae-47a9-abc2-ccded4b03368 | {
"language": "C#"
} | ```c#
using System.Windows.Input;
namespace DesktopWidgets.Events
{
internal class WidgetMouseDownEvent : WidgetEventBase
{
public MouseButton MouseButton { get; set; }
}
}```
Fix "Widget Mouse Down" event property friendly names | ```c#
using System.ComponentModel;
using System.Windows.Input;
namespace DesktopWidgets.Events
{
internal class WidgetMouseDownEvent : WidgetEventBase
{
[DisplayName("Mouse Button")]
public MouseButton MouseButton { get; set; }
}
}``` |
964ed5cd-4e0d-47f4-956d-956fea6b2166 | {
"language": "C#"
} | ```c#
using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle("Xamarin.Social")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]... | ```c#
using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle("Xamarin.Social")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]... |
81abf3ac-ebac-42ed-8e66-3a4c98e3c184 | {
"language": "C#"
} | ```c#
using System;
using MonoTouch.UIKit;
using MonoTouch.Foundation;
namespace Example_Drawing
{
[Register("AppDelegate")]
public class AppDelegate : UIApplicationDelegate
{
#region -= declarations and properties =-
protected UIWindow window;
protected UINavigationController mainNavController;
protecte... | ```c#
using System;
using MonoTouch.UIKit;
using MonoTouch.Foundation;
namespace Example_Drawing
{
[Register("AppDelegate")]
public class AppDelegate : UIApplicationDelegate
{
#region -= declarations and properties =-
protected UIWindow window;
protected UINavigationController mainNavController;
protecte... |
794eaf4a-f121-4783-9201-55a9833c87e1 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SGEnviro;
namespace SGEnviroTest
{
[TestClass]
public class ApiTest
{
private string apiKe... | ```c#
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SGEnviro;
namespace SGEnviroTest
{
[TestClass]
public class ApiTest
{
private string apiKe... |
37eeb6f3-3db3-4cd4-905a-bc7649fdfd01 | {
"language": "C#"
} | ```c#
using System;
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("RestKit")]
[assembly: AssemblyDescription("SIMPLE http client wrapper that eliminates the boilerplate code you don't want to write.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[ass... | ```c#
using System;
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("RestKit")]
[assembly: AssemblyDescription("SIMPLE http client wrapper that eliminates the boilerplate code you don't want to write.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[ass... |
bcb580d2-ef48-4ce1-a81a-88e955d1f9b7 | {
"language": "C#"
} | ```c#
using CommandLine;
namespace ProcessGremlinApp
{
public class ArgumentParser
{
public bool TryParse(string[] args, out Arguments arguments)
{
string invokedVerb = null;
object invokedVerbInstance = null;
var options = new Options();
if (Par... | ```c#
using CommandLine;
namespace ProcessGremlinApp
{
public class ArgumentParser
{
public bool TryParse(string[] args, out Arguments arguments)
{
if (args != null && args.Length != 0)
{
string invokedVerb = null;
object invokedVerbInstan... |
529feb93-9c8e-4550-8326-aec134537bee | {
"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... |
7831cbcb-ab40-401d-80af-09cb62b19750 | {
"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... |
e115faf3-9bf9-4408-bb17-0187ed822f1e | {
"language": "C#"
} | ```c#
namespace Parsley;
partial class Grammar
{
public static Parser<string> Keyword(string word)
{
if (word.Any(ch => !char.IsLetter(ch)))
throw new ArgumentException("Keywords may only contain letters.", nameof(word));
return input =>
{
var peek = input.Peek(... | ```c#
namespace Parsley;
partial class Grammar
{
public static Parser<string> Keyword(string word)
{
if (word.Any(ch => !char.IsLetter(ch)))
throw new ArgumentException("Keywords may only contain letters.", nameof(word));
return input =>
{
var peek = input.Peek(... |
160e4114-256c-472d-8c77-78a0b784c7ab | {
"language": "C#"
} | ```c#
using System;
using System.Diagnostics;
using System.IO;
using System.Windows;
using Windows.ApplicationModel;
namespace EarTrumpet.Extensions
{
public static class AppExtensions
{
public static Version GetVersion(this Application app)
{
if (HasIdentity(app))
{
... | ```c#
using System;
using System.Diagnostics;
using System.IO;
using System.Windows;
using Windows.ApplicationModel;
using EarTrumpet.Diagnosis;
namespace EarTrumpet.Extensions
{
public static class AppExtensions
{
public static Version GetVersion(this Application app)
{
if (HasIde... |
7d8b5e53-8731-433c-9dc2-041d8c193049 | {
"language": "C#"
} | ```c#
using System;
using UnityEditor;
using UnityEngine;
namespace Alensia.Core.UI
{
public static class ComponentFactory
{
[MenuItem("GameObject/UI/Alensia/Button", false, 10)]
public static Button CreateButton(MenuCommand command) => CreateComponent(command, Button.CreateInstance);
... | ```c#
using System;
using UnityEditor;
using UnityEngine;
namespace Alensia.Core.UI
{
public static class ComponentFactory
{
[MenuItem("GameObject/UI/Alensia/Label", false, 10)]
public static Label CreateLabel(MenuCommand command) => CreateComponent(command, Label.CreateInstance);
[Men... |
e8b3c79d-cfba-4cfe-ab58-24dad873ce3b | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
namespace Eco.Variables
{
public class PublicIpVariable : IVariableProvider
{
public Dictionary<string, Func<string>> GetVariables()
{
return ... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
namespace Eco.Variables
{
public class PublicIpVariable : IVariableProvider
{
string _lastIp;
DateTime _lastUpdate;
public Dictionary<string, Fun... |
d768d980-41f5-43f8-a978-e28683705e60 | {
"language": "C#"
} | ```c#
using Andromeda2D.Entities;
using Andromeda2D.Entities.Components;
using Andromeda2D.Entities.Components.Internal;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Andromeda.Entities.Components
{
/// <summary>
/// A controller... | ```c#
using Andromeda2D.Entities;
using Andromeda2D.Entities.Components;
using Andromeda2D.Entities.Components.Internal;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Andromeda.Entities.Components
{
/// <summary>
/// A controller... |
2809e207-b873-4caa-85fd-e5465eace348 | {
"language": "C#"
} | ```c#
using System;
using System.ServiceModel;
namespace MultiMiner.Remoting.Server
{
public class RemotingServer
{
private bool serviceStarted = false;
private ServiceHost myServiceHost = null;
public void Startup()
{
Uri baseAddress = new Uri("net.tcp://l... | ```c#
using System;
using System.ServiceModel;
namespace MultiMiner.Remoting.Server
{
public class RemotingServer
{
private bool serviceStarted = false;
private ServiceHost myServiceHost = null;
public void Startup()
{
Uri baseAddress = new Uri("net.tcp://l... |
70c62b58-2738-4bb4-aac7-9f36edd11eab | {
"language": "C#"
} | ```c#
using System;
using Gtk;
namespace VideoAggregator
{
class MainClass
{
public static void Main (string[] args)
{
Application.Init ();
MainWindow win = new MainWindow ();
win.Show ();
Application.Run ();
}
}
}
```
Make program maximized on start | ```c#
using System;
using Gtk;
namespace VideoAggregator
{
class MainClass
{
public static void Main (string[] args)
{
Application.Init ();
MainWindow win = new MainWindow ();
win.Maximize ();
win.Show ();
Application.Run ();
}
}
}
``` |
8fb92069-b0a8-4d38-aab0-b0ddf8b72046 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CuberLib
{
public class ImageTile
{
private Image image;
private Size size;
public I... | ```c#
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CuberLib
{
public class ImageTile
{
private Image image;
private Size size;
public I... |
068e8178-7346-484d-b57d-6da38ab69c6c | {
"language": "C#"
} | ```c#
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace BatteryCommander.Web.Models
{
public class Vehicle
{
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
[Required]
... | ```c#
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace BatteryCommander.Web.Models
{
public class Vehicle
{
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
[Required]
... |
3b5ebbbc-5c3e-4af3-8394-cf01a92f0625 | {
"language": "C#"
} | ```c#
using System;
using SocialToolBox.Core.Database;
using SocialToolBox.Core.Database.Serialization;
using SocialToolBox.Crm.Contact.Event;
namespace SocialToolBox.Sample.Web
{
/// <summary>
/// Data initially available in the system.
/// </summary>
public static class InitialData
{
pub... | ```c#
using System;
using SocialToolBox.Core.Database;
using SocialToolBox.Crm.Contact.Event;
namespace SocialToolBox.Sample.Web
{
/// <summary>
/// Data initially available in the system.
/// </summary>
public static class InitialData
{
public static readonly Id UserVictorNicollet = Id.Pa... |
586c8f5b-0d5f-4ad6-80c6-212f9f366327 | {
"language": "C#"
} | ```c#
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable enable
using System.Collections.Generic;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Mods;
using osu.Game.Scoring;
using osu.Game.Screens.Play;
usin... | ```c#
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable enable
using System.Collections.Generic;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Mods;
using osu.Game.Scoring;
using osu.Game.Screens.Play;
usin... |
81ab114d-1b8d-46c9-aecc-7708df829f10 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using CodeBreaker.Core;
using CodeBreaker.Core.Storage;
using Microsoft.EntityFrameworkCore;
namespace CodeBreaker.WebApp.Storage
{
public class ScoreStore : IScoreStore
{
private readonly CodeBreaker... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using CodeBreaker.Core;
using CodeBreaker.Core.Storage;
using Microsoft.EntityFrameworkCore;
namespace CodeBreaker.WebApp.Storage
{
public class ScoreStore : IScoreStore
{
private readonly CodeBreaker... |
ed4ae521-c32f-4192-902c-d7a02588d43f | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using Glimpse.Web;
using Microsoft.Framework.DependencyInjection;
namespace Glimpse
{
public class GlimpseWebServices
{
public static IServiceCollection GetDefaultServices()
{
var services = new ServiceCollection();
... | ```c#
using System;
using System.Collections.Generic;
using Glimpse.Web;
using Microsoft.Framework.DependencyInjection;
namespace Glimpse
{
public class GlimpseWebServices
{
public static IServiceCollection GetDefaultServices()
{
var services = new ServiceCollection();
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.