content
stringlengths
23
1.05M
using System.Threading.Tasks; namespace Orleankka { public static class ActorRefExtensions { public static Task Activate(this ActorRef @ref) => @ref.Tell(Orleankka.Activate.Message); public static Task Deactivate(this ActorRef @ref) => @ref.Tell(Orleankka.Deactivate.Message); } }
using System; using System.Collections.Generic; using System.Text; namespace xSkrape.APIWrapper { internal class AvailableMailboxesResult { public IList<AvailableMailbox> Mailboxes; public bool Success; public string Source; public string Message; } internal class AvailableMailbox { public string Moniker; public string Title; public string Description; } internal class MultiValueResult { public IDictionary<string, string> v; public IDictionary<string, string> dt; public bool Success; public string Message; public string Source; public bool NoData; public bool RobotsTxtWarning; public bool Truncated; } internal class SingleValueResult { public string v; public string dt; public bool Success; public string Message; public string Source; public bool NoData; public bool RobotsTxtWarning; public bool Truncated; } internal class TableValueResult { public IList<TableValueColumn> c; public IList<TableValueRow> r; public string Message; public string Source; public bool NoData; public bool Success; public bool HasHeader; public bool RobotsTxtWarning; public bool Truncated; } internal class TableValueColumn { public string cn; public string dt; public string fmt; } internal class TableValueRow { public IList<string> v; public IList<string> n; } internal class SendMessageResult { public bool Success; public string Message; public string Source; } internal class SendRSSResult { public bool Success; public string Message; public string Source; } internal class CreateDataResult { public bool Success; public string Message; public string Source; public string[] Data; } }
using Spire.Pdf; using Spire.Pdf.Graphics; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.IO; using System.Linq; using System.Text; using System.Windows.Forms; namespace TextToPDF { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { //Get text from .txt file string text = File.ReadAllText(@"..\..\..\..\..\..\Data\TextToPdf.txt"); //Create a pdf document PdfDocument doc = new PdfDocument(); PdfSection section = doc.Sections.Add(); PdfPageBase page = section.Pages.Add(); //Create a PdfFont PdfFont font = new PdfFont(PdfFontFamily.Helvetica, 11); //Set string format PdfStringFormat format = new PdfStringFormat(); format.LineSpacing = 20f; PdfBrush brush = PdfBrushes.Black; //Set text layout PdfTextLayout textLayout = new PdfTextLayout(); textLayout.Break = PdfLayoutBreakType.FitPage; textLayout.Layout = PdfLayoutType.Paginate; RectangleF bounds = new RectangleF(new PointF(10, 20), page.Canvas.ClientSize); PdfTextWidget textWidget = new PdfTextWidget(text, font, brush); textWidget.StringFormat = format; textWidget.Draw(page, bounds, textLayout); string output ="TextToPdf.pdf"; //Save to file doc.SaveToFile(output, FileFormat.PDF); //Launch the result file PDFDocumentViewer(output); } private void PDFDocumentViewer(string fileName) { try { System.Diagnostics.Process.Start(fileName); } catch { } } } }
namespace ScottPlot.Demo.WinForms.WinFormsDemos { partial class LiveDataUpdate { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.label1 = new System.Windows.Forms.Label(); this.formsPlot1 = new ScottPlot.FormsPlot(); this.timerUpdateData = new System.Windows.Forms.Timer(this.components); this.timerRender = new System.Windows.Forms.Timer(this.components); this.runCheckbox = new System.Windows.Forms.CheckBox(); this.rollCheckbox = new System.Windows.Forms.CheckBox(); this.SuspendLayout(); // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(12, 9); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(328, 13); this.label1.TabIndex = 0; this.label1.Text = "This example uses a fixed-size array and updates its values with time"; // // formsPlot1 // this.formsPlot1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.formsPlot1.Location = new System.Drawing.Point(12, 31); this.formsPlot1.Name = "formsPlot1"; this.formsPlot1.Size = new System.Drawing.Size(776, 407); this.formsPlot1.TabIndex = 1; // // timerUpdateData // this.timerUpdateData.Enabled = true; this.timerUpdateData.Interval = 5; this.timerUpdateData.Tick += new System.EventHandler(this.timerUpdateData_Tick); // // timerRender // this.timerRender.Enabled = true; this.timerRender.Interval = 20; this.timerRender.Tick += new System.EventHandler(this.timerRender_Tick); // // runCheckbox // this.runCheckbox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.runCheckbox.AutoSize = true; this.runCheckbox.Checked = true; this.runCheckbox.CheckState = System.Windows.Forms.CheckState.Checked; this.runCheckbox.Location = new System.Drawing.Point(742, 8); this.runCheckbox.Name = "runCheckbox"; this.runCheckbox.Size = new System.Drawing.Size(46, 17); this.runCheckbox.TabIndex = 2; this.runCheckbox.Text = "Run"; this.runCheckbox.UseVisualStyleBackColor = true; this.runCheckbox.CheckedChanged += new System.EventHandler(this.runCheckbox_CheckedChanged); // // rollCheckbox // this.rollCheckbox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.rollCheckbox.AutoSize = true; this.rollCheckbox.Location = new System.Drawing.Point(692, 8); this.rollCheckbox.Name = "rollCheckbox"; this.rollCheckbox.Size = new System.Drawing.Size(44, 17); this.rollCheckbox.TabIndex = 3; this.rollCheckbox.Text = "Roll"; this.rollCheckbox.UseVisualStyleBackColor = true; this.rollCheckbox.CheckedChanged += new System.EventHandler(this.rollCheckbox_CheckedChanged); // // LiveDataUpdate // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(800, 450); this.Controls.Add(this.rollCheckbox); this.Controls.Add(this.runCheckbox); this.Controls.Add(this.formsPlot1); this.Controls.Add(this.label1); this.Name = "LiveDataUpdate"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Live Data (fixed array)"; this.ResumeLayout(false); this.PerformLayout(); } #endregion private System.Windows.Forms.Label label1; private FormsPlot formsPlot1; private System.Windows.Forms.Timer timerUpdateData; private System.Windows.Forms.Timer timerRender; private System.Windows.Forms.CheckBox runCheckbox; private System.Windows.Forms.CheckBox rollCheckbox; } }
using Godot; using System; using System.Collections.Generic; public class PersonData { public Vector2 position; public float elev; public PersonAction personAction = PersonAction.Idle; public int pathIndex = 0; public float walkSpeed = 2; public Tile currentTile; public string personId; public bool hasSpouse; public string spouseId; public string motherId; public string fatherId; public List<string> childrenIds; public string houseId; public string workPlaceId; }
using UnityEngine; namespace com.tinylabproductions.TLPLib.Tween.fun_tween.serialization.tweeners { [AddComponentMenu("")] public class Transform_Position : SerializedTweener<Vector3, Transform> { public Transform_Position() : base( TweenOps.vector3, SerializedTweenerOps.Add.vector3, SerializedTweenerOps.Extract.position, TweenMutators.position, Defaults.vector3 ) { } } }
using System.Linq; using TaleWorlds.Engine; namespace AdditionalQuestsCode.Utils { public class Helpers { public static bool IsMCMLoaded() { bool loaded = false; var modnames = Utilities.GetModulesNames().ToList(); if (modnames.Contains("Bannerlord.MBOptionScreen"))// && !overrideSettings { Statics.MCMModuleLoaded = true; loaded = true; Logging.MessageDebug("MCM Module is loaded"); } return loaded; } } }
using Microsoft.AspNetCore.Http; using HotChocolate.AspNetCore.Instrumentation; using HotChocolate.AspNetCore.Serialization; using HotChocolate.AspNetCore.Subscriptions; using RequestDelegate = Microsoft.AspNetCore.Http.RequestDelegate; namespace HotChocolate.AspNetCore; public class WebSocketSubscriptionMiddleware : MiddlewareBase { private readonly IServerDiagnosticEvents _diagnosticEvents; public WebSocketSubscriptionMiddleware( RequestDelegate next, IRequestExecutorResolver executorResolver, IHttpResultSerializer resultSerializer, IServerDiagnosticEvents diagnosticEvents, NameString schemaName) : base(next, executorResolver, resultSerializer, schemaName) { _diagnosticEvents = diagnosticEvents ?? throw new ArgumentNullException(nameof(diagnosticEvents)); } public Task InvokeAsync(HttpContext context) { if (context.WebSockets.IsWebSocketRequest) { return HandleWebSocketSessionAsync(context); } else { return NextAsync(context); } } private async Task HandleWebSocketSessionAsync(HttpContext context) { if (!IsDefaultSchema) { context.Items[WellKnownContextData.SchemaName] = SchemaName.Value; } using (_diagnosticEvents.WebSocketSession(context)) { try { IRequestExecutor requestExecutor = await GetExecutorAsync(context.RequestAborted); IMessagePipeline? messagePipeline = requestExecutor.GetRequiredService<IMessagePipeline>(); ISocketSessionInterceptor? socketSessionInterceptor = requestExecutor.GetRequiredService<ISocketSessionInterceptor>(); context.Items[WellKnownContextData.RequestExecutor] = requestExecutor; await WebSocketSession .New(context, messagePipeline, socketSessionInterceptor) .HandleAsync(context.RequestAborted); } catch (Exception ex) { _diagnosticEvents.WebSocketSessionError(context, ex); } } } }
@{ ViewBag.Title = "Error"; } <br /><br /> <div class="container-fluid"> <div class="alert alert-danger col-md-6 col-md-offset-3"> <h3 class="">You have stumbled upon an error</h3> <div>The error details have been logged.</div> </div> </div>
using Integrator.Models; using Integrator.Models.Domain.Companies; using System; using System.Collections.Generic; namespace Integrator.Models.Domain.Companies { public partial class CompanyRelatedIndustryRepresentive:BaseEntity { public int CompanyRelatedIndustryID { get; set; } public int CompanyRepresentativeID { get; set; } public DateTime DateAssigned { get; set; } public virtual CompanyRelatedIndustry CompanyRelatedIndustry { get; set; } public virtual CompanyRepresentative CompanyRepresentative { get; set; } } }
using System; using System.Runtime.Serialization; namespace Apollo.Core.Model.Entity { [Serializable] [DataContract] public class OfferAction : BaseEntity { [DataMember] public string Name { get; set; } [DataMember] public int OfferRuleId { get; set; } [DataMember] public int OfferActionAttributeId { get; set; } [DataMember] public decimal? DiscountAmount { get; set; } [DataMember] public bool? FreeProductItself { get; set; } [DataMember] public int? FreeProductId { get; set; } [DataMember] public int? FreeProductPriceId { get; set; } [DataMember] public int? FreeProductQty { get; set; } [DataMember] public int? OptionOperatorId { get; set; } [DataMember] public string OptionOperand { get; set; } [DataMember] public int? DiscountQtyStep { get; set; } [DataMember] public decimal? MinimumAmount { get; set; } [DataMember] public bool FreeShipping { get; set; } [DataMember] public int RewardPoint { get; set; } [DataMember] public OfferOperator OptionOperator { get; set; } [DataMember] public OfferCondition Condition { get; set; } [DataMember] public int? XValue { get; set; } [DataMember] public decimal? YValue { get; set; } [DataMember] public bool? IsCart { get; set; } [DataMember] public bool? IsCatalog { get; set; } } }
using System; namespace New.Hope.Api.Configuration { public class ApiSettings { public String Name { get; set; } public String Version { get; set; } public String Environment { get; set; } } }
using System.Threading.Tasks; using Xtender.Async; namespace Xtender.Example.Console.Async.Extensions { public class StatedItemExtensionBase : IAsyncExtension<string, Item> { public Task Extend(Item _, IAsyncExtender<string> extender) { System.Console.WriteLine("Entered ItemExtensionBase"); if (extender.State is null) { extender.State = "Encountered an Item regarding Component."; return Task.CompletedTask; } extender.State += "Encountered an Item regarding Component."; return Task.CompletedTask; } } }
/* * User: m4rc3lo * Date: 12/10/2019 * Time: 01:31 */ using System; namespace TTT { //Classe para execucao e controle do jogo public class Jogo { // variável de instância (tem visibilidade em toda a classe) // abstrai o tabuleiro, tipo de dado: matrix de char private char[ , ] tabuleiro; private Pessoa pessoa1; private Pessoa pessoa2; private char vencedor; //construtor da classe public Jogo() { //inicializacao da variavel (espaco em memoria) tabuleiro = new char [3 , 3]; pessoa1 = new Pessoa(); pessoa2 = new Pessoa(); vencedor = '-'; //percorre cada posicao (linha x coluna) for (int linha = 0 ; linha < 3 ; linha++) { for (int coluna = 0 ; coluna < 3 ; coluna++) { tabuleiro [linha , coluna] = '-'; } } } //sorteia qual pesso inicia o jogo (recebe X) public void sorteia_first () { Random rand = new Random(); int first = rand.Next(1,3); if (first == 1) { pessoa1.set_simbolo('X'); pessoa2.set_simbolo('O'); pessoa1.set_first(true); pessoa1.set_turno(true); } else { pessoa1.set_simbolo('O'); pessoa2.set_simbolo('X'); pessoa2.set_first(true); pessoa2.set_turno(true); } } //nome e sorteio da primeira a jogar public void inicializa_game() { //define o nome das pessoas Desenho.apresentacao(); Entrada.get_nomes(pessoa1, pessoa2); sorteia_first();//escolhe primeira pessoa a jogar //a primeira fica com o X Desenho.mostra_first(pessoa1, pessoa2); Desenho.instrucoes(); } //game loop - enquanto for possível jogar... public void start_game() { //variáveis locais a fução bool empate = false; bool vitoria = false; //char vencedor = '-'; int contador = 0; //enquanto não for vitória ou não for empate while (!(vitoria) && !(empate)) { //variáveis locais ao escopo do while char eh_vitoria; int posicao = 0; //um jogador por turno if (pessoa1.get_turno()) { Desenho.desenha_tabuleiro(tabuleiro); //pega a posicao da jogada escolhida posicao = Entrada.pega_jogada(pessoa1, tabuleiro); //passa o turno pessoa1.set_turno(false); pessoa2.set_turno(true); Atualizacao.set_jogada(pessoa1, tabuleiro, posicao); eh_vitoria = Atualizacao.eh_vitoria(tabuleiro); Console.Clear(); //caso alguem ganhe if (eh_vitoria == 'X') { vitoria = true; vencedor = 'X'; } else if (eh_vitoria == 'O') { vitoria = true; vencedor = 'O'; } contador++; //controla quantidade de jogadas } else if (pessoa2.get_turno()) { Desenho.desenha_tabuleiro(tabuleiro); posicao = Entrada.pega_jogada(pessoa2, tabuleiro); pessoa2.set_turno(false); pessoa1.set_turno(true); Atualizacao.set_jogada(pessoa2, tabuleiro, posicao); eh_vitoria = Atualizacao.eh_vitoria(tabuleiro); Console.Clear(); if (eh_vitoria == 'X') { vitoria = true; vencedor = 'X'; } else if (eh_vitoria == 'O') { vitoria = true; vencedor = 'O'; } contador++; } if (contador >=9) // se não houver vitoria até o nono turmo empate = true; }//fim do while (vitoria ou empate) }//fim da função star_game() //encerra a partida public void end_game() { //verifica vencedor if(vencedor == pessoa1.get_simbolo()) Desenho.mostra_resultado(pessoa1); else if (vencedor == pessoa2.get_simbolo()) Desenho.mostra_resultado(pessoa2); else Desenho.mostra_empate(); //mostra tabuleiro final Desenho.desenha_tabuleiro(tabuleiro); Console.Write("Precione qualquel tecla para encerrar! . . . "); Console.ReadKey(true); } }//fim do escopo da classe Jogo }//fim do namespace
using System.Collections.Generic; using System.Linq; using Microsoft.AspNetCore.Mvc; using NodaTime; namespace AspNodaTime.Controllers { [Route("api/[controller]")] [ApiController] public class EventsController : ControllerBase { static readonly List<Event> events = new List<Event>() { new Event("Concert", new OffsetDateTime(new LocalDateTime(2020, 10, 20, 20, 0), Offset.FromHours(2))), new Event("New Year", new OffsetDateTime(new LocalDateTime(2021, 1, 1, 0, 0), Offset.FromHours(1))) }; /// <summary> /// Remember to url encode the after parameter: /// ?after=2020-10-20T23:00:00+02:00 should be encoded as ?after=2020-10-20T23:00:00%2B02:00 /// </summary> [HttpGet] public IEnumerable<Event> Get(OffsetDateTime after) { return events.Where(@event => after == null || @event.EventStartTime.ToInstant() > after.ToInstant()); } [HttpPost] public void Post([FromBody] Event @event) { events.Add(@event); } } }
using Logy.Maps.Geometry; using NUnit.Framework; namespace Logy.Maps.ReliefMaps.World.From17 { public class ReliefToNormalWander : ReliefToNormal { public ReliefToNormalWander() : base(7) { } /// <summary> /// how water moves from Greenland to Datum.Normal with solid litosphere /// </summary> [Test] public void Sharp() { // for k6 start 4000, 4352 (-637m..), 4852 (-510m..) // for k7 start 8200 (-1118m..), 8300plusHvalin string from = null;// "08300plusHvalin"; Subdir = "sharp" + from; // InitDataWithJson(); // Load(from, false, new Datum { X = -40, Y = 90 }); Run(K == 6 ? 30 : 50); } [Test] public void PlusWaterToHvalin() { Subdir = "plusHvalin"; Load(); /// InitDataWithJson(); // k6 GetP(22, 20) // for k7 near 78000 cub km Data.PixMan.Pixels[HealpixManager.GetP(90, 110)].Hoq = 30000; Run(100); } [Test] public void PlusWaterToHvalinAndSharpTo80() { Subdir = "plusHvalin"; Load(109, false, new Datum { X = -40, Y = 80 }); Run(113); } [Test] public void GeoisostasyAfterPlusAndSharp() { Load(null, true); Run(500); } } }
using EdFi.SampleDataGenerator.Core.Config; namespace EdFi.SampleDataGenerator.Core.UnitTests.Config { public class TestLocationInfo : ILocationInfo { public string State { get; set; } public ICity[] Cities { get; set; } public static TestLocationInfo Default = new TestLocationInfo { State = "TX", Cities = new ICity[] { TestCity.Default } }; } public class TestCity : ICity { public string Name { get; set; } public string County { get; set; } public IAreaCode[] AreaCodes { get; set; } public IPostalCode[] PostalCodes { get; set; } public static TestCity Default = new TestCity { Name = "Test City Name", AreaCodes = new IAreaCode[] { TestAreaCode.Default }, County = "Test County", PostalCodes = new IPostalCode[] { TestPostalCode.Default } }; } public class TestAreaCode : IAreaCode { public int Value { get; set; } public static TestAreaCode Default = new TestAreaCode { Value = 555 }; } public class TestPostalCode : IPostalCode { public string Value { get; set; } public static TestPostalCode Default = new TestPostalCode { Value = "78701" }; } }
using Verse; namespace AnimalBehaviours { public class CompProperties_RegisterAlternateGraphic : CompProperties { public CompProperties_RegisterAlternateGraphic() { this.compClass = typeof(CompRegisterAlternateGraphic); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace AE.Net.Mail { public class SafeDictionary<KT, VT> : Dictionary<KT, VT> { public SafeDictionary() { } public SafeDictionary(IEqualityComparer<KT> comparer) : base(comparer) { } public virtual new VT this[KT key] { get { return this.Get(key); } set { this.Set(key, value); } } } }
using Abp.Application.Services.Dto; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Text; using System.Threading.Tasks; using TaxiApp.Account; using TaxiApp.Cars; using TaxiApp.Cars.Dtos; namespace TaxiApp.Orders.Dtos { public class OrderDto : EntityDto<long> { public DateTime OrderDate { get; set; } public decimal? SuggestedPrice { get; set; } [Required] public LocationDto LocationFrom { get; set; } [Required] public LocationDto LocationTo { get; set; } public CarType ServiceType { get; set; } public User.GenderType? Gender { get; set; } public int? DriverExperience { get; set; } public int? MinimalCarProductionYear { get; set; } } }
/*using System; using StoreBL; using StoreModels; namespace StoreUI { public class AddProduct : IMenu { private static Product _prod = new Product(); private IStoreBL _storeBL; public AddProduct(IStoreBL p_storeBL) { _storeBL = p_storeBL; } public void Menu() { Console.WriteLine("Adding a new Product"); Console.WriteLine("Name - " + _prod.ItemName); Console.WriteLine("Category - "+ _prod.Category); Console.WriteLine("Price - "+ _prod.Price); Console.WriteLine("Description - "+ _prod.Description); Console.WriteLine("[1] - Input value for Name"); Console.WriteLine("[2] - Input value for Category"); Console.WriteLine("[3] - Input value for Price"); Console.WriteLine("[4] - Input value for Description"); Console.WriteLine("[5] - Add Product"); Console.WriteLine("[0] - Go Back"); } public MenuType UserChoice() { string userChoice = Console.ReadLine(); switch (userChoice) { case "1": Console.WriteLine("Type in the value for the Name"); _prod.ItemName = Console.ReadLine(); return MenuType.AddProduct; case "2": Console.WriteLine("Type in the value for the Category"); _prod.Category = Console.ReadLine(); return MenuType.AddProduct; case "3": Console.WriteLine("Type in the value for the Price"); _prod.Price = Decimal.Parse(Console.ReadLine()); return MenuType.AddProduct; case "4": Console.WriteLine("Type in the value for the Description"); _prod.ItemName = Console.ReadLine(); return MenuType.AddProduct; case "5": //Anything inside the try block will be catched if an exception has risen //Laymen's term if a problem has happened while doing this code, it will instead do the catch block try { _storeBL.AddProduct(_prod); } catch (System.Exception) { Console.WriteLine("You must input value to all fields above"); Console.WriteLine("Press Enter to continue"); Console.ReadLine(); return MenuType.AddProduct; } return MenuType.StoreMenu; case "0": return MenuType.StoreMenu; default: Console.WriteLine("Please input a valid response!"); Console.WriteLine("Press Enter to continue"); Console.ReadLine(); return MenuType.ListProduct; } } } } */
using Ardalis.ApiEndpoints; using Ardalis.Result.AspNetCore; using Ardalis.Result.Sample.Core.DTOs; using Ardalis.Result.Sample.Core.Model; using Ardalis.Result.Sample.Core.Services; using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; namespace Ardalis.Result.SampleWeb.WeatherForecastFeature; public class ForecastEndpoint : EndpointBaseSync .WithRequest<ForecastRequestDto> .WithActionResult<IEnumerable<WeatherForecast>> { private readonly WeatherService _weatherService; public ForecastEndpoint(WeatherService weatherService) { _weatherService = weatherService; } /// <summary> /// This uses an extension method to convert to an ActionResult /// </summary> /// <param name="model"></param> /// <returns></returns> [HttpPost("/Forecast/New")] public override ActionResult<IEnumerable<WeatherForecast>> Handle(ForecastRequestDto request) { if (DateTime.Now.Second % 2 == 0) // just so we can show both versions { // Extension method on ControllerBase return this.ToActionResult(_weatherService.GetForecast(request)); } Result<IEnumerable<WeatherForecast>> result = _weatherService.GetForecast(request); // Extension method on a Result instance (passing in ControllerBase instance) return result.ToActionResult(this); } }
/* * Created by SharpDevelop. * User: L.Schnitzmeier * Date: 14.11.2016 * Time: 13:02 * * To change this template use Tools | Options | Coding | Edit Standard Headers. */ using System; namespace CarsonDummy { /// <summary> /// Description of Settings. /// </summary> public class Settings { Gamemode CurrentGamemode = Gamemode.Normal; int TargetScore { get; set; } int[] CardPacks { get; set; } int Kicktimer { get; set; } public Settings() { } } }
using System.Collections; using System.Collections.Generic; namespace TreeCollections { /// <summary> /// Enumerator for level-order (breadth-first) traversal with optional max depth of traversal /// </summary> /// <typeparam name="TNode"></typeparam> public class LevelOrderEnumerator<TNode> : IEnumerator<TNode> where TNode : TreeNode<TNode> { private readonly TNode _rootOfIteration; private readonly int _maxDepth; private readonly Queue<TNode> _queue; private int _currentDepth; private int _currentGenerationCount; private int _nextGenerationCount; internal LevelOrderEnumerator(TNode rootOfIteration, int? maxRelativeDepth = null) { _rootOfIteration = rootOfIteration; _currentDepth = 0; _queue = new Queue<TNode>(); _currentGenerationCount = 1; _nextGenerationCount = 0; _maxDepth = maxRelativeDepth ?? int.MaxValue; Current = null; } public bool MoveNext() { if (Current == null) { Current = _rootOfIteration; ProcessCurrent(); return true; } if (_queue.Count == 0) { return false; } if (_currentGenerationCount == 0) { SwapGeneration(); } Current = _queue.Dequeue(); ProcessCurrent(); return true; } private void ProcessCurrent() { _currentGenerationCount--; if (_currentDepth >= _maxDepth) return; foreach (var child in Current.Children) { _nextGenerationCount++; _queue.Enqueue(child); } } private void SwapGeneration() { _currentDepth++; _currentGenerationCount = _nextGenerationCount; _nextGenerationCount = 0; } public TNode Current { get; private set; } object IEnumerator.Current => Current; public void Dispose() { } public void Reset() { Current = null; } } }
using System; namespace Article.Nucleotide.SampleCmdApp { class Program { static void Main(string[] args) { var instance = new Article.Nucleotide.Shared.Models.UnkeyedUserModel(); } } }
using Unity.Entities; using Unity.Collections; using Unity.Collections.LowLevel.Unsafe; using Unity.Mathematics; namespace Refsa.Collections.QuadTree { public unsafe struct QuadTreeNode { public int Index; public int Count; public static QuadTreeNode Null => new QuadTreeNode{Index = -1, Count = -1}; public static QuadTreeNode Empty => new QuadTreeNode{Index = 0, Count = 0}; } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Xamarin.Forms; namespace XamarinAudioPlayer { public class CustomSlider : Slider { //public static readonly BindableProperty MaxColorProperty =BindableProperty.Create(nameof(MaxColor), // typeof(Color), typeof(CustomSlider),Color.Default); //public Color MaxColor //{ // get { return (Color)GetValue(MaxColorProperty); } // set { SetValue(MaxColorProperty, value); } //} //public static readonly BindableProperty MinColorProperty =BindableProperty.Create(nameof(MinColor), // typeof(Color), typeof(CustomSlider),Color.Default); //public Color MinColor //{ // get { return (Color)GetValue(MinColorProperty); } // set { SetValue(MinColorProperty, value); } //} //public static readonly BindableProperty ThumbColorProperty =BindableProperty.Create(nameof(ThumbColor), // typeof(Color), typeof(CustomSlider),Color.Default); //public Color ThumbColor //{ // get { return (Color)GetValue(ThumbColorProperty); } // set { SetValue(ThumbColorProperty, value); } //} //public static readonly BindableProperty ThumbImageProperty =BindableProperty.Create(nameof(ThumbImage), // typeof(string),typeof(CustomSlider),string.Empty); //public string ThumbImage //{ // get { return (string)GetValue(ThumbImageProperty); } // set { SetValue(ThumbImageProperty, value); } //} } }
using System; using System.ComponentModel.DataAnnotations; using System.Collections.Generic; using System.Linq; namespace MLDB.Domain { public class Survey { public Guid Id{ get; init; } public Guid SiteId{ get; init; } public string CreateUserId{ get; init; } public DateTime CreateTimestamp { get; init; } public string CoordinatorName{ get; set; } public DateTime StartTimeStamp{ get; set; } public DateTime EndTimeStamp{ get; set; } public Int16 VolunteerCount{ get; set; } public Decimal TotalKg{ get; set; } private HashSet<LitterItem> _litterItems = new HashSet<LitterItem>(); public IReadOnlySet<LitterItem> LitterItems => _litterItems; public Survey(Guid siteId, string createUserId) { SiteId = siteId; CreateUserId = createUserId; CreateTimestamp = DateTime.UtcNow; } public Survey(Guid siteId, Guid surveyId, string createUserId) : this(siteId, createUserId) { Id = surveyId; } public void updateLitterItems(IEnumerable<LitterItem> litterItems) { var itemSet = litterItems.ToHashSet(); var dups = itemSet.GroupBy( x => x.LitterTypeId ) .Where( g => g.Count() > 1) .Select( g => g.Key ); if( dups.Count() > 0) { throw new ArgumentException($"Parameter contained duplicate litter type ids {String.Join(",", dups)}"); } _litterItems = litterItems.ToHashSet(); } } }
using System; using System.Collections.Generic; using System.Text; namespace Comet { public class Spacer : View { } }
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Model; using WebFrontEnd.Contracts; namespace WebFrontEnd.Controllers { public class TodoController : Controller { private readonly IRemoteTodoService _remoteTodoService; public TodoController(IRemoteTodoService remoteTodoService) { _remoteTodoService = remoteTodoService; } // GET: Todo public async Task<ActionResult> Index() { var todo = await _remoteTodoService.GetAll(); return View(todo); } // GET: Todo/Details/5 public async Task<ActionResult> Details(int id) { var todo = await _remoteTodoService.Get(id.ToString()); return View(todo); } // GET: Todo/Create public ActionResult Create() { return View(); } // POST: Todo/Create [HttpPost] [ValidateAntiForgeryToken] public async Task<ActionResult> Create([Bind("Name,IsComplete")] TodoItem todo) { try { await _remoteTodoService.Add(todo); // TODO: Add insert logic here return RedirectToAction(nameof(Index)); } catch { return View(); } } // GET: Todo/Edit/5 public async Task<ActionResult> Edit(int id) { var todo = await _remoteTodoService.Get(id.ToString()); return View(todo); } // POST: Todo/Edit/5 [HttpPost] [ValidateAntiForgeryToken] public async Task<ActionResult> Edit([Bind("Id,Name,IsComplete")] TodoItem todo) { try { // TODO: Add update logic here await _remoteTodoService.Update(todo); return RedirectToAction(nameof(Index)); } catch { return View(); } } // GET: Todo/Delete/5 public ActionResult Delete(int id) { return View(); } // POST: Todo/Delete/5 [HttpPost] [ValidateAntiForgeryToken] public async Task<ActionResult> Delete(int id, IFormCollection collection) { try { await _remoteTodoService.Delete(id.ToString()); return RedirectToAction(nameof(Index)); } catch { return View(); } } } }
namespace OJS.Common.Constants { public static class CacheConstants { public const int OneDayInSeconds = 86400; public const string MainContestCategoriesDropDown = "MainContestCategoriesDropDown"; public const string ContestCategoriesTree = "ContestCategoriesTree"; public const string ContestSubCategoriesFormat = "ContestSubCategories_id_{0}"; public const string ContestParentCategoriesFormat = "ContestParentCategories_id_{0}"; public const string ContestCategoryNameFormat = "ContestCategoryName_id_{0}"; } }
using System; using Castle.DynamicProxy; namespace Sweet.LoveWinne.Infrastructure { /// <summary> /// Need be authenticated /// </summary> public class AuthenticationInterceptor : IInterceptor { public long UserId { get; set; } public void Intercept (IInvocation invocation) { var authResult = ValidateAuth (this.UserId); if (authResult.IsSuccess) { invocation.Proceed (); } else { invocation.ReturnValue = authResult; } } private DefaultServicesResult ValidateAuth (long userId) { return new DefaultServicesResult (); } } }
using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Net; using System.Runtime.CompilerServices; using System.Text; using System.Threading.Tasks; using System.Xml; namespace CropModelMKS { readonly struct Label { public readonly string ProgID; public readonly int order; public Label(string ProgID, int order = 0) { this.ProgID = ProgID; this.order = order; } } struct Information { public readonly string location; public readonly string language; public Parameter parameters; public readonly DateTime end; public Information(XmlNodeList info) { language = info[0].InnerText; location = info[2].InnerText; DateTime.TryParse(info[4].InnerText, out end); XmlDocument doc = new XmlDocument(); doc.Load(info[info.Count - 1].InnerText); parameters = new Parameter(doc); } public void Change(string name, object value) { parameters.Change(name, value); } } class Segment { private Dictionary<Label, Information> informations; private IComponent component; private Dictionary<Label, Information>.Enumerator iterator; public Segment(State states, XmlNode information) { informations = new Dictionary<Label, Information> { }; Dictionary<string, int> indecies = new Dictionary<string, int>(); foreach (XmlNode node in information.ChildNodes) { XmlNodeList list = node.ChildNodes; string ProgID = list[1].InnerText; try { indecies[ProgID] += 1; } catch { indecies[ProgID] = 1; } informations[new Label(ProgID, indecies[ProgID])] = new Information(list); } } private void Factory(string language, IState states, IParameter parameters, string ProgID, string location) { if (language == "Fortran") { component = new Component_Fortran(states, parameters, ProgID); } else if (language == "MATLAB") { component = new Component_Assembly(states, parameters, ProgID, location); } else { component = new Component_COM(states, parameters, ProgID); } } public void Initialize(State states) { iterator = informations.GetEnumerator(); iterator.MoveNext(); Factory(iterator.Current.Value.language, states, iterator.Current.Value.parameters, iterator.Current.Key.ProgID, iterator.Current.Value.location); states.Replace(iterator.Current.Key.ProgID, component); } public void Update(State states) { component.Update(states); if (states.now == iterator.Current.Value.end) { if (!iterator.MoveNext()) { iterator = informations.GetEnumerator(); iterator.MoveNext(); } Factory(iterator.Current.Value.language, states, iterator.Current.Value.parameters, iterator.Current.Key.ProgID, iterator.Current.Value.location); states.Replace(iterator.Current.Key.ProgID, component); } } public bool Change(string lib, int index, string name, object value) { try { informations[new Label(lib, index)].parameters.Change(name, value); return true; } catch(KeyNotFoundException) { return false; } } } }
namespace PosixCommandline.Tests.Options { public class Nested { public Simple Options { get; set; } } }
using System.IO; using UCS.Core; using UCS.Core.Network; using UCS.Helpers; using UCS.Logic; using UCS.PacketProcessing.Commands.Server; using UCS.PacketProcessing.Messages.Server; namespace UCS.PacketProcessing.Messages.Client { // Packet 14305 internal class JoinAllianceMessage : Message { long m_vAllianceId; public JoinAllianceMessage(PacketProcessing.Client client, PacketReader br) : base(client, br) { } public override void Decode() { using (var br = new PacketReader(new MemoryStream(GetData()))) { m_vAllianceId = br.ReadInt64WithEndian(); } } public override void Process(Level level) { var alliance = ObjectManager.GetAlliance(m_vAllianceId); if (alliance != null) { if (!alliance.IsAllianceFull()) { level.GetPlayerAvatar().SetAllianceId(alliance.GetAllianceId()); var member = new AllianceMemberEntry(level.GetPlayerAvatar().GetId()); member.SetRole(1); alliance.AddAllianceMember(member); var b = new JoinedAllianceCommand(); b.SetAlliance(alliance); var c = new AllianceRoleUpdateCommand(); c.SetAlliance(alliance); c.SetRole(1); c.Tick(level); var a = new AvailableServerCommandMessage(Client); a.SetCommandId(1); a.SetCommand(b); var d = new AvailableServerCommandMessage(Client); d.SetCommandId(8); d.SetCommand(c); a.Send(); d.Send(); new AllianceStreamMessage(Client, alliance).Send(); } } } } }
using Newtonsoft.Json; using ScannTechSDK.Entidades; using ScannTechSDK.Utils.Excecoes; using System; using System.Net.Http; namespace ScannTechSDK.Mensagens { public class RequestBase: IDisposable { [JsonIgnore] protected HttpClient client = new HttpClient(); [JsonIgnore] public Empresa Empresa { get; } public RequestBase(Empresa empresa) { if (empresa == default(Empresa)) throw new EmpresaNaoInformadaException(); this.Empresa = empresa; } public void Dispose() { client.Dispose(); } } }
using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; namespace QS.DomainModel.Entity { public abstract class DomainTreeNodeBase<TEntity> : PropertyChangedBase, IDomainObject where TEntity : DomainTreeNodeBase<TEntity> { protected static readonly NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger(); #region Свойства public virtual int Id { get; set; } private TEntity parent; [Display(Name = "Родитель")] public virtual TEntity Parent { get => parent; set { if(NHibernate.NHibernateUtil.IsInitialized(Parent)) { parent?.Childs.Remove((TEntity)this); if(value != null && value.CheckCircle((TEntity)this)) { logger.Warn("Родитель не назначен, так как возникает зацикливание дерева."); return; } } SetField(ref parent, value, () => Parent); if(parent != null && NHibernate.NHibernateUtil.IsInitialized(Parent)) parent.Childs.Add((TEntity)this); } } private IList<TEntity> childs = new List<TEntity>(); [Display(Name = "Дочерние элементы")] public virtual IList<TEntity> Childs { get => childs; set => SetField(ref childs, value, () => Childs); } #endregion #region Внутренние private bool CheckCircle(TEntity node) { if(Parent == null) return false; if(Parent == node) return true; return Parent.CheckCircle(node); } #endregion public static TEntity GetRootParent(TEntity entity) { return entity.Parent == null ? entity : GetRootParent(entity.Parent); } } }
using NLog; using System; namespace Platinum.Metrics { /// <summary> /// Metric helper. /// </summary> public class Metric { private static Logger logger = LogManager.GetCurrentClassLogger(); /// <summary> /// Writes a time-series data-point. /// </summary> /// <typeparam name="T">Type of measure.</typeparam> /// <param name="measure">Value of measure.</param> /// <remarks> /// Name of measure will be automatically derived from the (non /// namespace-qualified) name of the CLR type. /// </remarks> public static void Write<T>( T measure ) { #region Validations if ( measure == null ) throw new ArgumentNullException( nameof( measure ) ); #endregion logger.Info( typeof( T ).Name, measure ); } } }
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class ScoreVisualizer : MonoBehaviour { RectTransform rect; RectTransform t1Rect; RectTransform t2Rect; Image t1Image; Image t2Image; int t1Tween = 0; int t2Tween = 0; int prevS1; int prevS2; void Awake() { rect = GetComponent<RectTransform>(); t1Rect = transform.Find("Team1Bar").GetComponent<RectTransform>(); t2Rect = transform.Find("Team2Bar").GetComponent<RectTransform>(); t1Image = transform.Find("Team1Bar").GetComponent<Image>(); t2Image = transform.Find("Team2Bar").GetComponent<Image>(); } public void Init(Color c1, Color c2, int s1, int s2) { t1Image.color = c1; t2Image.color = c2; UpdateScore(s1, s2); } public void UpdateScore(int s1, int s2) { int max = FieldManager.Instance.MaxPointsForWin; // Hard-coded for now. float interval = (rect.rect.width / 2f - 50f) / max; if (s1 != prevS1) { prevS1 = s1 > max ? max : s1; LeanTween.cancel(t1Tween); t1Tween = LeanTween.value(t1Rect.sizeDelta.x, s1 * interval, 1f).setOnUpdate((float val) => { t1Rect.sizeDelta = new Vector2(val, t1Rect.sizeDelta.y); }).setEase(LeanTweenType.easeInOutSine).uniqueId; } if (s2 != prevS2) { prevS2 = s2 > max ? max : s2; LeanTween.cancel(t2Tween); t2Tween = LeanTween.value(t2Rect.sizeDelta.x, s2 * interval, 1f).setOnUpdate((float val) => { t2Rect.sizeDelta = new Vector2(val, t2Rect.sizeDelta.y); }).setEase(LeanTweenType.easeInOutSine).uniqueId; } } }
using System; using System.Text.RegularExpressions; namespace Satochat.Shared.Util { public static class StringUtil { public static string ConvertLineEndings(string input, string lineEnding) { return Regex.Replace(input, "\r\n|[\r\n]", lineEnding); } public static string ConvertLineEndingsToSystem(string input) { return ConvertLineEndings(input, Environment.NewLine); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Real = System.Double; namespace M2M.Position { public interface IPosition3D : IPosition2D { Real GetZ(); } }
// 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 System.Numerics; using System.Runtime.Intrinsics; using System.Runtime.CompilerServices; public class GitHub_27551 { static int returnVal = 100; [MethodImpl(MethodImplOptions.NoInlining)] static byte GetByte() { return 0xaa; } [MethodImpl(MethodImplOptions.NoInlining)] static void ValidateResult(Byte[] resultElements, Byte[] valueElements) { bool succeeded = true; if (resultElements.Length <= valueElements.Length) { for (var i = 0; i < resultElements.Length; i++) { if (resultElements[i] != valueElements[i]) { returnVal = -1; break; } } } else { for (var i = 0; i < valueElements.Length; i++) { if (resultElements[i] != valueElements[i]) { returnVal = -1; break; } } for (var i = valueElements.Length; i < resultElements.Length; i++) { if (resultElements[i] != default) { returnVal = -1; break; } } } } [MethodImpl(MethodImplOptions.NoInlining)] private static void ValidateResult(Vector<Byte> result, Vector256<Byte> value) { Byte[] resultElements = new Byte[Vector<byte>.Count]; Unsafe.WriteUnaligned(ref Unsafe.As<Byte, byte>(ref resultElements[0]), result); Byte[] valueElements = new Byte[Vector256<byte>.Count]; Unsafe.WriteUnaligned(ref Unsafe.As<Byte, byte>(ref valueElements[0]), value); ValidateResult(resultElements, valueElements); } [MethodImpl(MethodImplOptions.NoInlining)] private static void ValidateResult(Vector256<Byte> result, Vector<Byte> value) { Byte[] resultElements = new Byte[Vector256<byte>.Count]; Unsafe.WriteUnaligned(ref Unsafe.As<Byte, byte>(ref resultElements[0]), result); Byte[] valueElements = new Byte[Vector<byte>.Count]; Unsafe.WriteUnaligned(ref Unsafe.As<Byte, byte>(ref valueElements[0]), value); ValidateResult(resultElements, valueElements); } [MethodImpl(MethodImplOptions.NoInlining)] static void Test(Vector256<byte> value) { Vector<Byte> result = value.AsVector(); ValidateResult(result, value); value = result.AsVector256(); ValidateResult(value, result); } public static int Main() { Vector256<Byte> value = Vector256.Create((byte)GetByte()); Test(value); return returnVal; } }
using Microsoft.AspNetCore.Http; using System.IO; using System.Net; using System.Threading.Tasks; namespace FeatureLoom.Web { public interface IWebRequestHandler { string Route { get; } Task<bool> HandleRequestAsync(IWebRequest request, IWebResponse response); } public interface IWebRequest { Stream Stream { get; } Task<string> ReadAsync(); string ContentType { get; } bool TryGetCookie(string key, out string content); bool IsGet { get; } bool IsPost { get; } bool IsPut { get; } bool IsDelete { get; } bool IsHead { get; } string Method { get; } string RelativePath { get; } string BasePath { get; } string FullPath { get; } string HostAddress { get; } bool TryGetQueryItem(string key, out string item); } public interface IWebResponse { Task WriteAsync(string reply); Stream Stream { get; } HttpStatusCode StatusCode { set; get; } string ContentType { get; set; } void AddCookie(string key, string content, CookieOptions options = null); void DeleteCookie(string key); } }
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using Devart.Data.MySql; namespace MySqlBackupTestApp { public partial class FormTestExcludeTables : Form { public FormTestExcludeTables() { InitializeComponent(); } private void btGetTables_Click(object sender, EventArgs e) { using (MySqlConnection conn = new MySqlConnection(Program.ConnectionString)) { using (MySqlCommand cmd = new MySqlCommand()) { cmd.Connection = conn; conn.Open(); DataTable dt = QueryExpress.GetTable(cmd, "show tables"); checkedListBox1.Items.Clear(); foreach (DataRow dr in dt.Rows) { checkedListBox1.Items.Add(dr[0] + "", false); } } } lbTotal.Text = "Total Tables: " + checkedListBox1.Items.Count; } private void btAll_Click(object sender, EventArgs e) { for (int i = 0; i < checkedListBox1.Items.Count; i++) { checkedListBox1.SetItemChecked(i, true); } } private void btNone_Click(object sender, EventArgs e) { for (int i = 0; i < checkedListBox1.Items.Count; i++) { checkedListBox1.SetItemChecked(i, false); } } private void btExport_Click(object sender, EventArgs e) { if (!Program.TargetDirectoryIsValid()) return; if (checkedListBox1.Items.Count == 0) { MessageBox.Show("No tables are listed."); return; } try { List<string> lst = new List<string>(); foreach (var item in checkedListBox1.CheckedItems) { lst.Add(item.ToString()); } using (MySqlConnection conn = new MySqlConnection(Program.ConnectionString)) { using (MySqlCommand cmd = new MySqlCommand()) { using (MySqlBackup mb = new MySqlBackup(cmd)) { cmd.Connection = conn; conn.Open(); mb.ExportInfo.ExcludeTables = lst; mb.ExportToFile(Program.TargetFile); } } } MessageBox.Show("Done."); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } } } }
using Visma.Sign.Api.Client.Dtos; namespace Visma.Sign.Api.Client.UnitTests.Builders.Dtos { sealed class PartnerAccessTokenDtoBuilder { private string m_accessToken = "xxxx"; private int m_expiresIn = 1; private string m_tokenType = "Bearer"; private string m_scope = ""; public PartnerAccessTokenDtoBuilder WithAccessToken(string value) { m_accessToken = value; return this; } public PartnerAccessTokenDtoBuilder WithExpiresIn(int value) { m_expiresIn = value; return this; } public PartnerAccessTokenDtoBuilder WithTokenType(string value) { m_tokenType = value; return this; } public PartnerAccessTokenDtoBuilder WithScope(string value) { m_scope = value; return this; } public PartnerAccessTokenDto Build() => new PartnerAccessTokenDto() { access_token = m_accessToken, expires_in = m_expiresIn, scope = m_scope, token_type = m_tokenType }; public static implicit operator PartnerAccessTokenDto(PartnerAccessTokenDtoBuilder b) => b.Build(); } }
<div id="index-banner" class="parallax-container"> <div class="section no-pad-bot"> <div class="row valign-wrapper"> <div class="col s8 m6 l4 offset-s1 offset-m1 offset-l1"> <h1 class="center teal-text text-darken-3">Sofia</h1> <h5 class="teal-text"> Arrange your trip by choosing the places you insist to visit. There is an option to reserve an available bike and a free slot where you can return it through the mobile application. Enjoy your ride! </h5> <div class="center"> <a href="#" id="download-button" class="btn-large waves-effect waves-light teal lighten-1"> Make a trip </a> </div> </div> </div> </div> <div class="parallax"> <img src="../../Images/Wallpapers 1600x900.jpg" alt="Bicycle"> </div> </div> <div class="row"> <div class="col s12 m4"> <div class="icon-block"> <h2 class="center brown-text"> <i class="material-icons">timeline</i> </h2> <h5 class="center">Most popular routes</h5> <p class="light"> Check out the most popular routes, sorted by how often users use it in descending order. You can see the best time result made to a given route and the user accomplished it. If you want you can try to improve that time. If so good luck! </p> <div class="center"> <a href="#" class="btn-large waves-effect waves-light teal lighten-1"> SHOW THE ROUTES </a> </div> </div> </div> <div class="col s12 m4"> <div class="icon-block"> <h2 class="center brown-text"> <i class="material-icons">directions_bike</i> </h2> <h5 class="center">Most active users</h5> <p class="light"> See the most active users, sorted by the total distance which they have ridden. You can see all the trips that a given user have been accomplishand pictures that have been taken during a specific trip. Then you can choose a trip, you are interested in and have a ride. If so we wish you pleasant journey! </p> <div class="center"> <a href="#" class="btn-large waves-effect waves-light teal lighten-1"> SHOW THE USERS </a> </div> </div> </div> <div class="col s12 m4"> <div class="icon-block"> <h2 class="center brown-text"> <i class="material-icons">location_on</i> </h2> <h5 class="center">All existing stations</h5> <p class="light"> Experience Sofia in a whole new way! Bike2Ride is an enjoyable and cost-effective way to get around the city. Buy a day pass or become a member to gain access to 1,000 bikes and 150 stations for short rides around town at your convenience. Here you can see all the existing stations where you can borrow and return a bike, and how many bikes are available. </p> <div class="center"> @Html.ActionLink( "SHOW THE MAP", "Index", "Map", new { area = "" }, new { @class = "btn-large waves-effect waves-light teal lighten-1" }) </div> </div> </div> </div> <div id="bottom-banner" class="parallax-container"> <div class="section"> <div class="container"> <div class="row"> <h5 class="col s4 light"> Locate a bike at one of the slots around the city. See bike availability on the Map or mobile app. </h5> </div> </div> </div> <div class="parallax"> <img src="../../Images/vintage-bicycle-bridge.jpg" alt="Vintage bicycle on a bridge"> </div> </div>
using System; using McMaster.Extensions.CommandLineUtils; using PortainerClient.Helpers; namespace PortainerClient.Command { /// <summary> /// Base abstractions for CMD command /// </summary> /// <typeparam name="T">Portainer API type</typeparam> public abstract class BaseApiCommand<T> : ICommand where T : class, new() { /// <summary> /// Instance of specific Portainer API /// </summary> protected readonly T ApiClient; /// <inheritdoc /> protected BaseApiCommand() { ApiClient = new T(); } /// <inheritdoc /> public virtual int OnExecute(CommandLineApplication app, IConsole console) { try { Do(app, console); return 0; } catch (Exception ex) { return console.WriteError(ex); } } /// <summary> /// Main implementation of command /// </summary> /// <param name="app"></param> /// <param name="console"></param> protected abstract void Do(CommandLineApplication app, IConsole console); } }
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using System.IO; using System.Threading.Tasks; namespace PvPGameServer { class Program { static async Task Main(string[] args) { var host = new HostBuilder() .ConfigureAppConfiguration((hostingContext, config) => { var env = hostingContext.HostingEnvironment; //config.SetBasePath(Directory.GetCurrentDirectory()); config.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true); }) .ConfigureLogging(logging => { logging.SetMinimumLevel(LogLevel.Debug); logging.AddConsole(); }) .ConfigureServices((hostContext, services) => { services.Configure<ServerOption>(hostContext.Configuration.GetSection("ServerOption")); services.AddHostedService<MainServer>(); }) .Build(); await host.RunAsync(); } } }
using System.Html; using System.Runtime.CompilerServices; namespace System.Net.Messaging { [IgnoreNamespace, Imported(ObeysTypeSystem = true)] public partial class MessageEvent : Event { internal MessageEvent() { } public MessageEvent(string type) { } public MessageEvent(string type, MessageEventInit eventInitDict) { } [IntrinsicProperty] public object Data { get { return null; } } [IntrinsicProperty] public string LastEventId { get { return null; } } [IntrinsicProperty] public string Origin { get { return null; } } [IntrinsicProperty] public MessagePortList Ports { get { return default(MessagePortList); } } [IntrinsicProperty] public TypeOption<WindowInstance, MessagePort> Source { get { return default(TypeOption<WindowInstance, MessagePort>); } } } }
using System.Collections; using System.Collections.Generic; using UnityEngine; namespace Waker { public class DestroyPoolOfLifeCycle : MonoBehaviour { private int id; private void OnDestroy() { Pool.DestroyPool(id); } public void Regist(int id) { this.id = id; } } }
using Newtonsoft.Json.Linq; using System; namespace IF.Lastfm.Core.Objects { /// <summary> /// TODO YearFormed -> FormationList /// "formationlist": { /// "formation": { /// "yearfrom": "2003", /// "yearto": "" /// } /// } /// /// TODO links /// "links": { /// "link": { /// "#text": "", /// "rel": "original", /// "href": "http://www.last.fm/music/Frightened+Rabbit/+wiki" /// } /// } /// </summary> public class LastWiki : ILastfmObject { #region Properties public DateTimeOffset Published { get; set; } public string Summary { get; set; } public string Content { get; set; } public int YearFormed { get; set; } #endregion internal static LastWiki ParseJToken(JToken token) { var wiki = new LastWiki { Summary = token.Value<string>("summary").Trim(), Content = token.Value<string>("content").Trim(), YearFormed = token.Value<int>("yearformed") }; //Artist that do not contain an official bio will come with an empty published property. //To avoid a parse exception, check if is null or empty. if (!string.IsNullOrEmpty(token.Value<string>("published"))) wiki.Published = token.Value<DateTime>("published"); return wiki; } } }
using System.Text.Json.Serialization; using Terminal.Gui; namespace PhantomKit.Models; [Serializable] public record HumanEditableColorScheme(HumanEditableAttribute Normal, HumanEditableAttribute Focus, HumanEditableAttribute HotNormal, HumanEditableAttribute HotFocus, HumanEditableAttribute Disabled) : IEquatable<ColorScheme> { /// <summary> /// The default color for text, when the view is not focused. /// </summary> [JsonInclude] public HumanEditableAttribute Normal { get; set; } = Normal; /// <summary>The color for text when the view has the focus.</summary> [JsonInclude] public HumanEditableAttribute Focus { get; set; } = Focus; /// <summary>The color for the hotkey when a view is not focused</summary> [JsonInclude] public HumanEditableAttribute HotNormal { get; set; } = HotNormal; /// <summary>The color for the hotkey when the view is focused.</summary> [JsonInclude] public HumanEditableAttribute HotFocus { get; set; } = HotFocus; /// <summary>The default color for text, when the view is disabled.</summary> [JsonInclude] public HumanEditableAttribute Disabled { get; set; } = Disabled; public virtual bool Equals(ColorScheme? other) { return this.ToColorScheme().Equals(other: other); } public ColorScheme ToColorScheme() { return new ColorScheme { Disabled = this.Disabled.ToAttribute(), Normal = this.Normal.ToAttribute(), Focus = this.Focus.ToAttribute(), HotFocus = this.HotFocus.ToAttribute(), HotNormal = this.HotNormal.ToAttribute(), }; } public static HumanEditableColorScheme FromColorScheme(ColorScheme colorScheme) { return new HumanEditableColorScheme( Normal: HumanEditableAttribute.FromAttribute(attribute: colorScheme.Normal), Focus: HumanEditableAttribute.FromAttribute(attribute: colorScheme.Focus), HotNormal: HumanEditableAttribute.FromAttribute(attribute: colorScheme.HotNormal), HotFocus: HumanEditableAttribute.FromAttribute(attribute: colorScheme.HotFocus), Disabled: HumanEditableAttribute.FromAttribute(attribute: colorScheme.Disabled) ); } public virtual int GetHashCode(object other) { if (other is HumanEditableColorScheme scheme) return scheme.ToColorScheme().GetHashCode(); return 0; } public override int GetHashCode() { return this.ToColorScheme().GetHashCode(); } }
@model DancingGoat.Models.Cafe <div class="col-md-6"> <div class="cafe-tile cursor-hand js-scroll-to-map" data-address="@Model.City, @Model.Street"> @if (ViewData.ContainsKey("ShowImage") && (bool)ViewData["ShowImage"] == true) { var photo = Model.Photo.FirstOrDefault(); <div class="cafe-image-tile-image-wrapper" style="background-image:url('@(photo != null ? photo.Url: "")'); background-size: cover; background-position: right center;"></div> } <div class="cafe-tile-content"> <h3 class="cafe-tile-name">@Html.DisplayFor(vm => vm.System.Name)</h3> <address class="cafe-tile-address"> <a href="javascript:void(0)" class="cafe-tile-address-anchor">@Html.DisplayFor(vm => vm.Street), @Html.DisplayFor(vm => vm.City)<br />@Html.DisplayFor(vm => vm.ZipCode), @Html.DisplayFor(vm => vm.Country), @Html.DisplayFor(vm => vm.State)</a> </address> <p class="cafe-tile-phone">@Html.DisplayFor(vm => vm.Phone)</p> </div> </div> </div>
using System; public class Appointment { public string Content { get; set; } private bool validDate = false; private DateTime date; public string Date { get { return Date.ToString(); } set { if (DateTime.TryParse(value, out var dateValue)) { date = dateValue; validDate = true; } } } } //https://pt.stackoverflow.com/q/542999/101
namespace Wallr.ImageSource { public interface IImageFromSource { IImage Image { get; } ImageSourceId SourceId { get; } } public class ImageFromSource : IImageFromSource { public ImageFromSource(IImage image, ImageSourceId sourceId) { Image = image; SourceId = sourceId; } public IImage Image { get; } public ImageSourceId SourceId { get; } } }
using System.Collections.Generic; namespace PT.PM.Matching.PatternsRepository { public class CombiningPatternsRepository : MemoryPatternsRepository { private IPatternsRepository[] patternsRepositories; public CombiningPatternsRepository(params IPatternsRepository[] patternsRepositories) { this.patternsRepositories = patternsRepositories; } protected override List<PatternDto> InitPatterns() { var result = new List<PatternDto>(); foreach (IPatternsRepository patternRepository in patternsRepositories) { result.AddRange(patternRepository.GetAll()); } return result; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace AcademyPopcorn { class AcademyPopcornMain { const int WorldRows = 23; const int WorldCols = 40; const int RacketLength = 6; static void Initialize(Engine engine) { int startRow = 3; int startCol = 2; int endCol = WorldCols - 2; for (int i = startCol; i < endCol; i++) { Block currBlock = new Block(new MatrixCoords(startRow, i)); engine.AddObject(currBlock); } AddGameFieldWalls(engine); AddUnpassableBlocks(engine); AddExplodingBlocks(engine); AddGiftBlocks(engine); AddBall(engine); Racket theRacket = new Racket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength); engine.AddObject(theRacket); theRacket = new Racket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength * 2); engine.AddObject(theRacket); } private static void AddGiftBlocks(Engine engine) { int startRow = 6; int startCol = 10; int endCol = 19; for (int col = startCol; col < endCol; col++) { var currBlock = new GiftBlock(new MatrixCoords(startRow, col), new FireGift()); engine.AddObject(currBlock); } } private static void AddExplodingBlocks(Engine engine) { int startRow = 4; int startCol = 8; int endCol = 19; for (int i = startCol; i < endCol; i++) { var currBlock = new ExplodingBlock(new MatrixCoords(startRow, i)); engine.AddObject(currBlock); } } private static void AddBall(Engine engine) { //UnstoppableBall unstoppableBall = new UnstoppableBall(new MatrixCoords(WorldRows / 2, 0), // new MatrixCoords(-1, 1), 5); //engine.AddObject(unstoppableBall); //MeteoriteBall theMeteoriteBall = new MeteoriteBall(new MatrixCoords(WorldRows / 2, 0), // new MatrixCoords(-1, 1), 5); //engine.AddObject(theMeteoriteBall); Ball theBall = new Ball(new MatrixCoords(WorldRows / 2, 0), new MatrixCoords(-1, 1)); engine.AddObject(theBall); } private static void AddUnpassableBlocks(Engine engine) { int startRow = 13; int startCol = 2; int endCol = 19; for (int i = startCol; i < endCol; i++) { var currBlock = new UnpassableBlock(new MatrixCoords(startRow, i)); engine.AddObject(currBlock); } } private static void AddGameFieldWalls(Engine engine) { // add left and right wolls for (int row = 2; row < WorldRows; row++) { var leftWoll = new IndestructibleBlock(new MatrixCoords(row, 0)); var rightWoll = new IndestructibleBlock(new MatrixCoords(row, WorldCols - 1)); engine.AddObject(leftWoll); engine.AddObject(rightWoll); } // add roof for (int col = 0; col < WorldCols; col++) { var roof = new IndestructibleBlock(new MatrixCoords(1, col)); engine.AddObject(roof); } } static void Main(string[] args) { IRenderer renderer = new ConsoleRenderer(WorldRows, WorldCols); IUserInterface keyboard = new KeyboardInterface(); var gameEngine = new AdvancedEngine(renderer, keyboard, 50); keyboard.OnLeftPressed += (sender, eventInfo) => { gameEngine.MovePlayerRacketLeft(); }; keyboard.OnRightPressed += (sender, eventInfo) => { gameEngine.MovePlayerRacketRight(); }; keyboard.OnActionPressed += (sender, eventInfo) => { gameEngine.ShootPlayerRacket(); }; Initialize(gameEngine); // Start game gameEngine.Run(); } } }
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; namespace MonoDevelop.MSBuild { /// <summary> /// Represents texts that can be displayed to the user /// </summary> public struct DisplayText { public DisplayText (string text, object displayElement = null) { this.Text = text; this.DisplayElement = displayElement; } /// <summary> /// An optional formatted display element for tooltip in the editor. If not provided, one will be created from the text. /// </summary> public object DisplayElement { get; } public string Text { get; } public bool IsEmpty => string.IsNullOrEmpty (Text); public static implicit operator DisplayText (string s) { return new DisplayText (s); } } }
using System; using System.Globalization; namespace Nager.ConfigParser { public abstract class BaseParserUnit { internal readonly CultureInfo _cultureInfo; internal readonly char _valueDelimiter; public BaseParserUnit() { } public BaseParserUnit(CultureInfo cultureInfo) { this._cultureInfo = cultureInfo; } public BaseParserUnit(CultureInfo cultureInfo, char valueDelimiter) { this._cultureInfo = cultureInfo; this._valueDelimiter = valueDelimiter; } public BaseParserUnit(char valueDelimiter) { this._valueDelimiter = valueDelimiter; } public abstract Type ParserUnitType { get; } public abstract object Deserialize(string value); public abstract string Serialize(object value); } }
using ConsultoraAPI.Models.Entities; using ConsultoraAPI.Models.Repository; using ConsultoraAPI.Models.RepositoryImpl; using ConsultoraAPI.Models.Service; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace ConsultoraAPI.Models.ServiceImpl { public class ProyectoService : IProyectoService { private IProyectoRepository proyectoRepository; public ProyectoService() { this.proyectoRepository = new ProyectoRepository(); } public bool Delete(int? id) { return proyectoRepository.Delete(id); } public List<Proyecto> FindAll() { return proyectoRepository.FindAll(); } public Proyecto FindById(int? id) { return proyectoRepository.FindById(id); } public bool Save(Proyecto t) { return proyectoRepository.Save(t); } public bool Update(Proyecto t) { return proyectoRepository.Update(t); } } }
namespace MediatRFluentDemo.Features.Milestones.Queries.GetMilestoneById { using MediatR; using MediatRFluentDemo.Context; using MediatRFluentDemo.Features.Milestones.Queries.GetAllMilestones; using Microsoft.EntityFrameworkCore; using Models; using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; public class GetMilestoneByIdQueryHandler : IRequestHandler<GetMilestoneByIdQuery, Milestone> { //private readonly IApplicationContext _context; IMediator mediator; //public GetMilestoneByIdQueryHandler(IApplicationContext context) //{ // this._context = context; //} public GetMilestoneByIdQueryHandler(IMediator mediator) { this.mediator = mediator; } public async Task<Milestone> Handle(GetMilestoneByIdQuery request, CancellationToken cancellationToken) { //Milestone result = await this._context.Milestones // .FirstOrDefaultAsync(x=>x.Id == request.Id); List<Milestone> milestones = await mediator.Send(new GetAllMilestonesQuery() { BypassCache = false }); Milestone result = milestones .FirstOrDefault(x => x.Id == request.Id); if (result == null) { return null; } return result; } } }
using System.Collections; using System.Collections.Generic; using UnityEngine; public class Keylock : MonoBehaviour { public GameObject door; public int id; bool isDoorOpen; public void OpenDoor() { //Cambiar rotacion de puerta para que se abra door.transform.Rotate(0f, 90f, 0f); //door.gameObject.SetActive(false); } private void OnTriggerEnter(Collider other) { if(!isDoorOpen) { Debug.Log("Trigger con keylock"); GameManager gameManager = FindObjectOfType<GameManager>(); if (gameManager.HasKey(id) || id < 0) { gameManager.ConsumeKey(id); //Usar llave OpenDoor(); isDoorOpen = true; this.gameObject.SetActive(false); } } } }
namespace Apskaita5.DAL.Common.DbSchema { /// <summary> /// Represents a type of a DbError, i.e. schema inconsistence. /// </summary> public enum DbSchemaErrorType { FieldMissing = 0, FieldDefinitionObsolete = 1, FieldObsolete = 2, TableMissing = 3, TableObsolete = 4, IndexMissing = 5, IndexObsolete = 6, } }
using System.Collections; using System.Collections.Generic; using UnityEngine; /// <summary> /// Controls Cube Behaviours /// </summary> public class CubeBehaviours_Example : MonoBehaviour { /// <summary> /// Public variable to set the Cube's speed /// </summary> public float Speed = 0.3f; /// <summary> /// Private variable to hold the current direction of the movement /// </summary> public float Direction = 1; /// <summary> /// Function to rotate the cube /// </summary> void RotateCube() { // Perform rotation transform.Rotate(Vector3.up * Speed * 10f * Direction); } /// <summary> /// Function to move the cube /// </summary> void MoveCube() { // Perform movement transform.Translate(Vector3.left * Speed * Direction); } /// <summary> /// Update is called once per frame /// </summary> void Update () { // Call function to move the cube MoveCube(); // Call function to rotate the cube RotateCube(); } }
using System; using System.Numerics; using System.Text.RegularExpressions; namespace Counting { public class StartUp { public static void Main() { string input = Console.ReadLine(); BigInteger number = BigInteger.Parse(Regex.Match(input, @"\d+").Value); for (BigInteger i = number + 1; i <= number + 10; i++) { Console.WriteLine(i); } } } }
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Threading; using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery; namespace Microsoft.CodeAnalysis.CSharp.Completion.KeywordRecommenders { internal class HiddenKeywordRecommender : AbstractSyntacticSingleKeywordRecommender { public HiddenKeywordRecommender() : base(SyntaxKind.HiddenKeyword, isValidInPreprocessorContext: true) { } protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken) { // cases: // #line | // #line h| // # line | // # line h| var previousToken1 = context.TargetToken; var previousToken2 = previousToken1.GetPreviousToken(includeSkipped: true); return previousToken1.Kind() == SyntaxKind.LineKeyword && previousToken2.Kind() == SyntaxKind.HashToken; } } }
using System; using System.Linq; using System.Reflection; using FullInspector.Internal; using FullSerializer.Internal; namespace FullInspector { /// <summary> /// Allows you to customize the `Add` item in, say, a Dictionary or a /// HashSet. This is analogous to InspectorCollectionItemAttributes so please /// see the documentation on that class for usage instructions. /// </summary> [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] public sealed class InspectorCollectionAddItemAttributesAttribute : Attribute { // ICustomAttributeProvider not necessarily available, so we just use // MemberInfo instead public MemberInfo AttributeProvider; public InspectorCollectionAddItemAttributesAttribute(Type attributes) { if (typeof(fiICollectionAttributeProvider).Resolve().IsAssignableFrom(attributes.Resolve()) == false) { throw new ArgumentException("Must be an instance of FullInspector.fiICollectionAttributeProvider", "attributes"); } var instance = (fiICollectionAttributeProvider)Activator.CreateInstance(attributes); AttributeProvider = fiAttributeProvider.Create(instance.GetAttributes().ToArray()); } } }
using System; using Teamway.WorkManagementService.Repository; namespace Teamway.WorkManagementService.Repository.Entities { internal class ShiftEntity { public int Id { get; set; } public DateTime Day { get; set; } public ShiftType Type { get; set; } public int WorkerId { get; set; } } }
namespace DouduckLib { public interface IState { IStateController controller { get; set; } bool isStarted { get; } bool isCompleted { get; } void StateUpdate (); IState GetNextState (); } }
using System; using System.Reflection; [assembly: AssemblyCopyright("Copyright © Tom Reich 2019")] [assembly: AssemblyVersion("2019.2.10.*")]
namespace LittleHeroes { using UnityEngine; using System.Collections; using System.Collections.Generic; public class EnemyFactory : MonoBehaviour { public float MaxEnemies; public float MaxMeteor; public Vector2 XRange; public Vector2 YRange; [SerializeField] private GameObject _planet; [SerializeField] private string _enemyPrefab; [SerializeField] private string _bossPrefab; [SerializeField] private string _meteorPrefab; private List<GameObject> _enemyPool; private List<GameObject> _meteorPool; private float _spawnTime; private GameObject _boss; private Boss _bossComponent; private void Start ( ) { Init ( ); _spawnTime = Time.time; } private void Init ( ) { Log.i ( "Initialization" ); if ( !PhotonNetwork.isMasterClient ) { this.enabled = false; return; } _enemyPool = new List<GameObject> ( ); for ( int i = 0; i < MaxEnemies; ++i ) { GameObject enemy = PhotonNetwork.Instantiate ( _enemyPrefab, transform.position, Quaternion.identity, 0 ); enemy.transform.parent = transform; enemy.transform.localPosition = Vector3.zero; //enemy.SetActive ( false ); _enemyPool.Add ( enemy ); } _meteorPool = new List<GameObject> ( ); for ( int i = 0; i < MaxMeteor; ++i ) { GameObject meteor = PhotonNetwork.Instantiate ( _meteorPrefab, transform.position, Quaternion.identity, 0 ); meteor.transform.parent = transform; meteor.SetActive ( false ); _meteorPool.Add ( meteor ); } Vector2 bossPos = getRandomCoord ( ); _boss = PhotonNetwork.Instantiate ( _bossPrefab, bossPos, Quaternion.identity, 0 ); _boss.transform.position = bossPos; _bossComponent = _boss.GetComponentInChildren<Boss> ( ); } private void Update ( ) { if ( Time.time - _spawnTime > 10f ) { spawnEnemy ( ); } } private Vector2 getRandomCoord ( ) { bool not_valid; Vector2 randCoord; do { randCoord = MathUtils.randomBetweenRange ( XRange, YRange ); not_valid = _planet.GetComponent<Renderer>().bounds.Contains ( randCoord ); } while ( not_valid ); return randCoord; } private void spawnEnemy ( ) { if ( !_boss.activeSelf ) { Vector2 newPos = getRandomCoord ( ); _boss.transform.position = newPos; _bossComponent.gameObject.GetPhotonView ( ).RPC ( "activeBoss", PhotonTargets.All, new object[] { newPos } ); } else { GameObject enemy; int i = 0; /*do { enemy = _enemyPool[i]; ++i; } while ( enemy.activeSelf && i < MaxEnemies ); _spawnTime = Time.time; if ( i == MaxEnemies ) return;*/ _spawnTime = Time.time; enemy = _enemyPool[i]; _enemyPool.RemoveAt ( i ); _enemyPool.Add ( enemy ); Vector2 newPos = getRandomCoord ( ); enemy.GetComponent<Rigidbody2D>().velocity = Vector3.zero; enemy.transform.position = newPos; enemy.GetPhotonView ( ).RPC ( "activeEnemy", PhotonTargets.All, new object[] { newPos } ); } } } }
using System.Text.Json; namespace EarWorm.Code { public class SavedData { const string SETTINGS_KEY = "SETTINGS"; const string SETDEF_KEY = "SETDEFS"; const string RESULTS_HISTORY_KEY = "RESULTS_HISTORY"; const string CURRENT_TEST_RESULT = "CURRENT_TEST_RESULT"; private SettingsData _settingsData; private SetDefData _setDefData; TestSetResult _currentResults; ResultsDB _resultsDB; public async Task Boot() { Util.Log("boot settings"); await LoadSettings(); await LoadSetDefs(); await LoadTestResults(); await LoadResultDB(); } async Task LoadSettings() { var json = await Util.ReadStorage(SETTINGS_KEY); if (json == null) _settingsData = Defaults.DefaultSettings; else _settingsData = JsonSerializer.Deserialize<SettingsData>(json); Util.Log(_settingsData.ToString()); } async Task LoadSetDefs() { var json = await Util.ReadStorage(SETDEF_KEY); if (json == null) _setDefData = new SetDefData { Current = Defaults.DefaultSetDef }; else _setDefData = JsonSerializer.Deserialize<SetDefData>(json); Util.Log(_setDefData.ToString()); } async Task LoadTestResults() { var json = await Util.ReadStorage(CURRENT_TEST_RESULT); if (json == null) { _currentResults = new TestSetResult { Results = new() }; } else { _currentResults = JsonSerializer.Deserialize<TestSetResult>(json); } } public async Task SaveCurrentResults() { _currentResults.DateTime = DateTime.Now; var json = JsonSerializer.Serialize(_currentResults); await Util.WriteStorage(CURRENT_TEST_RESULT, json); } public async void SaveSetDefs() { var json = JsonSerializer.Serialize(_setDefData); await Util.WriteStorage(SETDEF_KEY, json); } public async void SaveSettings() { var json = JsonSerializer.Serialize(_settingsData); await Util.WriteStorage(SETTINGS_KEY, json); } public SetDef CurrentSet { get { return _setDefData.Current; } set { _setDefData.Current = value; SaveSetDefs(); } } public SettingsData Settings { get { return _settingsData; } set { _settingsData = value; } } public TestSetResult CurrentResults => _currentResults; public ResultsDB ResultsDB => _resultsDB; internal async Task LoadResultDB() { var json = await Util.ReadStorage(RESULTS_HISTORY_KEY); if (json == null) { _resultsDB = new ResultsDB { Results = new() }; } else { _resultsDB = JsonSerializer.Deserialize<ResultsDB>(json); } } internal async void WriteResult() { // save current result to DB //var json = JsonSerializer.Serialize(_currentResults); _resultsDB.Results.Add(CurrentResults); var json = JsonSerializer.Serialize(_resultsDB); await Util.WriteStorage(RESULTS_HISTORY_KEY, json); } } }
using System; using System.Windows.Markup; namespace Plainion.Windows.Xaml { /// <summary> /// Xaml markup comparable to XInclude. Allows simple include of Xaml files into other Xaml files. /// </summary> [MarkupExtensionReturnType( typeof( object ) )] public class IncludeExtension : MarkupExtension { public string Path { get; set; } public override object ProvideValue( IServiceProvider serviceProvider ) { var reader = new ValidatingXamlReader(); return reader.Read<object>( Path ); } } }
using UnityEngine; namespace XFramework.Draw { public partial class RuntimeHandle { protected class Resources { public Material lineMat; public Material quadeMat; public Material shapMatRed; public Material shapMatBlue; public Material shapMatGreen; public Material shapMatSelected; public Mesh arrowMesh; public Mesh cubeMesh; public Resources(Color selectedColor) { lineMat = new Material(Shader.Find("RunTimeHandles/VertexColor")); lineMat.color = Color.white; quadeMat = new Material(Shader.Find("RunTimeHandles/VertexColor")); quadeMat.color = Color.white; shapMatRed = new Material(Shader.Find("RunTimeHandles/VertexColor")); shapMatRed.color = Color.red; shapMatBlue = new Material(Shader.Find("RunTimeHandles/VertexColor")); shapMatBlue.color = Color.blue; shapMatGreen = new Material(Shader.Find("RunTimeHandles/VertexColor")); shapMatGreen.color = Color.green; shapMatSelected = new Material(Shader.Find("RunTimeHandles/VertexColor")); shapMatSelected.color = selectedColor; arrowMesh = GLDraw.CreateArrow(Color.white, 1); cubeMesh = GLDraw.CreateCube(Color.white, Vector3.zero, 1); } } } }
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using ClangSharp.Interop; namespace ClangSharp { public sealed class RecordType : TagType { internal RecordType(CXType handle) : base(handle, CXTypeKind.CXType_Record, CX_TypeClass.CX_TypeClass_Record) { } public new RecordDecl Decl => (RecordDecl)base.Decl; } }
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace Sds.Osdr.WebApi.ConnectedUsers { public class ConnectedUserManager : IConnectedUserManager { IDictionary<Guid, Guid> _users = new Dictionary<Guid, Guid>(); private object _sync = new object(); public void SetCurrentNode(Guid userId, Guid nodeId) { lock (_sync) { _users[userId] = nodeId; } } public Guid? GetCurrentNode(Guid userId) { return _users.ContainsKey(userId) ? (Guid?)_users[userId] : null; } public void Remove(Guid userId) { lock (_sync) { _users.Remove(userId); } } } }
using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using StockExchangeYahooFinance.DbContext; namespace StockExchangeYahooFinance.Migrations { [DbContext(typeof(YahooFinanceDbContext))] [Migration("20170512124105_DefaultKeyStatisticsChange")] partial class DefaultKeyStatisticsChange { protected override void BuildTargetModel(ModelBuilder modelBuilder) { modelBuilder .HasAnnotation("ProductVersion", "1.1.1") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.BalanceSheetStatements", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<double>("AccountsPayable"); b.Property<double>("Cash"); b.Property<double>("CommonStock"); b.Property<string>("CompaniesId"); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<double>("DeferredLongTermLiab"); b.Property<string>("EndDate"); b.Property<double>("GoodWill"); b.Property<double>("IntangibleAssets"); b.Property<double>("Inventory"); b.Property<double>("LongTermDebt"); b.Property<double>("LongTermInvestments"); b.Property<double>("NetReceivables"); b.Property<double>("NetTangibleAssets"); b.Property<double>("OtherAssets"); b.Property<double>("OtherCurrentAssets"); b.Property<double>("OtherCurrentLiab"); b.Property<double>("OtherLiab"); b.Property<double>("OtherStockholderEquity"); b.Property<double>("PropertyPlantEquipment"); b.Property<double>("RetainedEarnings"); b.Property<double>("ShortLongTermDebt"); b.Property<double>("ShortTermInvestments"); b.Property<double>("TotalAssets"); b.Property<double>("TotalCurrentAssets"); b.Property<double>("TotalCurrentLiabilities"); b.Property<double>("TotalLiab"); b.Property<double>("TotalStockholderEquity"); b.HasKey("Id"); b.HasIndex("CompaniesId"); b.ToTable("BalanceSheetStatements"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.CalendarEarnings", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("CalendarEventsId"); b.Property<string>("CompaniesId"); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<string>("EarningsAverage"); b.Property<string>("EarningsDate"); b.Property<string>("EarningsHigh"); b.Property<string>("EarningsLow"); b.Property<string>("RevenueAverage"); b.Property<string>("RevenueHigh"); b.Property<string>("RevenueLow"); b.HasKey("Id"); b.HasIndex("CalendarEventsId"); b.HasIndex("CompaniesId"); b.ToTable("CalendarEarnings"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.CalendarEvents", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("CompaniesId"); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<string>("DividendDate"); b.Property<string>("ExDividendDate"); b.HasKey("Id"); b.HasIndex("CompaniesId"); b.ToTable("CalendarEvents"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.CashflowStatement", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("CapitalExpenditures"); b.Property<string>("ChangeInCash"); b.Property<string>("ChangeToAccountReceivables"); b.Property<string>("ChangeToInventory"); b.Property<string>("ChangeToLiabilities"); b.Property<string>("ChangeToNetincome"); b.Property<string>("ChangeToOperatingActivities"); b.Property<string>("CompaniesId"); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<string>("Depreciation"); b.Property<string>("DividendsPaid"); b.Property<string>("EffectOfExchangeRate"); b.Property<string>("EndDate"); b.Property<string>("IndustryTrendId"); b.Property<string>("Investments"); b.Property<string>("NetBorrowings"); b.Property<string>("NetIncome"); b.Property<string>("OtherCashflowsFromFinancingActivities"); b.Property<string>("OtherCashflowsFromInvestingActivities"); b.Property<string>("SalePurchaseOfStock"); b.Property<string>("TotalCashFromFinancingActivities"); b.Property<string>("TotalCashFromOperatingActivities"); b.Property<string>("TotalCashflowsFromInvestingActivities"); b.HasKey("Id"); b.HasIndex("CompaniesId"); b.ToTable("CashflowStatement"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.Companies", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("ADR_TSO"); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<string>("ExchangeId"); b.Property<string>("IPOyear"); b.Property<string>("IndustryId"); b.Property<string>("LastSale"); b.Property<string>("MarketCap"); b.Property<string>("Name"); b.Property<string>("RegionId"); b.Property<string>("SectorId"); b.Property<string>("Symbol"); b.Property<string>("Type"); b.HasKey("Id"); b.HasIndex("ExchangeId"); b.HasIndex("IndustryId"); b.HasIndex("RegionId"); b.HasIndex("SectorId"); b.ToTable("Companies"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.CompanyOfficers", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<int>("Age"); b.Property<string>("CompaniesId"); b.Property<string>("CompanyProfileId"); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<int>("ExercisedValue"); b.Property<string>("FiscalYear"); b.Property<int>("MaxAge"); b.Property<string>("Name"); b.Property<string>("Title"); b.Property<int>("TotalPay"); b.Property<int>("UnexercisedValue"); b.HasKey("Id"); b.HasIndex("CompaniesId"); b.HasIndex("CompanyProfileId"); b.ToTable("CompanyOfficers"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.CompanyProfile", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("Address1"); b.Property<int>("AuditRisk"); b.Property<int>("BoardRisk"); b.Property<string>("City"); b.Property<string>("CompaniesId"); b.Property<int>("CompensationAsOfEpochDate"); b.Property<int>("CompensationRisk"); b.Property<string>("Country"); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<string>("Fax"); b.Property<int>("FullTimeEmployees"); b.Property<int>("GovernanceEpochDate"); b.Property<string>("IndustryId"); b.Property<string>("IndustrySymbolId"); b.Property<string>("LongBusinessSummary"); b.Property<int>("OverallRisk"); b.Property<string>("Phone"); b.Property<string>("SectorId"); b.Property<int>("ShareHolderRightsRisk"); b.Property<string>("Website"); b.Property<string>("Zip"); b.HasKey("Id"); b.HasIndex("CompaniesId"); b.HasIndex("IndustryId"); b.HasIndex("IndustrySymbolId"); b.HasIndex("SectorId"); b.ToTable("CompanyProfile"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.Country", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("CountryCode"); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<string>("Name"); b.HasKey("Id"); b.ToTable("Country"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.Currencies", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("Code"); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<string>("Currency"); b.Property<string>("Entity"); b.Property<string>("MinorUnit"); b.Property<int>("NumericCode"); b.HasKey("Id"); b.ToTable("Currencies"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.DefaultKeyStatistics", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<double>("AnnualHoldingsTurnover"); b.Property<double>("AnnualReportExpenseRatio"); b.Property<double>("Beta"); b.Property<double>("Beta3Year"); b.Property<double>("BookValue"); b.Property<string>("Category"); b.Property<string>("CompaniesId"); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<double>("EarningsQuarterlyGrowth"); b.Property<double>("EnterpriseToEbitda"); b.Property<double>("EnterpriseToRevenue"); b.Property<double>("EnterpriseValue"); b.Property<double>("FiftyTwoWeekChange"); b.Property<double>("FiveYearAverageReturn"); b.Property<double>("FloatShares"); b.Property<double>("ForwardEps"); b.Property<double>("ForwardPe"); b.Property<string>("FundFamily"); b.Property<string>("FundInceptionDate"); b.Property<double>("HeldPercentInsiders"); b.Property<double>("HeldPercentInstitutions"); b.Property<double>("LastCapGain"); b.Property<double>("LastDividendValue"); b.Property<string>("LastFiscalYearEnd"); b.Property<string>("LastSplitDate"); b.Property<string>("LastSplitFactor"); b.Property<string>("LegalType"); b.Property<double>("MorningStarOverallRating"); b.Property<double>("MorningStarRiskRating"); b.Property<string>("MostRecentQuarter"); b.Property<double>("NetIncomeToCommon"); b.Property<string>("NextFiscalYearEnd"); b.Property<double>("PegRatio"); b.Property<double>("PriceToBook"); b.Property<double>("PriceToSalesTrailing12Months"); b.Property<double>("ProfitMargins"); b.Property<double>("RevenueQuarterlyGrowth"); b.Property<double>("SandP52WeekChange"); b.Property<double>("SharesOutstanding"); b.Property<double>("SharesShort"); b.Property<double>("SharesShortPriorMonth"); b.Property<double>("ShortPercentOfFloat"); b.Property<double>("ShortRatio"); b.Property<double>("ThreeYearAverageReturn"); b.Property<double>("TotalAssets"); b.Property<double>("TrailingEps"); b.Property<double>("Yield"); b.Property<double>("YtdReturn"); b.HasKey("Id"); b.HasIndex("CompaniesId"); b.ToTable("DefaultKeyStatistics"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.Earnings", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("CompaniesId"); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.HasKey("Id"); b.HasIndex("CompaniesId"); b.ToTable("Earnings"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.EarningsChartQuarterly", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("Actual"); b.Property<string>("CompaniesId"); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<string>("CurrentQuarterEstimate"); b.Property<string>("CurrentQuarterEstimateDate"); b.Property<string>("CurrentQuarterEstimateYear"); b.Property<string>("Date"); b.Property<string>("EarningsId"); b.Property<string>("Estimate"); b.HasKey("Id"); b.HasIndex("CompaniesId"); b.HasIndex("EarningsId"); b.ToTable("EarningsChartQuarterly"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.EarningsEstimate", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("Avg"); b.Property<string>("CompaniesId"); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<string>("EarningsTrendId"); b.Property<string>("Growth"); b.Property<string>("High"); b.Property<string>("Low"); b.Property<string>("YearAgoEps"); b.HasKey("Id"); b.HasIndex("CompaniesId"); b.HasIndex("EarningsTrendId"); b.ToTable("EarningsEstimate"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.EarningsHistory", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("CompaniesId"); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<string>("EpsActual"); b.Property<string>("EpsDifference"); b.Property<string>("EpsEstimate"); b.Property<string>("Period"); b.Property<string>("Quarter"); b.Property<string>("SurprisePercent"); b.HasKey("Id"); b.HasIndex("CompaniesId"); b.ToTable("EarningsHistory"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.EarningsTrend", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("CompaniesId"); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<string>("EarningsEstimate"); b.Property<string>("EndDate"); b.Property<string>("Growth"); b.Property<string>("NumberOfAnalysts"); b.Property<string>("Period"); b.HasKey("Id"); b.HasIndex("CompaniesId"); b.ToTable("EarningsTrend"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.EpsRevisions", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("CompaniesId"); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<string>("DownLast30Days"); b.Property<string>("DownLast90Days"); b.Property<string>("EarningsTrendId"); b.Property<string>("UpLast30Days"); b.Property<string>("UpLast7Days"); b.HasKey("Id"); b.HasIndex("CompaniesId"); b.HasIndex("EarningsTrendId"); b.ToTable("EpsRevisions"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.EpsTrend", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("CompaniesId"); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<string>("Current"); b.Property<string>("EarningsTrendId"); b.Property<string>("NinetyAgoRevenue"); b.Property<string>("SevenDaysAgo"); b.Property<string>("SixtydaysAgo"); b.Property<string>("ThirtydaysAgo"); b.HasKey("Id"); b.HasIndex("CompaniesId"); b.HasIndex("EarningsTrendId"); b.ToTable("EpsTrend"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.Estimates", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("CompaniesId"); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<string>("Growth"); b.Property<string>("IndexTrendId"); b.Property<string>("IndustryTrendId"); b.Property<string>("Period"); b.Property<string>("SectorTrendId"); b.HasKey("Id"); b.HasIndex("CompaniesId"); b.HasIndex("IndexTrendId"); b.HasIndex("IndustryTrendId"); b.HasIndex("SectorTrendId"); b.ToTable("Estimates"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.Exchange", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("ClosingTimeLocal"); b.Property<string>("CountryId"); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<string>("DataProvider"); b.Property<string>("Delay"); b.Property<string>("Name"); b.Property<string>("OpeningTimeLocal"); b.Property<string>("RegionId"); b.Property<string>("StockExchangeId"); b.Property<string>("Suffix"); b.Property<string>("TradingDays"); b.Property<string>("UtcOffsetStandardTime"); b.HasKey("Id"); b.HasIndex("CountryId"); b.HasIndex("RegionId"); b.ToTable("Exchange"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.FinanceModel", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("AfterHoursChangeRealtime"); b.Property<string>("AnnualizedGain"); b.Property<string>("Ask"); b.Property<string>("AskRealtime"); b.Property<string>("AverageDailyVolume"); b.Property<string>("Bid"); b.Property<string>("BidRealtime"); b.Property<string>("BookValue"); b.Property<string>("Change"); b.Property<string>("ChangeFromFiftydayMovingAverage"); b.Property<string>("ChangeFromTwoHundreddayMovingAverage"); b.Property<string>("ChangeFromYearHigh"); b.Property<string>("ChangeFromYearLow"); b.Property<string>("ChangePercentRealtime"); b.Property<string>("ChangeRealtime"); b.Property<string>("Change_PercentChange"); b.Property<string>("ChangeinPercent"); b.Property<string>("Commission"); b.Property<string>("CompaniesId"); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<string>("CurencyId"); b.Property<string>("CurrenciesId"); b.Property<string>("Currency"); b.Property<string>("Date"); b.Property<string>("DaysHigh"); b.Property<string>("DaysLow"); b.Property<string>("DaysRange"); b.Property<string>("DaysRangeRealtime"); b.Property<string>("DaysValueChange"); b.Property<string>("DaysValueChangeRealtime"); b.Property<string>("DividendPayDate"); b.Property<string>("DividendShare"); b.Property<string>("DividendYield"); b.Property<string>("EBITDA"); b.Property<string>("EPSEstimateCurrentYear"); b.Property<string>("EPSEstimateNextQuarter"); b.Property<string>("EPSEstimateNextYear"); b.Property<string>("EarningsShare"); b.Property<string>("ErrorIndicationreturnedforsymbolchangedinvalid"); b.Property<string>("ExDividendDate"); b.Property<string>("FiftydayMovingAverage"); b.Property<string>("HighLimit"); b.Property<string>("HoldingsGain"); b.Property<string>("HoldingsGainPercent"); b.Property<string>("HoldingsGainPercentRealtime"); b.Property<string>("HoldingsGainRealtime"); b.Property<string>("HoldingsValue"); b.Property<string>("HoldingsValueRealtime"); b.Property<string>("LastTradeDate"); b.Property<string>("LastTradePriceOnly"); b.Property<string>("LastTradeRealtimeWithTime"); b.Property<string>("LastTradeTime"); b.Property<string>("LastTradeWithTime"); b.Property<string>("LowLimit"); b.Property<string>("MarketCapRealtime"); b.Property<string>("MarketCapitalization"); b.Property<string>("MoreInfo"); b.Property<string>("Name"); b.Property<string>("Notes"); b.Property<string>("OneyrTargetPrice"); b.Property<string>("Open"); b.Property<string>("OrderBookRealtime"); b.Property<string>("PEGRatio"); b.Property<string>("PERatio"); b.Property<string>("PERatioRealtime"); b.Property<string>("PercebtChangeFromYearHigh"); b.Property<string>("PercentChange"); b.Property<string>("PercentChangeFromFiftydayMovingAverage"); b.Property<string>("PercentChangeFromTwoHundreddayMovingAverage"); b.Property<string>("PercentChangeFromYearLow"); b.Property<string>("PreviousClose"); b.Property<string>("PriceBook"); b.Property<string>("PriceEPSEstimateCurrentYear"); b.Property<string>("PriceEPSEstimateNextYear"); b.Property<string>("PricePaid"); b.Property<string>("PriceSales"); b.Property<string>("Rate"); b.Property<string>("SharesOwned"); b.Property<string>("ShortRatio"); b.Property<string>("StockExchange"); b.Property<string>("Symbol"); b.Property<string>("TickerTrend"); b.Property<string>("Time"); b.Property<string>("TradeDate"); b.Property<string>("TwoHundreddayMovingAverage"); b.Property<string>("Volume"); b.Property<string>("YearHigh"); b.Property<string>("YearLow"); b.Property<string>("YearRange"); b.HasKey("Id"); b.HasIndex("CompaniesId"); b.HasIndex("CurrenciesId"); b.ToTable("FinanceModel"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.FinancialData", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("CompaniesId"); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<double>("CurrentPrice"); b.Property<double>("CurrentRatio"); b.Property<double>("DebtToEquity"); b.Property<double>("EarningsGrowth"); b.Property<double>("Ebitda"); b.Property<double>("EbitdaMargins"); b.Property<double>("FreeCashflow"); b.Property<double>("GrossMargins"); b.Property<double>("GrossProfits"); b.Property<double>("NumberOfAnalystOpinions"); b.Property<double>("OperatingCashflow"); b.Property<double>("OperatingMargins"); b.Property<double>("ProfitMargins"); b.Property<double>("QuickRatio"); b.Property<string>("RecommendationKey"); b.Property<double>("RecommendationMean"); b.Property<double>("ReturnOnAssets"); b.Property<double>("ReturnOnEquity"); b.Property<double>("RevenueGrowth"); b.Property<double>("RevenuePerShare"); b.Property<double>("TargetHighPrice"); b.Property<double>("TargetLowPrice"); b.Property<double>("TargetMeanPrice"); b.Property<double>("TargetMedianPrice"); b.Property<double>("TotalCash"); b.Property<double>("TotalCashPerShare"); b.Property<double>("TotalDebt"); b.Property<double>("TotalRevenue"); b.HasKey("Id"); b.HasIndex("CompaniesId"); b.ToTable("FinancialData"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.FinancialsChartQuarterly", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("CompaniesId"); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<string>("Date"); b.Property<string>("Earning"); b.Property<string>("EarningsId"); b.Property<string>("Revenue"); b.HasKey("Id"); b.HasIndex("CompaniesId"); b.HasIndex("EarningsId"); b.ToTable("FinancialsChartQuarterly"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.FinancialsChartYearly", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("CompaniesId"); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<string>("Date"); b.Property<string>("Earning"); b.Property<string>("EarningsId"); b.Property<string>("Revenue"); b.HasKey("Id"); b.HasIndex("CompaniesId"); b.HasIndex("EarningsId"); b.ToTable("FinancialsChartYearly"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.FundOwnership", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("CompaniesId"); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<string>("Organization"); b.Property<double>("PctHeld"); b.Property<double>("Position"); b.Property<string>("ReportDate"); b.Property<double>("Value"); b.HasKey("Id"); b.HasIndex("CompaniesId"); b.ToTable("FundOwnership"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.History", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<double>("AdjClose"); b.Property<double>("Close"); b.Property<string>("CompaniesId"); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<string>("Date"); b.Property<double>("High"); b.Property<double>("Low"); b.Property<double>("Open"); b.Property<double>("Volume"); b.HasKey("Id"); b.HasIndex("CompaniesId"); b.ToTable("History"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.IncomeStatementHistory", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("CompaniesId"); b.Property<string>("CostOfRevenue"); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<string>("DiscontinuedOperations"); b.Property<string>("Ebit"); b.Property<string>("EffectOfAccountingCharges"); b.Property<string>("EndDate"); b.Property<string>("ExtraordinaryItems"); b.Property<string>("GrossProfit"); b.Property<string>("IncomeBeforeTax"); b.Property<string>("IncomeTaxExpense"); b.Property<string>("InterestExpense"); b.Property<string>("MinorityInterest"); b.Property<string>("NetIncome"); b.Property<string>("NetIncomeApplicableToCommonShares"); b.Property<string>("NetIncomeFromContinuingOps"); b.Property<string>("NonRecurring"); b.Property<string>("OperatingIncome"); b.Property<string>("OtherItems"); b.Property<string>("OtherOperatingExpenses"); b.Property<string>("ResearchDevelopment"); b.Property<string>("SellingGeneralAdministrative"); b.Property<string>("TotalOperatingExpenses"); b.Property<string>("TotalOtherIncomeExpenseNet"); b.Property<string>("TotalRevenue"); b.HasKey("Id"); b.HasIndex("CompaniesId"); b.ToTable("IncomeStatementHistory"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.IndexTrend", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("CompaniesId"); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<string>("PeRatio"); b.Property<string>("PegRatio"); b.Property<string>("Symbol"); b.HasKey("Id"); b.HasIndex("CompaniesId"); b.ToTable("IndexTrend"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.Industry", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<string>("Name"); b.HasKey("Id"); b.ToTable("Industrie"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.IndustrySimbol", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<string>("IndustryId"); b.Property<string>("Symbol"); b.HasKey("Id"); b.HasIndex("IndustryId"); b.ToTable("IndustrySimbol"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.IndustryTrend", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("CompaniesId"); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<string>("PeRatio"); b.Property<string>("PegRatio"); b.Property<string>("Symbol"); b.HasKey("Id"); b.HasIndex("CompaniesId"); b.ToTable("IndustryTrend"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.InsiderHolders", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("CompaniesId"); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<string>("LatestTransDate"); b.Property<string>("Name"); b.Property<double>("PositionDirect"); b.Property<string>("PositionDirectDate"); b.Property<double>("PositionIndirect"); b.Property<string>("PositionIndirectDate"); b.Property<double>("PositionSummary"); b.Property<string>("PositionSummaryDate"); b.Property<string>("Relation"); b.Property<string>("TransactionDescription"); b.Property<string>("Url"); b.HasKey("Id"); b.HasIndex("CompaniesId"); b.ToTable("InsiderHolders"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.InsiderTransactions", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("CompaniesId"); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<string>("FilerName"); b.Property<string>("FilerRelation"); b.Property<string>("FilerUrl"); b.Property<string>("MoneyText"); b.Property<string>("Ownership"); b.Property<double>("Shares"); b.Property<string>("StartDate"); b.Property<string>("TransactionText"); b.Property<double>("Value"); b.HasKey("Id"); b.HasIndex("CompaniesId"); b.ToTable("InsiderTransactions"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.InstitutionOwnership", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("CompaniesId"); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<string>("Organization"); b.Property<double>("PctHeld"); b.Property<double>("Position"); b.Property<string>("ReportDate"); b.Property<double>("Value"); b.HasKey("Id"); b.HasIndex("CompaniesId"); b.ToTable("InstitutionOwnership"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.MajorDirectHolders", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("CompaniesId"); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<string>("LatestTransDate"); b.Property<string>("Name"); b.Property<double>("PositionDirect"); b.Property<string>("PositionDirectDate"); b.Property<double>("PositionIndirect"); b.Property<string>("PositionIndirectDate"); b.Property<double>("PositionSummary"); b.Property<string>("PositionSummaryDate"); b.Property<string>("Relation"); b.Property<string>("TransactionDescription"); b.Property<string>("Url"); b.HasKey("Id"); b.HasIndex("CompaniesId"); b.ToTable("MajorDirectHolders"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.MajorHoldersBreakdown", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("CompaniesId"); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<double>("InsidersPercentHeld"); b.Property<int>("InstitutionsCount"); b.Property<double>("InstitutionsFloatPercentHeld"); b.Property<double>("InstitutionsPercentHeld"); b.HasKey("Id"); b.HasIndex("CompaniesId"); b.ToTable("MajorHoldersBreakdown"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.NetSharePurchaseActivity", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("BuyInfoCount"); b.Property<string>("BuyInfoShares"); b.Property<string>("CompaniesId"); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<string>("NetInfoCount"); b.Property<string>("NetInfoShares"); b.Property<string>("NetInstBuyingPercent"); b.Property<string>("NetInstSharesBuying"); b.Property<string>("NetPercentInsiderShares"); b.Property<string>("Period"); b.Property<string>("SellInfoCount"); b.Property<string>("SellInfoShares"); b.Property<string>("SellPercentInsiderShares"); b.Property<string>("TotalInsiderShares"); b.HasKey("Id"); b.HasIndex("CompaniesId"); b.ToTable("NetSharePurchaseActivity"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.OptionsCalls", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("Ask"); b.Property<string>("Bid"); b.Property<string>("Change"); b.Property<string>("CompaniesId"); b.Property<string>("ContractSize"); b.Property<string>("ContractSymbol"); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<string>("Currency"); b.Property<string>("Expiration"); b.Property<string>("ImpliedVolatility"); b.Property<string>("InTheMoney"); b.Property<string>("LastPrice"); b.Property<string>("OpenInterest"); b.Property<string>("PercentChange"); b.Property<string>("Strike"); b.Property<string>("Volume"); b.HasKey("Id"); b.HasIndex("CompaniesId"); b.ToTable("OptionsCalls"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.OptionsExpirationDates", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("CompaniesId"); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<string>("Date"); b.HasKey("Id"); b.HasIndex("CompaniesId"); b.ToTable("OptionsExpirationDates"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.OptionsQuote", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("Ask"); b.Property<string>("AskSize"); b.Property<string>("AverageDailyVolume10Day"); b.Property<string>("AverageDailyVolume3Month"); b.Property<string>("Bid"); b.Property<string>("BidSize"); b.Property<string>("BookValue"); b.Property<string>("CompaniesId"); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<string>("Currency"); b.Property<string>("DividendDate"); b.Property<string>("EpsForward"); b.Property<string>("EpsTrailingTwelveMonths"); b.Property<string>("ExchangeId"); b.Property<string>("ExchangeName"); b.Property<string>("ExchangeTimezoneName"); b.Property<string>("ExchangeTimezoneShortName"); b.Property<string>("FiftyDayAverage"); b.Property<string>("FiftyDayAverageChange"); b.Property<string>("FiftyDayAverageChangePercent"); b.Property<string>("FiftyTwoWeekHigh"); b.Property<string>("FiftyTwoWeekHighChange"); b.Property<string>("FiftyTwoWeekHighChangePercent"); b.Property<string>("FiftyTwoWeekLow"); b.Property<string>("FiftyTwoWeekLowChange"); b.Property<string>("FiftyTwoWeekLowChangePercent"); b.Property<string>("ForwardPe"); b.Property<string>("FullExchangeName"); b.Property<string>("GmtOffSetMilliseconds"); b.Property<string>("LongName"); b.Property<string>("Market"); b.Property<string>("MarketCap"); b.Property<string>("MarketState"); b.Property<string>("MessageBoardId"); b.Property<string>("PostMarketChange"); b.Property<string>("PostMarketChangePercent"); b.Property<string>("PostMarketPrice"); b.Property<string>("PostMarketTime"); b.Property<string>("PriceHint"); b.Property<string>("PriceToBook"); b.Property<string>("QuoteSourceName"); b.Property<string>("QuoteType"); b.Property<string>("RegularMarketChange"); b.Property<string>("RegularMarketChangePercent"); b.Property<string>("RegularMarketDayHigh"); b.Property<string>("RegularMarketDayLow"); b.Property<string>("RegularMarketOpen"); b.Property<string>("RegularMarketPreviousClose"); b.Property<string>("RegularMarketPrice"); b.Property<string>("RegularMarketTime"); b.Property<string>("RegularMarketVolume"); b.Property<string>("SharesOutstanding"); b.Property<string>("ShortName"); b.Property<string>("SourceInterval"); b.Property<string>("Symbol"); b.Property<string>("TrailingAnnualDividendRate"); b.Property<string>("TrailingPe"); b.Property<string>("TwoHundredDayAverage"); b.Property<string>("TwoHundredDayAverageChange"); b.Property<string>("TwoHundredDayAverageChangePercent"); b.HasKey("Id"); b.HasIndex("CompaniesId"); b.HasIndex("ExchangeId"); b.ToTable("OptionsQuote"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.OptionsStrikes", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("CompaniesId"); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<double>("Strike"); b.HasKey("Id"); b.HasIndex("CompaniesId"); b.ToTable("OptionsStrikes"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.RecommendationTrend", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<double>("Buy"); b.Property<string>("CompaniesId"); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<double>("Hold"); b.Property<string>("Period"); b.Property<double>("Sell"); b.Property<double>("StrongBuy"); b.Property<double>("StrongSell"); b.HasKey("Id"); b.HasIndex("CompaniesId"); b.ToTable("RecommendationTrend"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.Region", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<string>("Name"); b.HasKey("Id"); b.ToTable("Region"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.RevenueEstimate", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("Avg"); b.Property<string>("CompaniesId"); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<string>("EarningsTrendId"); b.Property<string>("Growth"); b.Property<string>("High"); b.Property<string>("Low"); b.Property<string>("NumberOfAnalysts"); b.Property<string>("YearAgoRevenue"); b.HasKey("Id"); b.HasIndex("CompaniesId"); b.HasIndex("EarningsTrendId"); b.ToTable("RevenueEstimate"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.Sector", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<string>("Name"); b.HasKey("Id"); b.ToTable("Sector"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.SectorTrend", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("CompaniesId"); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<string>("PeRatio"); b.Property<string>("PegRatio"); b.Property<string>("Symbol"); b.HasKey("Id"); b.HasIndex("CompaniesId"); b.ToTable("SectorTrend"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.UpgradeDowngradeHistory", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("Action"); b.Property<string>("CompaniesId"); b.Property<string>("CreatedByUser"); b.Property<DateTime>("CreationTime"); b.Property<string>("EpochGradeDate"); b.Property<string>("Firm"); b.Property<string>("FromGrade"); b.Property<string>("ToGrade"); b.HasKey("Id"); b.HasIndex("CompaniesId"); b.ToTable("UpgradeDowngradeHistory"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.BalanceSheetStatements", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.Companies", "Companies") .WithMany() .HasForeignKey("CompaniesId"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.CalendarEarnings", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.CalendarEvents", "CalendarEvents") .WithMany("Earnings") .HasForeignKey("CalendarEventsId"); b.HasOne("StockExchangeYahooFinance.Data.Models.Companies", "Companies") .WithMany() .HasForeignKey("CompaniesId"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.CalendarEvents", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.Companies", "Companies") .WithMany() .HasForeignKey("CompaniesId"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.CashflowStatement", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.Companies", "Companies") .WithMany() .HasForeignKey("CompaniesId"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.Companies", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.Exchange", "Exchange") .WithMany() .HasForeignKey("ExchangeId"); b.HasOne("StockExchangeYahooFinance.Data.Models.Industry", "Industry") .WithMany() .HasForeignKey("IndustryId"); b.HasOne("StockExchangeYahooFinance.Data.Models.Region", "Region") .WithMany() .HasForeignKey("RegionId"); b.HasOne("StockExchangeYahooFinance.Data.Models.Sector", "Sector") .WithMany() .HasForeignKey("SectorId"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.CompanyOfficers", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.Companies", "Companies") .WithMany() .HasForeignKey("CompaniesId"); b.HasOne("StockExchangeYahooFinance.Data.Models.CompanyProfile", "CompanyProfile") .WithMany("CompanyOfficers") .HasForeignKey("CompanyProfileId"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.CompanyProfile", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.Companies", "Companies") .WithMany() .HasForeignKey("CompaniesId"); b.HasOne("StockExchangeYahooFinance.Data.Models.Industry", "Industry") .WithMany() .HasForeignKey("IndustryId"); b.HasOne("StockExchangeYahooFinance.Data.Models.IndustrySimbol", "IndustrySymbol") .WithMany() .HasForeignKey("IndustrySymbolId"); b.HasOne("StockExchangeYahooFinance.Data.Models.Sector", "Sector") .WithMany() .HasForeignKey("SectorId"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.DefaultKeyStatistics", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.Companies", "Companies") .WithMany() .HasForeignKey("CompaniesId"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.Earnings", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.Companies", "Companies") .WithMany() .HasForeignKey("CompaniesId"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.EarningsChartQuarterly", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.Companies", "Companies") .WithMany() .HasForeignKey("CompaniesId"); b.HasOne("StockExchangeYahooFinance.Data.Models.Earnings", "Earnings") .WithMany() .HasForeignKey("EarningsId"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.EarningsEstimate", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.Companies", "Companies") .WithMany() .HasForeignKey("CompaniesId"); b.HasOne("StockExchangeYahooFinance.Data.Models.EarningsTrend", "EarningsTrend") .WithMany() .HasForeignKey("EarningsTrendId"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.EarningsHistory", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.Companies", "Companies") .WithMany() .HasForeignKey("CompaniesId"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.EarningsTrend", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.Companies", "Companies") .WithMany() .HasForeignKey("CompaniesId"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.EpsRevisions", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.Companies", "Companies") .WithMany() .HasForeignKey("CompaniesId"); b.HasOne("StockExchangeYahooFinance.Data.Models.EarningsTrend", "EarningsTrend") .WithMany() .HasForeignKey("EarningsTrendId"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.EpsTrend", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.Companies", "Companies") .WithMany() .HasForeignKey("CompaniesId"); b.HasOne("StockExchangeYahooFinance.Data.Models.EarningsTrend", "EarningsTrend") .WithMany() .HasForeignKey("EarningsTrendId"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.Estimates", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.Companies", "Companies") .WithMany() .HasForeignKey("CompaniesId"); b.HasOne("StockExchangeYahooFinance.Data.Models.IndexTrend", "IndexTrend") .WithMany("Estimateses") .HasForeignKey("IndexTrendId"); b.HasOne("StockExchangeYahooFinance.Data.Models.IndustryTrend", "IndustryTrend") .WithMany("Estimateses") .HasForeignKey("IndustryTrendId"); b.HasOne("StockExchangeYahooFinance.Data.Models.SectorTrend", "SectorTrend") .WithMany("Estimateses") .HasForeignKey("SectorTrendId"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.Exchange", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.Country", "Country") .WithMany() .HasForeignKey("CountryId"); b.HasOne("StockExchangeYahooFinance.Data.Models.Region", "Region") .WithMany() .HasForeignKey("RegionId"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.FinanceModel", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.Companies", "Companies") .WithMany() .HasForeignKey("CompaniesId"); b.HasOne("StockExchangeYahooFinance.Data.Models.Currencies", "Currencies") .WithMany() .HasForeignKey("CurrenciesId"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.FinancialData", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.Companies", "Companies") .WithMany() .HasForeignKey("CompaniesId"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.FinancialsChartQuarterly", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.Companies", "Companies") .WithMany() .HasForeignKey("CompaniesId"); b.HasOne("StockExchangeYahooFinance.Data.Models.Earnings", "Earnings") .WithMany() .HasForeignKey("EarningsId"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.FinancialsChartYearly", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.Companies", "Companies") .WithMany() .HasForeignKey("CompaniesId"); b.HasOne("StockExchangeYahooFinance.Data.Models.Earnings", "Earnings") .WithMany() .HasForeignKey("EarningsId"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.FundOwnership", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.Companies", "Companies") .WithMany() .HasForeignKey("CompaniesId"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.History", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.Companies", "Companies") .WithMany() .HasForeignKey("CompaniesId"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.IncomeStatementHistory", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.Companies", "Companies") .WithMany() .HasForeignKey("CompaniesId"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.IndexTrend", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.Companies", "Companies") .WithMany() .HasForeignKey("CompaniesId"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.IndustrySimbol", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.Industry", "Industry") .WithMany() .HasForeignKey("IndustryId"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.IndustryTrend", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.Companies", "Companies") .WithMany() .HasForeignKey("CompaniesId"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.InsiderHolders", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.Companies", "Companies") .WithMany() .HasForeignKey("CompaniesId"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.InsiderTransactions", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.Companies", "Companies") .WithMany() .HasForeignKey("CompaniesId"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.InstitutionOwnership", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.Companies", "Companies") .WithMany() .HasForeignKey("CompaniesId"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.MajorDirectHolders", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.Companies", "Companies") .WithMany() .HasForeignKey("CompaniesId"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.MajorHoldersBreakdown", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.Companies", "Companies") .WithMany() .HasForeignKey("CompaniesId"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.NetSharePurchaseActivity", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.Companies", "Companies") .WithMany() .HasForeignKey("CompaniesId"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.OptionsCalls", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.Companies", "Companies") .WithMany() .HasForeignKey("CompaniesId"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.OptionsExpirationDates", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.Companies", "Companies") .WithMany() .HasForeignKey("CompaniesId"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.OptionsQuote", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.Companies", "Companies") .WithMany() .HasForeignKey("CompaniesId"); b.HasOne("StockExchangeYahooFinance.Data.Models.Exchange", "Exchange") .WithMany() .HasForeignKey("ExchangeId"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.OptionsStrikes", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.Companies", "Companies") .WithMany() .HasForeignKey("CompaniesId"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.RecommendationTrend", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.Companies", "Companies") .WithMany() .HasForeignKey("CompaniesId"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.RevenueEstimate", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.Companies", "Companies") .WithMany() .HasForeignKey("CompaniesId"); b.HasOne("StockExchangeYahooFinance.Data.Models.EarningsTrend", "EarningsTrend") .WithMany() .HasForeignKey("EarningsTrendId"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.SectorTrend", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.Companies", "Companies") .WithMany() .HasForeignKey("CompaniesId"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.UpgradeDowngradeHistory", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.Companies", "Companies") .WithMany() .HasForeignKey("CompaniesId"); }); } } }
using System; using System.Collections.Generic; using System.Web.Mvc; using Benchmarks.AspNet.Models; namespace Benchmarks.AspNet.Controllers { public class EntityFrameworkController : Controller { Random random = new Random(); public ActionResult Index(string providerName, string queries) { int queryInt = 1; int.TryParse(queries, out queryInt); List<World> worlds = new List<World>(Math.Max(1, Math.Min(500, queryInt))); using (EntityFramework db = new EntityFramework(providerName)) { for (int i = 0; i < worlds.Capacity; i++) { int randomID = random.Next(0, 10000) + 1; worlds.Add(db.Worlds.Find(randomID)); } } return queries != null ? Json(worlds, JsonRequestBehavior.AllowGet) : Json(worlds[0], JsonRequestBehavior.AllowGet); } public ActionResult Fortunes(string providerName) { List<Fortune> fortunes = new List<Fortune>(); using (EntityFramework db = new EntityFramework(providerName)) { fortunes.AddRange(db.Fortunes); } fortunes.Add(new Fortune { ID = 0, Message = "Additional fortune added at request time." }); fortunes.Sort(); Response.Charset = "utf-8"; return View("Fortunes", fortunes); } public ActionResult Update(string providerName, int? queries) { List<World> worlds = new List<World>(Math.Max(1, Math.Min(500, queries ?? 1))); using (EntityFramework db = new EntityFramework(providerName)) { for (int i = 0; i < worlds.Capacity; i++) { int randomID = random.Next(0, 10000) + 1; int randomNumber = random.Next(0, 10000) + 1; World world = db.Worlds.Find(randomID); world.randomNumber = randomNumber; worlds.Add(world); } // batch update db.SaveChanges(); } return Json(worlds, JsonRequestBehavior.AllowGet); } } }
namespace Panther.CodeAnalysis.Syntax { public enum SyntaxKind { // Special Tokens EndOfInputToken, IdentifierToken, CommaToken, // Trivia tokens InvalidTokenTrivia, EndOfLineTrivia, WhitespaceTrivia, LineCommentTrivia, BlockCommentTrivia, // Literal tokens NumberToken, StringToken, // Keywords BreakKeyword, ClassKeyword, ContinueKeyword, DefKeyword, ElseKeyword, FalseKeyword, ForKeyword, IfKeyword, ImplicitKeyword, NamespaceKeyword, NewKeyword, ObjectKeyword, StaticKeyword, ToKeyword, TrueKeyword, UsingKeyword, ValKeyword, VarKeyword, WhileKeyword, // Operators AmpersandAmpersandToken, AmpersandToken, BangEqualsToken, BangToken, CaretToken, ColonToken, DashToken, DotToken, EqualsEqualsToken, EqualsToken, GreaterThanEqualsToken, GreaterThanToken, LessThanDashToken, LessThanEqualsToken, LessThanToken, PipePipeToken, PipeToken, PlusToken, SlashToken, StarToken, TildeToken, // grouping tokens CloseParenToken, OpenParenToken, OpenBraceToken, CloseBraceToken, // Expressions AssignmentExpression, BinaryExpression, BlockExpression, CallExpression, ForExpression, GroupExpression, IdentifierName, IfExpression, LiteralExpression, MemberAccessExpression, NewExpression, QualifiedName, UnaryExpression, UnitExpression, WhileExpression, // Statements BreakStatement, ContinueStatement, ExpressionStatement, VariableDeclarationStatement, // Nodes Template, TypeAnnotation, Parameter, Initializer, CompilationUnit, // Members ClassDeclaration, FunctionDeclaration, ObjectDeclaration, // Top level items UsingDirective, GlobalStatement, NamespaceDeclaration, NamespaceMembers, NestedNamespace } }
namespace Interfaces.Animal.Cat { class Tomcat : Cat { public Tomcat(string animal, int age, char gender = 'M') : base(animal, age, gender) { } } }
namespace MoviesRecommendationSystem.Data { using Microsoft.AspNetCore.Identity.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using MoviesRecommendationSystem.Data.Models; public class MoviesRecommendationDbContext : IdentityDbContext<User> { public MoviesRecommendationDbContext(DbContextOptions<MoviesRecommendationDbContext> options) : base(options) { } public DbSet<Actor> Actors { get; init; } public DbSet<Director> Directors { get; init; } public DbSet<Editor> Editors { get; init; } public DbSet<Genre> Genres { get; init; } public DbSet<Movie> Movies { get; init; } public DbSet<MovieActor> MovieActors { get; init; } public DbSet<MovieGenre> MovieGenres { get; init; } public DbSet<UserWatchlistMovie> UserWatchlistMovies { get; init; } public DbSet<Review> Reviews { get; init; } protected override void OnModelCreating(ModelBuilder builder) { builder .Entity<Editor>() .HasOne<User>() .WithOne() .HasForeignKey<Editor>(e => e.UserId) .OnDelete(DeleteBehavior.Restrict); builder.Entity<Movie>() .HasOne(m => m.Editor) .WithMany(e => e.Movies) .HasForeignKey(m => m.EditorId) .OnDelete(DeleteBehavior.Restrict); builder.Entity<Movie>() .HasOne(x => x.Director) .WithMany(x => x.Movies) .HasForeignKey(x => x.DirectorId) .OnDelete(DeleteBehavior.Restrict); builder.Entity<MovieActor>() .HasKey(x => new { x.MovieId, x.ActorId }); builder.Entity<MovieGenre>() .HasKey(x => new { x.MovieId, x.GenreId }); builder.Entity<UserWatchlistMovie>() .HasKey(x => new { x.UserId, x.MovieId }); builder.Entity<Review>() .HasOne(r => r.User) .WithMany(u => u.Reviews) .HasForeignKey(r => r.UserId) .OnDelete(DeleteBehavior.Restrict); builder.Entity<Review>() .HasOne(r => r.Movie) .WithMany(u => u.Reviews) .HasForeignKey(r => r.MovieId) .OnDelete(DeleteBehavior.Restrict); base.OnModelCreating(builder); } } }
namespace Fonet.Cli { using System; using System.IO; using Fonet.Cli.Parser; using Fonet.Render; using Fonet.Render.Pdf; /// <summary> /// Command line interface for FO.NET. /// </summary> public class FonetCli { /// <summary> /// Option to specify the input FO file. /// </summary> private Option fofOption; /// <summary> /// Option to specify the output PDF option. /// </summary> private Option pdfOption; /// <summary> /// Option to display command line help. /// </summary> private Option helpOption; /// <summary> /// Option to specify the font kerning for PDF output. /// </summary> private Option kerningOption; /// <summary> /// Option to specify how fonts should be handled for PDF output. /// </summary> private Option fontTypeOption; /// <summary> /// The main entry point for the application. /// </summary> /// <param name="args">System provided command line arguments.</param> /// <returns>0 if successful, otherwise -1.</returns> [STAThread] public static int Main(string[] args) { return new FonetCli().Run(args); } /// <summary> /// Entry point into the command line interface. /// </summary> /// <param name="args">System provided command line arguments.</param> /// <returns>0 if successful, otherwise -1.</returns> internal int Run(string[] args) { try { long start = DateTime.Now.Ticks; CommandLineParser cmd = new CommandLineParser(); this.fofOption = cmd.AddParameterOption("fo"); this.pdfOption = cmd.AddOption("pdf"); this.helpOption = cmd.AddOption("h"); this.kerningOption = cmd.AddOption("kerning"); this.fontTypeOption = cmd.AddParameterOption("fonttype"); FonetDriver driver = FonetDriver.Make(); driver.OnError += new FonetDriver.FonetEventHandler(this.FonetError); // May throw a CommandLineException if arguments are unparseable cmd.Parse(args); Stream inputStream = null; Stream outputStream = null; if (this.helpOption.IsProvided) { this.PrintUsage(); return 0; } if (this.fofOption.IsProvided) { // The filename argument given to the -fo option string fofFilename = this.fofOption.Argument; try { // Attmept to open the source file inputStream = new FileStream( fofFilename, FileMode.Open, FileAccess.Read); } catch (Exception e) { throw new FonetException( String.Format("Unable to open file {0}", fofFilename), e); } } else { throw new FonetException("No input file specified"); } driver.Options = this.GetPdfRendererOptions(); string[] remainder = cmd.GetRemainder(); if (remainder.Length > 0) { string outputFile = remainder[0]; try { outputStream = new FileStream(outputFile, FileMode.Create); } catch (Exception e) { throw new FonetException( String.Format("Unable to open file {0}", outputFile), e); } } else { // Default to standard output outputStream = Console.OpenStandardOutput(); } driver.Render(inputStream, outputStream); long end = DateTime.Now.Ticks; Console.WriteLine("Took {0} ms.", (end - start) / 10000); } catch (CommandLineException cle) { Console.WriteLine("Incorrect commandline arguments: " + cle.Message); this.PrintUsage(); return -1; } catch (FonetException e) { Console.WriteLine("[ERROR] FO.NET failed to render your document: {0}", e.Message); return -1; } catch (Exception e) { Console.WriteLine("[ERROR] {0}", e.Message); return -1; } return 0; } /// <summary> /// Returns the PDF renderer options configured according to command line options. /// </summary> /// <returns>PDF render options configured according to command line options.</returns> private PdfRendererOptions GetPdfRendererOptions() { PdfRendererOptions options = new PdfRendererOptions(); // Enable/disable evil kerning options.Kerning = this.kerningOption.IsProvided; // Enum.Parse() will throw an exception if the fontTypeOption argument // does not represent one of the pre-defined FontType members if (this.fontTypeOption.IsProvided) { try { options.FontType = (FontType)Enum.Parse( typeof(FontType), this.fontTypeOption.Argument, true); } catch (Exception) { Console.WriteLine( "[WARN] Unrecognised -fonttype argument: '{0}' - defaulting to 'Link'", this.fontTypeOption.Argument); } } return options; } /// <summary> /// Receives any errors thrown by FO.NET. /// </summary> /// <param name="driver">A reference to a driver.</param> /// <param name="e">The event arguments.</param> private void FonetError(object driver, FonetEventArgs e) { Console.WriteLine("[ERROR] {0}", e.GetMessage()); } /// <summary> /// Outputs command line interface help information. /// </summary> private void PrintUsage() { Console.WriteLine("Usage: fonet [-options]"); Console.WriteLine(String.Empty); Console.WriteLine("Where -options are:"); Console.WriteLine(" -kerning Enable kerning"); Console.WriteLine(" -fonttype <TrueType|Embed|Subset>"); Console.WriteLine(" Specifies how to handle TrueType fonts:"); Console.WriteLine(" Link - fonts are linked"); Console.WriteLine(" Embed - fonts are embedded in PDF"); Console.WriteLine(" Subset - fonts are subsetted and embedded in PDF"); Console.WriteLine(" -fo <filename>"); Console.WriteLine(" Path to an XSL-FO file"); Console.WriteLine(" -pdf <filename>"); Console.WriteLine(String.Empty); Console.WriteLine("Example:"); Console.WriteLine(String.Empty); Console.WriteLine("fonet -fo manual.fo -pdf manual.pdf"); Console.WriteLine(String.Empty); Console.WriteLine(" Transforms the XSL-FO document 'manual.fo' into the PDF"); Console.WriteLine(" document 'manual.pdf'"); } } }
using System.Collections; using System.Collections.Generic; using UnityEngine; public class LoopingOsc : MonoBehaviour { // Use this for initialization public float intensity = 1.0f; public float rate = 3.0f; float start; float iX; void Start () { start = Time.time; iX = GetComponent<RectTransform> ().localPosition.x; } // Update is called once per frame void Update () { var pos = GetComponent<RectTransform> ().localPosition; float x = (intensity * -Mathf.Cos (rate * (Time.time - start)) + 0.5f); GetComponent<RectTransform> ().localPosition = new Vector2 (iX + x, pos.y); } }
using System; using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Security.AccessControl; using System.Web; namespace ResTB.DB.Models { /// <summary> /// process dependent calculation parameters /// </summary> public class ObjectparameterPerProcess { public int ID { get; set; } public NatHazard NatHazard { get; set; } public Objectparameter Objektparameter { get; set; } // Vulnerability por intensidad public double VulnerabilityLow { get; set; } public double VulnerabilityMedium { get; set; } public double VulnerabilityHigh { get; set; } // Mortalidad por intensidad public double MortalityLow { get; set; } public double MortalityMedium { get; set; } public double MortalityHigh { get; set; } // Dano indirecto public double Value { get; set; } public string Unit { get; set; } //Vulnerability of indirect damage public double IndirectVulnerabilityLow { get; set; } public double IndirectVulnerabilityMedium { get; set; } public double IndirectVulnerabilityHigh { get; set; } // Duracion de dano indirecto public double DurationLow { get; set; } public double DurationMedium { get; set; } public double DurationHigh { get; set; } } }
using System; using System.Runtime.InteropServices; namespace RemoteControlSystem.ClientMessage { [Guid("F3B5D2EE-A02A-4c8c-89A1-319B525DD1C7")] [Serializable] public sealed class ControlEnterMessage { } }
using System.Reflection; using System.Windows; using System.Windows.Controls; using FlaUInspect.ViewModels; namespace FlaUInspect.Views { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow { private readonly MainViewModel _vm; public MainWindow() { InitializeComponent(); AppendVersionToTitle(); Height = 550; Width = 700; Loaded += MainWindow_Loaded; _vm = new MainViewModel(); DataContext = _vm; } private void AppendVersionToTitle() { var attr = Assembly.GetEntryAssembly().GetCustomAttribute(typeof(AssemblyInformationalVersionAttribute)) as AssemblyInformationalVersionAttribute; if (attr != null) { Title += " v" + attr.InformationalVersion; } } private void MainWindow_Loaded(object sender, System.EventArgs e) { if (!_vm.IsInitialized) { var dlg = new ChooseVersionWindow { Owner = this }; if (dlg.ShowDialog() != true) { Close(); } _vm.Initialize(dlg.SelectedAutomationType); Loaded -= MainWindow_Loaded; } } private void MenuItem_Click(object sender, RoutedEventArgs e) { Close(); } private void TreeViewSelectedHandler(object sender, RoutedEventArgs e) { var item = sender as TreeViewItem; if (item != null) { item.BringIntoView(); e.Handled = true; } } } }
public static class DungeonTextExtension { public enum RoomType { LesserMob, Boss, Start, Finish, Loot } public enum TextType { RoomEnter, Greeting, Main, Question, Success, Failure, Dismissal, RoomLeave } }
using System; using UnityEngine; using SA.Android.Editor; using SA.iOS.Editor; namespace SA.CrossPlatform.Editor { [Serializable] class UM_ExportedSettings { public string Settings => m_Settings; public AN_ExportedSettings AndroidSettings => m_AndroidSettings; public ISN_ExportedSettings ISNSettings => m_ISNSettings; [SerializeField] string m_Settings; [SerializeField] AN_ExportedSettings m_AndroidSettings; [SerializeField] ISN_ExportedSettings m_ISNSettings; public UM_ExportedSettings() { m_Settings = JsonUtility.ToJson(UM_Settings.Instance); m_AndroidSettings = AN_SettingsManager.GetExportedSettings(); m_ISNSettings = ISN_SettingsManager.GetExportedSettings(); } } }
using System; using System.ComponentModel; using System.Linq; using System.Reactive.Linq; using System.Reactive.Threading.Tasks; using System.Threading.Tasks; using Toaster.Interfaces; namespace Toaster.WebAPI { /// <summary> /// Monitor the toaster status. Supports long polling. /// </summary> public class ToasterStatusMonitor : IDisposable, IToasterStatusMonitor { /// <summary> /// We are watching the toaster status. /// </summary> IToaster _toaster; /// <summary> /// Track if the status has changed since the last time the client retrieved it. /// </summary> bool _changed; /// <summary> /// Status property names. /// </summary> static readonly string[] _statusProperties = { "Setting", "Content", "Toasting", "Color" }; /// <summary> /// Observable for toaster status property changes. /// </summary> IObservable<string> _statusChanged; /// <summary> /// Subscription to status changed. /// </summary> IDisposable _subscribeStatusChanged; /// <summary> /// Initialize the status monitor. /// </summary> /// <param name="toaster"></param> public ToasterStatusMonitor(IToaster toaster) { _toaster = toaster; _statusChanged = FromPropertyChanged(_toaster) .Where(name => _statusProperties.Contains(name)); _subscribeStatusChanged = _statusChanged //.Do(name => Console.WriteLine("Property {0} changed", name)) .Do(name => { _changed = true; }) .Subscribe(); } /// <summary> /// Observe property changes. /// </summary> /// <param name="source">Object to observe. </param> /// <returns>Observable sequence of property names. </returns> static IObservable<string> FromPropertyChanged(INotifyPropertyChanged source) { return Observable.FromEventPattern<PropertyChangedEventHandler, PropertyChangedEventArgs>( handler => source.PropertyChanged += handler, handler => source.PropertyChanged -= handler) .Select(x => x.EventArgs.PropertyName); } /// <summary> /// Get the toaster status. /// </summary> /// <returns>Toaster status. </returns> ToasterStatus GetToasterStatus() { return new ToasterStatus { setting = _toaster.Setting, content = _toaster.Content, toasting = _toaster.Toasting, color = _toaster.Color }; } /// <summary> /// Get a task to wait for the toaster status. /// </summary> /// <param name="timeout">Timeout in milliseconds. </param> /// <returns>Task to wait for the toaster status. </returns> public Task<ToasterStatus> GetToasterStatusAsync(int timeout) { if (_changed || (timeout <= 0)) { //Console.WriteLine("Getting status immediately"); _changed = false; return Task.FromResult(GetToasterStatus()); } //Console.WriteLine("Waiting for status {0} msec", timeout); return _statusChanged .Throttle(TimeSpan.FromMilliseconds(5)) .Timeout(TimeSpan.FromMilliseconds(timeout), Observable.Return("(timed out)")) //.Do(name => Console.WriteLine("Getting status for {0}", name)) .Select(name => GetToasterStatus()) .Take(1) .Do(status => { _changed = false; }) .ToTask(); } #region IDisposable Support protected virtual void Dispose(bool disposing) { if (disposing) { // Dispose managed state (managed objects). if (_subscribeStatusChanged != null) { _subscribeStatusChanged.Dispose(); _subscribeStatusChanged = null; } } } // TODO: override a finalizer only if Dispose(bool disposing) above has code to free unmanaged resources. // ~ObservableStatus() { // // Do not change this code. Put cleanup code in Dispose(bool disposing) above. // Dispose(false); // } // This code added to correctly implement the disposable pattern. public void Dispose() { // Do not change this code. Put cleanup code in Dispose(bool disposing) above. Dispose(true); // TODO: uncomment the following line if the finalizer is overridden above. // GC.SuppressFinalize(this); } #endregion } }
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using BethanysPieShop.Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; namespace BethanysPieShop.Controllers { public class OrderController : Controller { private readonly IOrderRepository _orderRepository; private readonly ShoppingCart _shoppingCart; public OrderController(IOrderRepository orderRepository,ShoppingCart shoppingcart) { _orderRepository = orderRepository; _shoppingCart = shoppingcart; } public IActionResult Checkout() { return View(); } public IActionResult Index() { return View(); } [HttpPost] public IActionResult Checkout(Order order) { var items = _shoppingCart.GetShoppingCartItems(); _shoppingCart.ShoppingCartItems = items; if (_shoppingCart.ShoppingCartItems.Count == 0) { ModelState.AddModelError("", "Your cart is empty, add some pies first"); } if (ModelState.IsValid) { _orderRepository.CreateOrder(order); _shoppingCart.ClearCart(); return RedirectToAction("CheckoutComplete"); } return View(order); } public IActionResult CheckoutComplete() { ViewBag.CheckoutCompleteMessage = HttpContext.User.Identity.Name + ", thanks for your order. You'll soon enjoy our delicious pies!"; return View(); } } }
using System; using System.Runtime.Serialization; namespace SlnParser.Contracts.Exceptions { /// <summary> /// An <see cref="Exception" /> that describes an unexpected structure of a Solution /// </summary> [Serializable] public class UnexpectedSolutionStructureException : Exception { /// <summary> /// Creates a new instance of <see cref="UnexpectedSolutionStructureException" /> /// </summary> /// <param name="message">The message why the structure is unexpected</param> public UnexpectedSolutionStructureException(string message) : base(message) { } /// <summary> /// Creates a new instance of <see cref="UnexpectedSolutionStructureException" /> /// </summary> /// <param name="message">The message why the structure is unexpected</param> /// <param name="inner">The inner <see cref="Exception" /></param> public UnexpectedSolutionStructureException(string message, Exception inner) : base(message, inner) { } /// <inheritdoc /> protected UnexpectedSolutionStructureException( SerializationInfo info, StreamingContext context) : base(info, context) { } } }
using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using HarmonyLib; namespace SolastaCommunityExpansion.Patches.Encounters { [HarmonyPatch(typeof(GameLocationBattle), "GetMyContenders")] [SuppressMessage("Minor Code Smell", "S101:Types should be named in PascalCase", Justification = "Patch")] internal static class GameLocationBattle_GetMyContenders { internal static void Postfix(GameLocationBattle __instance, ref List<GameLocationCharacter> __result) { if (!Main.Settings.EnableEnemiesControlledByPlayer || __instance == null) { return; } var gameLocationCharacterService = ServiceRepository.GetService<IGameLocationCharacterService>(); if (!gameLocationCharacterService.PartyCharacters.Contains(__instance.ActiveContender) && !gameLocationCharacterService.GuestCharacters.Contains(__instance.ActiveContender)) { __result = __instance.EnemyContenders; } } } [HarmonyPatch(typeof(GameLocationBattle), "GetOpposingContenders")] [SuppressMessage("Minor Code Smell", "S101:Types should be named in PascalCase", Justification = "Patch")] internal static class GameLocationBattle_GetOpposingContenders { internal static void Postfix(GameLocationBattle __instance, ref List<GameLocationCharacter> __result) { if (!Main.Settings.EnableEnemiesControlledByPlayer || __instance == null) { return; } var gameLocationCharacterService = ServiceRepository.GetService<IGameLocationCharacterService>(); if (!gameLocationCharacterService.PartyCharacters.Contains(__instance.ActiveContender) && !gameLocationCharacterService.GuestCharacters.Contains(__instance.ActiveContender)) { __result = __instance.PlayerContenders; } } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using LentoCore.Util; namespace LentoCore.Evaluator { public class TokenizeDoneEventArgs : EventArgs { public TokenStream TokenStream { get; } public TokenizeDoneEventArgs(TokenStream tokenStream) { TokenStream = tokenStream; } } }
using System; namespace Toggl.Foundation.Analytics { public enum LoginErrorSource { InvalidEmailOrPassword, GoogleLoginError, Offline, ServerError, MissingApiToken, Other } }
using SFA.DAS.AssessorService.Api.Types.Models.Dashboard; namespace SFA.DAS.AssessorService.Application.Api.Client.Clients { public interface IDashboardApiClient { System.Threading.Tasks.Task<GetEpaoDashboardResponse> GetEpaoDashboard(string epaoId); } }
using System.Collections; using System.Collections.Generic; using UnityEngine; using BaroqueUI; public class UnknownBox : MonoBehaviour { public Material activeMat, defaultMat, probablyBombMat, extraLightMat, probablyBombExtraLightMat; public bool probablyBomb; public Vector3Int position; public Mines mines; bool _hover; void Start() { var ht = Controller.HoverTracker(this); ht.onEnter += Ht_onEnter; ht.onLeave += Ht_onLeave; ht.onTriggerDown += Ht_onTriggerDown; ht.onTouchPressDown += Ht_onTouchPressDown; } private void Ht_onTouchPressDown(Controller controller) { probablyBomb = !probablyBomb; UpdateMaterial(); } private void Ht_onTriggerDown(Controller controller) { if (probablyBomb) return; mines.Click(transform); } private void Ht_onEnter(Controller controller) { _hover = true; UpdateMaterial(); } private void Ht_onLeave(Controller controller) { _hover = false; UpdateMaterial(); } bool ReceiveExtraLight() { foreach (var pos in mines.Neighbors(position)) { var digitbox = mines.GetCellComponent<DigitBox>(pos); if (digitbox != null && digitbox.emit_extra_light) return true; } return false; } public void UpdateMaterial() { Material mat; if (probablyBomb) mat = ReceiveExtraLight() ? probablyBombExtraLightMat : probablyBombMat; else if (_hover) mat = activeMat; else mat = ReceiveExtraLight() ? extraLightMat : defaultMat; GetComponent<Renderer>().sharedMaterial = mat; } }
// JAMBOX // General purpose game code for Unity // Copyright (c) 2021 Ted Brown using System; using System.Collections; using System.Collections.Generic; using UnityEngine; namespace Jambox { /// <summary> /// /// </summary> public class FpsTrigger : MonoBehaviour { public Action OnInteract; public bool _automaticInteraction; public string _requiredKeycardId; public string _prompt; public string _lockPrompt; private bool _hasBeenUsed; private LayerMask _heroLayer; private void Activate () { if (OnInteract != null) { OnInteract(); } _hasBeenUsed = true; FpsHud.Prompt.Hide(); FpsHud.Message.Hide(); enabled = false; } protected void Awake () { _heroLayer = LayerMask.NameToLayer("Hero"); enabled = false; } protected void OnTriggerEnter (Collider collider) { if (_hasBeenUsed || collider.gameObject.layer != _heroLayer) { return; } if (FpsHero.Instance.HasKeycard(_requiredKeycardId) == false) { FpsHud.Message.Show(_lockPrompt); return; } if (_automaticInteraction) { Activate(); } else { FpsHud.Prompt.Show(FpsControl.GetKeyboardInput(FpsInput.Interact), _prompt); enabled = true; } } protected void OnTriggerExit (Collider collider) { if (collider.gameObject.layer == _heroLayer) { FpsHud.Message.Hide(); FpsHud.Prompt.Hide(); enabled = false; } } protected void Update () { if (FpsControl.WasPressedThisFrame(FpsInput.Interact)) { Activate(); } } } }
using System; using System.Collections.Generic; using Starship.Core.Extensions; namespace Starship.Core.Security { public class PermissionContext { public PermissionContext() { Permissions = new Dictionary<Type, Dictionary<string, Permission>>(); } public PermissionTypes Get(Type type, string key) { if (Permissions.ContainsKey(type)) { if (key.IsEmpty() || Permissions[type].ContainsKey(key)) { return Permissions[type][key].Type; } } return PermissionTypes.None; } public void Set(Type type, PermissionTypes permissionType, string key) { if (!Permissions.ContainsKey(type)) { Permissions.Add(type, new Dictionary<string, Permission>()); } var permission = Permissions[type]; if (!permission.ContainsKey(key)) { permission.Add(key, new Permission()); } permission[key].Type = permissionType; } private Dictionary<Type, Dictionary<string, Permission>> Permissions { get; set; } } }
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) using System; using System.EnterpriseServices.Internal; namespace ICSharpCode.AspNet.Mvc { public class IIS6Administrator : IISAdministrator { const string IIS_WEB_LOCATION = "IIS://localhost/W3SVC/1/Root"; public IIS6Administrator(WebProjectProperties properties) : base(properties) { } public override bool IsIISInstalled() { return WebProjectService.IsIISInstalled; } public override void CreateVirtualDirectory(WebProject project) { string error = null; var virtualRoot = new IISVirtualRoot(); virtualRoot.Create(IIS_WEB_LOCATION, project.Directory, project.Name, out error); if (!String.IsNullOrEmpty(error)) { throw new ApplicationException(error); } } } }
using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Text; namespace WpfHexEditor.Sample.MVVM.Contracts.Hex { /// <summary> /// This interface parse the stream to custom Seagments; /// </summary> public interface IStreamToSeagmentsParser { /// <summary> /// The parser will parse the stream to seagments if succeed,otherwise,null will be returned. /// </summary> /// <param name="stream"></param> /// <returns></returns> ParsedInfo ParseStream(Stream stream); } /// <summary> /// The description info of <see cref="IStreamToSeagmentsParser"/> /// </summary> public interface IStreamToSeagmentsParserMetaData { int Order { get; } } [MetadataAttribute,AttributeUsage(AttributeTargets.Class,AllowMultiple = false)] public sealed class ExportStreamToSeagmentsParserAttribute : ExportAttribute,IStreamToSeagmentsParserMetaData { public ExportStreamToSeagmentsParserAttribute():base(typeof(IStreamToSeagmentsParser)) { } public int Order { get; set; } } }