lang stringclasses 10
values | seed stringlengths 5 2.12k |
|---|---|
csharp | // Send the request and get response.
var response = await client.SendAsync(request);
// Read response as a string.
var result = await response.Content.ReadAsStringAsync();
var translationResults = JsonConvert.DeserializeObject<Transl... |
csharp | this.GroupFooter1.RepeatEveryPage = true;
//
// xrLine3
//
this.xrLine3.BorderDashStyle = DevExpress.XtraPrinting.BorderDashStyle.Solid;
this.xrLine3.ForeColor = System.Drawing.Color.Transparent;
this.xrLine3.LineStyle = System.... |
csharp | {
/// <summary>
/// 异步请求
/// TODO:后续封装
/// </summary>
public class AsyncRequest
{
}
} |
csharp | void OnPostprocessTexture(Texture2D texture)
{
string lowerCaseAssetPath = assetPath.ToLower();
bool isInSpritesDirectory = lowerCaseAssetPath.IndexOf("/sprites/") != -1;
if (isInSpritesDirectory)
{
TextureImporter textureImporter = (Textu... |
csharp | /// </summary>
/// <returns>花呗API Client</returns>
public static EasySDK.Payment.Huabei.Client Huabei()
{
return new EasySDK.Payment.Huabei.Client(new Client(context));
}
|
csharp | public static class ServiceLocatorExtensions
{
public static object Resolve(this IServiceLocator locator, Type type, string key = null)
{
try
{
return string.IsNullOrEmpty(key) ? locator.GetInstance(type) : locator.GetInstance(type, key);
}
... |
csharp | <div class="nhsuk-grid-column-three-quarters nhsuk-u-three-quarters-tablet">
<span class="nhsuk-details__summary-text">
@Model.CustomPromptName
</span>
</div>
<div class="nhsuk-grid-column-one-quarter nhsuk-u-one-quarter-tablet right-align-tag-column">
<span cla... |
csharp | namespace CloudBread.OAuth
{
public class OAuthManager
{
public static BaseOAuth2Services OAuthService;
public enum OAuthServices
{
facebook,
google
}
public static BaseOAuth2Services GetServices(OAuthServices services){
|
csharp | /// <summary>
/// Custom exception encapsulates native exceptions thrown from within MdsLib
/// </summary>
public class MdsException : Exception
{
/// <summary>
/// MdsException constructor
/// </summary>
public MdsException() { }
#if __ANDROID__ |
csharp | [Benchmark]
public void SimpleCSVParserParrallel()
{
using (var reader = new CsvStreamReader<DataModel>("PackageAssets.csv", new CsvStreamOptions() { RemoveEmptyEntries = true }))
{
var entries = reader.AsParallel()
.ToList();
... |
csharp |
namespace TestWithUdpClient
{
public class StateObject
{
public Socket workSocket = null;
public const int BUFFER_SIZE = 1024;
public byte[] buffer = new byte[BUFFER_SIZE];
|
csharp | static void Print(List<GPU> list, bool noheader)
{
if (list != null)
{
if (!noheader)
{
Console.WriteLine("index, name, temperature, fan");
} |
csharp | {
public static class HashAgent
{
public static string SHA1(string input)
{
using (SHA1 hash = System.Security.Cryptography.SHA1.Create())
{
return string.Join("", hash.ComputeHash(Encoding.UTF8.GetBytes(input)).Select(item => item.ToString("x2")));... |
csharp | {
base.OnEnable();
this.SetDirty();
}
/// <summary>Sets the aspect ratio to match the given texture.</summary>
public void MatchTexture(UnityEngine.Texture2D texture)
{
if(texture != null) |
csharp | public class Path
{
private List<Point3D> paths = new List<Point3D>();
public Path()
{
this.Paths = new List<Point3D>();
}
public List<Point3D> Paths
{
get { return this.paths; } |
csharp | if (numLastYear * 2 < numThisYear)
{
WriteLine("The competition is more than twice as big this year!");
}
else if (isThisYearGreater)
{
WriteLine("The competition is bigger than ever!");
}
else
{
WriteLine("A tighter rac... |
csharp | }
public General<ProductDetail> GetById(int id)
{
throw new System.NotImplementedException();
}
public General<ProductDetail> Insert(InsertProductModel newProduct)
{
var result = new General<ProductDetail>() { IsSuccess = false };
try
... |
csharp | public partial class CameraView : ContentPage
{
CameraViewModel vm;
public CameraViewModel ViewModel
{
get => vm; set
{
vm = value;
BindingContext = vm;
}
}
public CameraView() |
csharp | /// <param name="enctype">The encoding type the form submission should use</param>
/// <param name="outputAntiforgeryToken">Whether or not to output an antiforgery token in the form; defaults to null which will output a token if the method isn't GET</param>
/// <returns>A <see cref="Form{TMode... |
csharp | break;
}
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
input = Console.ReadLine();
}
}
private static void PrintRating(string teamNa... |
csharp | using WebPlex.Services.Impl.Configuration;
using WebPlex.Services.Impl.Security;
using WebPlex.Services.Security;
using WebPlex.Web.Mvc;
using WebPlex.Web.Security; |
csharp | {
// These strings are the names used in the HTTP2 spec and should not be localized.
switch (code)
{
case Http2ProtocolErrorCode.NoError:
return "NO_ERROR";
default: // any unrecognized error code is treated as a protocol er... |
csharp |
public class mouse_cursor : MonoBehaviour
{
public Texture2D default_cursorTexture;
public CursorMode cursorMode = CursorMode.Auto;
public Vector2 hotSpot = Vector2.zero;
public Texture2D cursorOnClue;
public void change_cursor_to_default()
{ |
csharp | if (!IsEndingWithSeparator(dropboxDirectory))
dropboxDirectory += Path.AltDirectorySeparatorChar;
string password = args[3];
var newFiles = new HashSet<string>(
Directory.GetFiles(localDirectory, "*", SearchOption.AllDirectories) |
csharp | var isAllUpper = text.IsAllUpper();
return !string.IsNullOrWhiteSpace(text) && text.Length >= 1 && !isAllUpper
? char.ToLowerInvariant(text[0]) + text[1..]
: isAllUpper ? text.ToLowerInvariant() : text;
}
public static string GetPropertyKey(this ... |
csharp | {
/// <summary>
///
/// </summary>
public class EmbeddedItemIsCollectionException : Exception
{
public string Key { get; set; }
public EmbeddedItemIsCollectionException(string key)
{
Key = key;
}
}
} |
csharp | @using Kartverket.Metadatakatalog.Areas.HelpPage
@model ImageSample
<img src="@Model.Src" /> |
csharp | internal class MySqlDatabaseOptions : SqlDatabaseOptions
{
public MySqlDatabaseOptions()
{
this.StartDelimiter = this.EndDelimiter = "`";
}
}
}
|
csharp | using UnityEngine;
namespace SA
{
public abstract class WeaponBuffAction : WeaponAction
{
[Header("Base Config.")] |
csharp | <gh_stars>0
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace AnJiaWebServer_V1.JSON
{
public class SharecodeJson
{
public string ReturnCode { get; set; }
public string QRShareCode { get; set; }
} |
csharp | using ViewModels.Images;
public class HomeController : BaseController
{
private IRepository<CategoryPictures> categories;
public HomeController(IRepository<CategoryPictures> categories)
{
this.categories = categories;
}
public ActionResult Index()
... |
csharp | File.Move(tempFileName, newFileName);
}
Text = String.Format("{0} | {1}", Path.GetFileName(fileName), AppName);
Enabled = true;
}
void SaveGuiToPrison() {
|
csharp | /// Used by SubstituteProcessExecutionTests to test shimming. Receives the shimmed process
/// command line including the executable name and arguments as the command line arguments,
/// and the shimmed process current working directory and environment.
/// </summary>
public static class TestSub... |
csharp | // Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace RoslynPad.Roslyn.BraceMatching
{
internal struct BraceCharacterAndKind
{ |
csharp | {
static void Main(string[] args)
{
int number = int.Parse(Console.ReadLine());
int fromNumber = int.Parse(Console.ReadLine());
int multiply = 0;
for (; fromNumber <= 9; fromNumber++)
{
multiply = number * fromNumber;
... |
csharp | HashSet<int> relatedMcQuestionIds = new HashSet<int>();
// idea for this:
// QuestionBankID -> QuestionID -> OptionID
Dictionary<int, Dictionary<int, HashSet<int>>> relatedMcOptionsForMcQuestions = new Dictionary<int, Dictionary<int, HashSet<int>>>();
|
csharp | {
IdentityRole role = context.Roles.SingleOrDefault(_ => _.Name == roleName);
if (role == null)
{
role = context.Roles.Add(new IdentityRole()
{
Name = roleName,
});
... |
csharp | using ENCO.DDD.EntityFrameworkCore.Relational.Configuration;
using IFPS.Factory.Domain.Model;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace IFPS.Factory.EF.EntityConfigurations
{
public class UserInspectionConfiguration : EntityTypeConfiguration<UserInspection>
{
public override voi... |
csharp | using System.Threading.Tasks;
using Silky.Rpc.Runtime.Server;
namespace Silky.Rpc.Runtime
{
public interface IExecutor
{ |
csharp | * Copyright (c) 2003-2008 by AG-Software *
* All Rights Reserved. *
* Contact information for AG-Software is available at http://www.ag-software.de *
* *
* Licence: *
* The agsXMPP SDK is released under a dual licence * |
csharp |
namespace Alpaca.Markets
{
public sealed partial class AlpacaTradingClient
{
/// <inheritdoc />
public Task<IReadOnlyList<IWatchList>> ListWatchListsAsync(
CancellationToken cancellationToken = default) =>
_httpClient.GetAsync<IReadOnlyList<IWatchList>, List<JsonWatchLis... |
csharp | using ViewModels.TrackRecords;
public interface ITrackRecordsController : IController
{
ITrackRecordsViewModel TrackRecordsViewModel { get; }
void OnSessionStarted(SimulatorDataSet dataSet);
void OnDataLoaded(SimulatorDataSet dataSet);
bool EvaluateFastestLapCan... |
csharp | public static class EntityTypeBuilderExtensions
{
public static void HasTemporalTable<TEntity>(this EntityTypeBuilder<TEntity> builder)
where TEntity : class
{
TemporalConfiguration temporalConfiguration = new TemporalConfiguration(builder);
}
public sta... |
csharp | }
Logger.Log(LogLevel.DEBUG, "TextureBundle Refs matched: " + countFound);
return bundleMap;
}
private void SaveImages(Texture2D tex, ArtCard match)
{
var cardId = match.Id;
var card = CardDb.All[cardId];
var cardName = card.Name; |
csharp | CreateMeshData();
}
}
public void CreateMeshData()
{ |
csharp | /// </summary>
/// <remarks>
/// Null if the result doesn't have an inner result.
/// </remarks>
IErrorResult? ErrorResult { get; }
/// <summary>
/// The inner <see cref="IResult" />.
/// </summary> |
csharp | using J = Newtonsoft.Json.JsonPropertyAttribute;
namespace Ademund.OTC.Client.Model
{
public sealed record SMNMessage
{
[J("subject")] public string Subject { get; init; }
[J("message")] public string Message { get; init; }
[J("time_to_live")] public int TTL { get; init; } = 3600;
... |
csharp | /// Toggles sender signatures messages sent in a channel; requires appropriate administrator rights in the channel.
/// </summary>
public class ToggleSupergroupSignMessages : Function<Ok>
{
/// <summary>
/// Data type for serialization
/// </summary> |
csharp | namespace DataServices
{
public class Startup
{
private IConfiguration Configuration { get; }
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public void ConfigureServices(IServiceCollection services)
{ |
csharp | {
/// <summary>
/// 参数名
/// </summary>
public string Name { get; set; }
/// <summary>
/// 参数值
/// </summary> |
csharp | Name = "AllFeatures";
}
public bool IgnoreDisabledFeatures { get; set; }
}
}
|
csharp | namespace Lykke.Service.PayInternal.Core.Domain.Exchange
{
public class PreExchangeCommand
{
public string MerchantId { get; set; }
public string SourceAssetId { get; set; }
public decimal SourceAmount { get; set; }
public string DestAssetId { get; set; }
}
}
|
csharp | <gh_stars>1-10
namespace EmergencyCenter.Units.Contracts.Characters
{
public interface IParamedic : ICivilServant
{
}
}
|
csharp | namespace ModuleTelemetry.IotHub.configurations
{
public class IotHubOptions
{
public string ModuleName { get; set; }
public int TimeBetweenUpload { get; set; }
}
} |
csharp | /// </summary>
/// <param name="name">The name of the device to open</param>
/// <returns></returns>
public IOpenedDevice OpenDevice(string name)
{
int h = _caller.OpenDevice(name, _userName, _password);
return new NetworkDevice(name, h, _caller, _userName... |
csharp | /// <param name="disposing">true se for necessário descartar os recursos gerenciados; caso contrário, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
... |
csharp | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
namespace SampleBot.Configurations
{
public class SetSpeakMiddlewareConfiguration
{
public string Locale { get; set; }
public string VoiceFont { get; set; }
}
}
|
csharp | using Cryptography.Domain.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Cryptography.Domain.Abstractions
{
public interface IDesService
{
uint[] Encrypt(DesData desData);
uint[] Decrypt(DesData desData);
... |
csharp | {
public static List<Dictionary<string, object>> Combination; // Combination table
public static List<Dictionary<string, object>> ITEM_INFO; // Combination table
// Use this for initialization
public static void Init()
{ |
csharp | string GetRenderString();
/// <summary>
/// Gets a subset of the render string as it looks at this point in time. This means it may be in a partially
/// rendered (or not rendered at all) form.
/// </summary>
/// <param name="startIndex">The index to start at</param>
/// <param name="length">The l... |
csharp | using System;
using System.Collections.Generic;
using System.Text;
namespace MusicDaily.SpotifyPlaylist
{
public class Album
{
public string album_type { get; set; }
public List<object> available_markets { get; set; }
public ExternalUrls4 external_urls { get; set; }
public stri... |
csharp | public AddressType AddressType { get; set; }
public DateTime? ExpireDateTime { get; set; }
}
public enum AddressType
{
[Display(Name = "خانه")]
Home = 0,
[Display(Name = "محل کار")]
Work = 1,
[Display(Name = "سایر")] |
csharp | switch (evt.EventType)
{
case EventTypes.Failure:
Logger.LogCritical(new Exception(evt.SerializeError()),evt.Name);
break;
case EventTypes.Error:
Logger.LogError(new Exception(... |
csharp | /// </summary>
private int _numPages;
/// <summary>
/// The current page number
/// </summary>
private int _pageNumber;
/// <summary>
/// Widget that displays the current page number
/// </summary>
private Widget _pageNumberWidget; |
csharp | public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
Mapper.Initialize(cfg =>
{
cfg.AddProfile<BAUMappingProfile>();
});
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
... |
csharp | {
Sentence = sentence;
Word = word;
Occurences = 0;
}
|
csharp | to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above ... |
csharp | namespace AkkaFractal.Core
{
public class Completed
{
public Completed()
{
}
public static Completed Instance { get; } = new Completed();
}
} |
csharp | </div>
<div class="col-md-12 form-group mt-3">
<button type="submit" value="submit" class="btn submit_btn">Create</button>
</div>
</form>
|
csharp | _stream = null;
}
}
/// <summary>
/// @see IProcessAdapter#RegisterStream
/// </summary>
/// <param name="obj"></param>
public void RegisterStream(object obj)
{
var stream = obj as IItemStream;
if (st... |
csharp | }
public Task<List<Project>> QueryByNameAsync(string Name)
{
return context.Projects.Where(p => p.Name.Contains(Name)).ToListAsync();
}
}
}
|
csharp |
namespace Object71.SharePointCore.Common {
internal static class Constants {
internal const string LoginUrl = "https://login.microsoftonline.com/extSTS.srf";
}
} |
csharp | ns.Should().Be((ts.Ticks - ts.Ticks % 600000000) * 100);
}
[Test]
public void NanosecondsFrom_Should_return_value_with_ten_ending_zeroes()
{
var dt = new DateTime(635843473895094535);
var ts = TimeStamp.From(dt);
var ns = SUT.NanosecondsF... |
csharp | namespace PoESkillTree.Engine.Computation.Common.Builders.Stats
{
public interface IRequirementStatBuilders
{
IStatBuilder Level { get; }
IStatBuilder Strength { get; }
IStatBuilder Dexterity { get; }
IStatBuilder Intelligence { get; }
}
} |
csharp | var ds = JsonConvert.DeserializeObject(@"{}", t, new JsonSerializerSettings());
bo.GetType().GetMethod("GetNewCustCnt").Invoke(bo, new object[] { ds, request.CustNum, request.ShipToNum });
// Cycle through the passed parameters and update the new ds with those values
... |
csharp | Information($"Releasing {semVer.NuGetVersion} to nuget.org");
DotNetCoreNuGetPush(
pkgDir + File($"SoundpadConnector.{semVer.NuGetVersion}.nupkg"),
new DotNetCoreNuGetPushSettings {
Source = "nuget.org",
ApiKey = nugetKey
});
});
... |
csharp | }
private void OnNewNotification(KeyValuePair<string, MonitoredItemSiemens> i)
{
if (!String.IsNullOrEmpty(i.Value.Value))
if (NewNotification != null)
NewNotification(this, i.Value);
}
#region IDisposable Support
private ... |
csharp | : base(evaluation, stopCondition ?? new IterationsStopCondition(evaluation.dMaxValue, 1))
{
optimizedSolution = solution;
if (seed == null)
{
shuffler = new Shuffler();
rnd = new Random();
}
else
... |
csharp | symbol.SelfDataType,
symbol.ParameterDataTypes,
symbol.ReturnDataType);
}
}
|
csharp |
namespace Serenity.Abstractions
{
/// <summary>
/// Abstraction for ConfigurationManager to remove dependency on System.Configuration
/// </summary>
public interface IConfigurationManager
{
object AppSetting(string key, Type settingType);
Tuple<string, string> ConnectionString(strin... |
csharp | {
public interface IBatchResourceMonitor
{
Task DoneFetchEntityAsync(IValueResourceMonitorContext<AnfComicEntityTruck>[] context);
Task DoneFetchChapterAsync(IValueResourceMonitorContext<WithPageChapter>[] context);
}
} |
csharp |
while (true)
{
if (Program.ImportCanceled)
return records;
using (var imuSession = ImuSessionProvider.CreateInstance(this.ModuleName))
{
var cachedIrnsBatch = irns
.Skip(offset)
... |
csharp | using NugetVisualizer.Core.Domain;
namespace NugetVisualizer.Core.Repositories
{
using System.Threading.Tasks;
public interface IProjectRepository
{
void Add(Project project, IEnumerable<int> packageIds, int snapshotVersion);
List<Project> LoadProjects(int snapshotVersion);
Task<L... |
csharp | public SqlServerFunctionIIF(BooleanExpression booleanExpression, object trueValue, object falseValue)
: this((object) booleanExpression, trueValue, falseValue)
{
}
/// <summary>
/// Initializes a new instance of the SqlServerFunctionIIF class using specified expression and two values might be returned
/... |
csharp |
return mockup;
}
public static ValueInput CreateInput(String seed = "")
{
return new ValueInput()
{
};
}
private static Int32 currentEntityId = 0;
private static Object entityIdLock = new Object();
private static ... |
csharp | using System;
using System.Linq.Expressions;
using Komair.Expressions.Abstract;
namespace Komair.Expressions
{
public class ParameterExpressionNode : ExpressionNodeBase
{
public String Name { get; set; }
public ParameterExpressionNode(ExpressionType nodeType, Type type) : base(nodeT... |
csharp | {
int scopedIdx = idx;
funcs[idx] = () => valuesToReturn[scopedIdx];
}
return funcs;
} |
csharp |
SerializedProperty intProp = serArray.GetArrayElementAtIndex(n);
int value = intProp.intValue;
EditorGUI.DrawRect(rectV, cellColor);
intProp.intValue = EditorGUI.IntField(rectV, intProp.intValue, style);
++n;
... |
csharp |
public static Vector3[] circleArray;
public static void InitCircleArray() {
var a = Mathf.PI/segment * 2f; |
csharp | }
bool IViewItem.Selected
{
get
{
return isSelected;
|
csharp |
using System;
namespace Avalonia.X11
{
internal class X11Exception : Exception
{
public X11Exception(string message) : base(message)
{
}
}
}
|
csharp | using Nop.Web.Framework.Mvc.ModelBinding;
namespace Nop.Web.Areas.Admin.Models.Affiliates
{
/// <summary>
/// Represents an affiliated order model
/// </summary>
public partial record AffiliatedOrderModel : BaseNopEntityModel
{
#region Properties
public override int Id { get; set; ... |
csharp | using System;
using System.Collections.Generic;
public class Mouse : Mammal
{
public Mouse(string name, double weight, string livingRegion) : base(name, weight, livingRegion)
{
WeightIncrease = 0.1;
AcceptedFoods = new List<string> { "Fruit", "Vegetable" };
... |
csharp | public class Slime : MonoBehaviour {
public GameObject attack;
public int cool = 60;
public int moveTime = 5 * 60;
public int dir = 1;
public int anilock = -1;
private Vector3 cur = new Vector3();
private Vector3 pre = new Vector3();
private animationState an; |
csharp | using System;
namespace MAVN.Service.PartnerManagement.Domain.Models
{
public class PartnerLinkingInfo : IPartnerLinkingInfo
{ |
csharp | /// <summary>
/// Gets the identifier of the certificate.
/// </summary>
public Uri Id { get; internal set; }
/// <summary>
/// Gets the name of the certificate.
/// </summary>
public string Name { get; internal set; }
/// <summary>
/// G... |
csharp |
Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
Console.Write("Enter number a: ");
double a = double.Parse(Console.ReadLine());
Console.Write("Enter number b: ");
double b = double.Parse(Console.ReadLine());
if (a > b)
... |
csharp | {
InnerQuery = innerQuery;
Offset = offset.Body;
}
public Expression Offset { get; }
}
public class OffsetQuery<TResult> |
csharp | /// Provides logging methods to log exceptions using System.Diagnostics.Trace functionality.
/// To configure TraceLog in your project provide a system.diagnostics section in your config file:
/// <system.diagnostics>
/// <switches>
/// <!-- one of Off, Error, Warning, Info, Verbose -->
/// ... |
csharp |
/// <summary>
/// Converts map element into an Parameters or returns empty Parameters if conversion is not possible.
/// </summary>
/// <param name="key">a key of element to get.</param>
/// <returns>Parameters value of the element or empty Parameters if conversion is not suppor... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.