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<TranslationResult[]>(result);
return translationResults.OrderByDescending(x => x.DetectedLanguage.Score).FirstOrDefault();
}
|
csharp | this.GroupFooter1.RepeatEveryPage = true;
//
// xrLine3
//
this.xrLine3.BorderDashStyle = DevExpress.XtraPrinting.BorderDashStyle.Solid;
this.xrLine3.ForeColor = System.Drawing.Color.Transparent;
this.xrLine3.LineStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.xrLine3.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F);
this.xrLine3.Name = "xrLine3";
this.xrLine3.SizeF = new System.Drawing.SizeF(1000F, 12.99998F);
this.xrLine3.StylePriority.UseBorderDashStyle = false;
this.xrLine3.StylePriority.UseForeColor = false;
|
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 = (TextureImporter)assetImporter;
textureImporter.textureType = TextureImporterType.Sprite;
textureImporter.spritePixelsPerUnit = 32f;
textureImporter.filterMode = FilterMode.Point;
textureImporter.textureFormat = TextureImporterFormat.AutomaticTruecolor;
}
} |
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);
}
catch (ActivationException)
{
return null;
} |
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 class="nhsuk-u-visually-hidden">This prompt is:</span>
<strong class="nhsuk-u-font-size-19 right-align-tag nhsuk-tag @(Model.Mandatory ? "" : "nhsuk-tag--grey")">
|
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 race this year! Come out and cast your vote!");
|
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
{
var model = mapper.Map<Broot.DB.Entities.Product>(newProduct);
using (var srv = new BrootContext())
{ |
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{TModel}"/> object with an instance of the default form template renderer.</returns>
public static IForm<TChildModel> BeginChameleonFormFor<TParentModel, TChildModel>(this IHtmlHelper<TParentModel> helper, Expression<Func<TParentModel, TChildModel>> formFor, string action = "", FormMethod method = FormMethod.Post, HtmlAttributes htmlAttributes = null, EncType? enctype = null, bool? outputAntiforgeryToken = null)
{
var childHelper = helper.For(formFor, bindFieldsToParent: false);
return new Form<TChildModel>(childHelper, helper.GetDefaultFormTemplate(), action, method, htmlAttributes, enctype, outputAntiforgeryToken);
}
|
csharp | break;
}
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
input = Console.ReadLine();
}
}
private static void PrintRating(string teamName) |
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 error
case Http2ProtocolErrorCode.ProtocolError:
return "PROTOCOL_ERROR";
case Http2ProtocolErrorCode.InternalError:
return "INTERNAL_ERROR";
case Http2ProtocolErrorCode.FlowControlError:
return "FLOW_CONTROL_ERROR";
case Http2ProtocolErrorCode.SettingsTimeout: |
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 IValidationRule propertyRule)
{
return propertyRule.PropertyName.ToCamelCase();
}
public static bool HasConditions(this IValidationRule propertyRule) |
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()
{
IEnumerable<CategoryPictureViewModel> categoriesVM = this.categories |
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 TestSubstituteProcessExecutionShimProgram
{
public static int Main(string[] args)
{
// Echo out the command line for validation in tests.
Console.WriteLine("TestShim: Entered with command line: " + Environment.CommandLine);
return 0;
}
}
|
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;
Console.WriteLine($"{number} X {fromNumber} = {multiply}");
multiply = 0; |
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,
});
context.SaveChanges(); |
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 void ConfigureEntity(EntityTypeBuilder<UserInspection> builder)
{
builder.HasOne(ent => ent.User)
.WithMany()
.HasForeignKey(ent => ent.UserId);
builder.HasOne(ent => ent.Inspection) |
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<JsonWatchList>>(
"v2/watchlists", cancellationToken, _alpacaRestApiThrottler);
/// <inheritdoc />
public Task<IWatchList> CreateWatchListAsync(
NewWatchListRequest request,
CancellationToken cancellationToken = default) => |
csharp | using ViewModels.TrackRecords;
public interface ITrackRecordsController : IController
{
ITrackRecordsViewModel TrackRecordsViewModel { get; }
void OnSessionStarted(SimulatorDataSet dataSet);
void OnDataLoaded(SimulatorDataSet dataSet);
bool EvaluateFastestLapCandidate(ILapInfo lapInfo);
}
} |
csharp | public static class EntityTypeBuilderExtensions
{
public static void HasTemporalTable<TEntity>(this EntityTypeBuilder<TEntity> builder)
where TEntity : class
{
TemporalConfiguration temporalConfiguration = new TemporalConfiguration(builder);
}
public static void HasTemporalTable<TEntity>(
this EntityTypeBuilder<TEntity> builder,
Action<TemporalConfiguration<TEntity>> configuration)
where TEntity : class
{
TemporalConfiguration<TEntity> temporalConfiguration = new TemporalConfiguration<TEntity>(builder); |
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, _password);
} |
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();
}
base.Dispose(disposing);
}
#region Código gerado pelo Windows Form Designer
|
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 length of the substring to return</param>
/// <returns>The subset of the render string</returns>
string GetRenderString(int startIndex, int length);
/// <summary>
/// Gets the subset of the render string that is between the specified <see cref="ITagInstance"/>s as it
/// looks at this point in time. This means i may be in a partially rendering (or not rendered at all) form.
/// </summary>
|
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 string href { get; set; }
public string id { get; set; }
public List<Image2> images { get; set; }
public string name { get; set; } |
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(evt.SerializeError()), evt.Name);
break;
case EventTypes.Information: |
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();
}
var serviceScopeFactory = app.ApplicationServices.GetRequiredService<IServiceScopeFactory>();
using (var serviceScope = serviceScopeFactory.CreateScope()) |
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 copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
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 (stream != null)
{
|
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.NanosecondsFrom(ts);
var s = string.Join(string.Empty, ns.ToString().Reverse()); |
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
request.Parameters.ForEach(p => {
((DataSet)ds).Tables["CustCnt"].Rows[0][p.Key] = p.Value;
});
((DataSet)ds).Tables["CustCnt"].Rows[0]["RowMod"] = "U";
// Commit the transaction
bo.GetType().GetMethod("Update").Invoke(bo, new object[] { ds });
// Return the response as success if it got this far |
csharp | Information($"Releasing {semVer.NuGetVersion} to nuget.org");
DotNetCoreNuGetPush(
pkgDir + File($"SoundpadConnector.{semVer.NuGetVersion}.nupkg"),
new DotNetCoreNuGetPushSettings {
Source = "nuget.org",
ApiKey = nugetKey
});
});
Task("Default")
.IsDependentOn("SemVer")
.IsDependentOn("Clean")
.IsDependentOn("Build"); |
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 bool disposedValue = false; // Dient zur Erkennung redundanter Aufrufe.
protected virtual void Dispose(bool disposing) |
csharp | : base(evaluation, stopCondition ?? new IterationsStopCondition(evaluation.dMaxValue, 1))
{
optimizedSolution = solution;
if (seed == null)
{
shuffler = new Shuffler();
rnd = new Random();
}
else
{
shuffler = new Shuffler(seed.Value); |
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(string key);
} |
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)
.Take(Constants.DataBatchSize)
.ToList();
if (cachedIrnsBatch.Count == 0)
break; |
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<List<Project>> GetProjectsForPackage(string packageName, int snapshotVersion);
}
} |
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
/// </summary>
/// <param name="booleanExpression">A boolean expression which its result will determine which value to be returned</param>
/// <param name="trueValue">Value to return if logical clause evaluates to true</param>
/// <param name="falseValue">Value to return if logical clause evaluates to false</param> |
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 Int32 GetNextEntityId()
{ |
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(nodeType, type) { }
}
} |
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;
}
}
EditorGUI.EndProperty();
} |
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; }
[NopResourceDisplayName("Admin.Affiliates.Orders.CustomOrderNumber")]
public string CustomOrderNumber { 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" };
}
public override void AskForFood()
{
Console.WriteLine("Squeak"); |
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>
/// Gets the <see cref="Uri"/> of the vault in which the certificate is stored. |
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 -->
/// <add name="TraceLogSwitch" value="Error" />
/// </switches>
/// <trace autoflush="true"> |
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 supported.</returns>
public Parameters GetAsParameters(string key)
{
var value = GetAsMap(key);
return new Parameters(value);
} |
Subsets and Splits