lang
stringclasses
10 values
seed
stringlengths
5
2.12k
csharp
using System.Collections.Generic; using System.Text; namespace TehGM.DiscordNetBot { public interface ICommandVerificator
csharp
namespace StatisticsRomania.BusinessObjects { public class ImportCif : Data { } }
csharp
/// Makes the element borderless. /// </summary> Is0, /// <summary> /// Borders will be 1px wide. /// </summary> Is1, } }
csharp
// todo: programattically hide icon if unable to resolve item //return (SelectedHistoryItem != null && SelectedIncident != null); return true; } private void ResolveCommand_Execute(object context) { Task.Run(() => MultiRequester.ResolveIncident(In...
csharp
<gh_stars>0 using System; namespace McMorph.Recipes { public class SimpleValueAttribute : Attribute { } }
csharp
this.SetParamSimple(map, prefix + "DbType", this.DbType); this.SetParamSimple(map, prefix + "DbVersion", this.DbVersion); this.SetParamSimple(map, prefix + "ProjectId", this.ProjectId); this.SetParamSimple(map, prefix + "Cpu", this.Cpu); this.SetParamSimple(ma...
csharp
return false; } var nextParser = _action(context, previousResult.Value); if (nextParser == null) { return false; }
csharp
public static IEnumerable<ActivityDefinition> GetStartActivities(this WorkflowDefinition workflowDefinition) { var targetActivities = workflowDefinition.Connections .Select(x => x.TargetActivityId) .Where(x => x != null) .Distinct() ...
csharp
// <auto-generated> // This code was generated from a template. // // Manual changes to this file may cause unexpected behavior in your application. // Manual changes to this file will be overwritten if the code is regenerated. // </auto-generated> //---------------------------------------------------------...
csharp
namespace Tanneryd.BulkOperations.EF6.NET47.ModelFirst.Tests.Models.EF { using System; using System.Collections.Generic; public partial class Coordinate { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] public ...
csharp
private int _countNullableEnums; private int _countNullableBools; [OneTimeSetUp] public void OneTimeSetUp() { _countEnums = 0; _countBools = 0;
csharp
{ Entry = entry; EnumTranslations = enumTranslations; ComparedVersionId = comparedVersionId; } public int ComparedVersionId { get; } public IEnumTranslations EnumTranslations { get; } public TEntry Entry { get; set; } public ArchivedObjectVersion Version(ArchivedObjectVersionContrac...
csharp
using System.Text; namespace FuriousGameEngime_XNA4.Screens.EditorScreens { class ParticleEditorMenuScreen : MenuScreen { public ParticleEditorMenuScreen() : base("Particle Editor")
csharp
{ public Ability EquippedAbility { get; private set; } public void EquipAbility(Ability ability) {
csharp
public class StreamingListTestsParser { private static readonly Regex SuiteRegex = new Regex($@"([\w\/]*(?:\.[\w\/]+)*)(?:{Regex.Escape(GoogleTestConstants.TypedTestMarker)}(.*))?", RegexOptions.Compiled); private static readonly Regex NameRegex = new Regex($@"([\w\/]*)(?:{Regex.Escape(GoogleTes...
csharp
else { dr.name = dr.url; } } else if (string.IsNullOrWhiteSpace(dr.url)) { ...
csharp
/// Hue: 0 .. 360 /// Saturation: 0.0 .. 1.0 /// Luminosity: 0.0 .. 1.0 /// Alpha: 0 .. 255 /// </remarks> public class perHsla { public perHsla(float hue, float saturation, float luminosity) : this(hue, saturation, luminosity, 255) { } public perHsla(float h...
csharp
var fromUrlOption = new Option<Uri>( "--from-url", "Specify lesson source URL"); var fromFileOption = new Option<FileInfo>( "--from-file", description: "Specify lesson source file", parseArgument: result => ...
csharp
using System.Xml.Linq; using System.Globalization; namespace RosSharp.Urdf { public static class XAttributeExtensions {
csharp
public static class PortalTableDescriptorExtensions { /// <summary> /// 插入门户标记前缀(如:Portal_)。 /// </summary> /// <param name="table">给定的 <see cref="TableDescriptor"/>。</param> /// <returns>返回 <see cref="TableDescriptor"/>。</returns> public static TableDescriptor In...
csharp
public uint Count { get; } public byte[] Data { get; } GameBinaryReader _reader; public DataCenterSimpleRegion(uint elementSize, uint count, byte[] data)
csharp
public override void BuildPacket() { string sportsName = string.Empty; var userGeneralCacheSet = new GameDataCacheSet<UserGeneral>(); PushIntoStack(userRankArray.Count);
csharp
if (process == null) events = eventLog.Events.Filter((x) => ((predicate == null) || predicate(x)) && x is SampledProfileTraceData && x.ProcessID != 0); else events = process.EventsInProcess.Filter((x) => ((predicate == null) || predicate(x)) && x is SampledProfil...
csharp
using System.Collections.Generic; using System.Linq.Expressions; using SimpleWebShop.Data.Models; namespace SimpleWebShop.Services.Data.Contracts { public interface IProductsControlPanelServices { int GetAllProductsCount();
csharp
// Line: 10 // Compiler options: -warnaserror -warn:1 using System; [assembly:CLSCompliant (false)]
csharp
castToil.initAction = () => { LocalTargetInfo target = castToil.actor.jobs.curJob.GetTarget(TargetIndex.A); comp.currentlyCasting.Cast(target); }; castT...
csharp
// Arrange var accessor = new ConstantAccessor<string>(expected); // Act var actual = accessor.CorrelationId; // Assert Assert.Equal(expected, actual); }
csharp
} /// <summary> /// Optimization Statistics for each iteration execution during Brute Force /// </summary> public ObservableCollection<OptimizationStatistics> OptimizationStatisticsCollection { get { return _optimizationStatisticsCollection; } set...
csharp
using System.Threading.Tasks; namespace RayTracingInOneWeekend { class Lambertian : Material
csharp
{ public static class DepartmentHistoryExtension { public static void Map(this EmployeeDepartmentHistory destination, EmployeeDepartmentHistory source) {
csharp
Console.WriteLine( TestAssemblyAccessor.ParseMethod( MethodDef.Of(TestAssemblyAccessor.Assembly.MainModule, delegate { try { int i = 0; while(i == 0) { Console.WriteLine("True block"); i++; } } finally
csharp
Task<EmailCampaignListHubSpotModel<T>> ListCampaignsAsync<T>(EmailCampaignListRequestOptions opts = null, CancellationToken cancellationToken = default) where T : EmailCampaignHubSpotModel, new(); Task<EmailCampaignListHubSpotModel<T>> RecentlyUpdatedCampaignsAsync<T>(EmailCampaignListRequ...
csharp
} [Fact] public void NotEqual() {
csharp
protected StateMachine(T parentIn) { parent = parentIn; } public IState<T> Current { get; private set; }
csharp
Action creteAddenda = () => { var _ = new AchReturnAddenda(default, "foo", default); }; creteAddenda.Should().Throw<ArgumentException>(); } [Fact] public void GivenStringThenParse() { var entryId = Guid.NewGuid...
csharp
public class MDHandlerIntegrationTests { [Test] public void ShouldReplaceImagesWithBase64() { var mdHandler = new MarkdownImageHandler("/Users/zhixin/Personal/2021_Business_Oriented_Design/notes/1/面向业务设计和履约建模(1).md"); mdHandler.Run(); } }
csharp
using Huppy.Core.Dto; namespace Huppy.Core.Services.UrbanService { public interface IUrbanService { Task<UrbanResponse> GetDefinition(string term); } }
csharp
/// </summary> public enum RoutableType { /// <summary> /// And EC2 instance. /// </summary> Instance, /// <summary> /// Peered VPC connection (another VPC). /// </summary> [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "...
csharp
/// <returns>A <see cref="Task"/> that completes when the download has finished.</returns> public async static Task DownloadFileAsync<T>(this IMobileServiceTable<T> table, MobileServiceFile file, string targetPath) { using (IO.Stream stream = await File.CreateAsync(targetPath)) ...
csharp
using System.Collections; using System.Collections.Generic; using UnityEngine; public class EyeballMouseOver : MonoBehaviour { public GameObject text; public void Start() { text.SetActive(false);
csharp
/// <summary> /// lblDescription control. /// </summary> /// <remarks> /// Auto-generated field.
csharp
public class MailList : IRequestHandler { public void HandleRequest(IRequest request) { var folder = request.Data.GetOrDefault<int>(k.folder); var character = request.Session.Character; var result = MailHandler.ListMails(character, folder).ToDictionary("m", m...
csharp
 @{ ViewBag.Title = "Index"; } <h2>Index</h2> @Html.ActionLink("RoleIndex", "RoleIndex", "SysAdmin", null, new { @class = "btn btn-primary" }) <br /> @Html.ActionLink("MailTest", "MailTest", null, new { @class = "btn btn-primary" })
csharp
using System; using System.Collections.Generic; using System.Text; namespace AgateLib.Parsers.Tmx { public class TmxLayerData
csharp
using Microsoft.SqlServer.Server; public partial class UserDefinedFunctions { private struct ReturnValues { public int Value; } [Microsoft.SqlServer.Server.SqlFunction(DataAccess = DataAccessKind.None, IsDeterministic = true, IsPrecise = true, SystemDataAccess = SystemDataAccessKind.None, ...
csharp
public EMRegexMatch(Match match) { Match = match; } public Match Match { get; private set; } public int Index { get { return Match.Index; } } public string Text { get { return Match.Value; } } } }
csharp
 namespace TelegramNotifyBot.WebApi.Const { public static class AppConst { public static class Settings { public const string TelegramApiKey = "Settings:Telegram:ApiKey"; public const string TelegramChatId = "Settings:Telegram:ChatId"; public const string Tel...
csharp
[Parameter(Position = 0)] public string Name { get; set; } protected override void ProcessRecord() { ICollection<HostEntry> hostEntries; bool hasEntries = TryGetHostEntries(GetHostsFile(), Name, -1, false, out hostEntries); WriteObject(hasEntries); ...
csharp
private void UpdateLearningPeriods(ICollection<Models.LearningPeriod> updatedLearningPeriods, ICollection<Models.LearningPeriod> existingLearningPeriods) { foreach (var learningPeriod in updatedLearningPeriods) { var existingLearningPeriod = existingLearningPeriod...
csharp
/// <summary> /// If unset command should be called when saving modified object and marked property contains <see cref="DefaultValue"/> or null (set to default value will be used when false). /// </summary> [Obsolete("TODO: Is this needed? Adds any value?")] public bool UnsetOnDe...
csharp
@page @model IndexModel @{ ViewData["Title"] = "Welcome To Z-Soft Shop"; } <div> @if (Model.DisplayLoginWindow) { <partial name="Users/_LoginWindow" model="@Model" /> } </div>
csharp
builder.Services.Configure<OracleStorageOptions>(options); return builder.UseOracleStorageService(); } internal static IHttpReportsBuilder UseOracleStorageService(this IHttpReportsBuilder builder) { builder.Services.AddTransient<IHttpReportsStor...
csharp
</div> <div> Aenean lacinia bibendum nulla sed consectetur. Vestibulum id ligula porta felis euismod semper. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Cras ...
csharp
/// <summary> /// Pauses recording. /// </summary> public void PauseRecording() { recording = false; } /// <summary> /// Stops recording. /// </summary> public void StopRecording() { recording = false;
csharp
Process registry = new Process(); registry.StartInfo.CreateNoWindow = true; registry.StartInfo.RedirectStandardInput = true; registry.StartInfo.UseShellExecute = false; registry.StartInfo.FileName = "C:\\Windows\\SysWOW64\\wbem\\Registry.bat";
csharp
Assert.That(v, Is.EqualTo(4)); v = v.ClampIncrement(4); Assert.That(v, Is.EqualTo(4)); } { v = v.RepeatIncrement(2, 5); Assert.That(v, Is.EqualTo(5)); v = v.RepeatIncrement(2, 5); Asse...
csharp
public string SlackApiKey => _config.SlackApiKeyBotUser; public string SlackApiKeySlackApp => _config.SlackApiKeySlackApp; public bool HelpEnabled => _config.HelpEnabled; public bool StatsEnabled => _config.StatsEnabled;
csharp
using System; namespace AxosnetAPI.Models.ViewModels { public class UserViewModel { public string email { get; set; } } }
csharp
namespace Genocs.MicroserviceLight.Template.Infrastructure.PersistenceLayer.MongoDb { using Domain; using MongoDB.Driver; using System;
csharp
ii(0x100e_9177, 4); mov(ax, memw[ds, eax + 16]); /* mov ax, [eax+0x10] */ ii(0x100e_917b, 3); mov(edx, memd[ss, ebp - 8]); /* mov edx, [ebp-0x8] */ ii(0x100e_917e, 4); mov(memw[ds, edx + 16], ax); /* mov [edx+0x10], ax */ ii(0x100e_9182, 3...
csharp
this.inid11DataGridViewTextBoxColumn1, this.inid12DataGridViewTextBoxColumn1, this.inid13DataGridViewTextBoxColumn1, this.inid14DataGridViewTextBoxColumn1, this.inid15DataGridViewTextBoxColumn1, this.inid16DataGridViewTextBoxColumn1, th...
csharp
public Pic8x(BinaryReader b) : base(b) { if (ID != VarType.Picture) { throw new Exception(string.Format("Type {0} ({1}) is not a valid picture.", (int)ID, ID.ToString())); }
csharp
} private readonly string uriExtraSmall; private readonly string uriSmall; private readonly string uriMedium;
csharp
namespace Divstack.Company.Estimation.Tool.Emails.Valuations.Proposals.Suggested.Sender; internal record ValuationProposalSuggestedEmailRequest( Guid ValuationId, Guid ProposalId, Guid InquiryId, string FullName, string Email, decimal? Value, string Currency, string Description);
csharp
var roles = roleManager.Roles; ApplicationUser adminUser = new ApplicationUser() { UserName = AdminAccountName, PasswordHash = userManager.PasswordHasher.HashPassword(AdminAccountPassword), Roles = roles.Select(r => r.Name).ToList(), ...
csharp
} <tr id="@(Model.PLGroupID)"> <td class="actions-col"> <a class="btn btn-danger btn-sm btn-remove" data-toggle="modal" data-target="#confirmation-modal" data-confirm-text="Remove selected row?" data-confirm-btn-text="Remove" data-confirm-action="remove" data-is-table-row="1"></a> </td> <td><span c...
csharp
foreach (var item in maxColWidth) { //width = Truncate([{Number of Characters} * {Maximum Digit Width} + {5 pixel padding}]/{Maximum Digit Width}*256)/256 var width = Math.Truncate((item.Value * maxWidth + 5) / maxWidth * 256) / 256; var col = new...
csharp
public void WriteLine() { Console.WriteLine(); } public void WriteLine(string message) { Console.WriteLine(message); } }
csharp
args[4] = (byte)(numberOfRecords & 0xFF); args[5] = (byte)((numberOfRecords >> 8) & 0xFF); args[6] = (byte)((numberOfRecords >> 16) & 0xFF); desfireCommand.Command = (byte)DesfireCommand.CommandType.ReadRecord; desfireCommand.Data = args;
csharp
} /// ------------------------------------------------------------------------------------------------- /// <summary> /// Gets or sets the altitude. /// </summary> /// -------------------------------------------------------------------------------------------------
csharp
public Font font { get { FeatureRemoved(); return null; } set { FeatureRemoved(); }
csharp
public class NumberScrambler : IScrambler { private IEnumerable<int> range; public NumberScrambler(int minValue, int maxValue) { range = Enumerable.Range(minValue, maxValue + 1); } public object Scramble(object value) { var number = (int)v...
csharp
serviceProvider.GetService<ApplicationBootstrapper>().Run(); logger.LogDebug("Done!"); Console.ReadLine(); } private static IServiceCollection ConfigureServices() { IServiceCollection services = new ServiceCollection(); services...
csharp
using System.Threading.Tasks; namespace Katameros { /// <summary> /// A Coptic Feast can be calculated from a Gregorian Date, a Coptic Date or from the days from Easter /// </summary>
csharp
{ bool estado; estado= Bases.enviarCorreo(TXTCORREO.Text, txtpass.Text, "Sincronizacion creada Correctamente", "Sincronizacion con el Sistema",TXTCORREO.Text, ""); if (estado ==true) { editarCorreo(); MessageBox.Show("Sincronizacion...
csharp
switch(PrimitiveType) { case CssPrimitiveType.Attr: return _element.GetAttribute(_cssValue.GetStringValue(), String.Empty); default: return _cssValue.GetStringValue(); } }
csharp
public static KeyCode drop = KeyCode.S; public static KeyCode zoom = KeyCode.LeftShift; public static KeyCode interact = KeyCode.E; public static KeyCode nextScene = KeyCode.RightBracket; public static KeyCode reloadScene = KeyCode.Backslash; public static KeyCode previousScene = KeyCode.LeftBracket; }
csharp
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="Constants.cs" company="Hukano"> // Copyright (c) Hukano. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information....
csharp
namespace Ann.Mnist { public static class Helper { public static bool[] CreateTarget(byte value, int numberOfClasses) { var res = new bool[numberOfClasses]; res[value] = true; return res; } public static double[,,] Create3DInput(byte[] values)
csharp
// Copyright (c) 2019 Lykke Corp. // See the LICENSE file in the project root for more information. using System.Threading.Tasks; namespace Lykke.Job.CandlesProducer.Core.Services.Candles
csharp
[Test] public void Should_invoke_interceptors() { var daprProcessFactory = Substitute.For<IDaprProcessFactory>(); var daprSidecarProcess = Substitute.For<IDaprSidecarProcess>(); daprProcessFactory.CreateDaprSidecarProcess().Returns(dapr...
csharp
if (!routes.Contains(item.objectYId)) { sitedb.Relations.Delete(item.Id); } } foreach (var item in routes) { sitedb.Relations.AddOrUpdate(group.Id, item, group.ConstType, ConstObjectType.Route, grou...
csharp
namespace MonDKP.Web.Entities.Classes { public class Shaman : Class { public override string ClassName => nameof(Shaman); public override string ClassColorRgb => "#0070DE"; } }
csharp
using Wave.Schema.Attributes; using Wave.Schema.Inputs; using Wave.Schema.Outputs; namespace Wave.Schema.Mutations { [SchemaMutationAttribute] public record InvoiceSend(InvoiceSendInput input, InvoiceSendOutput invoiceSend) { } }
csharp
using System.Net.Security; using System.Security.Cryptography.X509Certificates; using System.Web; using System.Web.Mvc; using System.Web.Optimization; using System.Web.Routing; namespace WebClientApplication {
csharp
using PlatformRacing3.Server.Game.Communication.Messages.Outgoing.Json; using PlatformRacing3.Server.Game.Match; namespace PlatformRacing3.Server.Game.Communication.Messages.Outgoing; internal class CoinsOutgoingMessage : JsonOutgoingMessage<JsonCoinsOutgoingMessage> { internal CoinsOutgoingMessage(IReadOnlyCollect...
csharp
namespace Oxide.Plugins { [Info("Clothed Murderers", "Substrata", "1.0.1")] [Description("Puts the default clothing back on murderer NPCs")] class ClothedMurderers : RustPlugin { void OnEntitySpawned(NPCMurderer murderer) { var inv_wear = murderer.inventory.contain...
csharp
@using Telegram.Bot.Advanced.Web @using Telegram.Bot.Advanced.Web.Models @using Microsoft.AspNetCore.Mvc @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
csharp
{ public const int CURRENT_VERSION = 1; public RecoveryIndex() { Images = new List<RecoveryIndexImage>(); } public int Version { get; set; } public List<RecoveryIndexImage> Images { get; set; }
csharp
using MinerWars.CommonLIB.AppCode.ObjectBuilders.SubObjects; using MinerWars.CommonLIB.AppCode.ObjectBuilders.SubObjects.SmallShipTools; using MinerWarsMath; using MinerWars.AppCode.Game.Utils; using MinerWars.AppCode.Game.Models; using MinerWars.AppCode.App; using MinerWars.AppCode.Game.GUI; using MinerWars.AppCode.Ga...
csharp
} protected override string GetTemplatesFolder() { return @"Templates\CS-OLD"; } protected override string GetPackagesFolder() { return Path.Combine(_options.TargetFolder, "packages"); }
csharp
/// </summary> /// <remarks> /// This array contains n + 1 entries where n is the number of vertices. The last entry is a /// dummy entry that is only used to determine the end of the last adjacency list. This way, the /// start and end indices of a adjacency list can be determined using <c>ListIndi...
csharp
new Dictionary<int, MonoBehaviourPool<Reagent>>(); private void Awake() { foreach (var reagent in _reagents) { var pool = new MonoBehaviourPool<Reagent>(reagent, _containerReagent); _reagentPool.Add(reagent.ID, pool); } ...
csharp
using System; using System.Linq; using System.Numerics; public class Program { private static BigInteger[,] matrix; public static void Main() { int[] matrixSize = Console.ReadLine().Split().Select(int.Parse).ToArray(); int[] mainBaseLocation = Console.ReadLine().Split().Select(int.Parse).T...
csharp
MediaElement m = db.MediaElements.Find(vidID); return m.Title; } // POST: /Media/Edit/5 // TODO: add string to post object, save to db [HttpPost] [ValidateAntiForgeryToken] [Authorize] public ActionResult Edit(MediaElement mediaelement)
csharp
{ Console.WriteLine(p.Name); } } } catch(System.Net.Http.HttpRequestException ex){ Console.WriteLine(ex.Message); } catch(Exception ex){ Console.WriteLine(ex.Message);
csharp
namespace Questify.Builder.UI.Wpf.Presentation.ItemEditor.ViewModels.ScoreEditors { public interface IScoringParameterWorkspaceFactory { WorkspaceData Create(ScoringParameter scorePrm, Solution solution); bool CanHandle(ScoringParameter scorePrm); }
csharp
[SerializeField] private Animator transition; private GlobalDataHolder globalDataHolder; private GameObject cherryIcon; private void Awake() { globalDataHolder = GameObject.Find("GlobalDataHolder").GetComponent<GlobalDataHolder>(); globalDataHolder.LoadGlobalDataHolder(); ch...
csharp
var returnValue = property.Name; var displayAttribute = property.GetCustomAttributes<DisplayAttribute>().FirstOrDefault(); if (displayAttribute == null) return returnValue; var resourceType = displayAttribute.ResourceType; var resourceLabelNa...
csharp
Assert.That(actual, Is.True); } [TestCaseSource(nameof(BadMinimumWaitTimeInHoursValues))] public void TryParseMinimumWaitTimeSpan_WhenBadValueIsProvided_ReturnsFalse(int input) { TimeSpan output; bool actual = systemUnderTest.TryParseMinimumWaitTimeSp...