lang
stringclasses
10 values
seed
stringlengths
5
2.12k
csharp
material = new Material(Shader.Find("Stencils/Legacy Shaders/Bumped Specular")); } // Postprocess the image void OnRenderImage(RenderTexture source, RenderTexture destination) { Graphics.Blit(source, destination, material); } }
csharp
/// <param name="parameter">ViewModel specific parameter.</param> /// <returns>A Task.</returns> Task NavigateToAsync<TViewModel>(object parameter) where TViewModel : ViewModelBase; /// <summary> /// Navigates to a specific view based on the provided ViewModel. ...
csharp
<h2>&nbsp;&nbsp;&nbsp;About</h2> <div class="col-md-8"> <p>The .NET Nepal is an independent organization to foster open development and collaboration around the .NET ecosystem. It serves as a forum for community and commercial developers alike to broaden and strengthen the future of the .NET ecosystem b...
csharp
public void Initialise() { candidateStockpiles.AddRange(stockpilesByIngotType.Values); UpdatePreferred(); }
csharp
#region 创建 private void Create(object sender, RoutedEventArgs e) { CreateBulleinImport import = new CreateBulleinImport { Title = input_Title.Text, Context = input_Context.Text, BeginTime = GetTime(input_BeginTime...
csharp
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using OurPresence.Modeller.Generator; using OurPresence.Modeller.Interfaces; namespace OverwriteHeader { public class Generator : IGenerator {
csharp
using PayuNetSdk.PayU.Model.Payments; /// <summary> /// Represents an order result /// </summary> public class OrderReport { /// <summary> /// Gets or sets the order. /// </summary> /// <value> /// The order.
csharp
namespace FluentEvents.Infrastructure { /// <summary> /// Represents the application service provider. /// </summary> public interface IRootAppServiceProvider : IServiceProvider {
csharp
namespace Ryujinx.HLE.HOS.Services.Nfc { [Service("nfc:sys")] class ISystemManager : IpcService { public ISystemManager(ServiceCtx context) { } [CommandHipc(0)]
csharp
{ Reason = reason; } public Destroy(Jid altVenue) : this()
csharp
} } /// <summary> /// /// </summary> /// <param name="executionEntityManager"></param> /// <param name="parentExecution"></param> /// <param name="subProcess"></param>
csharp
gameOverPanel.SetActive(false); } public void HammerPressed() { hammerButtonAnim.SetTrigger("isPressed"); if (BoardManager.gameState == GameState.HammerPowerUp) SoundManager.Instance.PlayButtonClick(); else SoundManager.Instance.PlayInvalid(); }
csharp
/// <summary> /// The Golbal Question this one has been copied from. /// </summary> public int? DerivedFromId { get; set; } public int QuestionSheetId { get; set; } public QuestionSheet QuestionSheet { get; set; } }
csharp
this.RaisePropertyChanged("NombreAreaTematica"); } } } public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; protected void RaisePropertyChanged(string propertyName) {
csharp
using System.Collections.Generic; using System.Text; namespace HttpReports.Diagnostic.SqlClient { public class SqlClientDiagnosticListener : IDiagnosticListener
csharp
/// Check if r1 is under of r2 /// </summary> /// <param name="r1">First object</param> /// <param name="r2">Second object</param> /// <returns>True if it's under of</returns> public static bool IsUnderOf(Rectangle r1, Rectangle r2) { if (r1.Top >= r2....
csharp
using System.Collections.Generic; using System.Text; namespace Hospital.Models { public class PatientMedicament { public PatientMedicament() { }
csharp
get { return this._parse == null ? DefaultParseAction : this._parse; } set { this._parse = value; } } internal ScopeType GetScopeType (ScopeType stdScope) { ScopeType scope = this._scopeType; switch (this._scopeType) { case ScopeType.Default:
csharp
using System.Collections.Generic; using AdventOfCode.Lib; using System.Linq; using System.Text; namespace SmokeBasin.App { class Program {
csharp
public IDictionary<string, string> CompiledSources { get; set; } public TestableFileGenerator(IFileSystemWrapper fileSystem) : base(fileSystem) { } public override bool CanHandleFile(ReferencedFile referencedFile) { ...
csharp
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web; namespace ClientDependency.Core {
csharp
public class TestPlainText { [Test] public void TestPlain() { var markdownText = "*Hello*, [world](http://example.com)!"; var expected = "Hello, world!"; var actual = Markdown.ToPlainText(markdownText); Assert.AreEqual(expected, actual);
csharp
using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Dragon.Mail.Interfaces { public interface IResourceManager { IEnumerable<CultureInfo> GetAvailableCultures(); IEnumerable<string> GetKeys(Cu...
csharp
public IEnumerable<DiaryEntryModel> Get(DateTime diaryId) { var username = _identityService.CurrentUser; var results = TheRepository.GetDiaryEntries(username, diaryId.Date) .ToList() .Select(e => TheMo...
csharp
using Balanced; using System.Collections.Generic; Balanced.Balanced.configure("{{ api_key }}"); List<BankAccount> bankAccounts = BankAccount.Query().All();
csharp
{ public class Post { public string Code { get;set; }
csharp
@if (Model.Lists.Items.Count == 0) { <div class="message info">@T("There are no lists yet. <a href=\"{0}\">Create a List<a/>.", Url.Action("Create", "Admin", new { id = "", area = "Orchard.Lists" }))</div> } else { using (Html.BeginFormAntiForgeryPost()) { <fieldset class="bulk-actions"> <l...
csharp
X509Certificate2 x509 = null; using (FileStream fs = File.OpenRead(filename)) { byte[] data = new byte[fs.Length]; fs.Read(data, 0, data.Length); if (data[0] != 0x30) { // maybe it's ASCII PEM base64 ...
csharp
using SystemDot.Messaging.Addressing; using SystemDot.Messaging.Packaging; using SystemDot.Messaging.Storage; using SystemDot.Parallelism; namespace SystemDot.Messaging.LoadBalancing { class LoadBalancer : MessageProcessor { readonly SendMessageCache cache; readonly ConcurrentQueue<MessagePaylo...
csharp
namespace GTTG.Core.Tests.Time { public class DateTimeContextTests { [Fact] [Trait("Req.no", "DTI13")] public void IntervalsCanBeSame() { var dateTimeContext = new DateTimeContext(
csharp
{ [Table("MaternityBenefitsPerson")] public class MaternityBenefitsPerson { public Guid Id { get; set; } public int Age { get; set; } public string SpokenLanguage { get; set; } public string EducationLevel { get; set; } public string Province { get; set; } [C...
csharp
using System.Collections.Generic; using Domain.Models; namespace Domain.Repositories { public interface ITokenRepository { IEnumerable<Token> GetTokens(); int Add(TokenRequest inputModel); Token FindById(int id); } }
csharp
@model List<ApiUsage.Models.TodoItem> @foreach (var item in Model) { <h1>@item.Name</h1> <p>Finished: @item.IsComplete</p> <p>Finished list: @item.ListID</p> }
csharp
string app = System.Reflection.Assembly.GetExecutingAssembly().Location; writer.WriteLine("[InternetShortcut]"); writer.WriteLine("URL=file:///" + app); writer.WriteLine("IconIndex=0"); string icon = app.Replace('\\', '/...
csharp
using System; using System.IO; using System.Runtime.InteropServices; namespace MoarUtils.Utils.IO { public class FileTypes { [DllImport(@"urlmon.dll", CharSet = CharSet.Auto)] private extern static System.UInt32 FindMimeFromData( System.UInt32 pBC, [MarshalAs(UnmanagedType.LPStr)] System.Str...
csharp
<gh_stars>0 namespace MiniCRM.Web.Areas.Owners.Controllers { using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using MiniCRM.Common; using MiniCRM.Web.Controllers; [Authorize(Roles = GlobalConstants.OwnerUserRoleName)] [Area("Owners")] public class OwnersController ...
csharp
if (!this.UseAnimation) { if (this.Collapse) { this.pictureBoxExpandCollapse.Image = MainResources.expand.ToBitmap(); }
csharp
/// <summary> /// The logging service type /// </summary> public LoggerTypes LoggerType { get; set; } /// <summary> /// The minimum logging level /// </summary> public LogRecordTypes Level { get; set; } /// <summary>
csharp
{ if (actionExecutedContext.Response != null && corsApplies(actionExecutedContext)) { actionExecutedContext.Response.Headers.Add("Access-Control-Allow-Origin", "*"); }
csharp
namespace Infrastructure.Identity.Models { public class Message { public int Id { get; set; }
csharp
public const int InsufficientStorage = -10; public const int PlayStoreNotFound = -11; public const int NetworkUnrestricted = -12; public const int AppNotOwned = -13; public const int InternalError = -100; } public static class AssetPackStatus ...
csharp
{ Task<Uri> DownloadPublicUrlSharedFile(Guid fileId, IPAddress ipAddress = null); Task<Uri> DoDownloadFile(SharedDataFile publicFile, bool anonymous = false, IPAddress ipAddress = null); Task CreateDataSharingRequest(FileMetaData fileMetaData, string projectCode, User requestingUser, bool op...
csharp
using System.Collections.Generic; using System.Text; using System.Threading.Tasks; namespace IOTCS.EdgeGateway.Domain.Repositories { public interface IDriveRepository { Task<bool> Create(DriveModel deviceModel); Task<IEnumerable<DriveModel>> GetAllDrive();
csharp
{ public enum RecordingFileFormat { mp3, wav } }
csharp
} /// <summary> /// /// </summary>
csharp
using System.Text; using System.Windows.Forms; namespace SaleAD.FrmOptionData { public partial class frmMembers : Form { public frmMembers() { InitializeComponent(); }
csharp
namespace Findo.Framework.Interface.Interface { public interface ICache { TItem GetOrCreate<TItem>(string key, Func<TItem> func);
csharp
{ energy -= 2; Debug.Log("Particle destroyed"); int particleID = particles.IndexOf(particle); Destroy(particles[particleID].gameObject); particles.RemoveAt(particleID); size--; cellInfo.UpdateEner...
csharp
if ((offset = hdr[i + 4]) < 0) continue; actionOffset = (bint*)Address(offset); for (int x = 0; x < sizes[i + 4] / 4; x++) node._scriptOffsets[0][i].Add(*actionOffset++); } List<uint>[] flags = new List<uin...
csharp
using System.ComponentModel.Composition; using System.Linq; using System.Threading.Tasks; using Viticulture.Logic.Actions.Summer; using Viticulture.Logic.State; namespace Viticulture.Logic.Cards.Visitors.Summer { public class CultivatorCard : VisitorCard { public override string Description ...
csharp
throw new NotImplementedException(); } protected BinarySecretSecurityToken(string id, byte[] key, bool allowCrypto) { if (key == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("key"); _id = id; _effectiveTi...
csharp
using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; namespace RealTimeThemingEngine.Web.Common.Exceptions {
csharp
{ Server = server, Database = database, UserID = user, Password = password, ConnectionTimeout = 10 }; this.connectionString = builder.ConnectionString;
csharp
{ using System; public static class Validator { public static void ThrowIfIntegerIsBelowZero(int value, string message = null)
csharp
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; using Xunit; namespace Test_bug603649_cs {
csharp
if (prefix != null) result.Append(prefix); var currentId = Interlocked.Increment(ref _lastId); result.Append(currentId); return result.ToString(); } }
csharp
} private void OnEnemyCreated(Enemy enemy) { enemy.GetComponentInChildren<Renderer>().shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.ShadowsOnly;
csharp
namespace FreeID.Snowflake { /// <summary> /// 雪花ID /// </summary> public sealed class SnowflakeID { } }
csharp
Assert.NotNull(config); Assert.True(config.TryGetValue("aws:region", out var regionValue)); Assert.Equal("us-east-1", regionValue!.Value); Assert.False(regionValue.IsSecret); Assert.True(config.TryGetValue("project:name", out var secretValue)); Ass...
csharp
namespace LogicBuilder.Expressions.Utils.ExpressionBuilder.DateTimeOperators { public class MinuteOperator : IExpressionPart { public MinuteOperator(IExpressionPart operand) { Operand = operand; } public IExpressionPart Operand { get; private set; } public E...
csharp
using System.Collections.Generic; using UnityEngine; public class BrickUuid : MonoBehaviour { public string uuid;
csharp
private int mPathMaxLength = 260; [Inject] public ILogger Logger { get { return this.mLogger; } set { this.mLogger = value; } } public string InvalidPathChars
csharp
public int y { get; set; } public FireBomb(char[,] playGround, int apX, int apY, ref bool hit, ref bool endGame) { if (apY != 39 && apX < 118) { x = apX; y = apY + 1;
csharp
SampleCategory = "Charts", Tag = Tags.None, HasOptions = false }); SampleHelper.SampleViews.Add(new SampleInfo() { SampleView = typeof(FinancialCharts).AssemblyQualifiedName, Category = Categories.DataVis...
csharp
Assert.False(isValid); } [Fact] public void Token_ValidTo_Should_Return_DateTime_Based_On_ValidTo_Ticks() { DateTime now = DateTime.UtcNow; Token tokenOne = new Token { UserId = 123, SessionId = "132", ...
csharp
bool EscapeLiterals { get; set; } /// <summary> /// Set the list of regular expressions to ignore. The default is to ignore all kinds of whitespace. /// </summary> string[] Ignore { get; set; } /// <summary> /// Gets and sets the runtime of the constructed lexer...
csharp
using ESRI.ArcGIS.Geometry; using System; using TopologyCheck.Error; internal class GapsChecker : TopoClassChecker {
csharp
{ GL.ClearColor( ClearColor4.X, ClearColor4.Y, ClearColor4.Z, ClearColor4.W ); stateCache.ClearColor4 = ClearColor4; } if(stateCache.ClearDepth != ClearDept...
csharp
public enum DebotErrorCode { DebotStartFailed = 801, DebotFetchFailed = 802, DebotExecutionFailed = 803, DebotInvalidHandle = 804, DebotInvalidJsonParams = 805, DebotInvalidFunctionId = 806, DebotInvalidAbi = 807, DebotGetMethodFailed = 808, ...
csharp
using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Feign.Standalone.Reflection { class StandaloneFeignClientHttpProxyTypeBuilder : FeignClientHttpProxyTypeBuilder { protected override Type GetParentType(Type parentType) { ...
csharp
public Encoding Encoding { get; private set; } public HttpRequestMessage Request { get { return _controller.Request; }
csharp
.Bind (nameof(vm.ConvertButtonCommand)) } } .Center (); } class NumberToConvertEntry : Entry
csharp
{ rootName = objName; } else if (slashIndex == 0 || slashIndex == objName.Length - 1) { throw new ArgumentException("Invalid GameObject path"); } else { rootName = objName.Substring(0, sla...
csharp
//////////////////////////////////////////////////////////////////////// // PRIVATE METHODS ////////////////////////////////////////////////////////////////////////
csharp
cipherText = client.Encrypt( plainText ); roundTripPlaintext = server.Decrypt( cipherText ); if( roundTripPlaintext.Length != plainText.Length ) { throw new Exception(); } for( int i = 0; i < ...
csharp
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using MetroFramework.Forms;
csharp
{ key = new ECKey(PublicKey.ToByteArray()); } catch (ArgumentException) {
csharp
using System.Collections.Generic; using UnityEngine; /// <summary> /// Script attached to segment intersections to publish even indicating segment has changed /// </summary>
csharp
} /// <summary> /// 将一个xml数据反序列化为一个对象 /// </summary> /// <typeparam name="Tvalue">对象类型</typeparam> /// <param name="xmlStream">xml数据流</param> /// <returns></returns> public static Tvalue FromXml<Tvalue>(Stream xmlStream)
csharp
lock (lockObj) { if (ProjectCollection.GlobalProjectCollection.GetLoadedProjects(projectFullPath).Count != 0) { LoadedProj = ProjectCollection.GlobalProjectCollection.GetLoadedProjects(projectFullPath).FirstOrDefault<Project>(); ...
csharp
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Zajecia1.Models; namespace Zajecia1.Pages { public class IndexModel : PageModel
csharp
namespace Slipe { class CLI { static int Main(string[] args) { try { //args = new string[]
csharp
await insert.ExecuteAsync(transaction, typename, id, revision, output.ToArray()); } /// <inheritdoc /> public async Task<T> GetArchivedObject<T>(long id, int revision, string typename=null) { typename ??= typeof(T).Name;
csharp
this.Property(t => t.step_code) .IsFixedLength() .HasMaxLength(40); this.Property(t => t.step_type) .IsRequired() .IsFixedLength() .HasMaxLength(16); this.Property(t => t.step_log_id) ....
csharp
_deserialize = deserialize; } public T Get(IFormatReader parameter) => _deserialize(parameter); public void Write(IFormatWriter writer, T instance) { _serialize(writer, instance); } }
csharp
{ Task CreateAsync(CreateTransactionInputModel input); IEnumerable<T> GetAll<T>(); Task DeleteAsync(string id); IEnumerable<T> GetAllTransactionsByMonth<T>(InputYearMonthModel input); Task<T> GetByIdAsync<T>(string id); Task UpdateAsync(string id, EditTransaction...
csharp
using System.Windows.Ink; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; namespace GeoportalWidget { public class QueryResultData { public string Title { get; set; }
csharp
namespace CAFU.Core { public interface IInitializeNotifiable { void OnInitialize(); } }
csharp
startNewThread = true; } else if (versionA) { Debug.Log("Enough ping pong for today, disconnecting"); Close(); } } catch (System.Exception exception) {
csharp
namespace LinFx.Extensions.MultiTenancy; public interface ICurrentTenantAccessor { TenantInfo Current { get; set; } }
csharp
} } public static async Task<Package> ParseAsync( string xmlContent ) { using( var rdr = new StringReader( xmlContent ) )
csharp
if (EnableDesktopComposition) favorite += (Int32)PerfomanceOptions.TS_PERF_ENABLE_DESKTOP_COMPOSITION; if (EnableFontSmoothing) favorite += (Int32)PerfomanceOptions.TS_PERF_ENABLE_FONT_SMOOTHING; return favorite; } }
csharp
/// List the secrets for a repository. /// </summary> /// <remarks> /// See the <a href="https://docs.github.com/en/rest/reference/actions#list-repository-secrets">API documentation</a> for more information. /// </remarks> /// <param name="repoName">The owner of the repos...
csharp
} public void Dispose() { _exit = true; while (_server != null) Thread.Sleep(10); // Make sure we kill the waiting threads so the app can quit _activeThreads.ForEach(x => x.Abort()); } } }
csharp
/// City /// </summary> public string City { get; set; } /// <summary> /// Two letter country code /// </summary> public string CountryCode { get; set; } /// <summary> /// Full Country name
csharp
using System.Linq; namespace BFNet.MoreFck { public class Loop : TreeObject { public TreeObject[] TreeChildren; public override bool Equals(object? obj) => obj is Loop casted && TreeChildren.SequenceEqual(casted.TreeChildren); protected bool Equals(Loop other) => Equals(this, other);
csharp
{ public class ClientScopeEntityTypeConfiguration : IEntityTypeConfiguration<ClientScope> { public void Configure(EntityTypeBuilder<ClientScope> builder) { builder.HasOne(p => p.Client) .WithMany() .HasForeignKey(p => p.ClientId) .OnDel...
csharp
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and limitations under the License. using System; using Common.Logging; using NakedObjects.Facade; using NakedObjects.Rest.Snapshot.Utility; namespace NakedObjects.Rest.Model {...
csharp
private static Vector2 PolarVector2(float degrees, float magnitude) => new Vector2(Mathf.Cos(degrees * Mathf.Deg2Rad) * magnitude, Mathf.Sin(degrees * Mathf.Deg2Rad) * magnitude); /*private readonly Dictionary<Vector2, (Expression, float)> Expressions = new Dictionary<Vector2, (Expression, float)> { ...
csharp
namespace WebMoney.Services.BusinessObjects { [XmlRoot("payments", Namespace = "http://tempuri.org/ds.xsd")] internal sealed class ExportableTransferBundle { [XmlElement(ElementName = "payment")] public List<ExportableTransfer> Transfers { get; } public ExportableTransferBundle() ...