doc_id stringlengths 36 36 | metadata dict | input stringlengths 28 4.3k | output stringlengths 11 5.45k |
|---|---|---|---|
9354df66-10f5-425a-a531-b9d4578048ce | {
"language": "C#"
} | ```c#
```
Add helper to track ongoing operations in UI | ```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.Bindables;
namespace osu.Game.Screens.OnlinePlay
{
/// <summary>
/// Utility class to track ongoing online operations' pr... |
e1ac2ff2-6a07-490b-98a8-efa14548253f | {
"language": "C#"
} | ```c#
```
Add missing file to repository | ```c#
// ***********************************************************************
// Copyright (c) 2012 Charlie Poole
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction... |
23e2886b-ceaa-4490-a347-4a3fb97bd1c8 | {
"language": "C#"
} | ```c#
```
Add utility class (mapped from Java SDK) | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Alexa.NET.Request.Type;
namespace Alexa.NET.Request
{
public static class SkillRequestUtility
{
public static string GetIntentName(this SkillRequest request)
{
return request.Request i... |
f73b241a-fc77-4c31-a807-4b3c544627fb | {
"language": "C#"
} | ```c#
```
Add serviceable attribute to projects. | ```c#
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Reflection;
[assembly: AssemblyMetadata("Serviceable", "True")]``` |
851eef9e-3bc5-48b4-8bbc-295a64ac6384 | {
"language": "C#"
} | ```c#
```
Add API service to handle save and load of API keys | ```c#
using System;
using System.Threading.Tasks;
using ReceptionKiosk.Helpers;
using Windows.Storage;
using Windows.UI.Xaml;
namespace ReceptionKiosk.Services
{
public class APISettingsService
{
private string faceAPI;
private string bingAPI;
public APISettingsService()
{
... |
b648c8e2-f11a-4f05-beef-0178c225242d | {
"language": "C#"
} | ```c#
```
Add missing PartsDb base class | ```c#
using System;
using System.Data;
using System.Collections.Generic;
public delegate void ErrorHandler(string message, Exception exception);
public delegate void PartTypesHandler(List<PartType> partTypes);
public delegate void PartsHandler(PartCollection part);
public delegate void PartHandler(Part part);
public... |
3bfa7f40-0d7d-4d16-9098-9c196ac01791 | {
"language": "C#"
} | ```c#
```
Test for async graph updates from gui block/connector | ```c#
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using KSPCommEngr;
namespace CommEngrTest
{
[TestClass]
public class CommBlockTests
{
[TestMethod]
public void UpdateGraphOnDragStop()
{
Graph graph = new Graph(new int[,] {
... |
924c09cc-7bf6-49d2-9355-564bb35aad36 | {
"language": "C#"
} | ```c#
```
Add simple test case for FullscreenOverlay | ```c#
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using NUnit.Framework;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Game.Overlays;
using osuTK.Graphics;
namespace osu.Game.Tests.V... |
970bf59c-fb11-4a6b-a390-2c9639b5804b | {
"language": "C#"
} | ```c#
```
Check we don't reference DesignTime assemblies | ```c#
using System.IO;
using System.Reflection;
using NUnit.Framework;
public class GitHubAssemblyTests
{
[Theory]
public void GitHub_Assembly_Should_Not_Reference_DesignTime_Assembly(string assemblyFile)
{
var asm = Assembly.LoadFrom(assemblyFile);
foreach (var referencedAssembly in asm.G... |
996c22a7-6b65-4b65-8a28-2308dde4f205 | {
"language": "C#"
} | ```c#
```
Create new CelestialBody from asteroid data | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
namespace DMModuleScienceAnimateGeneric
{
public class AsteroidScience
{
protected DMModuleScienceAnimateGeneric ModSci = FlightGlobals.ActiveVessel.FindPartModulesImplementing<DMModuleScienc... |
a6443926-4611-457d-b419-b962aaf47071 | {
"language": "C#"
} | ```c#
```
Add test for BinarySearcher class | ```c#
using System.Collections.Generic;
using Xunit;
using Algorithms.Search;
namespace UnitTest.AlgorithmsTests
{
public static class BinarySearcherTest
{
[Fact]
public static void MergeSortTest()
{
//a list of int
IList<int> list = new List<int> {9, 3, 7, 1,... |
ebeca7c1-bbaf-4642-9aff-ba63b6a8a764 | {
"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.Graphics;
using osu.Framework.Graphics.Containers;
namespace osu.Game.Graphics.Containers
{
public class ShakeContainer : Container
{... | ```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.Graphics;
using osu.Framework.Graphics.Containers;
namespace osu.Game.Graphics.Containers
{
public class ShakeContainer : Container
{... |
f6c2f92d-aafe-4a1d-a6e5-167bbc4111c6 | {
"language": "C#"
} | ```c#
```
Introduce model to store path of stable osu! | ```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.Bindables;
namespace osu.Game.Tournament.Models
{
/// <summary>
/// Holds the complete data required to operate the tourn... |
43dfc633-2167-4123-a972-dbab1a32535b | {
"language": "C#"
} | ```c#
```
Add the support for autoscale SCPI command | ```c#
using System;
using System.Collections.Generic;
using System.Text;
namespace SCPI
{
public class AUTOSCALE : ICommand
{
public string Description => "The oscilloscope will automatically adjust the vertical scale, horizontal timebase, and trigger mode according to the input signal to realize opti... |
b3bceaae-87bb-4d90-80be-f14c8c208298 | {
"language": "C#"
} | ```c#
using System;
using System.Linq.Expressions;
namespace Nest.Resolvers
{
public static class Property
{
/// <summary>
/// Create a strongly typed string representation of the path to a property
/// <para>i.e p => p.Arrary.First().SubProperty.Field will return 'array.subProperty.field'</para>
/// </summa... | ```c#
using System;
using System.Linq.Expressions;
namespace Nest.Resolvers
{
public static class Property
{
/// <summary>
/// Create a strongly typed string representation of the path to a property
/// <para>i.e p => p.Array.First().SubProperty.Field will return 'array.subProperty.field'</para>
/// </summar... |
04fea32d-697e-41be-b1a9-0fe4bf755c18 | {
"language": "C#"
} | ```c#
```
Move JobStore cleanup to abstract class. | ```c#
using System;
namespace Quartz.DynamoDB.Tests.Integration.JobStore
{
/// <summary>
/// Abstract class that provides common dynamo db cleanup for JobStore integration testing.
/// </summary>
public abstract class JobStoreIntegrationTest : IDisposable
{
protected DynamoDB.JobStore _sut... |
0bf7ec90-4643-469a-8565-e5029f9268bc | {
"language": "C#"
} | ```c#
```
Copy source code from KLibrary-Labs | ```c#
using System;
using System.Collections.Generic;
namespace KLibrary.Linq
{
public static class Comparison
{
public static IComparer<T> CreateComparer<T>(Func<T, T, int> compare)
{
return new DelegateComparer<T>(compare);
}
public static IEqualityCo... |
733ac0c7-39fd-458c-86a4-5079e6397ad0 | {
"language": "C#"
} | ```c#
```
Implement testcase for room settings | ```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.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Online.Multiplayer;
using osu.Game.Screens.Multi.Match.Components;
namespace... |
8eadb20d-9cf5-48a4-a0d3-75f2f9479f4c | {
"language": "C#"
} | ```c#
```
Add stub implementation of local | ```c#
using System;
namespace Glimpse.Server
{
public class LocalBrokerPublisher : IBrokerPublisher
{
public void PublishMessage(IMessage message)
{
// TODO: push straight to the bus
}
}
}``` |
702149f0-d041-4297-b9a3-af7479410718 | {
"language": "C#"
} | ```c#
```
Add auto exit play mode on compile | ```c#
using UnityEngine;
using System.Collections;
using UnityEditor;
namespace Expanse
{
/// <summary>
/// Exits play mode automatically when Unity performs code compilation.
/// </summary>
[InitializeOnLoad]
public class ExitPlayModeOnCompile
{
private static ExitPlayModeOnCompile in... |
42387c00-a245-43f8-92fc-e01f7ab40c27 | {
"language": "C#"
} | ```c#
```
Add constant time functions and functions for generating random bytes | ```c#
using System;
using System.Runtime.CompilerServices;
namespace NSec.Experimental
{
public static class CryptographicUtilities
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void FillRandomBytes(Span<byte> data)
{
System.Security.Cryptography.RandomN... |
e637607c-9b5b-4219-876a-ef2f82f995c1 | {
"language": "C#"
} | ```c#
```
Add new configuration for ServiceContainer | ```c#
namespace TestHttpCompositionConsoleApp.ConfigurationSources
{
using System;
using Newtonsoft.Json;
using Serviceable.Objects.Composition.Graph;
using Serviceable.Objects.Composition.Graph.Stages.Configuration;
using Serviceable.Objects.Composition.Service;
using Serviceable.Objects.IO.Na... |
2afe1fcb-f180-49bd-8d40-7d85a44c9757 | {
"language": "C#"
} | ```c#
```
Add a class to perform basic vector operations (addition, subtraction, scaling) for the optimization needs. | ```c#
using System;
namespace ISAAR.MSolve.Analyzers.Optimization.Commons
{
public static class VectorOperations
{
public static double[] Add(double[] v1, double[] v2)
{
CheckDimensions(v1, v2);
double[] result = new double[v1.Length];
for (int i = 0; i <... |
f854c6e6-0240-4d1c-b114-f1b2d47b7c00 | {
"language": "C#"
} | ```c#
```
Add interface for common properties | ```c#
namespace food_tracker {
public interface IListItems {
double calories { get; set; }
double amount { get; set; }
double fats { get; set; }
double saturatedFat { get; set; }
double carbohydrates { get; set; }
double sugar { get; set; }
double protein { g... |
98841936-3228-497c-9494-af9a0019f02b | {
"language": "C#"
} | ```c#
```
Add extension to handle MPMediaItem | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using CoreGraphics;
using MediaManager.Library;
using MediaPlayer;
namespace MediaManager.Platforms.Ios.Media
{
public static class MPMediaItemExtensions
{
public static IMediaItem ToMediaItem(this MPMediaItem item)
{
... |
aa003cf4-0a72-4a1f-a95f-77c01d1c9317 | {
"language": "C#"
} | ```c#
namespace FakeItEasy.Core
{
using System;
using System.Linq;
using FakeItEasy.Creation;
/// <content>Auto fake property rule.</content>
public partial class FakeManager
{
[Serializable]
private class AutoFakePropertyRule
: IFakeObjectCallRule
... | ```c#
namespace FakeItEasy.Core
{
using System;
using System.Linq;
/// <content>Auto fake property rule.</content>
public partial class FakeManager
{
[Serializable]
private class AutoFakePropertyRule
: IFakeObjectCallRule
{
public FakeMan... |
302e8f70-bc78-4955-b5c4-3f79c9d915a2 | {
"language": "C#"
} | ```c#
```
Add a simple debug query | ```c#
using HotChocolate.Types;
using System;
using System.Collections.Generic;
using System.Text;
namespace Snowflake.Support.GraphQLFrameworkQueries.Queries.Debug
{
public class EchoQueries
: ObjectTypeExtension
{
protected override void Configure(IObjectTypeDescriptor descriptor)
{
... |
3b01759b-a6d2-49be-8700-8fcf55b8de79 | {
"language": "C#"
} | ```c#
```
Add keywords of the Print Schema Keywords v1.1 | ```c#
using System.Xml.Linq;
namespace Kip
{
public static class Pskv11
{
public static readonly XNamespace Namespace = "http://schemas.microsoft.com/windows/2013/05/printing/printschemakeywordsv11";
public static readonly XName JobPasscode = Namespace + "JobPasscode";
public static r... |
26991565-d29d-4a81-88e1-ecb8bbb21a1d | {
"language": "C#"
} | ```c#
```
Add class to avoid byte[] creation | ```c#
using System.IO;
using System.Runtime.InteropServices;
namespace Diadoc.Api.Com
{
[ComVisible(true)]
[Guid("AC96A3DD-E099-44CC-ABD5-11C303307159")]
public interface IComBytes
{
byte[] Bytes { get; set; }
void ReadFromFile(string path);
void SaveToFile(string path);
}
[ComVisible(true)]
[ProgId("D... |
b1a44b19-e2e9-42dc-a104-16f97872b541 | {
"language": "C#"
} | ```c#
```
Add generation of KML file to maps menu | ```c#
using FTAnalyzer.Utilities;
using System;
namespace FTAnalyzer.Mapping
{
static class GoogleAPIKey
{
static string APIkeyValue = string.Empty;
public static string KeyValue
{
get
{
if (string.IsNullOrEmpty(APIkeyValue))
{
... |
83fe5c51-47e9-484d-9a11-5abde284693a | {
"language": "C#"
} | ```c#
```
Move a small part of current | ```c#
using System;
using Umbraco.Core.Logging;
namespace Umbraco.Core.Composing
{
/// <summary>
/// Provides a static service locator for most singletons.
/// </summary>
/// <remarks>
/// <para>This class is initialized with the container in UmbracoApplicationBase,
/// right after the contain... |
7e4448bf-97da-4f59-b348-de22991c4d86 | {
"language": "C#"
} | ```c#
```
Add model class for mod presets | ```c#
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Collections.Generic;
namespace osu.Game.Rulesets.Mods
{
/// <summary>
/// A mod preset is a named collection of configured mods.... |
8453c881-29ed-47d6-b262-ddb7c7b97c1d | {
"language": "C#"
} | ```c#
```
Add exception type for native call failures. | ```c#
// ---------------------------------------------------------------------------------------
// <copyright file="NativeCallException.cs" company="">
// Copyright © 2015 by Adam Hellberg and Brandon Scott.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this sof... |
734b71d9-d339-486b-9c18-ee3a22b5031c | {
"language": "C#"
} | ```c#
```
Add version helper to simplify creating a version list | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
namespace KenticoInspector.Core.Helpers
{
public class VersionHelper
{
public static IList<Version> GetVersionList(params string[] versions)
{
return versions.Select(x => GetVersionFromShortString(x)).ToList()... |
a62922f8-59a3-476c-a00a-985a410f1b80 | {
"language": "C#"
} | ```c#
```
Add CreateGenericInstance Type extension method to help building models | ```c#
using System;
namespace Zbu.ModelsBuilder
{
public static class TypeExtensions
{
/// <summary>
/// Creates a generic instance of a generic type with the proper actual type of an object.
/// </summary>
/// <param name="genericType">A generic type such as <c>Something{}</c>... |
09c7bffd-e446-4eed-a7de-2dd9674de3e6 | {
"language": "C#"
} | ```c#
```
Add a base for web forms controls | ```c#
namespace My.AspNetCore.WebForms.Controls
{
public abstract class Control
{
public string Id { get; set; }
public string InnerHtml { get; protected set; }
public abstract void Render();
}
}
``` |
3da98539-3f45-4b40-805a-8a2d3ed5315c | {
"language": "C#"
} | ```c#
```
Add initial contract for message bus | ```c#
using System;
namespace Glimpse.Broker
{
public interface IMessageBus
{
IObservable<T> Listen<T>();
IObservable<T> ListenIncludeLatest<T>();
bool IsRegistered(Type type);
}
}``` |
890977ee-8f08-4238-9e17-4ebd951fd17f | {
"language": "C#"
} | ```c#
```
Add JWA enumeration for JWS Algorithms | ```c#
using System.Runtime.Serialization;
namespace THNETII.Security.JOSE
{
/// <summary>
/// Defines the set of <c>"alg"</c> (algorithm) Header Parameter
/// values defined by this specification for use with JWS.
/// <para>Specified in <a href="https://tools.ietf.org/html/rfc7518#section-3.1">RFC 751... |
ff6cbb4b-3acb-4e67-9f58-b845da2ba417 | {
"language": "C#"
} | ```c#
```
Read and write a Trie | ```c#
// Print a trie
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
class Node
{
private Dictionary<char, Node> Next = new Dictionary<char, Node>();
private bool IsWord;
public static Node Read(List<String> items)
{
return items
.Aggregate... |
1ebc8a3c-d48c-4cc5-81c2-249cfb540a31 | {
"language": "C#"
} | ```c#
```
Add sendgeneric command to TestClient to allow one to send arbitrary GenericMessagePackets to the simulator for testing purposes | ```c#
using System;
using System.Collections.Generic;
using System.Text;
using OpenMetaverse;
using OpenMetaverse.Packets;
namespace OpenMetaverse.TestClient
{
/// <summary>
/// Sends a packet of type GenericMessage to the simulator.
/// </summary>
public class GenericMessageCommand : Command
{
... |
2d860905-9248-45aa-ac07-6309ba9237dc | {
"language": "C#"
} | ```c#
```
Add move message module. First iteration before refactor | ```c#
using System;
using System.Linq;
using System.Threading.Tasks;
using Discord;
using Discord.Commands;
using Modix.Services.CommandHelp;
namespace Modix.Modules
{
[Name("Move Message"), RequireUserPermission(GuildPermission.ManageMessages), HiddenFromHelp]
public class MoveMessageModule : ModuleBase
... |
b430ae69-ee53-4168-b70e-673cce7fcafb | {
"language": "C#"
} | ```c#
```
Add failing tests for mapping of enum values | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using EntryPoint;
using Xunit;
namespace EntryPointTests {
public class EnumArguments {
[Fact]
public void Enums_Int() {
string[] args = new string[] {
"--opt-1", "3"... |
e4ac8e15-4d64-4d6e-9a60-0e93739e1334 | {
"language": "C#"
} | ```c#
@model StackExchange.Opserver.Views.Exceptions.ExceptionsModel
@{
var e = Model.Exception;
var log = Model.SelectedLog;
var exceptions = Model.Errors;
this.SetPageTitle(Model.Title);
}
@section head {
<script>
$(function () { Status.Exceptions.init({ log: '@log', id: '@e.GUID', enabl... | ```c#
@model StackExchange.Opserver.Views.Exceptions.ExceptionsModel
@{
var e = Model.Exception;
var log = Model.SelectedLog;
var exceptions = Model.Errors;
this.SetPageTitle(Model.Title);
}
@section head {
<script>
$(function () { Status.Exceptions.init({ log: '@log', id: '@e.GUID', enabl... |
2983fef2-7b26-4dc4-aa5a-5d05f19360e8 | {
"language": "C#"
} | ```c#
```
Add class to hold snippets for the Period type | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NodaTime.Demo
{
class PeriodDemo
{
}
}
``` |
18770bc8-7446-4212-8ac3-618f22bdd0ec | {
"language": "C#"
} | ```c#
```
Add - Attività Utente per la gestrione degli stati "InLavorazione" e "Prenotato" | ```c#
using System;
using System.Collections.Generic;
using System.Text;
namespace SO115App.Models.Classi.Soccorso
{
public class AttivitaUtente
{
public string Nominativo { get; set; }
public DateTime DataInizioAttivita { get; set; }
}
}
``` |
82c3904d-356d-4fd9-81cb-3910e46fa50f | {
"language": "C#"
} | ```c#
```
Add simple ping controller to check functionality. | ```c#
using A2BBAPI.Data;
using A2BBAPI.Models;
using A2BBCommon;
using A2BBCommon.DTO;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System;
using System.Linq;
using static A2BBAPI.Models.InOut;
namespace A2BBAPI.Controllers
{
/// <summary>
... |
3e3545bc-44f1-4433-92dc-e0e3fededd78 | {
"language": "C#"
} | ```c#
```
Add enumeration of supported SqlClient versions. | ```c#
/*
Copyright 2021 Jeffrey Sharp
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCL... |
d54dbc4c-ff83-43fc-9141-f34d45213506 | {
"language": "C#"
} | ```c#
```
Introduce a new ReleaseManager tool (populate-api-catalog) | ```c#
// Copyright 2022 Google LLC
//
// 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed... |
09eadb6a-9076-49df-984a-1649307e22b1 | {
"language": "C#"
} | ```c#
```
Add testable spectator streaming client | ```c#
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using osu.Framework.Bindables;
using osu.Framework.Utils;
using osu.Game.Online;
using osu.Game.Online.Spectator;
using osu.Game.R... |
1f2e3470-0162-48af-997a-6a875968552c | {
"language": "C#"
} | ```c#
```
Add visual test for EdgeSnappingContainer | ```c#
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Collections.Generic;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using os... |
9f8b7685-2732-46e7-bc0f-9c32b82821f6 | {
"language": "C#"
} | ```c#
```
Add unit tests for TestId | ```c#
using System.Collections.Generic;
using System.Linq;
using Arkivverket.Arkade.Core.Util;
using FluentAssertions;
using Xunit;
namespace Arkivverket.Arkade.CoreTests.Util
{
public class TestIdTests
{
[Fact]
public void ToStringTest()
{
var testId = new TestId(TestId.Te... |
b6034737-d2d8-4e3a-b547-c70ac8cfe2b5 | {
"language": "C#"
} | ```c#
```
Add missing file to repository | ```c#
// ***********************************************************************
// Copyright (c) 2010 Charlie Poole
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction... |
4bd4d2b0-7e62-444d-bdc4-0e647551f955 | {
"language": "C#"
} | ```c#
```
Fix missing files for release 3.7.4.2704 | ```c#
namespace Patagames.Pdf.Net.Controls.Wpf
{
/// <summary>
/// Represents the scaling options of the page for printing
/// </summary>
public enum PrintSizeMode
{
/// <summary>
/// Fit page
/// </summary>
Fit,
/// <summary>
/// Actual size
... |
547aa0db-56c2-4510-9215-b4322ec8966a | {
"language": "C#"
} | ```c#
```
Disable test parallelization in Marten.Testing | ```c#
using Xunit;
// 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: CollectionBehavior(DisableTestParallelization = true)]
``` |
d495a9c7-5591-49e6-a6a2-0638fe761bc2 | {
"language": "C#"
} | ```c#
```
Optimize coins management with CoinRegistry | ```c#
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using NBitcoin;
using WalletWasabi.Models;
namespace WalletWasabi.Gui.Models
{
public class CoinsRegistry
{
private HashSet<SmartCoin> _coins;
private object _lock;
public event NotifyCollectionChangedEventHandler ... |
dbf771bd-25f3-4d4b-b651-7a6333536dc6 | {
"language": "C#"
} | ```c#
```
Add tests to cover TestSuite.Copy | ```c#
using NUnit.Framework.Api;
using NUnit.TestData.OneTimeSetUpTearDownData;
using NUnit.TestData.TestFixtureSourceData;
using NUnit.TestUtilities;
namespace NUnit.Framework.Internal
{
// Tests that Copy is properly overridden for all types extending TestSuite - #3171
public class TestSuiteCopyTests
{
... |
ff2656f4-48f5-4b99-8ba4-6325a2cd9bcd | {
"language": "C#"
} | ```c#
```
Create Test that dapper works wil Session | ```c#
using System.Collections.Generic;
using System.Linq;
using Dapper;
using FakeItEasy;
using NUnit.Framework;
using Smooth.IoC.Dapper.FastCRUD.Repository.UnitOfWork.Tests.TestHelpers;
using Smooth.IoC.Dapper.Repository.UnitOfWork.Data;
namespace Smooth.IoC.Dapper.FastCRUD.Repository.UnitOfWork.Tests.ExampleTests
... |
db4e3311-0b8f-4a98-9a06-49ac7ec65443 | {
"language": "C#"
} | ```c#
```
Add Win32 functionality to get foreground process | ```c#
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace Articulate
{
/// <summary>
/// Gets information about the currently active window
/// </summary>
publ... |
e18ad94a-33d7-4703-9d48-956bf8ab4fff | {
"language": "C#"
} | ```c#
```
Add an xUnit test discoverer that ignores tests when run on AppVeyor | ```c#
namespace Respawn.DatabaseTests
{
using System;
using System.Collections.Generic;
using System.Linq;
using Xunit;
using Xunit.Abstractions;
using Xunit.Sdk;
public class SkipOnAppVeyorTestDiscoverer : IXunitTestCaseDiscoverer
{
private readonly IMessageSink _diagnosticMes... |
edbe0f49-07e7-48f9-8377-b8bf4a24c0e3 | {
"language": "C#"
} | ```c#
```
Change DropDownButton, Change Sepparotor name on Menu, Logout if unsuccessful ping Part VII | ```c#
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using Gtk;
namespace Moscrif.IDE.Components
{
class DropDownRadioButton: DropDownButton
{
public DropDownRadioButton()
{
}
protected override void OnPressed ()
{
//base.OnPressed ();
Gtk.Menu menu = new Gt... |
704dd515-0643-48a6-bc28-950e4f111f98 | {
"language": "C#"
} | ```c#
using System;
using System.IO;
using System.Net.Http;
using System.Net.Mime;
using System.Threading.Tasks;
namespace Dotnet.Script.Core
{
public class ScriptDownloader
{
public async Task<string> Download(string uri)
{
const string plainTextMediaType = "text/plain";
... | ```c#
using System;
using System.IO;
using System.IO.Compression;
using System.Net.Http;
using System.Threading.Tasks;
namespace Dotnet.Script.Core
{
public class ScriptDownloader
{
public async Task<string> Download(string uri)
{
using (HttpClient client = new HttpClient())
... |
539ce099-514e-4403-af11-10938c452f31 | {
"language": "C#"
} | ```c#
using System;
using System.Threading;
namespace ProcessTest_ConsoleApp
{
class Program
{
static int Main(string[] args)
{
try
{
if (args.Length > 0)
{
if (args[0].Equals("infinite"))
{
... | ```c#
using System;
using System.Threading;
namespace ProcessTest_ConsoleApp
{
class Program
{
static int Main(string[] args)
{
try
{
if (args.Length > 0)
{
if (args[0].Equals("infinite"))
{
... |
5940a545-00a3-4b5d-8c05-eb29b928325b | {
"language": "C#"
} | ```c#
```
Set specs on all tiles at Awake() | ```c#
using UnityEngine;
using UnityEngine.Assertions;
public class TileSystemManager : BaseBehaviour
{
private Shader shader;
void Start()
{
shader = Shader.Find("Sprites/Diffuse");
Assert.IsNotNull(shader);
SetChunksToStatic();
DisableShadows();
}
void SetChunksToStatic()
{
foreach (Transform chil... |
b24d8e27-59aa-42d8-8939-fd2d3338cd69 | {
"language": "C#"
} | ```c#
```
Add TLS token binding feature | ```c#
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using Microsoft.Framework.Runtime;
namespace Microsoft.AspNet.Http.Interfaces
{
/// <summary>
/// Provides... |
3d72bc44-5626-4788-9cf6-0341defe8437 | {
"language": "C#"
} | ```c#
```
Add items for database persistence | ```c#
namespace food_tracker {
public class NutritionItem {
public string name { get; set; }
public double calories { get; set; }
public double carbohydrates { get; set; }
public double sugars { get; set; }
public double fats { get; set; }
public double saturatedFats... |
339df4e9-7e9e-42f7-96d9-e7e7755f1cfe | {
"language": "C#"
} | ```c#
```
Add a abstract server class. Watch out for the todos. | ```c#
/*
* WoWCore - World of Warcraft 1.12 Server
* Copyright (C) 2017 exceptionptr
*
* 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 y... |
5b761cb7-71e7-48b7-b1b0-371429bbaefc | {
"language": "C#"
} | ```c#
```
Add assembly info for new project | ```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.Reflection;
using System.Resources;
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: NeutralResourcesLanguage("en-us")... |
40712732-7dad-4078-88a7-fc91ebc27df9 | {
"language": "C#"
} | ```c#
```
Implement CartSpecs to Control Specification | ```c#
using WJStore.Domain.Interfaces.Validation;
namespace WJStore.Domain.Entities.Specifications.CartSpecs
{
public class CartCountShouldBeGreaterThanZeroSpec : ISpecification<Cart>
{
public bool IsSatisfiedBy(Cart cart)
{
return cart.Count > 0;
}
}
}
``` |
3a401148-c051-4f25-8734-d82a625a21fd | {
"language": "C#"
} | ```c#
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Game.Graphics;
namespace osu.Game.Overlays.Toolbar
{
internal class ToolbarDirectButton : ToolbarOverlayTogg... | ```c#
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Game.Graphics;
namespace osu.Game.Overlays.Toolbar
{
internal class ToolbarDirectButton : ToolbarOverlayTogg... |
284cfaa1-2432-420c-b369-4273c5387596 | {
"language": "C#"
} | ```c#
```
Add test fixture for secret splitting | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
namespace ElectronicCash.Tests
{
[TestFixture]
class SecretSplittingTests
{
private static readonly byte[] _message = Helpers.GetBytes("Supersecretmessag... |
3f0bee8f-4d9b-47f2-ada4-f29d81e08665 | {
"language": "C#"
} | ```c#
```
Add a logging effect to debug | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace SmokeScreen
{
[EffectDefinition("DEBUG_EFFECT")]
class DebugEffect : EffectBehaviour
{
public override void OnEvent()
{
Print(effectName.PadRight(16) + "OnEvent single --------... |
2c5731b6-b997-4772-ad78-cbff85cd54d9 | {
"language": "C#"
} | ```c#
```
Implement test for client login. | ```c#
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moegirlpedia.MediaWikiInterop.Actions;
using Moegirlpedia.MediaWikiInterop.Actions.Models;
using Moegirlpedia.MediaWikiInterop.Actions.QueryProviders;
using Moegirlpedia.MediaWikiInterop.Primitives.DependencyInjection;
using System;
using System.Threading... |
a2df1a9b-a0f9-42ee-becf-d544441ad12c | {
"language": "C#"
} | ```c#
```
Add Composite implementation for Indexers | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CK.Monitoring;
namespace CK.Glouton.Lucene
{
class CompositeIndexer : IIndexer
{
private List<IIndexer> _indexers;
public CompositeIndexer ()
{
_... |
0ed979d3-ef99-4818-b477-14376b455594 | {
"language": "C#"
} | ```c#
```
Add a script for check if we are a tank. | ```c#
switch (ObjectManager.Me.WowSpecialization())
{
case WoWSpecialization.PaladinProtection:
case WoWSpecialization.WarriorProtection:
case WoWSpecialization.MonkBrewmaster:
case WoWSpecialization.DruidGuardian:
case WoWSpecialization.DeathknightBlood:
return true;
default:
return false;
}
// Usage: <Scri... |
acc7a3de-23e9-432c-9411-9eaf3ff8ef25 | {
"language": "C#"
} | ```c#
```
Add date time passing practices. | ```c#
using System;
using System.Collections.Generic;
using System.Globalization;
using Xunit;
namespace CSharpViaTest.OtherBCLs.HandleDates
{
/*
* Description
* ===========
*
* This test will try passing date time between the boundary (e.g. via HTTP).
* And the culture information at e... |
4544b275-14d0-4f1b-923f-959d8960884f | {
"language": "C#"
} | ```c#
```
Add script for serializing level data | ```c#
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using System;
using UnityEngine;
public class LevelData : BaseBehaviour
{
public int HP { get; set; }
public int AC { get; set; }
public int Damage { get; set; }
public void Save()
{
var bf = new BinaryFormatter();
FileStrea... |
7343c26f-1a04-4c35-aef1-186b0b1fc6fb | {
"language": "C#"
} | ```c#
```
Split model class for mod state | ```c#
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Bindables;
using osu.Game.Rulesets.Mods;
namespace osu.Game.Overlays.Mods
{
/// <summary>
/// Wrapper class used to store the current s... |
54067f8d-7334-47db-9544-6f81307be2cf | {
"language": "C#"
} | ```c#
```
Add IProvideExpenditure class to support data provision | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using GeneralUseClasses.Contracts;
namespace GeneralUseClasses.Services
{
public interface IProvideExpenditureData
{
IEnumerable<string> GetDominantTags();
IEnumerable<st... |
b7117ad5-d83a-4b3e-89b9-62e58fbde010 | {
"language": "C#"
} | ```c#
@model Dinamico.Models.ContentPage
@{
Content.Define(re =>
{
re.Title = "News page";
re.IconUrl = "{IconsUrl}/newspaper.png";
re.DefaultValue("Visible", false);
re.RestrictParents("Container");
re.Sort(N2.Definitions.SortBy.PublishedDescending);
});
}
@Html.Partial("LayoutPartials/Bl... | ```c#
@model Dinamico.Models.ContentPage
@{
Content.Define(re =>
{
re.Title = "News page";
re.IconUrl = "{IconsUrl}/newspaper.png";
re.DefaultValue("Visible", false);
re.RestrictParents("Container");
re.Sort(N2.Definitions.SortBy.PublishedDescending);
re.Tags("Tags");
});
}
@Html.Partia... |
06124bb1-4a96-4c95-b425-27ebe6d9931a | {
"language": "C#"
} | ```c#
namespace N2.Management
{
public partial class Top : System.Web.UI.MasterPage
{
}
}
```
Hide logout when not using forms auth | ```c#
using System.Configuration;
using System.Web.Configuration;
namespace N2.Management
{
public partial class Top : System.Web.UI.MasterPage
{
protected override void OnLoad(System.EventArgs e)
{
base.OnLoad(e);
try
{
var section = (AuthenticationSection)ConfigurationManager.GetSec... |
edfac37c-5c41-42e7-b3c1-95ca4e16ff78 | {
"language": "C#"
} | ```c#
```
Add a factory for Property path element | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace Pather.CSharp.PathElements
{
public class PropertyFactory : IPathElementFactory
{
public IPathElement Create(string pathElement)
{
... |
0991519d-f644-4516-ace4-4ada0dea4417 | {
"language": "C#"
} | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using neon2d.Math;
namespace neon2d.Physics
{
public class Rect
{
public float x, y;
public float width, height;
public Rect(int x, int y, int width, int height)
... | ```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using neon2d.Math;
namespace neon2d.Physics
{
public class Rect
{
public float x, y;
public float width, height;
public Rect(int x, int y, int width, int height)
... |
c22d11b3-050a-4471-89aa-6bb2c6dd94ef | {
"language": "C#"
} | ```c#
```
Add extension method to provide drawable adjustments | ```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;
namespace osu.Framework.Graphics
{
/// <summary>
/// Holds extension methods for <see cref="Drawable"/>.
/// </summary>
public static... |
63ef463c-057b-4244-913a-d1af06c8d5d2 | {
"language": "C#"
} | ```c#
```
Fix warnings in unit tests flagged by MSBuild Log | ```c#
// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Nam... |
56e37a70-eeb4-4e62-9198-9e705261e255 | {
"language": "C#"
} | ```c#
```
Add a button press example | ```c#
using UnityEngine;
using System.Collections;
public class HandleButtonPress : MonoBehaviour {
public OSVR.Unity.OSVRClientKit clientKit;
public OSVR.Unity.InterfaceCallbacks cb;
public void Start() {
GetComponent<OSVR.Unity.InterfaceCallbacks> ().RegisterCallback (handleButton);
}
public void handleB... |
2a4f0cab-0447-4b4d-9217-eaf834f6eff3 | {
"language": "C#"
} | ```c#
```
Add unit tests for UaTcpChannelOptions | ```c#
using FluentAssertions;
using System;
using System.Collections.Generic;
using System.Text;
using Workstation.ServiceModel.Ua;
using Xunit;
namespace Workstation.UaClient.UnitTests
{
public class UaApplicationOptionsTests
{
[Fact]
public void UaTcpTransportChannelOptionsDefaults()
... |
afb4f2af-05ea-47fd-a110-fa9a11160770 | {
"language": "C#"
} | ```c#
```
Create a class that is used to process the restQL queries. | ```c#
using System;
using System.Collections.Generic;
using System.Text;
namespace Nohros.Toolkit.RestQL
{
/// <summary>
/// A class used to process a restQL query.
/// </summary>
public class QueryProcessor
{
QueryInfo query_;
string query_key_;
#region .ctor
/// <summary>
... |
815bc302-eec0-41dd-bd2b-50d0fc5fdf8b | {
"language": "C#"
} | ```c#
using MahApps.Metro.Controls;
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;... | ```c#
using MahApps.Metro.Controls;
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;... |
e42b572e-6828-43cc-b28a-0770a8dae27f | {
"language": "C#"
} | ```c#
using System;
namespace ZocMonLib
{
public class Constant
{
public static readonly DateTime MinDbDateTime = new DateTime(1753, 1, 1);
public const long TicksInMillisecond = 10000;
public const long MinResolutionForDbWrites = 60 * 1000;
public const long MsPerDa... | ```c#
using System;
using System.Data.SqlTypes;
namespace ZocMonLib
{
public class Constant
{
public static readonly DateTime MinDbDateTime = SqlDateTime.MinValue.Value;
public const long TicksInMillisecond = TimeSpan.TicksPerMillisecond;
public const long MinResolutionForD... |
a4a07a65-6fa9-4e4f-89fd-9dc041b2385c | {
"language": "C#"
} | ```c#
```
Add a new Paused mode. | ```c#
using System;
using System.Collections.Generic;
using System.Text;
using MonoTorrent.Common;
namespace MonoTorrent.Client
{
class PausedMode : Mode
{
public override TorrentState State
{
get { return TorrentState.Paused; }
}
public PausedMode(TorrentManager manager)
: base(... |
a9d6c044-46c2-4c34-b464-afa784b9cf0e | {
"language": "C#"
} | ```c#
//
// Copyright 2012 Microsoft 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 by applicable... | ```c#
//
// Copyright 2012 Microsoft 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 by applicable... |
399dc6b3-c930-43ef-8f04-ae0a4ef5e13c | {
"language": "C#"
} | ```c#
```
Add test coverage of `SettingsCheckbox` | ```c#
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Linq;
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using... |
512d7201-6fd3-4f52-9d18-ddbd5cfbbf2b | {
"language": "C#"
} | ```c#
```
Add unit tests for Users API controller | ```c#
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using Moq;
using Xunit;
using ISTS.Api.Controllers;
using ISTS.Api.Helpers;
using ISTS.Application.Users;
namespace ISTS.Api.Test.Controllers
{
public class UsersControllerTests
{
pri... |
aec7c3dc-57ae-4038-bffb-0d042669742b | {
"language": "C#"
} | ```c#
```
Split out test for combo counter specifically | ```c#
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
using osu.Framework.Testing;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Osu;
using... |
19624b98-fb11-497e-91b8-37b8226a7517 | {
"language": "C#"
} | ```c#
```
Add test for racecondition issue | ```c#
using System.IO;
using Microsoft.Extensions.Configuration;
using NUnit.Framework;
using Tiver.Fowl.Drivers.Configuration;
using Tiver.Fowl.Drivers.DriverBinaries;
using Tiver.Fowl.Drivers.DriverDownloaders;
namespace Tiver.Fowl.Drivers.Tests
{
[TestFixture]
public class DownloadersParallel
{
... |
4d7b5635-5501-4204-8197-056ff71e8e87 | {
"language": "C#"
} | ```c#
```
Set Horizontal And Vertical Image Resolution | ```c#
using Aspose.Words.Saving;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Aspose.Words.Examples.CSharp.Rendering_Printing
{
class SetHorizontalAndVerticalImageResolution
{
public static void Run()
{
// The path to the documents... |
74f03c4b-36e8-4cd2-9196-e0784ed8d504 | {
"language": "C#"
} | ```c#
```
Add interface for content validation | ```c#
using Microsoft.AspNetCore.Http;
using System.Threading.Tasks;
namespace Porthor.ContentValidation
{
public interface IContentValidator
{
Task<bool> Validate(HttpRequest request);
}
}
``` |
d8012061-485d-493a-8480-4b8496959606 | {
"language": "C#"
} | ```c#
```
Create view model for user | ```c#
namespace DevelopmentInProgress.AuthorisationManager.ASP.Net.Core.ViewModels
{
public class UserViewModel
{
public string Id { get; set; }
public string Name { get; set; }
public string DisplayName { get; set; }
}
}
``` |
4d2e1866-686e-47cd-ab28-fbf125ba1053 | {
"language": "C#"
} | ```c#
```
Add toggle menu item test | ```c#
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Collections.Generic;
using osu.Framework.Graphics;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Tests.Visual.UserInterface
... |
7edcb405-7c27-4282-8281-54c3efd7c811 | {
"language": "C#"
} | ```c#
```
Add new parser test base | ```c#
using System;
using System.Linq;
using JetBrains.Annotations;
using JetBrains.Application.Components;
using JetBrains.ProjectModel;
using JetBrains.ReSharper.Psi;
using JetBrains.ReSharper.Psi.ExtensionsAPI;
using JetBrains.ReSharper.Psi.ExtensionsAPI.Tree;
using JetBrains.ReSharper.Psi.Files;
using JetBrains.ReS... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.