doc_id stringlengths 36 36 | metadata dict | input stringlengths 28 4.3k | output stringlengths 11 5.45k |
|---|---|---|---|
b2bc6471-d315-4437-8371-0d7b30837364 | {
"language": "C#"
} | ```c#
using NLog;
namespace Wox.Infrastructure.Logger
{
public class Log
{
private static NLog.Logger logger = LogManager.GetCurrentClassLogger();
public static void Error(System.Exception e)
{
#if DEBUG
throw e;
#else
while (e.InnerException != null)
... | ```c#
using NLog;
using Wox.Infrastructure.Exception;
namespace Wox.Infrastructure.Logger
{
public class Log
{
private static NLog.Logger logger = LogManager.GetCurrentClassLogger();
public static void Error(System.Exception e)
{
#if DEBUG
throw e;
#else
while ... |
f5ce0214-b830-4f1d-9dd7-0c4eaf09b5ab | {
"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.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.DotNet.ProjectModel.Graph;
namespace Microsoft.DotNet.Watc... | ```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.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.DotNet.ProjectModel.Graph;
namespace Microsoft.DotNet.Watc... |
1cb45f40-4ae6-4560-a501-d7fe659044df | {
"language": "C#"
} | ```c#
using Portal.CMS.Entities.Entities;
using System.Collections.Generic;
using System.Linq;
namespace Portal.CMS.Entities.Seed
{
public static class MenuSeed
{
public static void Seed(PortalEntityModel context)
{
if (!context.Menus.Any(x => x.MenuName == "Main Menu"))
... | ```c#
using Portal.CMS.Entities.Entities;
using System.Collections.Generic;
using System.Linq;
namespace Portal.CMS.Entities.Seed
{
public static class MenuSeed
{
public static void Seed(PortalEntityModel context)
{
if (!context.Menus.Any(x => x.MenuName == "Main Menu"))
... |
bf14db26-9c91-4827-a57c-4aac2607a526 | {
"language": "C#"
} | ```c#
/* Copyright 2015 Realm Inc - All Rights Reserved
* Proprietary and Confidential
*/
using System;
namespace RealmNet
{
public static class InteropConfig
{
public static bool Is64Bit
{
#if REALM_32
get {
Debug.Assert(IntPtr.Size == 4);
... | ```c#
/* Copyright 2015 Realm Inc - All Rights Reserved
* Proprietary and Confidential
*/
using System;
using UIKit;
using Foundation;
using System.IO;
namespace RealmNet
{
public static class InteropConfig
{
public static bool Is64Bit
{
#if REALM_32
get {
... |
aeb72d5a-e517-479f-9396-8377b21fb9d8 | {
"language": "C#"
} | ```c#
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Threading.Tasks;
namespace Microsoft.VisualStudio.LanguageServices.ExternalAccess.ProjectSystem... | ```c#
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Threading.Tasks;
namespace Microsoft.VisualStudio.LanguageServices.ExternalAccess... |
e9be75f2-7110-4df0-92bf-87f1bc3714c9 | {
"language": "C#"
} | ```c#
namespace Sitecore.FakeDb.Serialization.Pipelines
{
using Sitecore.Data;
using Sitecore.Data.Serialization.ObjectModel;
using Sitecore.Diagnostics;
using Sitecore.FakeDb.Pipelines;
public class CopyParentId
{
public void Process(DsItemLoadingArgs args)
{
Assert.ArgumentNotNull(args, "a... | ```c#
namespace Sitecore.FakeDb.Serialization.Pipelines
{
using Sitecore.Data;
using Sitecore.Diagnostics;
using Sitecore.FakeDb.Pipelines;
public class CopyParentId
{
public void Process(DsItemLoadingArgs args)
{
Assert.ArgumentNotNull(args, "args");
var syncItem = args.DsDbItem.SyncIt... |
0398068f-1f33-44dd-8024-a1f0f0e724ad | {
"language": "C#"
} | ```c#
@{
ViewBag.Title = "Studenten importeren";
}
<h2>Studenten importeren</h2>
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
<div class="form-horizontal">>
<p>Kopieer het CSV bestand in het veld hieronder.</p>
<textarea name="csv" id="csv" class="form-control"></textarea>
<... | ```c#
@{
ViewBag.Title = "Studenten importeren";
}
<h2>Studenten importeren</h2>
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
<div class="form-horizontal">
<p>Kopieer het CSV bestand in het veld hieronder.</p>
<textarea name="csv" id="csv" class="form-control"></textarea>
</... |
e77a95b2-b682-4586-b42d-e7beafcc849f | {
"language": "C#"
} | ```c#
using Monaco;
using Monaco.Editor;
using Monaco.Languages;
using System;
using System.Runtime.InteropServices.WindowsRuntime;
using System.Threading;
using Windows.Foundation;
namespace MonacoEditorTestApp.Helpers
{
class EditorHoverProvider : HoverProvider
{
public IAsyncOperation<Hover> Provid... | ```c#
using Monaco;
using Monaco.Editor;
using Monaco.Languages;
using System;
using System.Runtime.InteropServices.WindowsRuntime;
using System.Threading;
using Windows.Foundation;
namespace MonacoEditorTestApp.Helpers
{
class EditorHoverProvider : HoverProvider
{
public IAsyncOperation<Hover> Provid... |
a4800319-d1ef-451d-b14f-f80508716949 | {
"language": "C#"
} | ```c#
using System;
using System.Threading;
using System.Threading.Tasks;
namespace Akavache.Sqlite3.Internal
{
// Straight-up thieved from http://www.hanselman.com/blog/ComparingTwoTechniquesInNETAsynchronousCoordinationPrimitives.aspx
public sealed class AsyncLock
{
readonly SemaphoreSlim m_sem... | ```c#
using System;
using System.Threading;
using System.Threading.Tasks;
namespace Akavache.Sqlite3.Internal
{
// Straight-up thieved from http://www.hanselman.com/blog/ComparingTwoTechniquesInNETAsynchronousCoordinationPrimitives.aspx
public sealed class AsyncLock
{
readonly SemaphoreSlim m_sem... |
aaf091d6-63d1-4500-b03f-e7e429faeb14 | {
"language": "C#"
} | ```c#
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
namespace Fungus
{
[EventHandlerInfo("",
"Flowchart Enabled",
"The block will execute when the Flowchart game object is enabled.")]
[AddComponentMenu("")]
public class FlowchartE... | ```c#
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
namespace Fungus
{
[EventHandlerInfo("",
"Flowchart Enabled",
"The block will execute when the Flowchart game object is enabled.")]
[AddComponentMenu("")]
public class FlowchartE... |
3dca0476-bbbe-4885-be84-5eb1a39a6320 | {
"language": "C#"
} | ```c#
using Klawr.ClrHost.Interfaces;
using Klawr.UnrealEngine;
namespace $RootNamespace$
{
public class $ScriptName$ : UKlawrScriptComponent
{
public $ScriptName$(long instanceID, UObjectHandle nativeComponent)
: base(instanceID, nativeComponent)
{
}
}
}
```
Add missi... | ```c#
using Klawr.ClrHost.Interfaces;
using Klawr.ClrHost.Managed.SafeHandles;
using Klawr.UnrealEngine;
namespace $RootNamespace$
{
public class $ScriptName$ : UKlawrScriptComponent
{
public $ScriptName$(long instanceID, UObjectHandle nativeComponent)
: base(instanceID, nativeComponent)
... |
1a749092-d47d-429f-bd30-33c83958a615 | {
"language": "C#"
} | ```c#
using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;
namespace CsProjArrange
{
/// <summary>
/// Compares a list of attributes in order by value.
/// </summary>
public class AttributeKeyComparer : IComparer<IEnumerable<XAttribute>>
{
public AttributeKeyComparer(... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;
namespace CsProjArrange
{
/// <summary>
/// Compares a list of attributes in order by value.
/// </summary>
public class AttributeKeyComparer : IComparer<IEnumerable<XAttribute>>
{
public Attribu... |
9aafd744-3861-4408-aa68-56eb924713fb | {
"language": "C#"
} | ```c#
using WalletWasabi.Fluent.ViewModels.NavBar;
using WalletWasabi.Helpers;
namespace WalletWasabi.Fluent.ViewModels.Wallets.Actions
{
public abstract partial class WalletActionViewModel : NavBarItemViewModel
{
[AutoNotify] private bool _isEnabled;
protected WalletActionViewModel(WalletViewModelBase wallet)... | ```c#
using System.Reactive;
using System.Reactive.Linq;
using ReactiveUI;
using WalletWasabi.Fluent.ViewModels.NavBar;
using WalletWasabi.Helpers;
using WalletWasabi.Wallets;
namespace WalletWasabi.Fluent.ViewModels.Wallets.Actions
{
public abstract partial class WalletActionViewModel : NavBarItemViewModel
{
[Au... |
b07d409c-689c-4b50-8beb-7a8517697d33 | {
"language": "C#"
} | ```c#
using System.Globalization;
using System.Text;
namespace SCPI.Acquire
{
public class ACQUIRE_SRATE : ICommand
{
public string Description => "Query the current sample rate. The default unit is Sa/s.";
public float SampleRate { get; private set; }
public string Command(params st... | ```c#
using SCPI.Extensions;
using System.Text;
namespace SCPI.Acquire
{
public class ACQUIRE_SRATE : ICommand
{
public string Description => "Query the current sample rate. The default unit is Sa/s.";
public float SampleRate { get; private set; }
public string Command(params string[... |
dee4c29b-486e-49ea-b295-48d9ab5876d1 | {
"language": "C#"
} | ```c#
using ICities;
using CitiesHarmony.API;
namespace UOCRevisited
{
/// <summary>
/// The base mod class for instantiation by the game.
/// </summary>
public class UOCRMod : IUserMod
{
// Public mod name and description.
public string Name => ModName + " " + Version;
pu... | ```c#
using ICities;
using CitiesHarmony.API;
namespace UOCRevisited
{
/// <summary>
/// The base mod class for instantiation by the game.
/// </summary>
public class UOCRMod : IUserMod
{
// Public mod name and description.
public string Name => ModName + " " + Version;
pu... |
2361b102-a771-4b01-9854-3d583d062828 | {
"language": "C#"
} | ```c#
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using OpenStardriveServer.Domain.Database;
using OpenStardriveServer.HostedServices;
namespace OpenStardriveServer;
public class Startup
{
public void C... | ```c#
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using OpenStardriveServer.Domain.Database;
using OpenStardriveServer.HostedServices;
namespace OpenStardriveServer;
public class Startup
{
public void C... |
ff7f1e2b-3274-4216-849a-569d9a370c9d | {
"language": "C#"
} | ```c#
namespace Raygun.Messages.Tests
{
using NUnit.Framework;
using Shouldly;
[TestFixture]
public class RaygunClientMessageTests
{
[Test]
public void Should_return_name_from_the_AssemblyTitleAttribute()
{
// Given
var sut = SutFactory();
... | ```c#
namespace Raygun.Messages.Tests
{
using NUnit.Framework;
using Shouldly;
[TestFixture]
public class RaygunClientMessageTests
{
[Test]
public void Should_return_name_from_the_AssemblyTitleAttribute()
{
// Given
var sut = SutFactory();
... |
8643ad8c-204c-43a8-b183-cc7fd922db16 | {
"language": "C#"
} | ```c#
namespace Prometheus.HttpExporter.AspNetCore.InFlight
{
public class HttpInFlightOptions : HttpExporterOptionsBase
{
public Gauge Gauge { get; set; } =
Metrics.CreateGauge(DefaultName, DefaultHelp);
private const string DefaultName = "aspnet_http_inflight";
pri... | ```c#
namespace Prometheus.HttpExporter.AspNetCore.InFlight
{
public class HttpInFlightOptions : HttpExporterOptionsBase
{
public Gauge Gauge { get; set; } =
Metrics.CreateGauge(DefaultName, DefaultHelp);
private const string DefaultName = "http_executing_requests";
... |
71ba6233-c190-4c0d-a9f8-6eb12db4bda2 | {
"language": "C#"
} | ```c#
using Newtonsoft.Json;
using SourceSchemaParser.JsonConverters;
using System;
using System.Collections.Generic;
namespace SourceSchemaParser.Dota2
{
public class DotaSchemaItem : SchemaItem
{
public DotaSchemaItemTool Tool { get; set; }
[JsonProperty("tournament_url")]
public st... | ```c#
using Newtonsoft.Json;
using SourceSchemaParser.JsonConverters;
using System;
using System.Collections.Generic;
namespace SourceSchemaParser.Dota2
{
public class DotaSchemaItem : SchemaItem
{
public DotaSchemaItemTool Tool { get; set; }
[JsonProperty("tournament_url")]
public st... |
4118d612-7aa3-456a-b0cc-5f05ed521ded | {
"language": "C#"
} | ```c#
using System;
using System.Data;
using System.Threading.Tasks;
using Dapper.FastCrud;
using Dapper.FastCrud.Configuration.StatementOptions.Builders;
using Smooth.IoC.Dapper.Repository.UnitOfWork.Data;
using Smooth.IoC.Dapper.Repository.UnitOfWork.Helpers;
namespace Smooth.IoC.Dapper.Repository.UnitOfWork.Repo
{... | ```c#
using System;
using System.Data;
using System.Threading.Tasks;
using Dapper.FastCrud;
using Dapper.FastCrud.Configuration.StatementOptions.Builders;
using Smooth.IoC.Dapper.Repository.UnitOfWork.Data;
using Smooth.IoC.Dapper.Repository.UnitOfWork.Helpers;
namespace Smooth.IoC.Dapper.Repository.UnitOfWork.Repo
{... |
9302178a-5e3d-48ba-94e3-d9f9f10c5292 | {
"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.Diagnostics;
using MICore;
namespace AndroidDebugLauncher
{
internal static class TargetArchitectureExtensions
{
publ... | ```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.Diagnostics;
using MICore;
namespace AndroidDebugLauncher
{
internal static class TargetArchitectureExtensions
{
publ... |
b80d1dfe-a14e-437b-9225-1f9969ca7fe5 | {
"language": "C#"
} | ```c#
using Bartender.Tests.Context;
using Moq;
using Xunit;
namespace Bartender.Tests
{
public class CancellableAsyncQueryDispatcherTests : DispatcherTests
{
[Fact]
public async void ShouldHandleQueryOnce_WhenCallDispatchAsyncMethod()
{
await CancellableAsyncQueryDispatcher... | ```c#
using Bartender.Tests.Context;
using Moq;
using Shouldly;
using Xunit;
namespace Bartender.Tests
{
public class CancellableAsyncQueryDispatcherTests : DispatcherTests
{
[Fact]
public async void ShouldHandleQueryOnce_WhenCallDispatchAsyncMethod()
{
await CancellableAsyn... |
62f9064a-f23e-4e60-b574-2a6fa292f60b | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
namespace Seq.Api.Model.Diagnostics
{
public class ServerMetricsEntity : Entity
{
public ServerMetricsEntity()
{
RunningTasks = new List<RunningTaskPart>();
}
public double EventStoreDaysRecorded { get; set; }
... | ```c#
using System;
using System.Collections.Generic;
namespace Seq.Api.Model.Diagnostics
{
public class ServerMetricsEntity : Entity
{
public ServerMetricsEntity()
{
RunningTasks = new List<RunningTaskPart>();
}
public double EventStoreDaysRecorded { get; set; }
... |
559308ca-1ccc-402b-9af4-210497e5aa07 | {
"language": "C#"
} | ```c#
using Xunit;
namespace Dcc.Test
{
public class DccMiddlewareTests
{
[Fact]
public void SanityTest()
{
Assert.True(true);
}
}
}```
Make use of FluentAssertions in sanity unit test. | ```c#
using FluentAssertions;
using Xunit;
namespace Dcc.Test
{
public class DccMiddlewareTests
{
[Fact]
public void SanityTest()
{
true.Should().BeTrue();
}
}
}``` |
df032500-ba06-4119-83ab-c0e52f3ab303 | {
"language": "C#"
} | ```c#
using System;
using Tralus.Framework.BusinessModel.Entities;
namespace Tralus.Framework.Migration.Migrations
{
using System.Data.Entity.Migrations;
public sealed class Configuration : TralusDbMigrationConfiguration<Data.FrameworkDbContext>
{
public Configuration()
{
Auto... | ```c#
using System;
using Tralus.Framework.BusinessModel.Entities;
namespace Tralus.Framework.Migration.Migrations
{
using System.Data.Entity.Migrations;
public sealed class Configuration : TralusDbMigrationConfiguration<Data.FrameworkDbContext>
{
public Configuration()
{
Auto... |
88dbf977-5e73-49f6-95e4-cfd2203f4af4 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using CompetitionPlatform.Data.ProjectCategory;
namespace CompetitionPlatform.Data.ProjectCategory
{
public class ProjectCategoriesRepository : IProjectCategoriesRepository
{
public List<string> GetC... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using CompetitionPlatform.Data.ProjectCategory;
namespace CompetitionPlatform.Data.ProjectCategory
{
public class ProjectCategoriesRepository : IProjectCategoriesRepository
{
public List<string> GetC... |
16758c9d-1db1-45a3-be76-c21f0f82b95e | {
"language": "C#"
} | ```c#
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
namespace StyleCop.Analyzers.Test.CSharp7.SpacingRules
{
using Test.SpacingRules;
public class SA1008CSharp7UnitTests : SA10... | ```c#
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
namespace StyleCop.Analyzers.Test.CSharp7.SpacingRules
{
using System.Threading;
using System.Threading.Tasks;
using Styl... |
84defc42-14f7-434e-9026-f8cb043b21df | {
"language": "C#"
} | ```c#
namespace Fixie.Assertions
{
using System;
using System.Collections;
class EnumerableEqualityComparer
{
public bool EnumerableEqual(IEnumerable x, IEnumerable y)
{
var enumeratorX = x.GetEnumerator();
var enumeratorY = y.GetEnumerator();
while ... | ```c#
namespace Fixie.Assertions
{
using System;
using System.Collections;
class EnumerableEqualityComparer
{
public bool EnumerableEqual(IEnumerable x, IEnumerable y)
{
var enumeratorX = x.GetEnumerator();
var enumeratorY = y.GetEnumerator();
while ... |
439bcba6-e3e3-4ef0-9f8e-efc72adbf422 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using DbAndRepository;
using DbAndRepository.IRepositories;
using ... | ```c#
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using DbAndRepository;
using DbAndRepository.IRepositories;
using ... |
935fe525-6735-4a49-8bf1-04fdfe470500 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEditor;
namespace Entitas.Unity {
public class ScriptingDefineSymbols {
public Dictionary<BuildTargetGroup, string> buildTargetToDefSymbol { get { return _buildTargetToDefSymbol; } }
readonly Dictionary<BuildTarg... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEditor;
namespace Entitas.Unity {
public class ScriptingDefineSymbols {
public Dictionary<BuildTargetGroup, string> buildTargetToDefSymbol { get { return _buildTargetToDefSymbol; } }
readonly Dictionary<BuildTarg... |
5efa910b-f340-4a21-a07a-6cdfa8813350 | {
"language": "C#"
} | ```c#
namespace ForecastPCL.Test
{
using System;
using System.Configuration;
using System.Threading.Tasks;
using DarkSkyApi;
using NUnit.Framework;
[TestFixture]
public class LanguageTests
{
// These coordinates came from the Forecast API documentation,
// and should ... | ```c#
namespace ForecastPCL.Test
{
using System;
using System.Configuration;
using System.Threading.Tasks;
using DarkSkyApi;
using NUnit.Framework;
[TestFixture]
public class LanguageTests
{
// These coordinates came from the Forecast API documentation,
// and should ... |
265580a5-c129-4068-a4d0-a5a54b491654 | {
"language": "C#"
} | ```c#
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Diagnostics.Tracing;
using System.Reflection;
using Xunit;
namespace System.Net.NameResolution.T... | ```c#
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Diagnostics.Tracing;
using System.Reflection;
using Xunit;
namespace System.Net.NameResolution.T... |
c6dc54e5-f02d-4f93-9cd9-93689a3d0278 | {
"language": "C#"
} | ```c#
namespace SFA.DAS.EmployerAccounts.Web.Authorization
{
public static class AuthorizationConstants
{
public const string Tier2User = "Tier2User";
public const string TeamViewRoute = "accounts/{hashedaccountid}/teams/view";
public const string TeamRoute = "accounts/{hashedaccountid}... | ```c#
namespace SFA.DAS.EmployerAccounts.Web.Authorization
{
public static class AuthorizationConstants
{
public const string Tier2User = "Tier2User";
public const string TeamViewRoute = "accounts/{hashedaccountid}/teams/view";
public const string TeamRoute = "accounts/{hashedaccountid}... |
aaba0fbf-9bcf-45b4-b815-21ef41e00a8f | {
"language": "C#"
} | ```c#
using Serilog.Core;
using Serilog.Events;
namespace Umbraco.Core.Logging.SerilogExtensions
{
/// <summary>
/// This is used to create a new property in Logs called 'Log4NetLevel'
/// So that we can map Serilog levels to Log4Net levels - so log files stay consistent
/// </summary>
public clas... | ```c#
using Serilog.Core;
using Serilog.Events;
namespace Umbraco.Core.Logging.SerilogExtensions
{
/// <summary>
/// This is used to create a new property in Logs called 'Log4NetLevel'
/// So that we can map Serilog levels to Log4Net levels - so log files stay consistent
/// </summary>
internal cl... |
370ffb55-cc44-4a2a-a8ac-dbe326538792 | {
"language": "C#"
} | ```c#
using System.Text;
using Microsoft.AspNetCore.Mvc;
using RabbitMQ.Client;
namespace Rabbit.Controllers
{
public class RabbitController : Controller
{
ConnectionFactory _rabbitConnection;
public RabbitController([FromServices] ConnectionFactory rabbitConnection)
{
_ra... | ```c#
using System.Text;
using Microsoft.AspNetCore.Mvc;
using RabbitMQ.Client;
#if SSL
using System.Security.Authentication;
using System.Net.Security;
#endif
namespace Rabbit.Controllers
{
public class RabbitController : Controller
{
ConnectionFactory _rabbitConnection;
public RabbitContro... |
9c4aea7e-43fd-4821-8187-5204135552ae | {
"language": "C#"
} | ```c#
using Ets.Mobile.ViewModel.Contracts.Settings;
using System;
using System.Reactive.Linq;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using ReactiveUI;
using System.Reactive.Concurrency;
namespace Ets.Mobile.Content.Settings
{
public sealed partial class Options : UserControl
{
public ... | ```c#
using Ets.Mobile.ViewModel.Contracts.Settings;
using System;
using System.Reactive.Linq;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
namespace Ets.Mobile.Content.Settings
{
public sealed partial class Options : UserControl
{
public Options()
{
InitializeComponent()... |
d85dd70b-d222-4bd9-843b-c3e2bf3b8816 | {
"language": "C#"
} | ```c#
<!DOCTYPE html>
<html>
<head>
<title>Zaaikalender | @ViewBag.Title</title>
<link rel="stylesheet" href="/Content/Stylesheets/responsive-square-elements.css">
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script src="/Scripts/flowtype.js"></script>
<script src="/Scripts/fon... | ```c#
<!DOCTYPE html>
<html>
<head>
<title>Zaaikalender | @ViewBag.Title</title>
<link rel="stylesheet" href="/Content/Stylesheets/responsive-square-elements.css">
<!--[if lte IE 8]>
<script src="//cdnjs.cloudflare.com/ajax/libs/es5-shim/4.0.3/es5-shim.min.js"></script>
<script src="//c... |
ebe4e162-5cd7-497f-a1f3-ebf0656bf792 | {
"language": "C#"
} | ```c#
using System.Xml;
namespace Palaso.Xml
{
public static class XmlDomExtensions
{
public static XmlDocument StripXHtmlNameSpace(this XmlDocument node)
{
XmlDocument x = new XmlDocument();
x.LoadXml(node.OuterXml.Replace("xmlns", "xmlnsNeutered"));
return x;
}
public static void AddStyleSheet(t... | ```c#
using System;
using System.IO;
using System.Xml;
namespace Palaso.Xml
{
public static class XmlDomExtensions
{
public static XmlDocument StripXHtmlNameSpace(this XmlDocument node)
{
XmlDocument x = new XmlDocument();
x.LoadXml(node.OuterXml.Replace("xmlns", "xmlnsNeutered"));
return x;
}
pub... |
edd90daa-505e-4423-801b-9e0d485559bd | {
"language": "C#"
} | ```c#
using static System.Console;
using CIV.Ccs;
using CIV.Interfaces;
namespace CIV
{
class Program
{
static void Main(string[] args)
{
var text = System.IO.File.ReadAllText(args[0]);
var processes = CcsFacade.ParseAll(text);
var trace = CcsFacade.RandomTrace(proce... | ```c#
using static System.Console;
using System.Linq;
using CIV.Ccs;
using CIV.Hml;
namespace CIV
{
class Program
{
static void Main(string[] args)
{
var text = System.IO.File.ReadAllText(args[0]);
var processes = CcsFacade.ParseAll(text);
var hmlText = "[[ack]][[ack]... |
3716ba1f-3480-468d-a1bd-92c3c4b89bcb | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using CommandLine;
using Meraki;
namespace Meraki.Console
{
class Program
{
static void Main(string[] args)
{
try
{
Parser.Default.ParseArguments<LabOp... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using CommandLine;
using Meraki;
namespace Meraki.Console
{
class Program
{
static void Main(string[] args)
{
try
{
Parser.Default.ParseArguments<LabOp... |
3544f157-8e4c-459d-a3aa-960a1c52e91c | {
"language": "C#"
} | ```c#
using System.Dynamic;
namespace KenticoInspector.Core.Models
{
public class ReportResults
{
public ReportResults()
{
Data = new ExpandoObject();
}
public dynamic Data { get; set; }
public string Status { get; set; }
public string Summary { get... | ```c#
using System.Dynamic;
namespace KenticoInspector.Core.Models
{
public class ReportResults
{
public ReportResults()
{
Data = new ExpandoObject();
}
public dynamic Data { get; set; }
public string Heading { get; set; }
public string Status { get... |
72310c75-dc3f-4055-b9cb-7efb1985359f | {
"language": "C#"
} | ```c#
using System.Collections.Generic;
namespace Arkivverket.Arkade.Core.Util.FileFormatIdentification;
public interface IFileFormatInfoFilesGenerator
{
void Generate(IEnumerable<IFileFormatInfo> fileFormatInfoSet, string relativePathRoot, string resultFileFullPath);
}```
Add namespace brackets - because of tea... | ```c#
using System.Collections.Generic;
namespace Arkivverket.Arkade.Core.Util.FileFormatIdentification
{
public interface IFileFormatInfoFilesGenerator
{
void Generate(IEnumerable<IFileFormatInfo> fileFormatInfoSet, string relativePathRoot,
string resultFileFullPath);
}
}``` |
cd27bec7-eb77-4f88-98a1-97c91b05e882 | {
"language": "C#"
} | ```c#
using Microsoft.Win32;
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;
namespace PathViewer
{
public partial class FormPathViewer : Form
{... | ```c#
using Microsoft.Win32;
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;
namespace PathViewer
{
public partial class FormPathViewer : Form
{... |
f1cafab3-c6a4-4286-9809-f51ceeeabf81 | {
"language": "C#"
} | ```c#
using System.Reflection;
[assembly: AssemblyTitle("Autofac.Extras.Tests.Moq")]
[assembly: AssemblyDescription("")]
```
Build script now writes the package name and version into the AssemblyDescription attibute. This allows the package information to be seen in Visual Studio avoiding confusion with the assem... | ```c#
using System.Reflection;
[assembly: AssemblyTitle("Autofac.Extras.Tests.Moq")]
``` |
5fad08e9-cc78-4917-8626-38d7c3590dd9 | {
"language": "C#"
} | ```c#
using System.Drawing;
using System.Windows.Forms;
using BrightIdeasSoftware;
namespace SteamGames
{
internal sealed class GameRenderer : AbstractRenderer
{
private readonly StringFormat sf;
public GameRenderer()
{
sf = new StringFormat(StringFormat.GenericTypographic);
sf.Alignment = StringAlign... | ```c#
using System.Drawing;
using System.Windows.Forms;
using BrightIdeasSoftware;
namespace SteamGames
{
internal sealed class GameRenderer : AbstractRenderer
{
private readonly StringFormat sf;
private Brush SelectionBrush = new SolidBrush(Color.FromKnownColor(KnownColor.Highlight));
public GameRenderer()... |
c9e65dd3-5626-4f63-914d-56690a9da77a | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using Assent.Reporters.DiffPrograms;
namespace Assent.Reporters
{
public class DiffReporter : IReporter
{
#if NET45
internal static readonly bool IsWindows = Environment.OSVersion.Platform == PlatformID.Win32NT;
#else
internal static readonl... | ```c#
using System;
using System.Collections.Generic;
using Assent.Reporters.DiffPrograms;
namespace Assent.Reporters
{
public class DiffReporter : IReporter
{
#if NET45
internal static readonly bool IsWindows = Environment.OSVersion.Platform == PlatformID.Win32NT;
#else
internal static readonl... |
191d77f7-d06a-418e-9237-64bcd47fd1f6 | {
"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;
using System.Collections.Generic;
using System.Linq;
using JetBrains.Annotations;
using osu.Game.Online.API;
namespace osu.Game.Onl... | ```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;
using System.Collections.Generic;
using System.Linq;
using JetBrains.Annotations;
using osu.Game.Online.API;
namespace osu.Game.Onl... |
1d1fcb39-8b08-4002-9374-0b5252432de6 | {
"language": "C#"
} | ```c#
namespace TraktApiSharp.Objects.Get.Users.Lists
{
using Newtonsoft.Json;
using System.Globalization;
/// <summary>
/// A collection of ids for various web services for a Trakt list.
/// </summary>
public class TraktListIds
{
/// <summary>
/// The Trakt numeric id for ... | ```c#
namespace TraktApiSharp.Objects.Get.Users.Lists
{
using Newtonsoft.Json;
/// <summary>A collection of ids for various web services, including the Trakt id, for a Trakt list.</summary>
public class TraktListIds
{
/// <summary>Gets or sets the Trakt numeric id.</summary>
[JsonPrope... |
6e5683a0-165f-47ec-9d46-592d392e2dd4 | {
"language": "C#"
} | ```c#
// Copyright 2007-2015 Chris Patterson, Dru Sellers, Travis Smith, et. al.
//
// 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/LICEN... | ```c#
// Copyright 2007-2015 Chris Patterson, Dru Sellers, Travis Smith, et. al.
//
// 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/LICEN... |
829af8d5-8465-400d-a944-a4d60b897125 | {
"language": "C#"
} | ```c#
using MailKit.Net.Smtp;
using MimeKit;
using MimeKit.Text;
using System;
using System.Collections.Generic;
namespace SecretSanta.Utilities
{
public static class EmailMessage
{
public static void Send(MailboxAddress from, IEnumerable<MailboxAddress> to, string subject, string body)
{
... | ```c#
using MailKit.Net.Smtp;
using MimeKit;
using MimeKit.Text;
using System;
using System.Collections.Generic;
namespace SecretSanta.Utilities
{
public static class EmailMessage
{
public static void Send(MailboxAddress from, IEnumerable<MailboxAddress> to, string subject, string body)
{
... |
55893c6f-5b71-478f-b6b7-131870d5709c | {
"language": "C#"
} | ```c#
using Content.Shared.GameObjects.Components.Movement;
using Robust.Client.Player;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Map;
#nullable enable
namespace Content.Client.GameObjects.Components.Movement
{
[RegisterComponent]
[ComponentReference(typeof(IMoverComponent)... | ```c#
using Content.Shared.GameObjects.Components.Movement;
using Robust.Shared.GameObjects;
using Robust.Shared.Map;
#nullable enable
namespace Content.Client.GameObjects.Components.Movement
{
[RegisterComponent]
[ComponentReference(typeof(IMoverComponent))]
public class PlayerInputMoverComponent : Share... |
4d461873-6440-4ba7-aeed-4b8824d9d817 | {
"language": "C#"
} | ```c#
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace Dangl.WebDocumentation.ViewModels.Admin
{
public class CreateProjectViewModel
{
[Display(Name ="Name")]
public string ProjectName { get; set; }
[Display(Name ="Public access")]
publi... | ```c#
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace Dangl.WebDocumentation.ViewModels.Admin
{
public class CreateProjectViewModel
{
[Display(Name ="Name")]
[Required]
public string ProjectName { get; set; }
[Display(Name ="Public acce... |
fd813764-916c-4eae-a667-607641319068 | {
"language": "C#"
} | ```c#
using System;
namespace DAQ.Environment
{
public class PHBonesawFileSystem : DAQ.Environment.FileSystem
{
public PHBonesawFileSystem()
{
Paths.Add("MOTMasterDataPath", "C:\\Users\\cafmot\\Box\\CaF MOT\\MOTData\\MOTMasterData\\");
Paths.Add("scriptListPath", "C:\\C... | ```c#
using System;
namespace DAQ.Environment
{
public class PHBonesawFileSystem : DAQ.Environment.FileSystem
{
public PHBonesawFileSystem()
{
Paths.Add("MOTMasterDataPath", "C:\\Users\\cafmot\\Box Sync\\CaF MOT\\MOTData\\MOTMasterData\\");
Paths.Add("scriptListPath", "... |
9a9350dc-a519-4cee-8d7a-66d5dc87aaee | {
"language": "C#"
} | ```c#
#load ../amazon.csx
pvc.Task("push", () => {
pvc.Source("src/**/*.*")
.Pipe(new PvcCloudFront(
accessKey: keys.accessKey,
secretKey: keys.secretKey,
bucketName: "pvcbuild-com",
distributionId: "E13RNZ6AJTCYUR"
));
});
```
Remove src folder from paths before pushing | ```c#
#load ../amazon.csx
pvc.Task("push", () => {
pvc.Source("src/**/*.*")
.Pipe((streams) => {
// strip src folder from paths
var currentDirectory = Directory.GetCurrentDirectory();
var resultStreams = new List<PvcStream>();
foreach (var stream in streams) {
var fullPath = Path.GetFullPath(stream.Str... |
dd9711e3-e71b-4e9d-96da-18f9c19c4a0f | {
"language": "C#"
} | ```c#
namespace NLogging
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
public abstract class Handler : IHandler
{
private IFormatter formatter;
private LogLevel logLevel;
protected Handler()
... | ```c#
namespace NLogging
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
public abstract class Handler : IHandler
{
private IFormatter formatter;
protected Handler()
{
this.formatter ... |
054f09ca-367b-4f33-9479-8da352d2553d | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Common.Logging;
using GladNet;
namespace Booma.Proxy
{
[SceneTypeCreate(GameSceneType.Pioneer2)]
public sealed class Default6DCommandHandler : Command6DHandler<UnknownSubCommand6DCommand>
... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Common.Logging;
using GladNet;
namespace Booma.Proxy
{
[SceneTypeCreate(GameSceneType.Pioneer2)]
public sealed class Default6DCommandHandler : Command6DHandler<UnknownSubCommand6DCommand>
... |
e780f600-cc0d-4635-b3a7-7164bda56ec4 | {
"language": "C#"
} | ```c#
using System;
using HtmlAgilityPack;
namespace ReverseMarkdown.Converters
{
public class Ol
: ConverterBase
{
public Ol(Converter converter)
: base(converter)
{
this.Converter.Register("ol", this);
this.Converter.Register("ul", this);
}
public override string Convert(HtmlNode node)
{
... | ```c#
using System;
using HtmlAgilityPack;
namespace ReverseMarkdown.Converters
{
public class Ol
: ConverterBase
{
public Ol(Converter converter)
: base(converter)
{
this.Converter.Register("ol", this);
this.Converter.Register("ul", this);
}
public override string Convert(HtmlNode node)
{
... |
683d9e66-d728-4b0c-923b-cc231ffac4b6 | {
"language": "C#"
} | ```c#
namespace TraktApiSharp.Objects.Get.Shows.Episodes
{
using Basic;
/// <summary>A collection of ids for various web services, including the Trakt id, for a Trakt episode.</summary>
public class TraktEpisodeIds : TraktIds
{
}
}
```
Remove slug from episode ids. | ```c#
namespace TraktApiSharp.Objects.Get.Shows.Episodes
{
using Attributes;
using Newtonsoft.Json;
/// <summary>A collection of ids for various web services, including the Trakt id, for a Trakt episode.</summary>
public class TraktEpisodeIds
{
/// <summary>Gets or sets the Trakt numeric i... |
45d7678d-72bb-43b7-89cd-9387aa47498a | {
"language": "C#"
} | ```c#
using NUnit.Framework;
namespace NSubstitute.Acceptance.Specs
{
[TestFixture]
public class MatchingDerivedTypesForGenerics
{
IGenMethod _sub;
[SetUp]
public void Setup()
{
_sub = Substitute.For<IGenMethod>();
}
[Test]
public void Calls_to_generic_types_with_derived_parameters_should_be_mat... | ```c#
using NUnit.Framework;
namespace NSubstitute.Acceptance.Specs
{
[TestFixture]
public class MatchingDerivedTypesForGenerics
{
IGenMethod _sub;
[SetUp]
public void Setup()
{
_sub = Substitute.For<IGenMethod>();
}
[Test]
public void Calls_to_generic_types_with_derived_parameters_should_be_mat... |
3ff7ffe6-521e-4458-8e19-ff66e783b413 | {
"language": "C#"
} | ```c#
using LunaClient.Base;
using LunaClient.Base.Interface;
using LunaClient.Network;
using LunaCommon.Message.Client;
using LunaCommon.Message.Data.Vessel;
using LunaCommon.Message.Interface;
using System;
namespace LunaClient.Systems.VesselRemoveSys
{
public class VesselRemoveMessageSender : SubSystem<VesselR... | ```c#
using LunaClient.Base;
using LunaClient.Base.Interface;
using LunaClient.Network;
using LunaCommon.Message.Client;
using LunaCommon.Message.Data.Vessel;
using LunaCommon.Message.Interface;
using System;
namespace LunaClient.Systems.VesselRemoveSys
{
public class VesselRemoveMessageSender : SubSystem<VesselR... |
6bc40c88-27e6-4f99-b065-611ef5138aa5 | {
"language": "C#"
} | ```c#
using System;
using ValveResourceFormat.Serialization;
namespace GUI.Types.ParticleRenderer.Emitters
{
public class InstantaneousEmitter : IParticleEmitter
{
public bool IsFinished { get; private set; }
private readonly IKeyValueCollection baseProperties;
private Action particle... | ```c#
using System;
using ValveResourceFormat.Serialization;
namespace GUI.Types.ParticleRenderer.Emitters
{
public class InstantaneousEmitter : IParticleEmitter
{
public bool IsFinished { get; private set; }
private readonly IKeyValueCollection baseProperties;
private Action particle... |
b2844ce5-818f-4240-b822-6e42813d97c1 | {
"language": "C#"
} | ```c#
namespace LanguageServer
{
//using Options;
using System;
using System.Collections.Generic;
using System.Reflection;
public class ManualAssemblyResolver : IDisposable
{
private readonly List<Assembly> _assemblies;
public ManualAssemblyResolver()
{
Ap... | ```c#
namespace LanguageServer
{
//using Options;
using System;
using System.Collections.Generic;
using System.Reflection;
public class GrammarDescriptionFactory
{
private static readonly IGrammarDescription _antlr = new AntlrGrammarDescription();
public static List<string> All... |
83c8c61c-ba68-4fb0-8d95-083e0b98bbda | {
"language": "C#"
} | ```c#
// -----------------------------------------------------------------------
// <copyright file="Program.cs" company="(none)">
// Copyright © 2013 John Gietzen. All Rights Reserved.
// This source is subject to the MIT license.
// Please see license.txt for more information.
// </copyright>
// -------------... | ```c#
// -----------------------------------------------------------------------
// <copyright file="Program.cs" company="(none)">
// Copyright © 2013 John Gietzen. All Rights Reserved.
// This source is subject to the MIT license.
// Please see license.txt for more information.
// </copyright>
// -------------... |
5bd5b87a-6491-4ca5-88b4-97281d1ce05a | {
"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("NDeproxy")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assemb... | ```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("NDeproxy")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assemb... |
5d04907a-16fc-468d-bf9d-96193e2cfaa3 | {
"language": "C#"
} | ```c#
namespace Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.Implementation
{
using System;
using Microsoft.ApplicationInsights.Channel;
/// <summary>
/// Utility class for sampling score generation.
/// </summary>
internal static class SamplingScoreGenerator
{
///... | ```c#
namespace Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.Implementation
{
using System;
using Microsoft.ApplicationInsights.Channel;
/// <summary>
/// Utility class for sampling score generation.
/// </summary>
internal static class SamplingScoreGenerator
{
///... |
d3e26a39-8c94-4f4c-9522-676ec60b0938 | {
"language": "C#"
} | ```c#
using System;
using Castle.MicroKernel.Registration;
using Castle.MicroKernel.SubSystems.Configuration;
using Castle.Windsor;
using Castle.MicroKernel.Resolvers.SpecializedResolvers;
namespace AppHarbor
{
public class AppHarborInstaller : IWindsorInstaller
{
public void Install(IWindsorContainer container, ... | ```c#
using System;
using Castle.MicroKernel.Registration;
using Castle.MicroKernel.SubSystems.Configuration;
using Castle.Windsor;
using Castle.MicroKernel.Resolvers.SpecializedResolvers;
namespace AppHarbor
{
public class AppHarborInstaller : IWindsorInstaller
{
public void Install(IWindsorContainer container, ... |
32a910d9-2c9e-4fbb-821d-c0478d9feeec | {
"language": "C#"
} | ```c#
namespace EverlastingStudent.Models
{
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using EverlastingStudent.Common;
public class Difficulty
{
private ICollection<Homework> homeworks;
private ICollection<FreelanceProject> freelanceProjects;
... | ```c#
namespace EverlastingStudent.Models
{
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using EverlastingStudent.Common.Models;
public class Difficulty
{
private ICollection<Homework> homeworks;
private ICollection<FreelanceProject> freelanceProj... |
197ea628-50a1-48b5-8186-a6f9cee61892 | {
"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.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Diagnostics;
using System.Net;
us... | ```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.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Diagnostics;
using System.Net;
us... |
1bbf56e3-212d-481f-b4a8-f08d8c9d6ca7 | {
"language": "C#"
} | ```c#
using System;
using Abp.Auditing;
using Castle.Core.Logging;
using Microsoft.AspNetCore.Http;
using Abp.Extensions;
namespace Abp.AspNetCore.Mvc.Auditing
{
public class HttpContextClientInfoProvider : IClientInfoProvider
{
public string BrowserInfo => GetBrowserInfo();
public string Cli... | ```c#
using System;
using Abp.Auditing;
using Castle.Core.Logging;
using Microsoft.AspNetCore.Http;
using Abp.Extensions;
namespace Abp.AspNetCore.Mvc.Auditing
{
public class HttpContextClientInfoProvider : IClientInfoProvider
{
public string BrowserInfo => GetBrowserInfo();
public string Cli... |
67ad3584-f063-454e-a93c-45c15b6f0fca | {
"language": "C#"
} | ```c#
namespace TraktApiSharp.Requests
{
internal struct TraktPaginationOptions
{
internal TraktPaginationOptions(int? page, int? limit)
{
Page = page;
Limit = limit;
}
internal int? Page { get; set; }
internal int? Limit { get; set; }
}
}
`... | ```c#
namespace TraktApiSharp.Requests
{
internal struct TraktPaginationOptions
{
internal TraktPaginationOptions(int? page, int? limit)
{
Page = page;
Limit = limit;
}
internal int? Page { get; }
internal int? Limit { get; }
}
}
``` |
9a5ff708-0ebd-43ad-8986-a5efbcb49361 | {
"language": "C#"
} | ```c#
namespace Boxed.Templates.Test
{
using System;
using System.Threading;
public static class CancellationTokenFactory
{
public static CancellationToken GetCancellationToken(TimeSpan? timeout) =>
GetCancellationToken(timeout ?? TimeSpan.FromSeconds(20));
public static Ca... | ```c#
namespace Boxed.Templates.Test
{
using System;
using System.Threading;
public static class CancellationTokenFactory
{
public static CancellationToken GetCancellationToken(TimeSpan? timeout) =>
GetCancellationToken(timeout ?? TimeSpan.FromSeconds(30));
public static Ca... |
73d07cb8-26ca-4ede-bec0-0250aaaa3107 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CenturyLinkCloudSDK.IntegrationTests
{
public static class Credentials
{
public static string Username = "";
public static string Password = "";
}
}
```
Add ... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CenturyLinkCloudSDK.IntegrationTests
{
public static class Credentials
{
public static string Username = "";
public static string Password = "";
public st... |
e76b1eff-26c9-4eb2-bab3-713b25894d46 | {
"language": "C#"
} | ```c#
using System.Windows.Forms;
using TweetDuck.Plugins;
using TweetDuck.Resources;
namespace TweetDuck.Core.Notification.Example{
sealed class FormNotificationExample : FormNotificationMain{
public override bool RequiresResize => true;
protected override bool CanDragWindow => Program.UserConfig... | ```c#
using System.Windows.Forms;
using TweetDuck.Core.Controls;
using TweetDuck.Plugins;
using TweetDuck.Resources;
namespace TweetDuck.Core.Notification.Example{
sealed class FormNotificationExample : FormNotificationMain{
public override bool RequiresResize => true;
protected override bool CanD... |
a7aaeb2c-48da-49e2-9782-07f96687ae94 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windo... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windo... |
d2396ad9-1c93-43c6-82d0-bc4811ad2da2 | {
"language": "C#"
} | ```c#
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Threading;
using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
namespace Microsoft.Cod... | ```c#
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Threading;
using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
namespace Microsoft.Cod... |
c8e6dacb-2d49-46f0-abc2-a1e2d52b21e7 | {
"language": "C#"
} | ```c#
using System.ComponentModel;
using System.Linq;
using System.Windows.Forms;
using SolarWinds.InformationService.Contract2;
namespace SwqlStudio
{
public partial class QueryParameters : Form
{
public QueryParameters(PropertyBag queryParameters)
{
InitializeComponent();
... | ```c#
using System.ComponentModel;
using System.Linq;
using System.Windows.Forms;
using SolarWinds.InformationService.Contract2;
namespace SwqlStudio
{
public partial class QueryParameters : Form
{
public QueryParameters(PropertyBag queryParameters)
{
InitializeComponent();
... |
f7ede2ad-2d28-4078-b805-26819e5fb5c0 | {
"language": "C#"
} | ```c#
using System;
using Octostache;
namespace Calamari.Integration.Processes
{
public static class VariableDictionaryExtensions
{
public static void EnrichWithEnvironmentVariables(this VariableDictionary variables)
{
var environmentVariables = Environment.GetEnvironmentVariables()... | ```c#
using System;
using Calamari.Deployment;
using Octostache;
namespace Calamari.Integration.Processes
{
public static class VariableDictionaryExtensions
{
public static void EnrichWithEnvironmentVariables(this VariableDictionary variables)
{
var environmentVariables = Environmen... |
1c29efcb-7310-4565-bd23-4b142f1350ce | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HtmlAgilityPack;
namespace JenkinsTitleUpdater
{
class Program
{
static int Main(string[] args)
{
if (args.Length == 0)
{
Usage();
return -1;
}
Ht... | ```c#
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HtmlAgilityPack;
namespace JenkinsTitleUpdater
{
class Program
{
static int Main(string[] args)
{
if (args.Length == 0)
{
Usage();
return -1;
}
Ht... |
6678861d-10a5-43e8-9196-72194e3222c8 | {
"language": "C#"
} | ```c#
using System;
namespace CefSharp
{
/// <summary>
/// Event arguments to the LoadCompleted event handler set up in IWebBrowser.
/// </summary>
public class NavStateChangedEventArgs : EventArgs
{
public bool CanGoForward { get; private set; }
public bool CanGoBack { get; privat... | ```c#
using System;
namespace CefSharp
{
/// <summary>
/// Event arguments to the NavStateChanged event handler set up in IWebBrowser.
/// </summary>
public class NavStateChangedEventArgs : EventArgs
{
public bool CanGoForward { get; private set; }
public bool CanGoBack { get; priv... |
cc2e0a1e-c0f4-4e22-be97-d82727417ea6 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Im... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Im... |
226bafdd-1e0f-42bc-b1be-a1a56f1e7f4e | {
"language": "C#"
} | ```c#
using System;
using Mono.Addins;
using Mono.Addins.Description;
[assembly:Addin ("TypeScript",
Namespace = "MonoDevelop",
Version = "0.4",
Category = "Web Development")]
[assembly:AddinName ("TypeScript")]
[assembly:AddinDescription ("Adds TypeScript support. Updated to use TypeScript 1.4")]
[assembly:Add... | ```c#
using System;
using Mono.Addins;
using Mono.Addins.Description;
[assembly:Addin ("TypeScript",
Namespace = "MonoDevelop",
Version = "0.5",
Category = "Web Development")]
[assembly:AddinName ("TypeScript")]
[assembly:AddinDescription ("Adds TypeScript support. Updated to use TypeScript 1.4")]
[assembly:Add... |
33ae9070-a7bb-4ed2-b7d9-d38a5bc59876 | {
"language": "C#"
} | ```c#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CustomSimplePlayer : MonoBehaviour {
public int speed = 10;
Rigidbody rigidbody;
Vector3 velocity;
// Use this for initialization
void Start () {
rigidbody = GetComponent<Rigidbody>();
}
//... | ```c#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CustomSimplePlayer : MonoBehaviour {
public float speed = 10.0f;
Rigidbody rigidbody;
Vector3 velocity;
// Use this for initialization
void Start () {
Cursor.lockState = CursorLockMode.Locked;
... |
3a79427d-9136-4f51-8931-95ec06f99b6e | {
"language": "C#"
} | ```c#
using System.Collections.Generic;
using HarryPotterUnity.Cards.Generic;
using JetBrains.Annotations;
namespace HarryPotterUnity.Cards.Spells.Charms
{
[UsedImplicitly]
public class EndlessSandwiches : GenericSpell {
protected override void SpellAction(List<GenericCard> targets)
{
... | ```c#
using System.Collections.Generic;
using HarryPotterUnity.Cards.Generic;
using JetBrains.Annotations;
namespace HarryPotterUnity.Cards.Spells.Charms
{
[UsedImplicitly]
public class EndlessSandwiches : GenericSpell {
protected override void SpellAction(List<GenericCard> targets)
{
... |
5ca0e9ca-524b-43e6-bd77-b28991b3012b | {
"language": "C#"
} | ```c#
using System;
public struct Vector2
{
public Vector2(double X, double Y)
{
this.x = X;
this.Y = Y;
}
private double x;
public double X { get { return x; } private set { x = value; } }
public double Y { get; private set; }
public double this[int i]
{
get {... | ```c#
using System;
public struct Vector2
{
public Vector2(double X, double Y)
{
this.x = X;
this.Y = Y;
}
private double x;
public double X { get { return x; } private set { x = value; } }
public double Y { get; private set; }
public double this[int i]
{
get {... |
797485a0-24fa-4e80-94a8-25b60611a355 | {
"language": "C#"
} | ```c#
namespace Mios.Validation.Mvc {
using System.Collections.Generic;
using System.Web.Mvc;
public static class ModelStateDictionaryExtensions {
public static void AddErrors(this ModelStateDictionary modelState, IEnumerable<ValidationError> errors) {
foreach(var error in errors) {
modelState.AddM... | ```c#
namespace Mios.Validation.Mvc {
using System.Collections.Generic;
using System.Web.Mvc;
public static class ModelStateDictionaryExtensions {
public static void AddErrors(this ModelStateDictionary modelState, IEnumerable<ValidationError> errors) {
foreach(var error in errors) {
modelState.AddM... |
aa42811a-b99b-4087-b205-a41cb9667564 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Xunit;
namespace Pather.CSharp.UnitTests
{
// This project can output the Class library as a NuGet Package.
// To enable this option, right-click on the project and select the Properties menu item. In ... | ```c#
using FluentAssertions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Xunit;
namespace Pather.CSharp.UnitTests
{
// This project can output the Class library as a NuGet Package.
// To enable this option, right-click on the project and select the P... |
91b201a2-ac84-4a41-9654-4004bbeabf33 | {
"language": "C#"
} | ```c#
using System.Runtime.CompilerServices;
[assembly:TypeForwardedTo(typeof(Gelf4Net.Layout.GelfLayout))]
[assembly:TypeForwardedTo(typeof(Gelf4Net.Appender.GelfHttpAppender))]
[assembly:TypeForwardedTo(typeof(Gelf4Net.Appender.GelfUdpAppender))]
[assembly:TypeForwardedTo(typeof(Gelf4Net.Appender.AsyncGelfUdpAppende... | ```c#
using System.Runtime.CompilerServices;
[assembly:TypeForwardedTo(typeof(Gelf4Net.Layout.GelfLayout))]
[assembly:TypeForwardedTo(typeof(Gelf4Net.Appender.GelfHttpAppender))]
[assembly:TypeForwardedTo(typeof(Gelf4Net.Appender.AsyncGelfHttpAppender))]
[assembly:TypeForwardedTo(typeof(Gelf4Net.Appender.GelfUdpAppend... |
b34b2a21-e4f4-4495-b101-3d559798493c | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Substructio.Logging
{
public interface IErrorReporting
{
void ReportError(Exception e);
void ReportMessage(string message);
}
public class NullErrorRepor... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Substructio.Logging
{
public interface IErrorReporting
{
string ReportError(Exception e);
string ReportMessage(string message);
}
public class NullErrorR... |
bb82b286-9707-4ff5-b98b-ecd2337ec230 | {
"language": "C#"
} | ```c#
@inherits DotNetNuke.Web.Mvc.Framework.DnnWebViewPage<ContingentViewModel>
@using DotNetNuke.Web.Mvc.Helpers
@using R7.University.EduProgramProfiles.ViewModels
<td itemprop="eduCode">@Model.EduProgramProfile.EduProgram.Code</td>
<td itemprop="eduName">@Model.EduProgramProfileTitle</td>
<td itemprop="eduLe... | ```c#
@inherits DotNetNuke.Web.Mvc.Framework.DnnWebViewPage<ContingentViewModel>
@using DotNetNuke.Web.Mvc.Helpers
@using R7.University.EduProgramProfiles.ViewModels
<td itemprop="eduCode">@Model.EduProgramProfile.EduProgram.Code</td>
<td itemprop="eduName">@Model.EduProgramProfileTitle</td>
<td itemprop="eduLe... |
5d9cdc98-bfad-454d-8ea0-1cc65ea6eac4 | {
"language": "C++"
} | ```c++
// RUN: %check_clang_tidy %s hicpp-exception-baseclass %t
namespace std {
class exception {};
} // namespace std
class derived_exception : public std::exception {};
class non_derived_exception {};
void problematic() {
try {
throw int(42); // Built in is not allowed
// CHECK-MESSAGES: [[@LINE-1]]:5: warn... | ```c++
// RUN: %check_clang_tidy %s hicpp-exception-baseclass %t -- -- -fcxx-exceptions
namespace std {
class exception {};
} // namespace std
class derived_exception : public std::exception {};
class non_derived_exception {};
void problematic() {
try {
throw int(42); // Built in is not allowed
// CHECK-MESSAG... |
5dfd3276-3b19-471f-9df4-fe9eb265a077 | {
"language": "C++"
} | ```c++
#include "mapped_file.h"
#include <exception/os.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/stat.h>
namespace sasm { namespace utils {
mapped_file::~mapped_file()
{
if (_is_mapped)
unmap();
}
void mapped_file::map()
{
int fd;
struct stat buf;
char* begin;
if ((fd = open(get_pa... | ```c++
#include "mapped_file.h"
#include <exception/elf.h>
#include <exception/os.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/stat.h>
namespace sasm { namespace utils {
mapped_file::~mapped_file()
{
if (_is_mapped)
unmap();
}
void mapped_file::map()
{
int fd;
struct stat buf;
char* begin;... |
7e83d0db-e425-403b-a540-6f17eecc79d5 | {
"language": "C++"
} | ```c++
VectorXf v;
v.setLinSpaced(5,0.5f,1.5f).transpose();
cout << v << endl;
```
Remove confusing transpose() in setLinSpaced() docs. | ```c++
VectorXf v;
v.setLinSpaced(5,0.5f,1.5f);
cout << v << endl;
``` |
9f6e192f-de10-49e5-afe3-6542b55b8ac9 | {
"language": "C++"
} | ```c++
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===--------------------... | ```c++
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===--------------------... |
b2dcbcee-28d4-4c03-8d33-4db25fe4137d | {
"language": "C++"
} | ```c++
#include <cppunit/XmlOutputter.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
#include <cppunit/ui/text/TestRunner.h>
#include <cppunit/TestResult.h>
#include <cppunit/TestResultCollector.h>
#include "SystemTest.h"
int main(int argc, char* argv[])
{
CppUnit::TestResult controller;
CppUnit::Tes... | ```c++
#include <cppunit/XmlOutputter.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
#include <cppunit/ui/text/TestRunner.h>
#include <cppunit/TestResult.h>
#include <cppunit/TestResultCollector.h>
#include "SystemTest.h"
int main(int argc, char* argv[])
{
CppUnit::TestResult controller;
CppUnit::Tes... |
658cf060-37e4-4402-aae8-0b0f1cafa4f2 | {
"language": "C++"
} | ```c++
#include "common.th"
// c <- multiplicand
// d <- multiplier
// b -> product
.global imul
imul:
pushall(h,i,j)
b <- 0
#if IMUL_EARLY_EXITS
i <- d == 0
i <- c == 0 + i
i <- i <> 0
jnzrel(i, L_done)
#endif
h <- 1
j <- d >> 31 // save sign bit in j
j <- -j // conve... | ```c++
#include "common.th"
// c <- multiplicand
// d <- multiplier
// b -> product
.global imul
imul:
#if IMUL_EARLY_EXITS
b <- c == 0
d <- d &~ b // d = (c == 0) ? 0 : d
b <- d <> 0
jzrel(b, L_done)
#endif
pushall(h,i,j)
b <- 0
h <- 1
j <- d >> 31 // save sign bit in j
j... |
3f359eaa-2f22-4687-adb2-3ecb8a7cf3c0 | {
"language": "C++"
} | ```c++
/** \file SysLog.h
* \brief Declaration of class SysLog.
* \author Dr. Johannes Ruscheinski
*/
/*
* Copyright 2020 University Library of Tübingen
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* publis... | ```c++
/** \file SysLog.h
* \brief Declaration of class SysLog.
* \author Dr. Johannes Ruscheinski
*/
/*
* Copyright 2020 University Library of Tübingen
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* publis... |
6dcea68e-1dc1-4b59-8031-9ff4b88add1d | {
"language": "C++"
} | ```c++
Matrix2f M = Matrix2f::Random();
Matrix2f m;
m = M;
cout << "Here is the matrix m:" << endl << m << endl;
cout << "Now we want to replace m by its own transpose." << endl;
cout << "If we do m = m.transpose(), then m becomes:" << endl;
m = m.transpose() * 1;
cout << m << endl << "which is wrong!" << endl;
cout <<... | ```c++
Matrix2f M = Matrix2f::Random();
Matrix2f m;
m = M;
cout << "Here is the matrix m:" << endl << m << endl;
cout << "Now we want to copy a column into a row." << endl;
cout << "If we do m.col(1) = m.row(0), then m becomes:" << endl;
m.col(1) = m.row(0);
cout << m << endl << "which is wrong!" << endl;
cout << "Now ... |
4408bc9a-491c-422d-9087-1685bcac4344 | {
"language": "C++"
} | ```c++
#define SYS_CLOCK_GETTIME 263
#include "linux_clock.cpp"
```
Fix a syscall number for 64-bit arm | ```c++
#ifdef BITS_64
#define SYS_CLOCK_GETTIME 113
#endif
#ifdef BITS_32
#define SYS_CLOCK_GETTIME 263
#endif
#include "linux_clock.cpp"
``` |
0152a7ce-726d-4b67-9bfd-566509e2aafe | {
"language": "C++"
} | ```c++
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/idle.h"
#include "base/basictypes.h"
#if defined(USE_X11)
#include "chrome/browser/idle_query_x11.h"
#endif
#if !de... | ```c++
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/idle.h"
#include "base/basictypes.h"
#if defined(USE_X11)
#include "chrome/browser/idle_query_x11.h"
#endif
#if !de... |
c74688bd-e2f4-4b45-b2ed-bc578d091acb | {
"language": "C++"
} | ```c++
// RUN: %clang_cl_asan -O0 %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
#include <windows.h>
HANDLE done;
DWORD CALLBACK work_item(LPVOID) {
int subscript = -1;
volatile char stack_buffer[42];
stack_buffer[subscript] = 42;
// CHECK: AddressSanitizer: stack-buffer-underflow on address [[ADDR:0x[0-9a-... | ```c++
// RUN: %clang_cl_asan -O0 %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
#include <windows.h>
HANDLE done;
DWORD CALLBACK work_item(LPVOID) {
int subscript = -1;
volatile char stack_buffer[42];
stack_buffer[subscript] = 42;
// CHECK: AddressSanitizer: stack-buffer-underflow on address [[ADDR:0x[0-9a-... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.