content
stringlengths
23
1.05M
using MediatR; namespace SFA.DAS.ProviderPayments.Calc.ManualAdjustments.Application.ReversePaymentCommand { public class ReversePaymentCommandRequest : IRequest<ReversePaymentCommandResponse> { public string RequiredPaymentIdToReverse { get; set; } public string YearOfCollection { get; set; } } }
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; using Scheduler.Domain.Entities; namespace Scheduler.Persistence.Configurations { public class JobConfiguration : IEntityTypeConfiguration<Job> { public void Configure(EntityTypeBuilder<Job> builder) { builder.Property(j => j.JobNumber) .IsRequired() .HasMaxLength(10); builder.Property(j => j.Description) .IsRequired() .HasMaxLength(160); builder.Property(j => j.Location) .IsRequired() .HasMaxLength(50); } } }
using Microsoft.JSInterop; using Entity = Store.Shared.Entities.Faq; namespace Store.Client.Pages.Help; [Route(Url)] public partial class Faq : IAsyncDisposable { public const string Seo = "faq"; public const string Url = $"{Help.Url}/{Seo}"; private List<Breadcrumb>? _breadcrumbs; private IReadOnlyCollection<Entity>? _questions; private IJSObjectReference? _module; [Inject] public IFaqService Service { get; init; } = null!; [Inject] public IStringLocalizer<Faq> Text { get; init; } = null!; [Inject] public IStringLocalizer<Contacts> ContactsText { get; init; } = null!; [Inject] public IStringLocalizer<Help> HelpText { get; init; } = null!; [Inject] public IJSRuntime JS { get; init; } = null!; protected override void OnInitialized() { _breadcrumbs = new() { new Breadcrumb(HelpText["HeadingTitle"], Help.Url), new Breadcrumb(Text["HeadingTitle"], Url) }; } protected override async Task OnInitializedAsync() { _questions = await Service.GetForBlockAsync(3); } protected override async Task OnAfterRenderAsync(bool firstRender) { if (firstRender) { _module = await JS.InvokeAsync<IJSObjectReference>("import", "./Pages/Help/Faq.razor.js"); } SetSchemaAttributes(); } private async void SetSchemaAttributes() { if (_module is not null) { await _module.InvokeVoidAsync("setSchemaAttributes"); } } private async void RemoveSchemaAttributes() { if (_module is not null) { await _module.InvokeVoidAsync("removeSchemaAttributes"); } } public async ValueTask DisposeAsync() { if (_module is not null) { RemoveSchemaAttributes(); await _module.DisposeAsync(); } } }
/* This code is derived from jgit (http://eclipse.org/jgit). Copyright owners are documented in jgit's IP log. This program and the accompanying materials are made available under the terms of the Eclipse Distribution License v1.0 which accompanies this distribution, is reproduced below, and is available at http://www.eclipse.org/org/documents/edl-v10.php All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of the Eclipse Foundation, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ using NGit; using Sharpen; namespace NGit { [NUnit.Framework.TestFixture] public class ObjectIdTest { [NUnit.Framework.Test] public virtual void Test001_toString() { string x = "def4c620bc3713bb1bb26b808ec9312548e73946"; ObjectId oid = ObjectId.FromString(x); NUnit.Framework.Assert.AreEqual(x, oid.Name); } [NUnit.Framework.Test] public virtual void Test002_toString() { string x = "ff00eedd003713bb1bb26b808ec9312548e73946"; ObjectId oid = ObjectId.FromString(x); NUnit.Framework.Assert.AreEqual(x, oid.Name); } [NUnit.Framework.Test] public virtual void Test003_equals() { string x = "def4c620bc3713bb1bb26b808ec9312548e73946"; ObjectId a = ObjectId.FromString(x); ObjectId b = ObjectId.FromString(x); NUnit.Framework.Assert.AreEqual(a.GetHashCode(), b.GetHashCode()); NUnit.Framework.Assert.AreEqual(b, a, "a and b are same"); } [NUnit.Framework.Test] public virtual void Test004_isId() { NUnit.Framework.Assert.IsTrue(ObjectId.IsId("def4c620bc3713bb1bb26b808ec9312548e73946" ), "valid id"); } [NUnit.Framework.Test] public virtual void Test005_notIsId() { NUnit.Framework.Assert.IsFalse(ObjectId.IsId("bob"), "bob is not an id"); } [NUnit.Framework.Test] public virtual void Test006_notIsId() { NUnit.Framework.Assert.IsFalse(ObjectId.IsId("def4c620bc3713bb1bb26b808ec9312548e7394" ), "39 digits is not an id"); } [NUnit.Framework.Test] public virtual void Test007_isId() { NUnit.Framework.Assert.IsTrue(ObjectId.IsId("Def4c620bc3713bb1bb26b808ec9312548e73946" ), "uppercase is accepted"); } [NUnit.Framework.Test] public virtual void Test008_notIsId() { NUnit.Framework.Assert.IsFalse(ObjectId.IsId("gef4c620bc3713bb1bb26b808ec9312548e73946" ), "g is not a valid hex digit"); } [NUnit.Framework.Test] public virtual void Test009_toString() { string x = "ff00eedd003713bb1bb26b808ec9312548e73946"; ObjectId oid = ObjectId.FromString(x); NUnit.Framework.Assert.AreEqual(x, ObjectId.ToString(oid)); } [NUnit.Framework.Test] public virtual void Test010_toString() { string x = "0000000000000000000000000000000000000000"; NUnit.Framework.Assert.AreEqual(x, ObjectId.ToString(null)); } [NUnit.Framework.Test] public virtual void Test011_toString() { string x = "0123456789ABCDEFabcdef1234567890abcdefAB"; ObjectId oid = ObjectId.FromString(x); NUnit.Framework.Assert.AreEqual(x.ToLower(), oid.Name); } [NUnit.Framework.Test] public virtual void TestGetByte() { byte[] raw = new byte[20]; for (int i = 0; i < 20; i++) { raw[i] = unchecked((byte)(unchecked((int)(0xa0)) + i)); } ObjectId id = ObjectId.FromRaw(raw); NUnit.Framework.Assert.AreEqual(raw[0] & unchecked((int)(0xff)), id.FirstByte); NUnit.Framework.Assert.AreEqual(raw[0] & unchecked((int)(0xff)), id.GetByte(0)); NUnit.Framework.Assert.AreEqual(raw[1] & unchecked((int)(0xff)), id.GetByte(1)); for (int i_1 = 2; i_1 < 20; i_1++) { NUnit.Framework.Assert.AreEqual(raw[i_1] & unchecked((int)(0xff)), id.GetByte(i_1 ), "index " + i_1); } } [NUnit.Framework.Test] public virtual void TestSetByte() { byte[] exp = new byte[20]; for (int i = 0; i < 20; i++) { exp[i] = unchecked((byte)(unchecked((int)(0xa0)) + i)); } MutableObjectId id = new MutableObjectId(); id.FromRaw(exp); NUnit.Framework.Assert.AreEqual(ObjectId.FromRaw(exp).Name, id.Name); id.SetByte(0, unchecked((int)(0x10))); NUnit.Framework.Assert.AreEqual(unchecked((int)(0x10)), id.GetByte(0)); exp[0] = unchecked((int)(0x10)); NUnit.Framework.Assert.AreEqual(ObjectId.FromRaw(exp).Name, id.Name); for (int p = 1; p < 20; p++) { id.SetByte(p, unchecked((int)(0x10)) + p); NUnit.Framework.Assert.AreEqual(unchecked((int)(0x10)) + p, id.GetByte(p)); exp[p] = unchecked((byte)(unchecked((int)(0x10)) + p)); NUnit.Framework.Assert.AreEqual(ObjectId.FromRaw(exp).Name, id.Name); } for (int p_1 = 0; p_1 < 20; p_1++) { id.SetByte(p_1, unchecked((int)(0x80)) + p_1); NUnit.Framework.Assert.AreEqual(unchecked((int)(0x80)) + p_1, id.GetByte(p_1)); exp[p_1] = unchecked((byte)(unchecked((int)(0x80)) + p_1)); NUnit.Framework.Assert.AreEqual(ObjectId.FromRaw(exp).Name, id.Name); } } } }
namespace XInputAssistManager { public enum InputCode { deside, cancel, dash, attack, dodge, lockon, jump, guard, sliding, hold, END, } }
using System; using Collections.Pooled; using revghost.Injection.Dependencies; namespace revghost.Injection; public struct ValueDependencyCollection<TContext> : IDependencyCollection where TContext : IReadOnlyContext { private readonly PooledList<IDependency> _dependencies; private readonly TContext _context; public ValueDependencyCollection(TContext context, int capacity = 0) { _context = context; _dependencies = new PooledList<IDependency>(capacity); } public ReadOnlySpan<IDependency> Dependencies => _dependencies.Span; public void Add(IDependency dependency) { if (_dependencies is null) throw new InvalidOperationException($"{nameof(ValueDependencyCollection<TContext>)} was not setup"); _dependencies.Add(dependency); } public bool TryResolve(out bool canStillBeResolvedSynchronously) { if (_dependencies is null) throw new InvalidOperationException($"{nameof(ValueDependencyCollection<TContext>)} was not setup"); canStillBeResolvedSynchronously = _dependencies.Count > 0; var depCount = _dependencies.Count; while (depCount-- > 0) { if (_dependencies[0].IsResolved) continue; try { _dependencies[0].Resolve(_context); } catch (Exception ex) { _dependencies[0].ResolveException = ex; } if (!_dependencies[0].IsResolved) canStillBeResolvedSynchronously = false; } if (canStillBeResolvedSynchronously) _dependencies.Clear(); return _dependencies.Count == 0; } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace My_library { public static class MyGPA { /// <summary> /// Calculate grade from score /// </summary> /// <param name="score">student score</param> /// <returns>Grade from score</returns> public static string calculateGrade(double score) { /* if (score >= 50) { return "s"; } else { return "F"; } */ return score >= 50 ? "S":"F"; } } }
using Newtonsoft.Json; using System; using System.Net.Http; using System.Threading.Tasks; namespace SpecFlow.AutoFixture.Tests { public static class HttpClientExtensions { public static async Task<(T Result, HttpResponseMessage Response)> GetJsonResult<T>( this HttpClient source, string url, HttpMethod? method = null, object? content = null) { var request = new HttpRequestMessage(method ?? HttpMethod.Get, url) { Content = content == null ? null : new JsonContent(content) }; var response = await source.SendAsync(request); response.EnsureSuccessStatusCode(); var dto = await response.ContentAs<T>(); return (dto, response); } public static async Task<HttpResponseMessage> SendJsonContent( this HttpClient source, string url, HttpMethod method, object content, bool ensureSuccess = true) { var request = new HttpRequestMessage(method, url) { Content = content == null ? null : new JsonContent(content) }; var response = await source.SendAsync(request); if (ensureSuccess) { response.EnsureSuccessStatusCode(); } return response; } public static async Task<T> ContentAs<T>(this HttpResponseMessage response) { var respContent = await response.Content.ReadAsStringAsync(); var settings = new JsonSerializerSettings(); return JsonConvert.DeserializeObject<T>(respContent, settings); } public static async Task<Guid> ContentAsGuid(this HttpResponseMessage response) { var respContent = await response.Content.ReadAsStringAsync(); return Guid.Parse(respContent); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace BusinessObjectLayer.Progressive.OnlineShop.V2.Part5 { // Resp: encaps. order details. public class OnlineOrder { public string OrderId { get; } public DateTime Created { get; } public decimal Total { get; } public bool Paid { get; internal set; } public List<OnlineBasketItem> Items { get; } public OnlineOrder(List<OnlineBasketItem> items) { Items = items; Total = items.Sum(item => item.Quantity * item.Product.Price); Created = DateTime.Now; OrderId = Guid.NewGuid().ToString(); } } }
using Datagrid.Net.Enums; using System; namespace Datagrid.Net.Attributes { [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] public class OrderByAttribute : Attribute { public readonly string ColumnName; public readonly SortDirection Direction; public OrderByAttribute(string columnName, SortDirection direction) { ColumnName = columnName; Direction = direction; } } }
namespace ULIB { /// <summary> /// /// </summary> public static class UPluginType { /// <summary> /// Plugin type for used in PluginManager /// </summary> public const string Plugin = "UPlugin"; /// <summary> /// Plugin type for used in Serializer /// </summary> public const string Serialize = "USerialize"; /// <summary> /// Plugin type for used in LanguageManager /// </summary> public const string Language = "ULanguage"; /// <summary> /// Plugin type for used in Gateway /// </summary> public const string Gateway = "UGateway"; /// <summary> /// Plugin type for used in FileManager /// </summary> public const string File = "UFile"; /// <summary> /// Plugin type for used in QualityManager /// </summary> public const string Quality = "UQuality"; } }
using UnityEngine; namespace ProceduralCharacter.Movement { [RequireComponent(typeof(MovementController), typeof(MovementInterpreter), typeof(MovementFloatRide))] public class MovementCrouch : MonoBehaviour { #region Variables (PRIVATE) MovementController _MC; MovementFloatRide _MFR; MovementInterpreter _Input; [SerializeField, Min(0)] float _crouchRideHeightMultiplier = 0.5f; [SerializeField, Min(0)] float _crouchSpeedMultiplier = 0.5f; #endregion #region Properties (PUBLIC) public float CrouchRideMultiplier => _crouchRideHeightMultiplier; public float CrouchSpeedMultiploer => _crouchSpeedMultiplier; #endregion #region Unity Methods // Start is called before the first frame update private void Start() { _MC = GetComponent<MovementController>(); _MFR = GetComponent<MovementFloatRide>(); _Input = GetComponent<MovementInterpreter>(); } private void Update() { if (_Input.Crouch) { _MFR.RideHeightMultiplier = _crouchRideHeightMultiplier; _MC.DefaultSpeedMultiplier = _crouchSpeedMultiplier; } } #endregion #region Methods #endregion } }
using Thinktecture.IdentityServer.Models.Configuration; namespace Thinktecture.Samples { class WSTrust : WSTrustConfiguration { public WSTrust() { Enabled = false; } } }
using System; using System.Collections.Generic; using System.Data; using System.IO; using System.Net; using System.Text; using System.Xml; using System.Xml.Serialization; namespace ConfigApp.Helpers { public static class XMLHelper { #region public Methods public static IDictionary<String, Int32> columnDictionary = null; /// <summary> /// Generic method for the Get response From API /// </summary> /// <param name="type">Type of the Object</param> /// <param name="webServiceUrl">Api Url</param> /// <returns></returns> public static object XmlDeserializeObject(Type type, string webServiceUrl) { Object result = null; var request = (HttpWebRequest)WebRequest.Create(webServiceUrl); request.UserAgent = Constants.USER_AGENT; request.Method = Constants.METHOD_GET; request.Accept = Constants.REQUEST_ACCESPT_XML; request.Credentials = new NetworkCredential(Constants.API_USER_NAME, Constants.API_PASSWORD); request.ContentType = Constants.REQUEST_CONTENT_TYPE; try { var response = (HttpWebResponse)request.GetResponse(); if (response.StatusCode != HttpStatusCode.OK) return null; var dataStream = response.GetResponseStream(); var xSerializer = new XmlSerializer(type); if (dataStream != null) { result = xSerializer.Deserialize(dataStream); } } catch (Exception exception) { // Need to Log exception } return result; } /// <summary> /// Output the result in either XML or Json format. /// </summary> /// <param name="data"></param> /// <returns></returns> public static string FormatXMLString(string data) { XmlTextWriter xmlWriter = null; try { if (!string.IsNullOrWhiteSpace(data)) { XmlDocument xmlResponse = new XmlDocument(); xmlResponse.LoadXml(data); // Output formatted XML StringBuilder xmlString = new StringBuilder(); StringWriter stringWriter = new StringWriter(xmlString); xmlWriter = new XmlTextWriter(stringWriter); xmlWriter.Formatting = Formatting.Indented; xmlResponse.WriteTo(xmlWriter); return xmlString.ToString(); } return ""; } finally { if (xmlWriter != null) xmlWriter.Close(); } } /// <summary> /// Output the result in either XML or Json format. /// </summary> /// <param name="data"></param> /// <returns></returns> public static string FormatJSONString(string data) { try { if (!string.IsNullOrWhiteSpace(data)) { return data; } return ""; } finally { } } /// <summary> /// This will convert xml node to class properites /// </summary> /// <param name="source"></param> /// <param name="destination"></param> /// <returns></returns> public static object ConvertXMLToObject(XmlNode source, object destination) { foreach (XmlNode item in source.ChildNodes) { var info = destination.GetType().GetProperty(item.Name); if (info != null) { info.SetValue(destination, item.InnerText, null); } } return destination; } public static object ToObject(DataTable table, object destination) { return destination; } public static string ToString(this System.Xml.XmlNodeList nodeList, int indentation = 0) { String returnStr = ""; if (nodeList != null) { foreach (XmlNode node in nodeList) { returnStr += node.OuterXml; } } return returnStr; } #endregion } }
using System; using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Web; /// <summary> /// Summary description for ConvertHtmlToImage /// </summary> public class ConvertHtmlToImage { public ConvertHtmlToImage() { // // TODO: Add constructor logic here // } public void ConvertHtmlToImage1() { //Bitmap m_Bitmap = new Bitmap(400, 600); //PointF point = new PointF(0, 0); //SizeF maxSize = new System.Drawing.SizeF(500, 500); //TheArtOfDev.HtmlRenderer.HtmlRender.Render(Graphics.FromImage(m_Bitmap), // "<html><body><p>This is a shitty html code</p>" // + "<p>This is another html line</p></body>", // point, maxSize); //m_Bitmap.Save(@"C:\Test.png", ImageFormat.Png); } }
namespace Passingwind.Blog.MetaWeblog { /// <summary> /// MetaWeblog MediaInfo struct /// returned from NewMediaObject call /// </summary> public struct MWAMediaInfo { #region Constants and Fields /// <summary> /// Url that points to Saved MediaObejct /// </summary> public string url; #endregion } }
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.UI; public class LevelEvent : MonoBehaviour { [Header("Unlocked Level")] public GameObject[] unlockLevel; [Header("Locked Level")] public GameObject[] lockedLevel; public GameObject loadingImage; public Animator loadingBar; // waktu transisi public float transitionTime = 7f; public Level level; // kalo 1 berarti EZ kalo 2 berarti medium kalo 3 berarti hard public int LevelDiff = 1; void OnEnable() { // ganti level muncul atau kaga switch (LevelDiff) { case 1: LevelObject(lockedLevel, unlockLevel, lockedLevel.Length, level.easy+1); break; case 2: LevelObject(lockedLevel, unlockLevel, lockedLevel.Length, level.medium+1); break; case 3: LevelObject(lockedLevel, unlockLevel, lockedLevel.Length, level.hard+1); break; default: Debug.LogError("Level Difficult only 1-3 values will selected"); break; } } // ganti level muncul atau kaga private void LevelObject(GameObject[] lockObj, GameObject[] unlockObj, int levelLength, int currentLevel) { // bool dikunci atau pun tidak di level bool isUnlocked = true; bool isLocked = false; // pilih level yang gk dikunci for (int i = 0; i < levelLength; i++) { for (int b = 0; b < currentLevel; b++) { // ubah set active untuk yang dikunci maupun tidak unlockObj[b].SetActive(isUnlocked); lockObj[b].SetActive(isLocked); } } // pesan debug Debug.Log("level unclocked: " + level.easy.ToString()); } // ubah value level ketika masuk level public void LevelEasy(int currentLevel) { LevelManager1.currentEasyLevel = currentLevel; Debug.Log("selecting easy level: " + currentLevel.ToString()); StartCoroutine(loadingScene("easy-level")); } // ubah value level ketika masuk level public void LevelMedium(int currentLevel) { LevelManager1.currentMediumLevel = currentLevel; Debug.Log("selecting medium level: " + currentLevel.ToString()); StartCoroutine(loadingScene("medium-level")); } // ubah value level ketika masuk level public void LevelHard(int currentLevel) { LevelManager1.currentHardLevel = currentLevel; Debug.Log("selecting hard level: " + currentLevel.ToString()); StartCoroutine(loadingScene("hard-level")); } // loading scene IEnumerator loadingScene(string scene) { loadingImage.SetActive(true); loadingBar.SetTrigger("Loading"); yield return new WaitForSeconds(transitionTime); SceneManager.LoadScene(scene); } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Data.SqlClient; using System.Configuration; using System.Data; namespace UserProvider { public class User { public int id { get; set; } public string Ddid { get; set; } public string Name { get; set; } public string DeptName { get; set; } } public class UserProvider { public static List<User> GetDdUserList() { ConnectionStringSettings settings = ConfigurationManager.ConnectionStrings["UserConnection"]; string str = settings.ConnectionString; string sqlcom = "SELECT Id, UserName AS Name, DepartName, DdId FROM Users WHERE IsDelete =0 "; SqlConnection sc = new SqlConnection(str); SqlDataAdapter sda = new SqlDataAdapter(sqlcom, sc); DataSet ds = new DataSet(); sda.Fill(ds); List<User> nl = new List<User>(); DataTable dt = ds.Tables[0]; foreach (DataRow dr in dt.Rows) { User u = new User { id = int.Parse(dr["Id"].ToString()), Name = dr["Name"].ToString(), Ddid = dr["DdId"].ToString() }; string dept = dr["DepartName"].ToString(); dept = dept.Replace('&', '-'); string[] aa = dept.Split(','); u.DeptName = aa[0]; nl.Add(u); } return nl; } } }
using PraksaMid; using PraksaMid.Model; using System; using System.Web.UI.WebControls; namespace PraksaFront { public partial class AttendanceInterest : System.Web.UI.Page { protected int workId = 0; protected void Page_Load(object sender, EventArgs e) { Logic.SessionManager.See(); if (Request.QueryString["workId"] != "") workId = Convert.ToInt16(Request.QueryString["workId"]); if (!IsPostBack) { GetAttendants(); } } private void GetAttendants() { attendanceRepeater.DataSource = Attendant.GetAttendants(workId); attendanceRepeater.DataBind(); } } }
#if UNITY_EDITOR using UnityEditor; using UnityEngine; [CustomEditor(typeof(EventManager))] public class EventManagerEditor : Editor { public override void OnInspectorGUI() { DrawDefaultInspector(); EventManager script = (EventManager)target; if (GUILayout.Button("Fire Test Item Event")) { script.FireTestItemEvent(); } if (GUILayout.Button("Fire Test Skill Event")) { script.FireTestSkillUnlockedEvent(); } if (GUILayout.Button("Unlock ALL skills")) { script.TestUnlockAllSkills(); } if (GUILayout.Button("One of each item")) { script.AddOneOfEachItem(); } } } #endif
 using OpenQA.Selenium; using System; namespace Miharu2.BackEnd.Translation.WebCrawlers { class WCGoogleTranslator : WebCrawlerTranslator { private const string _URL = "https://translate.google.com/#view=home&op=translate&sl=ja&tl=en&text="; public WCGoogleTranslator(WebDriverManager webDriverManager) : base(webDriverManager) { } public override TranslationType Type { get { return TranslationType.Google_Web; } } protected override By FetchBy { get { return By.XPath("//div[@class='zkZ4Kc dHeVVb']"); } } protected override string GetUri(string text) { return _URL + Uri.EscapeDataString(text); } public override string ProcessResult(IWebElement result) { string res = ""; res += result.GetAttribute("data-text"); return res; } } }
using Microsoft.Xna.Framework.Graphics; using System; namespace ARPG.Entities.Sprites.Items.Misc { public class NullItem : Item { public NullItem(Texture2D tex, string name, int id) : base(tex, name, id) { } public override void OnUse() { throw new Exception("Almost Heavens, West Virginia... Blue-ridge mountains, Shenandoah River..."); } } }
using System; using Microsoft.VisualStudio.TestTools.UnitTesting; using TRL.Csharp.Collections; using TRL.Csharp.Models; using System.Collections.Generic; namespace TRL.Csharp.Test.Collections { [TestClass] public class GenericObservableListTests { private string LastTradedSymbol; private GenericObservableList<Trade> tradeList; private int MethodLaunchCounter; private void UpdateLastTradedSymbol(Trade trade) { LastTradedSymbol = trade.Symbol; MethodLaunchCounter++; } [TestInitialize] public void Setup() { tradeList = new GenericObservableList<Trade>(); tradeList.OnItemAdded += UpdateLastTradedSymbol; } [TestMethod] public void dont_throw_an_exception_when_event_is_not_assigned_test() { tradeList.OnItemAdded -= UpdateLastTradedSymbol; tradeList.Add(new Trade(DateTime.Now, 10, 11)); } [TestMethod] public void link_an_event_twice_test() { tradeList.OnItemAdded += UpdateLastTradedSymbol; tradeList.Add(new Trade(DateTime.Now, 10, 11)); Assert.AreEqual(2, MethodLaunchCounter); } [TestMethod] public void tradeList_is_List_of_Trade_test() { Assert.IsInstanceOfType(tradeList, typeof(List<Trade>)); } [TestMethod] public void get_Count_of_tradeList_test() { for (int i = 0; i < 10; i++) { tradeList.Add(new Trade("ST12345-RF-01", "RTS-9.14", DateTime.Now, 125000, 5)); } Assert.AreEqual(10, tradeList.Count); } [TestMethod] public void notify_on_Trade_added_to_tradeList_test() { Trade trade = new Trade("ST12345-RF-01", "RTS-9.14", DateTime.Now, 125000, 5); tradeList.Add(trade); Assert.AreEqual(trade.Symbol, LastTradedSymbol); } [TestMethod] public void remove_Trade_from_tradeList_test() { Trade trade = new Trade(DateTime.Now, 25.05, 10); tradeList.Add(trade); Assert.AreEqual(1, tradeList.Count); tradeList.Remove(trade); Assert.AreEqual(0, tradeList.Count); } } }
namespace Beranek.ErrorComponents.Tests { using Microsoft.VisualStudio.TestTools.UnitTesting; using Beranek.ErrorComponents; using System; using System.Diagnostics; using System.Threading; [TestClass()] public class TimedActionTests { [TestMethod()] public void RunWithDelayTest() { var called = false; var sw = new Stopwatch(); ManualResetEvent mre = new ManualResetEvent(false); Action act = new Action(() => { called = true; sw.Stop(); mre.Set(); }); var delayedAction = new TimedAction(act); sw.Start(); delayedAction.RunWithDelay(2000); mre.WaitOne(); Assert.IsTrue(called); Assert.IsTrue(sw.Elapsed.TotalMilliseconds > 2000); } [TestMethod()] public void CancelTest() { var called = false; var sw = new Stopwatch(); ManualResetEvent mre = new ManualResetEvent(false); Action act = new Action(() => { called = true; sw.Stop(); mre.Set(); }); var delayedAction = new TimedAction(act); sw.Start(); delayedAction.RunWithDelay(2000); delayedAction.Cancel(); var signaled = mre.WaitOne(3000); Assert.IsFalse(called); Assert.IsFalse(signaled); Assert.IsTrue(sw.IsRunning); } } }
using QtGui; using QtWidgets; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using QtCore.Qt; using QtCore; namespace QtSharpDemos.GuiExample { public class Paint_TextDemo : QtWidgets.QWidget { public Paint_TextDemo ( ) { WindowTitle = "Paint Text Demo"; Resize ( 400, 300 ); Show ( ); } protected override void OnPaintEvent ( QPaintEvent e ) { base.OnPaintEvent ( e ); var painter = new QPainter(this); DrawLyrics ( painter ); painter.End ( ); } void DrawLyrics ( QPainter painter ) { painter.Brush = new QColor ( 25, 25, 25 ); painter.Font = new QFont ( "Courier", 10 ); painter.DrawText ( new QPoint ( 20, 30 ), "Most relationships seem so transitory" ); painter.DrawText ( new QPoint ( 20, 60 ), "They're good but not the permanent one" ); painter.DrawText ( new QPoint ( 20, 120 ), "Who doesn't long for someone to hold" ); painter.DrawText ( new QPoint ( 20, 150 ), "Who knows how to love without being told" ); painter.DrawText ( new QPoint ( 20, 180 ), "Somebody tell me why I'm on my own" ); painter.DrawText ( new QPoint ( 20, 210 ), "If there's a soulmate for everyone" ); } } }
using Microsoft.AspNetCore.Mvc.Infrastructure; using Microsoft.AspNetCore.Mvc.ModelBinding; using Microsoft.AspNetCore.Mvc.Rendering; using Microsoft.AspNetCore.Mvc.ViewEngines; using Microsoft.AspNetCore.Mvc.ViewFeatures; using System.IO; using System.Threading.Tasks; namespace SF.Core.Common.Razor { public interface IViewRenderService { Task<string> RenderViewAsString<TModel>(string viewName, TModel model); } /// <summary> /// 此类是提供一种容易的方法来生成html字符串 /// 使用 Razor templates and models,用于生成电子邮件的html字符串。 /// </summary> /// <example> /// await new ViewRenderer.RenderViewAsString<string>("EmailTemplates/AccountApprovedTextEmail", loginUrl); /// </example> public class ViewRenderService : IViewRenderService { public ViewRenderService( ICompositeViewEngine viewEngine, ITempDataProvider tempDataProvider, IActionContextAccessor actionAccessor ) { this.viewEngine = viewEngine; this.tempDataProvider = tempDataProvider; this.actionAccessor = actionAccessor; } private ICompositeViewEngine viewEngine; private ITempDataProvider tempDataProvider; private IActionContextAccessor actionAccessor; public async Task<string> RenderViewAsString<TModel>(string viewName, TModel model) { var viewData = new ViewDataDictionary<TModel>( metadataProvider: new EmptyModelMetadataProvider(), modelState: new ModelStateDictionary()) { Model = model }; var actionContext = actionAccessor.ActionContext; var tempData = new TempDataDictionary(actionContext.HttpContext, tempDataProvider); using (StringWriter output = new StringWriter()) { ViewEngineResult viewResult = viewEngine.FindView(actionContext, viewName, true); ViewContext viewContext = new ViewContext( actionContext, viewResult.View, viewData, tempData, output, new HtmlHelperOptions() ); await viewResult.View.RenderAsync(viewContext); return output.GetStringBuilder().ToString(); } } } }
using Xunit; namespace WmcSoft.Text { public class TokenizerTests { [Fact] public void CanTokenizeString() { var expected = new[] { "a", "b", "c" }; var actual = "a b c".Tokenize(); Assert.Equal(expected, actual); } [Fact] public void CanTokenizeStringWithEmptyTokens() { var expected = new[] { "a", "b", "c" }; var actual = " a b c ".Tokenize(); Assert.Equal(expected, actual); } [Fact] public void CanTokenizeOnChar() { var expected = new[] { "a", "b", "c" }; var actual = " a b c ".Tokenize(' '); Assert.Equal(expected, actual); } } }
using UnityEngine; using System.Collections; public abstract class FpsCase{ GameObject m_tmpObj = null; string m_str = ""; public GameObject tmpObj { get { if (null == m_tmpObj) m_tmpObj = GameObject.Find(m_str); return m_tmpObj; } } public FpsCase(string str) { m_str= str; } public virtual void show (bool bShow) { tmpObj.SetActive(bShow); } public static Renderer[] rs = null; public void show(string shaderName, bool bShow) { foreach (Renderer r in rs) { if (r.sharedMaterial.shader.name.Contains(shaderName) && !r.name.Contains("haishui") && !r.name.Contains("langhua") && !r.name.Contains("sky")) r.enabled = bShow; } } }
using Microsoft.AspNetCore.Mvc; using System.Threading.Tasks; namespace Admin.NETApp.Core.Service { public interface ISysPosService { Task AddPos(AddPosInput input); Task DeletePos(DeletePosInput input); Task<SysPos> GetPos([FromQuery] QueryPosInput input); Task<dynamic> GetPosList([FromQuery] PosInput input); Task<dynamic> QueryPosPageList([FromQuery] PosInput input); Task UpdatePos(UpdatePosInput input); } }
using System.Collections.Generic; using DragonchainSDK.Interchain.Networks; namespace DragonchainSDK.Interchain.Bitcoin { public class BitcoinTransactionRequest { public BitcoinNetwork Network { get; set; } public BitcoinTransaction Transaction { get; set; } } public class BitcoinTransaction { public decimal? Fee { get; set; } public string Data { get; set; } public string Change { get; set; } public IEnumerable<Output> Outputs { get; set; } } public class Output { public string To { get; set; } public decimal Value { get; set; } } }
namespace JustOrderIt.Web.Areas.Public.ViewModels.Products { using System; using System.Collections.Generic; using System.Linq; using System.Web; using AutoMapper; using Data.Models; using Images; using Infrastructure.Mapping; public class ProductImagesPartialViewModel { private ICollection<ImageForProductFullViewModel> images; public ProductImagesPartialViewModel() { this.images = new HashSet<ImageForProductFullViewModel>(); } public ImageForProductFullViewModel MainImage { get { if (this.Images.Any()) { return this.images.FirstOrDefault(img => img.IsMainImage) ?? this.images.FirstOrDefault(); } return new ImageForProductFullViewModel(); } } public ICollection<ImageForProductFullViewModel> Images { get { return this.images; } set { this.images = value; } } } }
using Microsoft.Research.DataOnboarding.DomainModel; using Microsoft.Research.DataOnboarding.FileService.Models; using Microsoft.Research.DataOnboarding.Utilities.Model; using System.Collections.Generic; namespace Microsoft.Research.DataOnboarding.WebApi.ViewModels { public class ColumnLevelMetadataViewModel { public ColumnLevelMetadataViewModel() { this.MetadataList = new List<ColumnLevelMetadata>(); this.SheetList = new List<FileSheet>(); this.TypeList = new List<FileColumnType>(); this.UnitList = new List<FileColumnUnit>(); } public IEnumerable<ColumnLevelMetadata> MetadataList { get; set; } public IEnumerable<FileSheet> SheetList { get; set; } public IEnumerable<FileColumnType> TypeList { get; set; } public IEnumerable<FileColumnUnit> UnitList { get; set; } } }
using System.Collections; using System.Collections.Generic; using UnityEngine; public class InteractableHighlight : MonoBehaviour { [Tooltip("Set whether or not you want this interactible to highlight when hovering over it")] public bool highlightOnHover = true; [Tooltip("An array of child gameObjects to not render a highlight for. Things like transparent parts, vfx, etc.")] public GameObject[] hideHighlight; private MeshFilter[] highlightRenderers; private SkinnedMeshRenderer[] highlightSkinnedRenderers; private static Material highlightMat; private void Start() { highlightRenderers = GetComponentsInChildren<MeshFilter>(); highlightSkinnedRenderers = GetComponentsInChildren<SkinnedMeshRenderer>(); if (highlightMat == null) highlightMat = (Material)Resources.Load("SteamVR_HoverHighlight", typeof(Material)); if (highlightMat == null) Debug.LogError("Hover Highlight Material is missing. Please create a material named 'SteamVR_HoverHighlight' and place it in a Resources folder"); } private void HandHoverUpdate() { if (highlightOnHover) { if (highlightRenderers != null) { for (int highlightIndex = 0; highlightIndex < highlightRenderers.Length; highlightIndex++) { MeshFilter mesh = highlightRenderers[highlightIndex]; if (CheckHighlights(mesh)) { Matrix4x4 matrix = Matrix4x4.TRS(mesh.transform.position, mesh.transform.rotation, mesh.transform.lossyScale); for (int subIndex = 0; subIndex < mesh.sharedMesh.subMeshCount; subIndex++) { Graphics.DrawMesh(mesh.sharedMesh, matrix, highlightMat, 0, null, subIndex); } } } } if (highlightSkinnedRenderers != null) { for (int highlightIndex = 0; highlightIndex < highlightSkinnedRenderers.Length; highlightIndex++) { SkinnedMeshRenderer mesh = highlightSkinnedRenderers[highlightIndex]; if (CheckHighlights(mesh)) { Matrix4x4 matrix = Matrix4x4.TRS(mesh.transform.position, mesh.transform.rotation, mesh.transform.lossyScale); for (int subIndex = 0; subIndex < mesh.sharedMesh.subMeshCount; subIndex++) { Graphics.DrawMesh(mesh.sharedMesh, matrix, highlightMat, 0, null, subIndex); } } } } } } private bool CheckHighlights(Component comp) { for (int highlightIndex = 0; highlightIndex < hideHighlight.Length; highlightIndex++) if (comp.gameObject == hideHighlight[highlightIndex]) return false; return true; } }
using JetBrains.Annotations; using Tauron.Application.Master.Commands.Deployment.Build.Data; namespace Tauron.Application.Master.Commands.Deployment.Build.Commands { public sealed class DeleteAppCommand : DeploymentCommandBase<DeleteAppCommand, AppInfo> { public DeleteAppCommand([NotNull] string appName) : base(appName) { } } }
using System; using System.Collections.Generic; using System.Reactive.Concurrency; using System.Reactive.Linq; using System.Resources; using System.Threading.Tasks; using MovieList.Data.Models; using MovieList.DialogModels; using MovieList.ViewModels.Forms.Base; using ReactiveUI; using ReactiveUI.Fody.Helpers; using ReactiveUI.Validation.Extensions; using ReactiveUI.Validation.Helpers; using static MovieList.Data.Constants; namespace MovieList.ViewModels.Forms { public sealed class SpecialEpisodeFormViewModel : SeriesComponentFormBase<SpecialEpisode, SpecialEpisodeFormViewModel> { public SpecialEpisodeFormViewModel( SpecialEpisode episode, SeriesFormViewModel parent, IObservable<int> maxSequenceNumber, ResourceManager? resourceManager, IScheduler? scheduler = null) : base(parent, maxSequenceNumber, resourceManager, scheduler) { this.SpecialEpisode = episode; this.CopyProperties(); this.ChannelRule = this.ValidationRule( vm => vm.Channel, channel => !String.IsNullOrWhiteSpace(channel), "ChannelEmpty"); this.YearRule = this.ValidationRule(vm => vm.Year, SeriesMinYear, SeriesMaxYear, nameof(this.Year)); this.PosterUrlRule = this.ValidationRule(vm => vm.PosterUrl, url => url.IsUrl(), "PosterUrlInvalid"); this.InitializeValueDependencies(); this.CanAlwaysDelete(); this.EnableChangeTracking(); } public SpecialEpisode SpecialEpisode { get; } [Reactive] public int Month { get; set; } [Reactive] public string Year { get; set; } = null!; [Reactive] public bool IsWatched { get; set; } [Reactive] public bool IsReleased { get; set; } [Reactive] public override string Channel { get; set; } = String.Empty; [Reactive] public string? PosterUrl { get; set; } public ValidationHelper ChannelRule { get; } public ValidationHelper YearRule { get; } public ValidationHelper PosterUrlRule { get; } public override bool IsNew => this.SpecialEpisode.Id == default; protected override SpecialEpisodeFormViewModel Self => this; protected override ICollection<Title> ItemTitles => this.SpecialEpisode.Titles; protected override string NewItemKey => "NewSpecialEpisode"; public override int GetNextYear() => Int32.Parse(this.Year) + 1; protected override void EnableChangeTracking() { this.TrackChanges(vm => vm.Month, vm => vm.SpecialEpisode.Month); this.TrackChanges(vm => vm.Year, vm => vm.SpecialEpisode.Year.ToString()); this.TrackChanges(vm => vm.IsWatched, vm => vm.SpecialEpisode.IsWatched); this.TrackChanges(vm => vm.IsReleased, vm => vm.SpecialEpisode.IsReleased); this.TrackChanges(vm => vm.Channel, vm => vm.SpecialEpisode.Channel); this.TrackChanges(vm => vm.SequenceNumber, vm => vm.SpecialEpisode.SequenceNumber); this.TrackChanges(vm => vm.PosterUrl, vm => vm.SpecialEpisode.PosterUrl.EmptyIfNull()); base.EnableChangeTracking(); } protected override async Task<SpecialEpisode> OnSaveAsync() { await this.SaveTitlesAsync(); this.SpecialEpisode.Month = this.Month; this.SpecialEpisode.Year = Int32.Parse(this.Year); this.SpecialEpisode.IsWatched = this.IsWatched; this.SpecialEpisode.IsReleased = this.IsReleased; this.SpecialEpisode.Channel = this.Channel; this.SpecialEpisode.SequenceNumber = this.SequenceNumber; this.SpecialEpisode.PosterUrl = this.PosterUrl; return this.SpecialEpisode; } protected override async Task<SpecialEpisode?> OnDeleteAsync() => await Dialog.Confirm.Handle(new ConfirmationModel("DeleteSpecialEpisode")) ? this.SpecialEpisode : null; protected override void CopyProperties() { base.CopyProperties(); this.Month = this.SpecialEpisode.Month; this.Year = this.SpecialEpisode.Year.ToString(); this.IsWatched = this.SpecialEpisode.IsWatched; this.IsReleased = this.SpecialEpisode.IsReleased; this.Channel = this.SpecialEpisode.Channel; this.SequenceNumber = this.SpecialEpisode.SequenceNumber; this.PosterUrl = this.SpecialEpisode.PosterUrl; } protected override void AttachTitle(Title title) => title.SpecialEpisode = this.SpecialEpisode; private void InitializeValueDependencies() { this.WhenAnyValue(vm => vm.IsReleased) .Where(isReleased => !isReleased) .Subscribe(_ => this.IsWatched = false); this.WhenAnyValue(vm => vm.IsWatched) .Where(isWatched => isWatched) .Subscribe(_ => this.IsReleased = true); this.WhenAnyValue(vm => vm.Year) .Where(_ => this.YearRule.IsValid) .Select(Int32.Parse) .Where(year => year != this.Scheduler.Now.Year) .Subscribe(year => this.IsReleased = year < this.Scheduler.Now.Year); } } }
using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyTitle("ControllerReload")] [assembly: AssemblyDescription("A simple script that reloads SHVDN by using a controller button combination")] [assembly: AssemblyCompany("justalemon")] [assembly: AssemblyProduct("ControllerReload")] [assembly: AssemblyCopyright("© 2018 Hannele 'Lemon' Ruiz")] [assembly: ComVisible(false)] [assembly: Guid("01078687-2525-4f49-84ea-9cddaef4e3a9")] [assembly: AssemblyVersion("1.0.1")] [assembly: AssemblyFileVersion("1.0.1")]
using OrchardCore.Modules; using Microsoft.Extensions.DependencyInjection; using OrchardCore.DisplayManagement.Descriptors; namespace OrchardCore.Html.Media { [RequireFeatures("OrchardCore.Media")] public class Startup : StartupBase { public override void ConfigureServices(IServiceCollection services) { services.AddScoped<IShapeTableProvider, MediaShapes>(); } } }
using System; using FullInspector.Internal; using FullSerializer; using UnityEditor; using UnityEngine; namespace FullInspector.Modules { [CustomPropertyEditor(typeof(Type))] public class TypePropertyEditor : PropertyEditor<Type> { public class StateObject : IGraphMetadataItemNotPersistent { public fiOption<Type> Type; } public override Type Edit(Rect region, GUIContent label, Type element, fiGraphMetadata metadata) { Rect labelRect, buttonRect = region; if (string.IsNullOrEmpty(label.text) == false) { fiRectUtility.SplitHorizontalPercentage(region, .3f, 2, out labelRect, out buttonRect); GUI.Label(labelRect, label); } string displayed = "<no type>"; if (element != null) { displayed = element.CSharpName(); } StateObject stateObj = metadata.GetMetadata<StateObject>(); if (GUI.Button(buttonRect, displayed)) { TypeSelectionPopupWindow.CreateSelectionWindow(element, type => stateObj.Type = fiOption.Just(type)); } if (stateObj.Type.HasValue) { GUI.changed = true; var type = stateObj.Type.Value; stateObj.Type = fiOption<Type>.Empty; return type; } return element; } public override float GetElementHeight(GUIContent label, Type element, fiGraphMetadata metadata) { return EditorStyles.toolbarButton.CalcHeight(label, Screen.width); } } }
using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Threading; using System.Xml; namespace NoitaSeedChanger { class Release { private static Dictionary<string, List<string>> data = new Dictionary<string, List<string>>(); public static string currentHash = string.Empty; public static List<IntPtr> currentTargets = new List<IntPtr>(); public static void Init() { GetCurrentHash(); ReadXML("ReleaseData.xml"); GetCurrentTargets(); } private static void ReadXML(string fileName) // Reads XML and fills data dictionary { XmlDocument doc = new XmlDocument(); try { doc.Load(fileName); } catch (Exception e) { Helper.Error(e.Message); Thread.Sleep(10000); throw; } XmlNodeList Nodes = doc.DocumentElement.SelectNodes("/Release/Data"); foreach (XmlNode node in Nodes) { string hash = ""; List<string> targets = new List<string>(); for (int i = 0; i < node.ChildNodes.Count; i++) { if (i == 0) { hash = node.ChildNodes[i].InnerText; } else { targets.Add(node.ChildNodes[i].InnerText); } } data.Add(hash, targets); } } public static void GetCurrentTargets() { List<IntPtr> targetList = new List<IntPtr>(); foreach (var item in data) { if (item.Key == currentHash) { foreach (var target in item.Value) { targetList.Add((IntPtr)int.Parse(target, NumberStyles.AllowHexSpecifier)); } } } currentTargets = targetList; } public static void GetCurrentHash() { try { string hash = File.ReadAllLines(GetHashFilePath(), Encoding.UTF8)[0]; currentHash = hash; } catch (Exception e) { Helper.Error(e.Message); Thread.Sleep(10000); throw; } } private static string GetHashFilePath() { return Path.GetDirectoryName(Program.game.MainModule.FileName) + "/_version_hash.txt"; } } }
using System; using System.Collections.Generic; using System.Text; namespace Ceptic.Endpoint { public class CommandSettings { public readonly int bodyMax; public readonly long timeMax; public CommandSettings(int bodyMax, long timeMax) { this.bodyMax = bodyMax; this.timeMax = timeMax; } public CommandSettings Copy() { return new CommandSettings(bodyMax, timeMax); } public static CommandSettings Combine(CommandSettings initial, CommandSettings updates) { int bodyMax = updates.bodyMax >= 0 ? updates.bodyMax : initial.bodyMax; long timeMax = updates.timeMax >= 0 ? updates.timeMax : initial.timeMax; return new CommandSettings(bodyMax, timeMax); } public static CommandSettings CreateWithBodyMax(int bodyMax) { return new CommandSettings(bodyMax, -1); } } }
using System.Collections; using System.Collections.Generic; using UnityEngine; public abstract class Warrior : MonoBehaviour { public Vector2Int StartingPosition { get; set; } public Vector2Int Position { get; protected set; } public bool Dead { get; protected set; } virtual public void Start() { transform.position = BattleGrid.Instance.GetPosition(StartingPosition); Position = StartingPosition; } public void ResetPosition() { Move(StartingPosition - Position); } public virtual void Move(Vector2Int amount, bool setPosAnyways = false) { Vector2Int tile = Position + amount; Vector3 position = BattleGrid.Instance.GetPosition(tile); if (position != Vector3.zero || setPosAnyways) { Position = tile; transform.position = position; } } public void GhostMove(Vector2Int amount) { Vector2Int tile = Position + amount; Vector3 position = BattleGrid.Instance.GetPosition(tile); if (position != Vector3.zero) { transform.position = position; } } abstract public void Kill(); }
using Jasper; using Jasper.Configuration; namespace Module1 { public class Module1Extension : IJasperExtension { public static JasperOptionsBuilder Registry { get; set; } public void Configure(JasperOptionsBuilder registry) { Registry = registry; registry.Settings.Alter<ModuleSettings>(_ => { _.From = "Module1"; _.Count = 100; }); registry.Services.For<IModuleService>().Use<ServiceFromModule>(); } } public interface IModuleService { } public class ModuleSettings { public string From { get; set; } = "Default"; public int Count { get; set; } } public class ServiceFromModule : IModuleService { } }
using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; using NHSD.GPIT.BuyingCatalogue.EntityFramework.Users.Models; namespace NHSD.GPIT.BuyingCatalogue.EntityFramework.Users.Configuration { internal sealed class AspNetUserEntityTypeConfiguration : IEntityTypeConfiguration<AspNetUser> { public void Configure(EntityTypeBuilder<AspNetUser> builder) { builder.ToTable("AspNetUsers", Schemas.Users); builder.HasKey(u => u.Id); builder.Property(u => u.Id).ValueGeneratedOnAdd(); builder.Property(u => u.CatalogueAgreementSigned).IsRequired().HasDefaultValue(0); builder.Property(u => u.Email).HasMaxLength(256).IsRequired(); builder.Property(u => u.EmailConfirmed).IsRequired().HasDefaultValue(0); builder.Property(u => u.FirstName) .IsRequired() .HasMaxLength(100); builder.Property(u => u.LastName) .IsRequired() .HasMaxLength(100); builder.Ignore(u => u.FullName); builder.Property(u => u.NormalizedEmail).HasMaxLength(256).IsRequired(); builder.Property(u => u.NormalizedUserName).HasMaxLength(256).IsRequired(); builder.Property(u => u.OrganisationFunction) .IsRequired() .HasMaxLength(50); builder.Property(u => u.PhoneNumber).HasMaxLength(35); builder.Property(u => u.PhoneNumberConfirmed).IsRequired().HasDefaultValue(0); builder.Property(u => u.UserName).HasMaxLength(256).IsRequired(); builder.Property(u => u.LastUpdated).HasDefaultValue(DateTime.UtcNow); builder.HasOne(u => u.PrimaryOrganisation) .WithMany() .HasForeignKey(u => u.PrimaryOrganisationId) .HasConstraintName("FK_AspNetUsers_OrganisationId"); builder.HasIndex(u => u.NormalizedEmail, "AK_AspNetUsers_NormalizedEmail").IsUnique(); builder.HasIndex(u => u.NormalizedUserName, "AK_AspNetUsers_NormalizedUserName") .IsUnique(); builder.HasOne(u => u.LastUpdatedByUser) .WithMany() .HasForeignKey(u => u.LastUpdatedBy) .HasConstraintName("FK_AspNetUsers_LastUpdatedBy"); } } }
// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. // using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Earn.Dashboard.DAL; using Earn.Dashboard.LomoUsersDAL; using Earn.DataContract.Commerce; using Earn.DataContract.LomoUsers; namespace Earn.Dashboard.Web.Service { public class CustomerService { public static async Task<List<Transaction>> FetchTransactionsByFilter(TransactionsFilter filter) { var data = await CommerceDal.FetchTransactionsByFilter(filter); return data; } public static async Task<List<Settlement>> FetchSettlementsByFilter(TransactionsFilter filter) { var data = await CommerceDal.FetchSettlementsByFilter(filter); return data; } public static async Task<List<string>> FetchMerchantsAsync() { var data = await CommerceDal.FetchMerchantsAsync(); List<string> uniqueMerchants = data.Select(x => x.Name).Distinct().ToList(); return uniqueMerchants; } public static async Task<List<CardBrand>> FetchCardBrandsAsync() { var data = await CommerceDal.FetchCardBrandsAsync(); return data; } public static List<TransactionType> FetchTransactionTypes() { var data = CommerceDal.FetchTransactionTypes(); return data; } public static async Task<List<Customer>> FindCustomers(string filter) { List<Customer> users = new List<Customer>(); Guid tmp; if (filter.Length == 4) { List<CardInfo> userCards = await CommerceDal.FetchCardInfo(filter); List<Guid> userIds = userCards.Select(x => x.GlobalUserId) .ToList(); users = await LomoUserDal.FetchUsersByIds(userIds); } else if (filter.Contains("@")) { users = await LomoUserDal.FetchUsersByFilter(new CustomerFilter { Email = filter }); } else if (Guid.TryParse(filter, out tmp)) { users = await LomoUserDal.FetchUsersByFilter(new CustomerFilter { UserId = tmp }); } else { users = await LomoUserDal.FetchUsersByFilter(new CustomerFilter { MSIDorPUID = filter }); } foreach (var user in users) { user.Id = await CommerceDal.FetchUserIdByGlobalId(user.GlobalId); var userCards = await CommerceDal.FetchCardInfo(user.GlobalId); if (userCards != null && userCards.Any()) { user.Cards = userCards; } else { user.Cards = new List<CardInfo>(); } } return users; } public static async Task<List<UserReferral>> FetchReferrals(Guid userId) { var data = await CommerceDal.FetchReferrals(userId); return data; } public static async Task<List<EarnBurnLineItem>> FetchUserEarnBurnLineItems(Guid userId) { var data = await CustomerServiceDAL.GetEarnBurnLineItems(userId); return data; } public static async Task<List<EarnBurnHistoryRecord>> FetchEarnBurnHistory(Guid guid) { var data = await CustomerServiceDAL.GetEarnBurnHistory(guid); return data; } public static async Task<IssueCreditsResponse> IssueCredits(IssueCreditsRequest request) { int amount = (int)(request.Amount * 100); string issuer = request.Issuer + " via Earn Dashboard Customer Service Tool"; var result = await CustomerServiceDAL.IssueCredits(request.UserId, amount, request.Explanation, issuer); return result; } } }
using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; using Terraria.GameContent; using System; using Microsoft.Xna.Framework.Graphics; namespace ExampleMod.Content.Projectiles { public class ExamplePaperAirplaneProjectile : ModProjectile { public override void SetStaticDefaults() { DisplayName.SetDefault("Example Paper Airplane Projectile"); // The English name of the projectile } public override void SetDefaults() { Projectile.width = 10; // The width of the projectile Projectile.height = 10; // The height of the projectile Projectile.aiStyle = -1; // We are setting the aiStyle to -1 to use the custom AI below. If just want the vanilla behavior, you can set the aiStyle to 159. Projectile.friendly = true; // Can the projectile deal damage to enemies? Projectile.DamageType = DamageClass.Ranged; // Set the damage type to ranged damage. // Setting this to true will stop the projectile from automatically flipping its sprite when changing directions. // The vanilla paper airplanes have this set to true. // If this is true the projectile won't flip its sprite vertically while doing a loop, but the paper airplane can be upside down if it is shot one direction and then turns around on its own. // Set to false if you want the projectile to always be right side up. Projectile.manualDirectionChange = true; // If you are using Projectile.aiStyle = 159, setting the AIType isn't necessary here because the two types of vanilla paper airplanes aiStyles have the same AI. // AIType = ProjectileID.PaperAirplaneA; } // This is the behavior of the paper airplane. // If you just want the same vanilla behavior, you can instead set Projectile.aiStyle = 159 in SetDefaults and remove this AI() section. public override void AI() { // All projectiles have timers that help to delay certain events // Projectile.ai[0], Projectile.ai[1] — timers that are automatically synchronized on the client and server // This will run only once as soon as the projectile spawns. if (Projectile.ai[1] == 0f) { Projectile.direction = (Projectile.velocity.X > 0).ToDirectionInt(); // If it is moving right, then set Projectile.direction to 1. If it is moving left, then set Projectile.direction to -1. Projectile.rotation = Projectile.velocity.ToRotation(); // Set the rotation based on the velocity. Projectile.ai[1] = 1f; // Set Projectile.ai[1] to 1. This is only used to make this section of code run only once. Projectile.ai[0] = -Main.rand.Next(30, 80); // Set Projectile.ai[0] to a random number from -30 to -79. Projectile.netUpdate = true; // Sync the projectile in a multiplayer game. } // Kill the projectile if it touches a liquid. (It will automatically get killed by touching a tile. You can change that by returning false in OnTileCollide()) if (Projectile.wet && Projectile.owner == Main.myPlayer) { Projectile.Kill(); } Projectile.ai[0] += 1f; // Increase Projectile.ai[0] by 1 every tick. Remember, there are 60 ticks per second. Vector2 rotationVector = Projectile.rotation.ToRotationVector2() * 8f; // Get the rotation of the projectile. float ySinModifier = (float)Math.Sin((float)Math.PI * 2f * (float)(Main.timeForVisualEffects % 90.0 / 90.0)) * Projectile.direction * Main.WindForVisuals; // This will make the projectile fly in a sine wave fashion. Vector2 newVelocity = rotationVector + new Vector2(Main.WindForVisuals, ySinModifier); // Create a new velocity using the rotation and wind. bool directionSameAsWind = Projectile.direction == Math.Sign(Main.WindForVisuals) && Projectile.velocity.Length() > 3f; // True if the projectile is moving the same direction as the wind and is not moving slowly. bool readyForFlip = Projectile.ai[0] >= 20f && Projectile.ai[0] <= 69f; // True if Projectile.ai[0] is between 20 and 69 // Once Projectile.ai[0] reaches 70... if (Projectile.ai[0] == 70f) { Projectile.ai[0] = -Main.rand.Next(120, 600); // Set it back to a random number from -120 to -599. } // Do a flip! This will cause the projectile to fly in a loop if directionSameAsWind and readyForFlip are true. if (readyForFlip && directionSameAsWind) { float lerpValue = Utils.GetLerpValue(0f, 30f, Projectile.ai[0], clamped: true); newVelocity = rotationVector.RotatedBy((-Projectile.direction) * ((float)Math.PI * 2f) * 0.02f * lerpValue); } Projectile.velocity = newVelocity.SafeNormalize(Vector2.UnitY) * Projectile.velocity.Length(); // Set the velocity to the value we calculated above. // If it is flying normally. i.e. not flying a loop. if (!(readyForFlip && directionSameAsWind)) { float yModifier = MathHelper.Lerp(0.15f, 0.05f, Math.Abs(Main.WindForVisuals)); // Half of time, decrease the y velocity a little. if (Projectile.timeLeft % 40 < 20) { Projectile.velocity.Y -= yModifier; } // The other half of time, increase the y velocity a little. else { Projectile.velocity.Y += yModifier; } // Cap the y velocity so the projectile falls slowly and doesn't rise too quickly. // MathHelper.Clamp() allows you to set a minimum and maximum value. In this case, the result will always be between -2f and 2f (inclusive). Projectile.velocity.Y = MathHelper.Clamp(Projectile.velocity.Y, -2f, 2f); // Set the x velocity. // MathHelper.Clamp() allows you to set a minimum and maximum value. In this case, the result will always be between -6f and 6f (inclusive). Projectile.velocity.X = MathHelper.Clamp(Projectile.velocity.X + Main.WindForVisuals * 0.006f, -6f, 6f); // Switch direction when the current velocity and the oldVelocity have different signs. if (Projectile.velocity.X * Projectile.oldVelocity.X < 0f) { Projectile.direction *= -1; // Reverse the direction Projectile.ai[0] = -Main.rand.Next(120, 300); // Set Projectile.ai[0] to a random number from -120 to -599. Projectile.netUpdate = true; // Sync the projectile in a multiplayer game. } } // Set the rotation and spriteDirection Projectile.rotation = Projectile.velocity.ToRotation(); Projectile.spriteDirection = Projectile.direction; // Let's add some dust for special effect. In this case, it runs every other tick (30 ticks per second). if (Projectile.timeLeft % 2 == 0) { Dust.NewDustPerfect(new Vector2(Projectile.Center.X - (Projectile.width * Projectile.direction), Projectile.Center.Y), ModContent.DustType<Dusts.Sparkle>(), null, 0, default, 0.5f); //Here we spawn the dust at the back of the projectile with half scale. } } // We need to draw the projectile manually. If you don't include this, the projectile will be facing the wrong direction when flying left. public override bool PreDraw(ref Color lightColor) { // This is where we specify which way to flip the sprite. If the projectile is moving to the left, then flip it vertically. SpriteEffects spriteEffects = ((Projectile.spriteDirection <= 0) ? SpriteEffects.FlipVertically : SpriteEffects.None); // Getting texture of projectile Texture2D texture = TextureAssets.Projectile[Type].Value; // Get the currently selected frame on the texture. Rectangle sourceRectangle = texture.Frame(1, Main.projFrames[Type], frameY: Projectile.frame); Vector2 origin = sourceRectangle.Size() / 2f; // Applying lighting and draw our projectile Color drawColor = Projectile.GetAlpha(lightColor); Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), sourceRectangle, drawColor, Projectile.rotation, origin, Projectile.scale, spriteEffects, 0); // It's important to return false, otherwise we also draw the original texture. return false; } public override void Kill(int timeLeft) { SoundEngine.PlaySound(SoundID.Item10, Projectile.position); // Play a sound when the projectile dies. In this case, that is when it hits a block or a liquid. if (Projectile.owner == Main.myPlayer && !Projectile.noDropItem) { int dropItemType = ModContent.ItemType<Items.ExamplePaperAirplane>(); // This the item we want the paper airplane to drop. int newItem = Item.NewItem(Projectile.GetSource_DropAsItem(), Projectile.Hitbox, dropItemType); // Create a new item in the world. Main.item[newItem].noGrabDelay = 0; // Set the new item to be able to be picked up instantly // Here we need to make sure the item is synced in multiplayer games. if (Main.netMode == NetmodeID.MultiplayerClient && newItem >= 0) { NetMessage.SendData(MessageID.SyncItem, -1, -1, null, newItem, 1f); } } // Let's add some dust for special effect. for (int i = 0; i < 10; i++) { Dust.NewDust(Projectile.Center, Projectile.width, Projectile.height, ModContent.DustType<Dusts.Sparkle>()); } } } }
using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace EJ2MVCSampleBrowser.Models { public class InlineEmployees { public string Name { get; set; } public string Eimg { get; set; } public List<InlineEmployees> EmployeesList() { List<InlineEmployees> emp = new List<InlineEmployees>(); emp.Add(new InlineEmployees { Name = "Andrew", Eimg = "7" }); emp.Add(new InlineEmployees { Name = "Anne", Eimg = "1" }); emp.Add(new InlineEmployees { Name = "Janet", Eimg = "3" }); emp.Add(new InlineEmployees { Name = "Laura", Eimg = "2" }); emp.Add(new InlineEmployees { Name = "Michael", Eimg = "9" }); emp.Add(new InlineEmployees { Name = "Nancy", Eimg = "4" }); emp.Add(new InlineEmployees { Name = "Robert", Eimg = "8" }); emp.Add(new InlineEmployees { Name = "Steven", Eimg = "10" }); return emp; } } }
using System; using Foundation; namespace Mobile_App_Xamarin_Native.iOS { public static class CookieHelper { public static void ClearCookies() { var storage = NSHttpCookieStorage.SharedStorage; foreach (var cookie in storage.Cookies) { storage.DeleteCookie(cookie); } } } }
using System.Collections.Generic; using System.ComponentModel.DataAnnotations; namespace IntelligentPlant.DataCore.Client.Model.Queries { /// <summary> /// A request to call a custom function. /// </summary> public class CustomFunctionRequest { /// <summary> /// Gets or sets the component name to send the custom function to. Leave blank for /// general-purpose custom function messages. /// </summary> public string ComponentName { get; set; } /// <summary> /// The name of the custom function to call. /// </summary> [Required] [MaxLength(200)] public string MethodName { get; set; } /// <summary> /// The function parameters. /// </summary> public IDictionary<string, string> Parameters { get; set; } } }
using UnityEngine; namespace Septyr.ScriptableObjectArchitecture { /// <summary> /// Internal extension methods for <see cref="Vector4"/>. /// </summary> internal static class Vector4Extensions { /// <summary> /// Returns a <see cref="Quaternion"/> instance where the component values are equal to this /// <see cref="Vector4"/>'s components. /// </summary> /// <param name="vector4"></param> /// <returns></returns> public static Quaternion ToQuaternion(this Vector4 vector4) { return new Quaternion(vector4.x, vector4.y, vector4.z, vector4.w); } } }
using System.Collections; using System.Collections.Generic; using UnityEngine; public class ShootObjectResponse : MonoBehaviour { private GameObject player; private PlayerManager playerManager; [SerializeField]private string objectDescription = string.Empty; [SerializeField]private int health = 1; void Awake(){ player = GameObject.FindWithTag ("Player"); playerManager = player.GetComponent<PlayerManager>(); } void OnTriggerEnter (Collider other){ if (other.CompareTag ("Player")) { if (string.Equals (objectDescription, "Bullet", System.StringComparison.CurrentCultureIgnoreCase)) { playerManager.health -= 1; gameObject.SetActive (false); } } if (other.CompareTag ("Bullet")) { int BulletID = other.transform.GetComponent<BulletControll> ().bulletID; if (BulletID == 1) return; --health; if(health == 0) StartCoroutine(DeactivateObjects(gameObject, other.gameObject)); else StartCoroutine(DeactivateObjects(other.gameObject)); Vector3 HitLocation = other.transform.position; StartCoroutine( GameController.Instance.HitEffectLocation (HitLocation)); //int BulletID = other.transform.GetComponent<BulletControll> ().bulletID;// //if (BulletID == 0) // if (string.Equals (objectDescription, "Health", System.StringComparison.CurrentCultureIgnoreCase)) { PlayerManager.Instance.health += 1; } int randomNum = Random.Range(0,10); switch (randomNum) { case 0: GameObject PowerUp = PowerUpSpawn.Instance.SpawnPowerUpLocation (HitLocation); StartCoroutine (DestroyObjects (12f, PowerUp)); break; default: break; } } } IEnumerator DestroyObjects(float time, params GameObject[] gO){ yield return new WaitForSeconds(time); if (gO == null) foreach (GameObject go in gO) go.SetActive (false); } IEnumerator DeactivateObjects(params GameObject[] gO){ // yield return new WaitForSeconds(0.2f); yield return null;//new WaitForEndOfFrame (); foreach (GameObject go in gO) go.SetActive (false); } }
namespace Axypo.CQRSLite.Messages { public interface IMessage<TResult> { } }
using System; using System.Collections.Generic; using System.Net; using System.Net.NetworkInformation; using System.Net.Sockets; namespace FastGithub.UI { /// <summary> /// udp日志工具类 /// </summary> static class UdpLoggerPort { /// <summary> /// 获取日志端口 /// </summary> public static int Value { get; } = GetAvailableUdpPort(38457); /// <summary> /// 获取可用的随机Udp端口 /// </summary> /// <param name="minValue"></param> /// <param name="addressFamily"></param> /// <returns></returns> private static int GetAvailableUdpPort(int minValue, AddressFamily addressFamily = AddressFamily.InterNetwork) { var hashSet = new HashSet<int>(); var tcpListeners = IPGlobalProperties.GetIPGlobalProperties().GetActiveUdpListeners(); foreach (var endpoint in tcpListeners) { if (endpoint.AddressFamily == addressFamily) { hashSet.Add(endpoint.Port); } } for (var port = minValue; port < IPEndPoint.MaxPort; port++) { if (hashSet.Contains(port) == false) { return port; } } throw new ArgumentException("当前无可用的端口"); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace FriendyFy.Models.Enums { public enum PrivacySettings { Private = 0, Public = 1 } }
using System; namespace ObjectiveStrategy.GameModels.Definitions { [Flags] public enum UnitFlags // TODO: split these into movement flags and attack flags { None = 0, Agile = 1, // ignores difficult terrain Flying = 2, // ignores difficult and blocking terrain AttacksAir = 4, AttacksGround = 8, } }
// NClass - Free class diagram editor // Copyright (C) 2006-2009 Balazs Tihanyi // // This program is free software; you can redistribute it and/or modify it under // the terms of the GNU General Public License as published by the Free Software // Foundation; either version 3 of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, but WITHOUT // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along with // this program; if not, write to the Free Software Foundation, Inc., // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Reflection; using System.Xml.Serialization; using System.Collections.Generic; using NClass.Translations; namespace NClass.Core { public abstract class Language { public abstract string Name { get; } public abstract string AssemblyName { get; } [XmlIgnore] public abstract Dictionary<AccessModifier, string> ValidAccessModifiers { get; } [XmlIgnore] public abstract Dictionary<ClassModifier, string> ValidClassModifiers { get; } [XmlIgnore] public abstract Dictionary<FieldModifier, string> ValidFieldModifiers { get; } [XmlIgnore] public abstract Dictionary<OperationModifier, string> ValidOperationModifiers { get; } public abstract bool SupportsAssemblyImport { get; } public abstract bool SupportsInterfaces { get; } public abstract bool SupportsStructures { get; } public abstract bool SupportsEnums { get; } public abstract bool SupportsDelegates { get; } public abstract bool SupportsExplicitImplementation { get; } public abstract bool ExplicitVirtualMethods { get; } public abstract string DefaultFileExtension { get; } protected abstract string[] ReservedNames { get; } protected abstract string[] TypeKeywords { get; } public bool IsForbiddenName(string name) { return ( Contains(ReservedNames, name) || Contains(TypeKeywords, name) ); } public bool IsForbiddenTypeName(string name) { return Contains(ReservedNames, name); } //TODO: a languageName ne az assembly neve legyen, hanem a Name property! public static Language GetLanguage(string languageName) { try { string languageString = languageName; Assembly assembly = Assembly.Load("NClass." + languageString); foreach (Type type in assembly.GetTypes()) { if (type.IsSubclassOf(typeof(Language))) { object languageInstance = type.InvokeMember("Instance", BindingFlags.Public | BindingFlags.Static | BindingFlags.GetProperty, null, null, null); return (languageInstance as Language); } } return null; } catch { return null; } } private static bool Contains(string[] values, string value) { if (values == null) return false; for (int i = 0; i < values.Length; i++) if (values[i] == value) return true; return false; } /// <exception cref="ArgumentException"> /// The language does not support explicit interface implementation. /// </exception> /// <exception cref="ArgumentNullException"> /// <paramref name="operation"/> is null.-or- /// <paramref name="newParent"/> is null. /// </exception> protected internal abstract Operation Implement(Operation operation, CompositeType newParent, bool explicitly); /// <exception cref="ArgumentException"> /// <paramref name="operation"/> cannot be overridden. /// </exception> /// <exception cref="ArgumentNullException"> /// <paramref name="operation"/> is null. /// </exception> protected internal abstract Operation Override(Operation operation, CompositeType newParent); /// <exception cref="BadSyntaxException"> /// The <paramref name="name"/> does not fit to the syntax. /// </exception> public virtual string GetValidName(string name, bool isGenericName) { if (IsForbiddenName(name)) throw new BadSyntaxException(Strings.ErrorForbiddenName); return name; } /// <exception cref="BadSyntaxException"> /// The <paramref name="name"/> does not fit to the syntax. /// </exception> public virtual string GetValidTypeName(string name) { if (IsForbiddenTypeName(name)) throw new BadSyntaxException(Strings.ErrorForbiddenTypeName); return name; } public virtual ClassModifier TryParseClassModifier(string value) { try { return (ClassModifier) Enum.Parse( typeof(ClassModifier), value, true); } catch { return ClassModifier.None; } } public virtual AccessModifier TryParseAccessModifier(string value) { try { if (string.IsNullOrEmpty(value)) return AccessModifier.Default; else return (AccessModifier) Enum.Parse(typeof(AccessModifier), value, true); } catch { return AccessModifier.Default; } } public virtual OperationModifier TryParseOperationModifier(string value) { try { if (string.IsNullOrEmpty(value)) { return OperationModifier.None; } else { return (OperationModifier) Enum.Parse( typeof(OperationModifier), value, true); } } catch { return OperationModifier.None; } } public abstract bool IsValidModifier(FieldModifier modifier); public abstract bool IsValidModifier(OperationModifier modifier); public abstract bool IsValidModifier(AccessModifier modifier); /// <exception cref="BadSyntaxException"> /// The <paramref name="operation"/> contains invalid modifier combinations. /// </exception> protected internal abstract void ValidateOperation(Operation operation); /// <exception cref="BadSyntaxException"> /// The <paramref name="field"/> contains invalid modifier combinations. /// </exception> protected internal abstract void ValidateField(Field field); protected internal abstract ClassType CreateClass(); /// <exception cref="InvalidOperationException"> /// The language does not support structures. /// </exception> protected internal abstract StructureType CreateStructure(); /// <exception cref="InvalidOperationException"> /// The language does not support interfaces. /// </exception> protected internal abstract InterfaceType CreateInterface(); /// <exception cref="InvalidOperationException"> /// The language does not support enums. /// </exception> protected internal abstract EnumType CreateEnum(); /// <exception cref="InvalidOperationException"> /// The language does not support delegates. /// </exception> protected internal abstract DelegateType CreateDelegate(); protected internal abstract ArgumentList CreateParameterCollection(); public abstract string GetAccessString(AccessModifier access, bool forCode); public abstract string GetFieldModifierString(FieldModifier modifier, bool forCode); public abstract string GetOperationModifierString(OperationModifier modifier, bool forCode); public abstract string GetClassModifierString(ClassModifier modifier, bool forCode); public string GetAccessString(AccessModifier access) { return GetAccessString(access, false); } public string GetFieldModifierString(FieldModifier modifier) { return GetFieldModifierString(modifier, false); } public string GetOperationModifierString(OperationModifier modifier) { return GetOperationModifierString(modifier, false); } public string GetClassModifierString(ClassModifier modifier) { return GetClassModifierString(modifier, false); } public override string ToString() { return Name; } } }
using System; using System.Collections.Generic; using System.Text; namespace LumiSoft.Net.RTP { /// <summary> /// This class holds known RTCP packet types. /// </summary> public class RTCP_PacketType { /// <summary> /// Sender report. /// </summary> public const int SR = 200; /// <summary> /// Receiver report. /// </summary> public const int RR = 201; /// <summary> /// Session description. /// </summary> public const int SDES = 202; /// <summary> /// BYE. /// </summary> public const int BYE = 203; /// <summary> /// Application specifiec data. /// </summary> public const int APP = 204; } }
using ServiceSupport.Infrastructure.DTO; using System; using System.Collections.Generic; using System.Text; namespace ServiceSupport.Infrastructure.Commands.Shops { public class CreateShop { public string Address { get; set; } public PersonDto ResponsiblePerson { get; set; } public string SID { get; set; } public string Phone { get; set; } } }
/* * ajma.Utils.InputBox * Displays a prompt in a dialog box, waits for the user to input text or click a button, and then returns a string containing the contents of the text box. * * Andrew J. Ma * ajmaonline@hotmail.com */ using System; using System.Drawing; using System.Windows.Forms; namespace ajma.Utils { /// <summary> /// Displays a prompt in a dialog box, waits for the user to input text or click a button, and then returns a string containing the contents of the text box. /// </summary> public class InputBox { /// <summary> /// Displays a prompt in a dialog box, waits for the user to input text or click a button, and then returns a string containing the contents of the text box. /// </summary> /// <param name="Prompt">String expression displayed as the message in the dialog box.</param> /// <param name="Title">String expression displayed in the title bar of the dialog box.</param> /// <returns>The value in the textbox is returned if the user clicks OK or presses the ENTER key. If the user clicks Cancel, a zero-length string is returned.</returns> public static string Show(string Prompt, string Title) { return Show(null, Prompt, Title, "", -1, -1); } public static string Show(IWin32Window owner, string Prompt, string Title) { return Show(owner, Prompt, Title, "", -1, -1); } /// <summary> /// Displays a prompt in a dialog box, waits for the user to input text or click a button, and then returns a string containing the contents of the text box. /// </summary> /// <param name="Prompt">String expression displayed as the message in the dialog box.</param> /// <param name="Title">String expression displayed in the title bar of the dialog box.</param> /// <param name="DefaultResponse">String expression displayed in the text box as the default response if no other input is provided. If you omit DefaultResponse, the displayed text box is empty.</param> /// <returns>The value in the textbox is returned if the user clicks OK or presses the ENTER key. If the user clicks Cancel, a zero-length string is returned.</returns> public static string Show(string Prompt, string Title, string DefaultResponse) { return Show(null, Prompt, Title, DefaultResponse, -1, -1); } public static string Show(IWin32Window owner, string Prompt, string Title, string DefaultResponse) { return Show(owner, Prompt, Title, DefaultResponse, -1, -1); } public static string Show(string Prompt, string Title, string DefaultResponse, int XPos, int YPos) { return Show(null, Prompt, Title, DefaultResponse, XPos, YPos); } /// <summary> /// Displays a prompt in a dialog box, waits for the user to input text or click a button, and then returns a string containing the contents of the text box. /// </summary> /// <param name="Prompt">String expression displayed as the message in the dialog box.</param> /// <param name="Title">String expression displayed in the title bar of the dialog box.</param> /// <param name="DefaultResponse">String expression displayed in the text box as the default response if no other input is provided. If you omit DefaultResponse, the displayed text box is empty.</param> /// <param name="XPos">Integer expression that specifies, in pixels, the distance of the left edge of the dialog box from the left edge of the screen.</param> /// <param name="YPos">Integer expression that specifies, in pixels, the distance of the upper edge of the dialog box from the top of the screen.</param> /// <returns>The value in the textbox is returned if the user clicks OK or presses the ENTER key. If the user clicks Cancel, a zero-length string is returned.</returns> public static string Show(IWin32Window owner, string Prompt, string Title, string DefaultResponse, int XPos, int YPos) { // Create a new input box dialog InputBoxForm frmInputBox = new InputBoxForm(); frmInputBox.Title = Title; frmInputBox.Prompt = Prompt; frmInputBox.DefaultResponse = DefaultResponse; if (XPos >= 0 && YPos >= 0) frmInputBox.StartLocation = new Point(XPos, YPos); if (owner == null) frmInputBox.ShowDialog(); else frmInputBox.ShowDialog(owner); return frmInputBox.ReturnValue; } } }
//----------------------------------------------------------------------------- // Torque // Copyright GarageGames, LLC 2011 //----------------------------------------------------------------------------- singleton Material(test1__07___Default__wall01_) { mapTo = "_07___Default__wall01_"; diffuseMap[0] = "tiles01"; diffuseColor[0] = "1 1 1 1"; specular[0] = "0 0 0 1"; specularPower[0] = 1; pixelSpecular[0] = false; emissive[0] = false; doubleSided = false; translucent = false; translucentBlendOp = "None"; }; singleton Material(test1_orig_18___Default) { diffuseMap[0] = ""; mapTo = "orig_18___Default"; diffuseColor[0] = "0 0 0 1"; specular[0] = "0 0 0 1"; specularPower[0] = 2; pixelSpecular[0] = false; emissive[0] = true; doubleSided = false; translucent = false; translucentBlendOp = "None"; }; singleton Material(test1__01___Default) { diffuseMap[0] = "art/bramtest1/generic1.tga"; mapTo = "_01___Default"; diffuseColor[0] = "1 1 1 1"; specular[0] = "0 0 0 1"; specularPower[0] = 2; pixelSpecular[0] = false; emissive[0] = false; doubleSided = false; translucent = false; translucentBlendOp = "None"; }; singleton Material(test1_Material__1) { diffuseMap[0] = "fence.psd"; mapTo = "Material__1"; diffuseColor[0] = "1 1 1 1"; specular[0] = "0 0 0 1"; specularPower[0] = 2; pixelSpecular[0] = false; emissive[0] = false; doubleSided = false; translucent = false; translucentBlendOp = "None"; }; singleton Material(test1__03___Default) { diffuseMap[0] = ""; mapTo = "_03___Default"; diffuseColor[0] = "0 0 0 1"; specular[0] = "0 0 0 1"; specularPower[0] = 2; pixelSpecular[0] = false; emissive[0] = true; doubleSided = false; translucent = false; translucentBlendOp = "None"; }; singleton Material(test1__04___Default) { diffuseMap[0] = ""; mapTo = "_04___Default"; diffuseColor[0] = "0 0 0 1"; specular[0] = "0 0 0 1"; specularPower[0] = 2; pixelSpecular[0] = false; emissive[0] = true; doubleSided = false; translucent = false; translucentBlendOp = "None"; }; singleton Material(test1__05___Default) { diffuseMap[0] = ""; mapTo = "_05___Default"; diffuseColor[0] = "0 0 0 1"; specular[0] = "0 0 0 1"; specularPower[0] = 2; pixelSpecular[0] = false; emissive[0] = true; doubleSided = false; translucent = false; translucentBlendOp = "None"; }; singleton Material(test1__06___Default) { diffuseMap[0] = ""; mapTo = "_06___Default"; diffuseColor[0] = "0 0 0 1"; specular[0] = "0 0 0 1"; specularPower[0] = 2; pixelSpecular[0] = false; emissive[0] = true; doubleSided = false; translucent = false; translucentBlendOp = "None"; }; singleton Material(test1__11___Default) { diffuseMap[0] = ""; mapTo = "_11___Default"; diffuseColor[0] = "0 0 0 1"; specular[0] = "0 0 0 1"; specularPower[0] = 2; pixelSpecular[0] = false; emissive[0] = true; doubleSided = false; translucent = false; translucentBlendOp = "None"; }; singleton Material(test1__12___Default) { diffuseMap[0] = ""; mapTo = "_12___Default"; diffuseColor[0] = "0 0 0 1"; specular[0] = "0 0 0 1"; specularPower[0] = 2; pixelSpecular[0] = false; emissive[0] = true; doubleSided = false; translucent = false; translucentBlendOp = "None"; }; singleton Material(test1__07___Default) { diffuseMap[0] = "./building_02_df_var2.tga"; mapTo = "_07___Default"; diffuseColor[0] = "1 1 1 1"; specular[0] = "0 0 0 1"; specularPower[0] = 2; pixelSpecular[0] = false; emissive[0] = false; doubleSided = false; translucent = false; translucentBlendOp = "None"; normalMap[0] = "./building_02_nm.tga"; specularMap[0] = "./building_02_spec.tga"; }; singleton Material(test1__15___Default) { diffuseMap[0] = ""; mapTo = "_15___Default"; diffuseColor[0] = "0 0 0 1"; specular[0] = "0 0 0 1"; specularPower[0] = 2; pixelSpecular[0] = false; emissive[0] = true; doubleSided = false; translucent = false; translucentBlendOp = "None"; }; singleton Material(test1_orig_14___Default) { diffuseMap[0] = ""; mapTo = "orig_14___Default"; diffuseColor[0] = "0 0 0 1"; specular[0] = "0 0 0 1"; specularPower[0] = 2; pixelSpecular[0] = false; emissive[0] = true; doubleSided = false; translucent = false; translucentBlendOp = "None"; }; singleton Material(test1__16___Default) { diffuseMap[0] = "art/bramtest1/focus_buidling_df.tga"; mapTo = "_16___Default"; diffuseColor[0] = "0 0 0 1"; specular[0] = "0.917647 0.917647 0.917647 1"; specularPower[0] = 66; pixelSpecular[0] = 0; emissive[0] = 0; doubleSided = false; translucent = false; translucentBlendOp = "None"; normalMap[0] = "art/bramtest1/focus_buidling_nm.tga"; specularMap[0] = "art/bramtest1/focus_buidling_df.tga"; }; singleton Material(test1_orig_17___Default) { diffuseMap[0] = ""; mapTo = "orig_17___Default"; diffuseColor[0] = "0 0 0 1"; specular[0] = "0 0 0 1"; specularPower[0] = 2; pixelSpecular[0] = false; emissive[0] = true; doubleSided = false; translucent = false; translucentBlendOp = "None"; }; singleton Material(test1__19___Default) { diffuseMap[0] = ""; mapTo = "_19___Default"; diffuseColor[0] = "0 0 0 1"; specular[0] = "0 0 0 1"; specularPower[0] = 2; pixelSpecular[0] = false; emissive[0] = true; doubleSided = false; translucent = false; translucentBlendOp = "None"; }; singleton Material(test1__20___Default) { diffuseMap[0] = ""; mapTo = "_20___Default"; diffuseColor[0] = "0 0 0 1"; specular[0] = "0 0 0 1"; specularPower[0] = 2; pixelSpecular[0] = false; emissive[0] = true; doubleSided = false; translucent = false; translucentBlendOp = "None"; }; singleton Material(test1__22___Default) { diffuseMap[0] = ""; mapTo = "_22___Default"; diffuseColor[0] = "0 0 0 1"; specular[0] = "0 0 0 1"; specularPower[0] = 2; pixelSpecular[0] = false; emissive[0] = true; doubleSided = false; translucent = false; translucentBlendOp = "None"; }; singleton Material(test6_orig_orig_orig_orig_01___Default) { diffuseMap[0] = "art/bramtest1/building_01_df.tga"; mapTo = "orig_orig_orig_orig_01___Default"; diffuseColor[0] = "1 1 1 1"; specular[0] = "0 0 0 1"; specularPower[0] = 2; pixelSpecular[0] = 1; emissive[0] = false; doubleSided = false; translucent = false; translucentBlendOp = "None"; normalMap[0] = "art/bramtest1/building_01_nm.tga"; specularMap[0] = ""; cubemap = "Sky_Day_Blur02"; }; singleton Material(test1__02___Default) { mapTo = "orig_orig_orig_orig_orig_orig_orig_01_-_Default"; diffuseColor[0] = "0.992157 0.992157 0.992157 1"; specular[0] = "0.992157 0.788235 0.513726 1"; specularPower[0] = "1"; emissive[0] = "0"; translucentBlendOp = "None"; diffuseMap[0] = "./building_01_df.tga"; normalMap[0] = "./building_01_nm.tga"; cubemap = "DefaultSkyMatCubemap"; pixelSpecular[0] = "1"; specularMap[0] = "./building_01_spec.tga"; }; singleton Material(building_01_glassMat) { mapTo = "glassMat"; diffuseMap[0] = "./building_01_df.tga"; normalMap[0] = ""; specularMap[0] = ""; diffuseColor[0] = "0.12549 0.0784314 0.027451 1"; specular[0] = "1 1 1 1"; specularPower[0] = "54"; doubleSided = false; translucent = false; translucentBlendOp = "None"; pixelSpecular[0] = "1"; cubemap = "GoldenHourCloudySkyCubeMap"; materialTag0 = "RoadAndPath"; glow[0] = "0"; };
namespace OpenIddictDemo; public abstract class OpenIddictDemoDomainTestBase : OpenIddictDemoTestBase<OpenIddictDemoDomainTestModule> { }
using RavenNest.Models; using System; using System.Collections.Generic; namespace RavenNest.BusinessLogic.Game { public interface IClanManager { IReadOnlyList<Player> GetClanMembers(Guid clanId); IReadOnlyList<Player> GetInvitedPlayers(Guid clanId); IReadOnlyList<ClanRole> GetClanRoles(Guid clanId); Clan GetClan(Guid clanId); Clan GetClanByCharacter(Guid characterId); Clan GetClanByUserId(string userId); Clan CreateClan(string userId, string name, string logo); Clan CreateClan(Guid ownerUserId, string name, string logoImageFile); bool AcceptClanInvite(Guid inviteId); bool CreateClanRole(Guid clanId, string name, int level); bool RemoveClanRole(Guid roleId); bool UpdateClanRole(Guid roleId, string newName, int newLevel); bool UpdateClanName(Guid clanId, string newName); bool UpdateClanLogo(Guid clanId, string logoImageFile); bool AssignMemberClanRole(Guid clanId, Guid characterId, Guid roleId); bool AddClanMember(Guid clanId, Guid characterId, Guid roleId); bool RemoveClanMember(Guid clanId, Guid characterId); bool SendPlayerInvite(Guid clanId, Guid characterId, Guid? sender = null); bool RemovePlayerInvite(Guid clanId, Guid characterId); bool RemovePlayerInvite(Guid inviteId); void UpdateMemberRole(Guid clanId, Guid characterId, Guid roleId); bool CanChangeClanName(Guid clanId); int GetNameChangeCount(Guid clanId); bool ResetNameChangeCounter(Guid clanId); } }
@* For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860 *@ @{ ViewData["Title"] = "Repartidores"; } <input type="hidden" value="@Url.Action("GetData","Dealer")" id="urlData"/> <div class="row"> <div class="col text-center header"> Manejo de <span class="color-text-red">repartidores</span> </div> </div> <div class="row"> <div class="col text-center header-caption"> <span class="header-caption">Sistema de <span class="color-text-red">repartidores.</span></span> </div> </div> <br /> <br /> <div class="row"> <div class="col-md-10 offset-md-1 title-project"> <span> En este ejemplo se muestra un sistema de manejo de repartidores, en el se tiene una lista de 8 motociclistas en un horario de 9:00 am a 8:00 pm en el cual un usuario puede apartar un repartidor dentro del horario. </span> </div> </div> <br /> <br /> <div class="row template"> <div class="col-md-5 offset-md-1"> <span class="d-block"> 1. Dar clic en la fecha seleccionada. </span> <span class="d-block"> 2. Selecciona un motociclista. </span> <span class="d-block"> 3. Una vez que se selecciona el motocilicsta la fecha cambiara de color. </span> <span class="d-block"> 4. Para liberar al recurso se tiene que volver a dar clic en la fecha </span> <span class="d-block"> 5. Para cambiar recurso se tiene que seleccionar otro motocilista de la fecha seleccionada </span> <span class="d-block"> Estatus: </span> <span class="d-block"> <div class="square-status status-active"></div> - Fecha sin asignar motociclista. </span> <span class="d-block"> <div class="square-status status-selected"></div> - Fecha asignada a un motociclista. </span> <span class="d-block"> <div class="square-status status-disabled"></div> - Fecha fuera de un horario valido. </span> </div> </div> <br /> <br /> <div id="divDetail"> </div> <br /> <br /> @section Scripts{ <script src="~/js/dealer.js" asp-append-version="true"></script> }
using Microsoft.EntityFrameworkCore; using SmartHomeWWW.Core.Infrastructure; using SmartHomeWWW.Server.Messages; using SmartHomeWWW.Server.Messages.Commands; using System.Text; using Telegram.Bot.Types; namespace SmartHomeWWW.Server.Telegram.BotCommands { public class UsersCommand : ITelegramBotCommand { public UsersCommand(IMessageBus bus, IDbContextFactory<SmartHomeDbContext> dbContextFactory) { _bus = bus; _dbContextFactory = dbContextFactory; } private readonly IMessageBus _bus; private readonly IDbContextFactory<SmartHomeDbContext> _dbContextFactory; public Task Run(Message message, CancellationToken cancellationToken = default) { var args = message.Text?.Split(' ') ?? Array.Empty<string>(); if (args.Length < 1) { return Task.CompletedTask; } if (args.Length == 1) { return ListUsers(message); } return Task.CompletedTask; } private async Task ListUsers(Message message) { using var context = await _dbContextFactory.CreateDbContextAsync(); var users = context.TelegramUsers.OrderBy(u => u.Username); var sb = new StringBuilder(); sb.AppendLine("Telegram users in db:"); var i = 1; foreach (var user in users) { sb.AppendLine($"{i}. {user.Username} [{user.UserType}]"); i++; } _bus.Publish(new TelegramSendTextMessageCommand { ChatId = message.Chat.Id, Text = sb.ToString(), }); } } }
 using System; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.Linq; using DevExpress.Data.Helpers; using DevExpress.Xpo; using DevExpress.Xpo.DB; using DevExpress.Xpo.DB.Helpers; using Fasterflect; namespace Xpand.Xpo.DB { public class SchemaColumnSizeUpdater : ISchemaUpdater { static SchemaColumnSizeUpdater() { Disabled = true; } static readonly HashSet<string> HashSet=new HashSet<string>(); public static bool Disabled { get; set; } public void Update(ConnectionProviderSql connectionProviderSql, DataStoreUpdateSchemaEventArgs dataStoreUpdateSchemaEventArgs) { if (connectionProviderSql == null || Disabled) return; using (((IDisposable) ((AsyncLockHelper) connectionProviderSql.GetPropertyValue("LockHelper")).CallMethod("Lock"))) { if (!connectionProviderSql.CanCreateSchema) return; try { if (dataStoreUpdateSchemaEventArgs.UpdateSchemaResult == UpdateSchemaResult.SchemaExists) { UpdateColumnSize(dataStoreUpdateSchemaEventArgs.Tables, connectionProviderSql); } } catch (Exception e) { Trace.TraceError(e.ToString()); } } } private void UpdateColumnSize(IEnumerable<DBTable> tables, ConnectionProviderSql sqlDataStore) { foreach (var table in tables.Where(table => !HashSet.Contains(table.Name))) { HashSet.Add(table.Name); DBTable actualTable = null; foreach (var column in table.Columns.Where(col => col.ColumnType == DBColumnType.String)) { if (actualTable == null) { actualTable = new DBTable(table.Name); sqlDataStore.GetTableSchema(actualTable, false, false); } DBColumn dbColumn = column; var actualColumn = actualTable.Columns.Find(col => String.Compare(col.Name, sqlDataStore.ComposeSafeColumnName(dbColumn.Name), StringComparison.OrdinalIgnoreCase) == 0); if (NeedsAltering(column, actualColumn)) { if ((actualColumn.Size < column.Size) || (column.Size == SizeAttribute.Unlimited)) { var sql = GetSql(table, sqlDataStore, column); Trace.WriteLineIf(new TraceSwitch("XPO", "").TraceInfo, sql); sqlDataStore.ExecSql(new Query(sql)); } } } } } string GetSql(DBTable table, ConnectionProviderSql sqlDataStore, DBColumn column) { return string.Format(CultureInfo.InvariantCulture, "alter table {0} {3} {1} {2}", sqlDataStore.FormatTableSafe(table), sqlDataStore.FormatColumnSafe(column.Name), sqlDataStore.GetSqlCreateColumnFullAttributes(table, column,true), (sqlDataStore is BaseOracleConnectionProvider || sqlDataStore is MySqlConnectionProvider) ? "modify" : "alter column"); } bool NeedsAltering(DBColumn column, DBColumn actualColumn) { return (actualColumn != null) && (actualColumn.ColumnType == DBColumnType.String) && (actualColumn.Size != column.Size) && (column.DBTypeName != $"varchar({actualColumn.Size})"); } } }
using SqExpress.SqlExport.Internal; using SqExpress.SqlExport.Statement.Internal; using SqExpress.StatementSyntax; using SqExpress.Syntax; namespace SqExpress.SqlExport { public class TSqlExporter : ISqlExporter { public static readonly TSqlExporter Default = new TSqlExporter(SqlBuilderOptions.Default); private readonly SqlBuilderOptions _builderOptions; public TSqlExporter(SqlBuilderOptions builderOptions) { this._builderOptions = builderOptions; } public string ToSql(IExpr expr) { var sqlExporter = new TSqlBuilder(this._builderOptions); if (expr.Accept(sqlExporter, null)) { return sqlExporter.ToString(); } throw new SqExpressException("Could not build Sql"); } public string ToSql(IStatement statement) { var builder = new TSqlStatementBuilder(this._builderOptions, null); statement.Accept(builder); return builder.Build(); } } }
using CommandLine; using System; using System.Collections.Generic; using System.Text; namespace XSwap.CLI { [Verb("test", HelpText = "Test connection to RPC of a blockchain")] public class TestOptions { [Value(0, HelpText = "The name of the chain to test")] public string ChainName { get; set; } } [Verb("newkey", HelpText = "Create a public key")] public class NewOptions { } [Verb("take", HelpText = "Take an offer, this will always ask you confirmation before broadcasting anything")] public class TakeOptions { [Value(0, HelpText = "The offer")] public string Offer { get; set; } } [Verb("propose", HelpText = "Propose an offer")] public class ProposeOptions { [Value(0, HelpText = "Create an offer (example for offering 2 LTC against 1 BTC: 2LTC=>1BTC)")] public string Proposition { get; set; } [Value(1, HelpText = "Public key of the other party")] public string PubKey { get; set; } } [Verb("exit", HelpText = "Quit.")] public class QuitOptions { //normal options here } }
using NRealbit; using System; using System.Collections.Generic; using System.Text; namespace NRXplorer { public partial class NRXplorerNetworkProvider { private void InitGroestlcoin(ChainName networkType) { Add(new NRXplorerNetwork(NRealbit.Altcoins.Groestlcoin.Instance, networkType) { MinRPCVersion = 2160000, CoinType = NetworkType == ChainName.Mainnet ? new KeyPath("17'") : new KeyPath("1'") }); } } }
using Core.DataAccess.EntityFramework; using DataAccess.Abstract; using Entities.Concrete; using Entities.DTOs; using System; using System.Collections.Generic; using System.Text; using System.Linq; namespace DataAccess.Concrete.EntityFramework { public class EfCarDal : EFEntityRepositoryBase<Car, ReCapContext>, ICarDal { public List<CarDetailDto> GetCarDetails() { using (ReCapContext context = new ReCapContext()) { var result = from c in context.Cars join b in context.Brands on c.BrandId equals b.BrandId join cl in context.Colors on c.ColorId equals cl.ColorId select new CarDetailDto { CarId = c.CarId, Description = c.Description, DailyPrice = c.DailyPrice, BrandName = b.BrandName, ColorName = cl.ColorName }; return result.ToList(); } } } }
using System; using Xamarin.Forms; namespace TodoAWSSimpleDB { public partial class LoginPage : ContentPage { public LoginPage () { InitializeComponent (); } void OnLoginClicked (object sender, EventArgs e) { // Use a custom renderer to display the authentication UI Navigation.PushModalAsync (new AuthenticationPage ()); } } }
/** * Author: Ryan A. Kueter * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ using System.Xml.Linq; namespace FreeDataExports.Spreadsheets.Ods1_3 { /// <summary> /// Stores the data definition for a type. /// </summary> internal class DataDefinition { internal int Index { get; set; } internal string Name { get; set; } internal DataType DataType { get; set; } internal XElement Element { get; set; } internal string Worksheet { get; set; } } }
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------- using System; using System.Diagnostics; using System.Runtime.Serialization; using System.Text; namespace Microsoft.Samples.DiagnosticsFeed { [DataContract] class ProcessData { [DataMember] long VirtualMemorySize; [DataMember] long PeakVirtualMemorySize; [DataMember] long PeakWorkingSetSize; public ProcessData(Process p) { this.VirtualMemorySize = p.VirtualMemorySize64; this.PeakVirtualMemorySize = p.PeakVirtualMemorySize64; this.PeakWorkingSetSize = p.PeakWorkingSet64; } public override string ToString() { StringBuilder sb = new StringBuilder(); sb.AppendFormat("Virtual Memory: {0}", this.VirtualMemorySize); sb.Append(Environment.NewLine); sb.AppendFormat("PeakVirtualMemorySize: {0}", this.PeakVirtualMemorySize); sb.Append(Environment.NewLine); sb.AppendFormat("PeakWorkingSetSize: {0}", this.PeakWorkingSetSize); sb.Append(Environment.NewLine); return sb.ToString(); } } }
namespace WebToolHelper { partial class structureControl { /// <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.saveBtn = new System.Windows.Forms.Button(); this.tabControl1 = new System.Windows.Forms.TabControl(); this.SinglePageTab = new System.Windows.Forms.TabPage(); this.panel3 = new System.Windows.Forms.Panel(); this.panel6 = new System.Windows.Forms.Panel(); this.label3 = new System.Windows.Forms.Label(); this.comboBox4 = new System.Windows.Forms.ComboBox(); this.panel5 = new System.Windows.Forms.Panel(); this.label2 = new System.Windows.Forms.Label(); this.comboBox3 = new System.Windows.Forms.ComboBox(); this.panel4 = new System.Windows.Forms.Panel(); this.label1 = new System.Windows.Forms.Label(); this.comboBox2 = new System.Windows.Forms.ComboBox(); this.panel2 = new System.Windows.Forms.Panel(); this.panel9 = new System.Windows.Forms.Panel(); this.label6 = new System.Windows.Forms.Label(); this.comboBox7 = new System.Windows.Forms.ComboBox(); this.panel8 = new System.Windows.Forms.Panel(); this.label5 = new System.Windows.Forms.Label(); this.comboBox6 = new System.Windows.Forms.ComboBox(); this.panel7 = new System.Windows.Forms.Panel(); this.label4 = new System.Windows.Forms.Label(); this.comboBox5 = new System.Windows.Forms.ComboBox(); this.panel1 = new System.Windows.Forms.Panel(); this.comboBox1 = new System.Windows.Forms.ComboBox(); this.formPageTab = new System.Windows.Forms.TabPage(); this.panel10 = new System.Windows.Forms.Panel(); this.panel13 = new System.Windows.Forms.Panel(); this.label9 = new System.Windows.Forms.Label(); this.comboBox10 = new System.Windows.Forms.ComboBox(); this.panel14 = new System.Windows.Forms.Panel(); this.panel15 = new System.Windows.Forms.Panel(); this.label10 = new System.Windows.Forms.Label(); this.comboBox11 = new System.Windows.Forms.ComboBox(); this.panel16 = new System.Windows.Forms.Panel(); this.label11 = new System.Windows.Forms.Label(); this.comboBox12 = new System.Windows.Forms.ComboBox(); this.panel17 = new System.Windows.Forms.Panel(); this.label12 = new System.Windows.Forms.Label(); this.comboBox13 = new System.Windows.Forms.ComboBox(); this.panel18 = new System.Windows.Forms.Panel(); this.comboBox14 = new System.Windows.Forms.ComboBox(); this.panel11 = new System.Windows.Forms.Panel(); this.comboBox8 = new System.Windows.Forms.ComboBox(); this.tabControl1.SuspendLayout(); this.SinglePageTab.SuspendLayout(); this.panel3.SuspendLayout(); this.panel6.SuspendLayout(); this.panel5.SuspendLayout(); this.panel4.SuspendLayout(); this.panel2.SuspendLayout(); this.panel9.SuspendLayout(); this.panel8.SuspendLayout(); this.panel7.SuspendLayout(); this.panel1.SuspendLayout(); this.formPageTab.SuspendLayout(); this.panel10.SuspendLayout(); this.panel13.SuspendLayout(); this.panel14.SuspendLayout(); this.panel15.SuspendLayout(); this.panel16.SuspendLayout(); this.panel17.SuspendLayout(); this.panel18.SuspendLayout(); this.panel11.SuspendLayout(); this.SuspendLayout(); // // saveBtn // this.saveBtn.Location = new System.Drawing.Point(10, 504); this.saveBtn.Name = "saveBtn"; this.saveBtn.Size = new System.Drawing.Size(947, 23); this.saveBtn.TabIndex = 3; this.saveBtn.Text = "SAVE"; this.saveBtn.UseVisualStyleBackColor = true; // // tabControl1 // this.tabControl1.Controls.Add(this.SinglePageTab); this.tabControl1.Controls.Add(this.formPageTab); this.tabControl1.Location = new System.Drawing.Point(10, 3); this.tabControl1.Name = "tabControl1"; this.tabControl1.SelectedIndex = 0; this.tabControl1.Size = new System.Drawing.Size(947, 495); this.tabControl1.TabIndex = 4; // // SinglePageTab // this.SinglePageTab.Controls.Add(this.panel11); this.SinglePageTab.Controls.Add(this.panel3); this.SinglePageTab.Controls.Add(this.panel2); this.SinglePageTab.Controls.Add(this.panel1); this.SinglePageTab.Location = new System.Drawing.Point(4, 22); this.SinglePageTab.Name = "SinglePageTab"; this.SinglePageTab.Padding = new System.Windows.Forms.Padding(3); this.SinglePageTab.Size = new System.Drawing.Size(939, 469); this.SinglePageTab.TabIndex = 0; this.SinglePageTab.Text = "Single Page"; this.SinglePageTab.UseVisualStyleBackColor = true; // // panel3 // this.panel3.BackColor = System.Drawing.SystemColors.ControlLight; this.panel3.Controls.Add(this.panel6); this.panel3.Controls.Add(this.panel5); this.panel3.Controls.Add(this.panel4); this.panel3.Location = new System.Drawing.Point(6, 60); this.panel3.Name = "panel3"; this.panel3.Size = new System.Drawing.Size(630, 363); this.panel3.TabIndex = 5; // // panel6 // this.panel6.BackColor = System.Drawing.SystemColors.ButtonFace; this.panel6.Controls.Add(this.label3); this.panel6.Controls.Add(this.comboBox4); this.panel6.Location = new System.Drawing.Point(3, 243); this.panel6.Name = "panel6"; this.panel6.Size = new System.Drawing.Size(621, 97); this.panel6.TabIndex = 1; // // label3 // this.label3.AutoSize = true; this.label3.Location = new System.Drawing.Point(269, 29); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(69, 13); this.label3.TabIndex = 4; this.label3.Text = "MODULE #3"; // // comboBox4 // this.comboBox4.FormattingEnabled = true; this.comboBox4.Items.AddRange(new object[] { "Navbar"}); this.comboBox4.Location = new System.Drawing.Point(55, 45); this.comboBox4.Name = "comboBox4"; this.comboBox4.Size = new System.Drawing.Size(540, 21); this.comboBox4.TabIndex = 3; // // panel5 // this.panel5.BackColor = System.Drawing.SystemColors.ButtonFace; this.panel5.Controls.Add(this.label2); this.panel5.Controls.Add(this.comboBox3); this.panel5.Location = new System.Drawing.Point(3, 135); this.panel5.Name = "panel5"; this.panel5.Size = new System.Drawing.Size(621, 102); this.panel5.TabIndex = 1; // // label2 // this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(269, 32); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(69, 13); this.label2.TabIndex = 3; this.label2.Text = "MODULE #2"; // // comboBox3 // this.comboBox3.FormattingEnabled = true; this.comboBox3.Items.AddRange(new object[] { "Navbar"}); this.comboBox3.Location = new System.Drawing.Point(46, 48); this.comboBox3.Name = "comboBox3"; this.comboBox3.Size = new System.Drawing.Size(540, 21); this.comboBox3.TabIndex = 2; // // panel4 // this.panel4.BackColor = System.Drawing.SystemColors.ButtonFace; this.panel4.Controls.Add(this.label1); this.panel4.Controls.Add(this.comboBox2); this.panel4.Location = new System.Drawing.Point(3, 25); this.panel4.Name = "panel4"; this.panel4.Size = new System.Drawing.Size(621, 104); this.panel4.TabIndex = 0; // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(269, 32); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(69, 13); this.label1.TabIndex = 2; this.label1.Text = "MODULE #1"; // // comboBox2 // this.comboBox2.FormattingEnabled = true; this.comboBox2.Items.AddRange(new object[] { "Navbar"}); this.comboBox2.Location = new System.Drawing.Point(46, 48); this.comboBox2.Name = "comboBox2"; this.comboBox2.Size = new System.Drawing.Size(540, 21); this.comboBox2.TabIndex = 1; // // panel2 // this.panel2.BackColor = System.Drawing.SystemColors.ControlLight; this.panel2.Controls.Add(this.panel9); this.panel2.Controls.Add(this.panel8); this.panel2.Controls.Add(this.panel7); this.panel2.Location = new System.Drawing.Point(641, 60); this.panel2.Name = "panel2"; this.panel2.Size = new System.Drawing.Size(291, 363); this.panel2.TabIndex = 4; // // panel9 // this.panel9.BackColor = System.Drawing.SystemColors.ButtonFace; this.panel9.Controls.Add(this.label6); this.panel9.Controls.Add(this.comboBox7); this.panel9.Location = new System.Drawing.Point(7, 243); this.panel9.Name = "panel9"; this.panel9.Size = new System.Drawing.Size(278, 97); this.panel9.TabIndex = 2; // // label6 // this.label6.AutoSize = true; this.label6.Location = new System.Drawing.Point(114, 29); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(69, 13); this.label6.TabIndex = 7; this.label6.Text = "MODULE #6"; // // comboBox7 // this.comboBox7.FormattingEnabled = true; this.comboBox7.Items.AddRange(new object[] { "Navbar"}); this.comboBox7.Location = new System.Drawing.Point(38, 45); this.comboBox7.Name = "comboBox7"; this.comboBox7.Size = new System.Drawing.Size(225, 21); this.comboBox7.TabIndex = 4; // // panel8 // this.panel8.BackColor = System.Drawing.SystemColors.ButtonFace; this.panel8.Controls.Add(this.label5); this.panel8.Controls.Add(this.comboBox6); this.panel8.Location = new System.Drawing.Point(6, 135); this.panel8.Name = "panel8"; this.panel8.Size = new System.Drawing.Size(278, 102); this.panel8.TabIndex = 2; // // label5 // this.label5.AutoSize = true; this.label5.Location = new System.Drawing.Point(114, 32); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(69, 13); this.label5.TabIndex = 6; this.label5.Text = "MODULE #5"; // // comboBox6 // this.comboBox6.FormattingEnabled = true; this.comboBox6.Items.AddRange(new object[] { "Navbar"}); this.comboBox6.Location = new System.Drawing.Point(38, 48); this.comboBox6.Name = "comboBox6"; this.comboBox6.Size = new System.Drawing.Size(225, 21); this.comboBox6.TabIndex = 3; // // panel7 // this.panel7.BackColor = System.Drawing.SystemColors.ButtonFace; this.panel7.Controls.Add(this.label4); this.panel7.Controls.Add(this.comboBox5); this.panel7.Location = new System.Drawing.Point(6, 25); this.panel7.Name = "panel7"; this.panel7.Size = new System.Drawing.Size(278, 104); this.panel7.TabIndex = 1; // // label4 // this.label4.AutoSize = true; this.label4.Location = new System.Drawing.Point(114, 32); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(69, 13); this.label4.TabIndex = 5; this.label4.Text = "MODULE #4"; // // comboBox5 // this.comboBox5.FormattingEnabled = true; this.comboBox5.Items.AddRange(new object[] { "Navbar"}); this.comboBox5.Location = new System.Drawing.Point(38, 48); this.comboBox5.Name = "comboBox5"; this.comboBox5.Size = new System.Drawing.Size(225, 21); this.comboBox5.TabIndex = 2; // // panel1 // this.panel1.BackColor = System.Drawing.SystemColors.ControlLight; this.panel1.Controls.Add(this.comboBox1); this.panel1.Location = new System.Drawing.Point(6, 6); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(926, 48); this.panel1.TabIndex = 3; // // comboBox1 // this.comboBox1.FormattingEnabled = true; this.comboBox1.Items.AddRange(new object[] { "Navbar"}); this.comboBox1.Location = new System.Drawing.Point(102, 14); this.comboBox1.Name = "comboBox1"; this.comboBox1.Size = new System.Drawing.Size(778, 21); this.comboBox1.TabIndex = 0; // // formPageTab // this.formPageTab.Controls.Add(this.panel10); this.formPageTab.Controls.Add(this.panel14); this.formPageTab.Controls.Add(this.panel18); this.formPageTab.Location = new System.Drawing.Point(4, 22); this.formPageTab.Name = "formPageTab"; this.formPageTab.Padding = new System.Windows.Forms.Padding(3); this.formPageTab.Size = new System.Drawing.Size(939, 449); this.formPageTab.TabIndex = 1; this.formPageTab.Text = "Form Page"; this.formPageTab.UseVisualStyleBackColor = true; // // panel10 // this.panel10.BackColor = System.Drawing.SystemColors.ControlLight; this.panel10.Controls.Add(this.panel13); this.panel10.Location = new System.Drawing.Point(6, 62); this.panel10.Name = "panel10"; this.panel10.Size = new System.Drawing.Size(630, 378); this.panel10.TabIndex = 8; // // panel13 // this.panel13.BackColor = System.Drawing.SystemColors.ButtonFace; this.panel13.Controls.Add(this.label9); this.panel13.Controls.Add(this.comboBox10); this.panel13.Location = new System.Drawing.Point(3, 25); this.panel13.Name = "panel13"; this.panel13.Size = new System.Drawing.Size(618, 350); this.panel13.TabIndex = 0; // // label9 // this.label9.AutoSize = true; this.label9.Location = new System.Drawing.Point(264, 157); this.label9.Name = "label9"; this.label9.Size = new System.Drawing.Size(69, 13); this.label9.TabIndex = 2; this.label9.Text = "MODULE #1"; // // comboBox10 // this.comboBox10.FormattingEnabled = true; this.comboBox10.Items.AddRange(new object[] { "Navbar"}); this.comboBox10.Location = new System.Drawing.Point(41, 173); this.comboBox10.Name = "comboBox10"; this.comboBox10.Size = new System.Drawing.Size(540, 21); this.comboBox10.TabIndex = 1; // // panel14 // this.panel14.BackColor = System.Drawing.SystemColors.ControlLight; this.panel14.Controls.Add(this.panel15); this.panel14.Controls.Add(this.panel16); this.panel14.Controls.Add(this.panel17); this.panel14.Location = new System.Drawing.Point(641, 62); this.panel14.Name = "panel14"; this.panel14.Size = new System.Drawing.Size(291, 378); this.panel14.TabIndex = 7; // // panel15 // this.panel15.BackColor = System.Drawing.SystemColors.ButtonFace; this.panel15.Controls.Add(this.label10); this.panel15.Controls.Add(this.comboBox11); this.panel15.Location = new System.Drawing.Point(6, 278); this.panel15.Name = "panel15"; this.panel15.Size = new System.Drawing.Size(278, 97); this.panel15.TabIndex = 2; // // label10 // this.label10.AutoSize = true; this.label10.Location = new System.Drawing.Point(114, 29); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(69, 13); this.label10.TabIndex = 7; this.label10.Text = "MODULE #6"; // // comboBox11 // this.comboBox11.FormattingEnabled = true; this.comboBox11.Items.AddRange(new object[] { "Navbar"}); this.comboBox11.Location = new System.Drawing.Point(38, 45); this.comboBox11.Name = "comboBox11"; this.comboBox11.Size = new System.Drawing.Size(225, 21); this.comboBox11.TabIndex = 4; // // panel16 // this.panel16.BackColor = System.Drawing.SystemColors.ButtonFace; this.panel16.Controls.Add(this.label11); this.panel16.Controls.Add(this.comboBox12); this.panel16.Location = new System.Drawing.Point(6, 150); this.panel16.Name = "panel16"; this.panel16.Size = new System.Drawing.Size(278, 102); this.panel16.TabIndex = 2; // // label11 // this.label11.AutoSize = true; this.label11.Location = new System.Drawing.Point(114, 32); this.label11.Name = "label11"; this.label11.Size = new System.Drawing.Size(69, 13); this.label11.TabIndex = 6; this.label11.Text = "MODULE #5"; // // comboBox12 // this.comboBox12.FormattingEnabled = true; this.comboBox12.Items.AddRange(new object[] { "Navbar"}); this.comboBox12.Location = new System.Drawing.Point(38, 48); this.comboBox12.Name = "comboBox12"; this.comboBox12.Size = new System.Drawing.Size(225, 21); this.comboBox12.TabIndex = 3; // // panel17 // this.panel17.BackColor = System.Drawing.SystemColors.ButtonFace; this.panel17.Controls.Add(this.label12); this.panel17.Controls.Add(this.comboBox13); this.panel17.Location = new System.Drawing.Point(6, 25); this.panel17.Name = "panel17"; this.panel17.Size = new System.Drawing.Size(278, 104); this.panel17.TabIndex = 1; // // label12 // this.label12.AutoSize = true; this.label12.Location = new System.Drawing.Point(114, 32); this.label12.Name = "label12"; this.label12.Size = new System.Drawing.Size(69, 13); this.label12.TabIndex = 5; this.label12.Text = "MODULE #4"; // // comboBox13 // this.comboBox13.FormattingEnabled = true; this.comboBox13.Items.AddRange(new object[] { "Navbar"}); this.comboBox13.Location = new System.Drawing.Point(38, 48); this.comboBox13.Name = "comboBox13"; this.comboBox13.Size = new System.Drawing.Size(225, 21); this.comboBox13.TabIndex = 2; // // panel18 // this.panel18.BackColor = System.Drawing.SystemColors.ControlLight; this.panel18.Controls.Add(this.comboBox14); this.panel18.Location = new System.Drawing.Point(6, 8); this.panel18.Name = "panel18"; this.panel18.Size = new System.Drawing.Size(926, 48); this.panel18.TabIndex = 6; // // comboBox14 // this.comboBox14.FormattingEnabled = true; this.comboBox14.Items.AddRange(new object[] { "Navbar"}); this.comboBox14.Location = new System.Drawing.Point(102, 14); this.comboBox14.Name = "comboBox14"; this.comboBox14.Size = new System.Drawing.Size(778, 21); this.comboBox14.TabIndex = 0; // // panel11 // this.panel11.BackColor = System.Drawing.Color.Gainsboro; this.panel11.Controls.Add(this.comboBox8); this.panel11.Location = new System.Drawing.Point(6, 430); this.panel11.Name = "panel11"; this.panel11.Size = new System.Drawing.Size(926, 33); this.panel11.TabIndex = 6; // // comboBox8 // this.comboBox8.FormattingEnabled = true; this.comboBox8.Items.AddRange(new object[] { "Navbar"}); this.comboBox8.Location = new System.Drawing.Point(74, 6); this.comboBox8.Name = "comboBox8"; this.comboBox8.Size = new System.Drawing.Size(778, 21); this.comboBox8.TabIndex = 1; // // structureControl // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(969, 539); this.Controls.Add(this.tabControl1); this.Controls.Add(this.saveBtn); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; this.Name = "structureControl"; this.Text = "structureControl"; this.tabControl1.ResumeLayout(false); this.SinglePageTab.ResumeLayout(false); this.panel3.ResumeLayout(false); this.panel6.ResumeLayout(false); this.panel6.PerformLayout(); this.panel5.ResumeLayout(false); this.panel5.PerformLayout(); this.panel4.ResumeLayout(false); this.panel4.PerformLayout(); this.panel2.ResumeLayout(false); this.panel9.ResumeLayout(false); this.panel9.PerformLayout(); this.panel8.ResumeLayout(false); this.panel8.PerformLayout(); this.panel7.ResumeLayout(false); this.panel7.PerformLayout(); this.panel1.ResumeLayout(false); this.formPageTab.ResumeLayout(false); this.panel10.ResumeLayout(false); this.panel13.ResumeLayout(false); this.panel13.PerformLayout(); this.panel14.ResumeLayout(false); this.panel15.ResumeLayout(false); this.panel15.PerformLayout(); this.panel16.ResumeLayout(false); this.panel16.PerformLayout(); this.panel17.ResumeLayout(false); this.panel17.PerformLayout(); this.panel18.ResumeLayout(false); this.panel11.ResumeLayout(false); this.ResumeLayout(false); } #endregion private System.Windows.Forms.Button saveBtn; private System.Windows.Forms.TabControl tabControl1; private System.Windows.Forms.TabPage SinglePageTab; private System.Windows.Forms.Panel panel3; private System.Windows.Forms.Panel panel6; private System.Windows.Forms.Label label3; private System.Windows.Forms.ComboBox comboBox4; private System.Windows.Forms.Panel panel5; private System.Windows.Forms.Label label2; private System.Windows.Forms.ComboBox comboBox3; private System.Windows.Forms.Panel panel4; private System.Windows.Forms.Label label1; private System.Windows.Forms.ComboBox comboBox2; private System.Windows.Forms.Panel panel2; private System.Windows.Forms.Panel panel9; private System.Windows.Forms.Label label6; private System.Windows.Forms.ComboBox comboBox7; private System.Windows.Forms.Panel panel8; private System.Windows.Forms.Label label5; private System.Windows.Forms.ComboBox comboBox6; private System.Windows.Forms.Panel panel7; private System.Windows.Forms.Label label4; private System.Windows.Forms.ComboBox comboBox5; private System.Windows.Forms.Panel panel1; private System.Windows.Forms.ComboBox comboBox1; private System.Windows.Forms.TabPage formPageTab; private System.Windows.Forms.Panel panel10; private System.Windows.Forms.Panel panel13; private System.Windows.Forms.Label label9; private System.Windows.Forms.ComboBox comboBox10; private System.Windows.Forms.Panel panel14; private System.Windows.Forms.Panel panel15; private System.Windows.Forms.Label label10; private System.Windows.Forms.ComboBox comboBox11; private System.Windows.Forms.Panel panel16; private System.Windows.Forms.Label label11; private System.Windows.Forms.ComboBox comboBox12; private System.Windows.Forms.Panel panel17; private System.Windows.Forms.Label label12; private System.Windows.Forms.ComboBox comboBox13; private System.Windows.Forms.Panel panel18; private System.Windows.Forms.ComboBox comboBox14; private System.Windows.Forms.Panel panel11; private System.Windows.Forms.ComboBox comboBox8; } }
namespace Toggl.Core { public static class ApplicationUrls { public const string Scheme = "toggl"; public const string Host = "tracker"; public static class Main { public const string Path = "/main"; public static string Default => $"{Scheme}://{Host}{Path}"; } public static class TimeEntry { public const string TimeEntryId = "timeEntryId"; public const string WorkspaceId = "workspaceId"; public const string StartTime = "startTime"; public const string StopTime = "stopTime"; public const string Duration = "duration"; public const string Description = "description"; public const string ProjectId = "projectId"; public const string TaskId = "taskId"; public const string Tags = "tags"; public const string Billable = "billable"; public const string Source = "source"; public static class Start { public const string Path = "/timeEntry/start"; public static string Default => $"{Scheme}://{Host}{Path}"; public static string WithDescription(string description) => $"{Default}?description={description}"; } public static class Stop { public const string Path = "/timeEntry/stop"; public static string Default => $"{Scheme}://{Host}{Path}"; public static string FromSiri => $"{Scheme}://{Host}{Path}?source=Siri"; } public static class Create { public const string Path = "/timeEntry/create"; public static string Default => $"{Scheme}://{Host}{Path}"; } public static class Update { public const string Path = "/timeEntry/update"; public static string Default => $"{Scheme}://{Host}{Path}"; } public static class ContinueLast { public const string Path = "/timeEntry/continue"; public static string Default => $"{Scheme}://{Host}{Path}"; } public static class New { public const string Path = "/timeEntry/new"; public static string Default => $"{Scheme}://{Host}{Path}"; } public static class Edit { public const string Path = "/timeEntry/edit"; public static string Default => $"{Scheme}://{Host}{Path}"; } } public static class Reports { public const string Path = "/reports"; public const string WorkspaceId = "workspaceId"; public const string StartDate = "startDate"; public const string EndDate = "endDate"; public static string Default => $"{Scheme}://{Host}{Path}"; } public static class Calendar { public const string Path = "/calendar"; public const string EventId = "eventId"; public static string Default => $"{Scheme}://{Host}{Path}"; public static string ForId(string eventId) => $"{Scheme}://{Host}{Path}?eventId={eventId}"; } } }
using FreeRedis; using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace OnceMi.Framework.Extension.Filters { /// <summary> /// 重复请求 /// </summary> public class GolbalTranActionFilter : IActionFilter { private readonly ILogger<GolbalTranActionFilter> _logger; private readonly RedisClient _redis; public GolbalTranActionFilter(ILogger<GolbalTranActionFilter> logger , RedisClient redis) { _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _redis = redis ?? throw new ArgumentNullException(nameof(redis)); } public void OnActionExecuted(ActionExecutedContext context) { return; } public void OnActionExecuting(ActionExecutingContext context) { return; } } }
namespace GrowATree.Application.Trees.Commands.AddImage { using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using global::Common.Constants; using GrowATree.Application.Common.Models; using MediatR; using Microsoft.AspNetCore.Http; public class AddTreeImagesCommand : IRequest<Result<List<string>>> { [Required(ErrorMessage = ErrorMessages.TreeNotFoundErrorMessage)] public string TreeId { get; set; } [Required(ErrorMessage = ErrorMessages.TreeImageRequiredErrorMessage)] public List<IFormFile> ImagesFiles { get; set; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Reactive.Concurrency; using System.Reactive.Linq; using System.Threading; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Trakx.Coinbase.Custody.Client.Interfaces; using Trakx.Coinbase.Custody.Client.Models; using Trakx.Common.Interfaces; namespace Trakx.IndiceManager.Server.Data { /// <summary> /// A service used to poll the Coinbase Custody Api to be notified of new deposits /// on Trakx' Coinbase Wallets. /// </summary> public interface ICoinbaseTransactionListener { /// <summary> /// Stream of incoming transaction on Trakx coinbase wallets /// </summary> IObservable<CoinbaseTransaction> TransactionStream { get; } /// <summary> /// Allows to stop the Observable stream by passing a cancellationToken in parameter. /// </summary> void StopListening(); } /// <inheritdoc cref="ICoinbaseTransactionListener"/> /// <inheritdoc cref="IDisposable"/> public sealed class CoinbaseTransactionListener : ICoinbaseTransactionListener, IDisposable { /// <summary> /// Interval at which we try to retrieve new transactions from Coinbase Custody. /// </summary> public static readonly TimeSpan PollingInterval = TimeSpan.FromSeconds(10); private readonly CancellationTokenSource _cancellationTokenSource; private readonly ILogger<CoinbaseTransactionListener> _logger; private readonly IServiceScope _initialisationScope; /// <summary> /// A service used to poll the Coinbase Custody Api to be notified of new deposits /// on Trakx' Coinbase Wallets. /// </summary> public CoinbaseTransactionListener(ICoinbaseClient coinbaseClient, IServiceScopeFactory serviceScopeFactory, ILogger<CoinbaseTransactionListener> logger, IScheduler? scheduler = default) { _logger = logger; _initialisationScope = serviceScopeFactory.CreateScope(); var transactionDataProvider = _initialisationScope.ServiceProvider.GetService<ITransactionDataProvider>(); scheduler ??= Scheduler.Default; _cancellationTokenSource = new CancellationTokenSource(); TransactionStream = Observable.Interval(PollingInterval, scheduler) .TakeWhile(_ => !_cancellationTokenSource.IsCancellationRequested) .Select(async i => { try { logger.LogDebug("Querying Coinbase Custody for new transactions."); var transactions = coinbaseClient.GetTransactions(endTime: await transactionDataProvider.GetLastWrappingTransactionDatetime(), paginationOptions: new PaginationOptions(pageSize:100)); return transactions.ToObservable(); } catch (Exception e) { logger.LogError(e, "Failed to get new transactions from Coinbase Custody"); return new CoinbaseTransaction[0].ToObservable(scheduler); } }) .SelectMany(t => t) .SelectMany(t => t) //todo: think about a solution to only do a distinct on a finite set of transactions, //it looks like here the only way to do a distinct would be to keep in memory all the //transactions that ever appeared in the stream to perform comparison. This is probably //slow and leaky. .Distinct(t => string.Join("|", t.Hashes)) .Do(t => logger.LogDebug("New transaction found on wallet {0}", t.WalletId)); } #region Implementation of ICoinbaseTransactionListener /// <inheritdoc /> public void StopListening() { _logger.LogDebug("Stopping to look for coinbase transactions."); _cancellationTokenSource.Cancel(); } /// <inheritdoc /> public IObservable<CoinbaseTransaction> TransactionStream { get; } #endregion #region Implementation of IDisposable /// <inheritdoc /> public void Dispose() { _cancellationTokenSource?.Dispose(); _initialisationScope?.Dispose(); } #endregion } }
// <copyright file="RockPegasusSceneState.cs" company="https://github.com/yangyuan"> // Copyright (c) The Hearthrock Project. All rights reserved. // </copyright> namespace Hearthrock.Pegasus { /// <summary> /// SceneState for Pegasus. /// </summary> public enum RockPegasusSceneState { /// <summary> /// The None. /// </summary> None, /// <summary> /// Invalid Scene, can do nothing. /// </summary> InvalidScene, /// <summary> /// Blocking Scene, should wait. /// </summary> BlockingScene, /// <summary> /// A not support scene but can be canceled to hub. /// </summary> CancelableScene, /// <summary> /// A quests dialog is showing. /// </summary> QuestsDialog, /// <summary> /// A general dialog is showing. /// </summary> GeneralDialog, /// <summary> /// The hub scene. /// </summary> HubScene, /// <summary> /// The adventure (PVE) scene. /// </summary> AdventureScene, /// <summary> /// The tournament (PVP) scene. /// </summary> TournamentScene, /// <summary> /// Playing the game. /// </summary> GamePlay } }
using AMKsGear.Architecture.Modeling; namespace AMKsGear.Architecture.Data.Schema { public interface IUsernameString { string Username { get; set; } } public interface IUsernameStringEntity : IUsernameString, IEntity { } public interface IUsernameStringModel : IUsernameString, IModel { } }
using System; namespace MD5.Library { public class TransformNumber { public uint NumberK { get; set; } public ushort NumberS { get; set; } public uint NumberI { get; set; } public TransformNumber(uint k, ushort s, uint i) { NumberK = k; NumberS = s; NumberI = i; } } }
using Microsoft.VisualStudio.TestTools.UnitTesting; using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.IO; using System.IO.Pipes; using System.Threading; using System.Threading.Tasks; namespace Capnp.Net.Runtime.Tests { [TestClass] [TestCategory("Coverage")] public class FramePumpTests { class MyStruct : SerializerState { public MyStruct() { SetStruct(0, 1); } } [TestMethod] public void PipedFramePump() { int UnpackFrame(WireFrame frame) { int count = frame.Segments.Count; for (int i = 0; i < count; i++) { Assert.AreEqual(i + 1, frame.Segments[i].Length); } return count; } WireFrame PackFrame(int value) { var segments = new Memory<ulong>[value]; for (int i = 0; i < value; i++) { ulong[] a = new ulong[i + 1]; segments[i] = new Memory<ulong>(a); } return new WireFrame(segments); } Thread rxRunner = null; using (var server = new AnonymousPipeServerStream(PipeDirection.Out, HandleInheritability.None)) using (var client = new AnonymousPipeClientStream(PipeDirection.In, server.ClientSafePipeHandle)) using (var bc = new BlockingCollection<int>(8)) { server.ReadMode = PipeTransmissionMode.Byte; client.ReadMode = PipeTransmissionMode.Byte; using (var txPump = new FramePump(server)) using (var rxPump = new FramePump(client)) { rxRunner = new Thread(() => { rxPump.Run(); }); rxPump.FrameReceived += f => bc.Add(UnpackFrame(f)); rxRunner.Start(); for (int i = 0; i < 100; i++) { txPump.Send(PackFrame(1)); txPump.Send(PackFrame(8)); txPump.Send(PackFrame(2)); txPump.Send(PackFrame(7)); txPump.Send(PackFrame(3)); txPump.Send(PackFrame(6)); txPump.Send(PackFrame(4)); txPump.Send(PackFrame(5)); Assert.IsTrue(SpinWait.SpinUntil(() => bc.Count == 8, 500)); Assert.AreEqual(1, bc.Take()); Assert.AreEqual(8, bc.Take()); Assert.AreEqual(2, bc.Take()); Assert.AreEqual(7, bc.Take()); Assert.AreEqual(3, bc.Take()); Assert.AreEqual(6, bc.Take()); Assert.AreEqual(4, bc.Take()); Assert.AreEqual(5, bc.Take()); } } } Assert.IsTrue(rxRunner.Join(500)); } [TestMethod] public void FramePumpDeferredProcessing() { int UnpackAndVerifyFrame(WireFrame frame, int expectedCount) { int count = frame.Segments.Count; Assert.AreEqual(expectedCount, count); for (int i = 0; i < count; i++) { int length = frame.Segments[i].Length; Assert.AreEqual(expectedCount - i, length); for (int j = 0; j < length; j++) { var expected = (ulong) (length - j); var actual = frame.Segments[i].Span[j]; Assert.AreEqual(expected, actual); } } return count; } WireFrame PackFrame(int value) { var segments = new Memory<ulong>[value]; for (int i = 0; i < value; i++) { ulong[] a = new ulong[value - i]; segments[i] = new Memory<ulong>(a); for (int j = 0; j < a.Length; j++) { a[j] = (ulong)(a.Length - j); } } return new WireFrame(segments); } Thread rxRunner = null; using (var server = new AnonymousPipeServerStream(PipeDirection.Out, HandleInheritability.None)) using (var client = new AnonymousPipeClientStream(PipeDirection.In, server.ClientSafePipeHandle)) using (var bc = new BlockingCollection<WireFrame>(8)) { server.ReadMode = PipeTransmissionMode.Byte; client.ReadMode = PipeTransmissionMode.Byte; using (var txPump = new FramePump(server)) using (var rxPump = new FramePump(client)) { rxRunner = new Thread(() => { rxPump.Run(); }); rxPump.FrameReceived += bc.Add; rxRunner.Start(); txPump.Send(PackFrame(1)); txPump.Send(PackFrame(8)); txPump.Send(PackFrame(2)); txPump.Send(PackFrame(7)); txPump.Send(PackFrame(3)); txPump.Send(PackFrame(6)); txPump.Send(PackFrame(4)); txPump.Send(PackFrame(5)); Assert.IsTrue(SpinWait.SpinUntil(() => bc.Count == 8, 50000)); UnpackAndVerifyFrame(bc.Take(), 1); UnpackAndVerifyFrame(bc.Take(), 8); UnpackAndVerifyFrame(bc.Take(), 2); UnpackAndVerifyFrame(bc.Take(), 7); UnpackAndVerifyFrame(bc.Take(), 3); UnpackAndVerifyFrame(bc.Take(), 6); UnpackAndVerifyFrame(bc.Take(), 4); UnpackAndVerifyFrame(bc.Take(), 5); } } Assert.IsTrue(rxRunner.Join(500)); } } }
using Newtonsoft.Json; using System.Collections.Generic; namespace LaunchwaresUpdater.Models { [JsonObject] public class UpdateFiles { public UpdateFiles() { List = new List<string>(); } [JsonProperty("files")] public List<string> List { get; set; } } }
using System; namespace Xero.NetStandard.OAuth2.Test.Model.Accounting { public class XeroConfiguration { public string AccountingBaseUrl { get; set; } public string BankfeedsBaseUrl { get; set; } public string PayrollAuBaseUrl { get; set; } } }
using EmptyBox.UI; namespace EmptyBox.Media.Encoding { public sealed class VideoStreamProperties { public Size<ushort> Resolution { get; } public double FPS { get; } public VideoStreamProperties(Size<ushort> resolution) { Resolution = resolution; FPS = double.PositiveInfinity; } public VideoStreamProperties(Size<ushort> resolution, double fps) { Resolution = resolution; FPS = fps; } } }
namespace DerMistkaefer.DvbLive.TriasCommunication.Data { /// <summary> /// Response Structure for an Location Information Stop Request /// </summary> public class LocationInformationStopResponse { /// <summary> /// Id of this Stop Point /// </summary> public string IdStopPoint { get; set; } = ""; /// <summary> /// Stop Point Name /// </summary> public string StopPointName { get; set; } = ""; /// <summary> /// Geo Longitude of the Stop /// </summary> public decimal Longitude { get; set; } /// <summary> /// Geo Latitude of the Stop /// </summary> public decimal Latitude { get; set; } } }
using System.Diagnostics.Contracts; using System.Reflection; namespace System.ComponentModel { internal sealed class EventDescriptor : MemberDescriptor { #region Public Properties public override string Name { get { var name = @event.Name; Contract.Assume(!string.IsNullOrEmpty(name)); return name; } } public Type EventType { get { Contract.Ensures(Contract.Result<Type>() != null); return @event.EventHandlerType; } } #endregion #region Private / Protected private readonly EventInfo @event; #endregion #region Constructors internal EventDescriptor(EventInfo @event) { Contract.Requires(@event != null); this.@event = @event; } #endregion #region Methods [ContractInvariantMethod] [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "Required for code contracts.")] private void ObjectInvariant() { Contract.Invariant(@event != null); } public void AddEventHandler(object source, Delegate handler) { @event.AddEventHandler(source, handler); } public void RemoveEventHandler(object source, Delegate handler) { @event.RemoveEventHandler(source, handler); } #endregion } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using TextArt.ViewModels; using System.Drawing; namespace TextArt.Factories { public class Form1ViewModelFactory { public ViewModels.MainFormViewModel Create() { return new MainFormViewModel() { BackgroundColor = Color.Black, MaximumFontSize = 40, MinimumFontSize = 10, DesiredWidth = 800, DesiredHeight = 600, LockAspectRatio = true, FontName = "Arial", XStep = 20, YStep = 20, Alphabet = "abcdefghijklmnopqrstuvwxyz" }; } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.Collections.Generic; using System.Linq; using System.Text; using Cake.Core.Scripting.Analysis; using Cake.Core.Scripting.Processors.Loading; namespace Cake.Core.Scripting.Processors { internal sealed class LoadDirectiveProcessor : UriDirectiveProcessor { private readonly IEnumerable<ILoadDirectiveProvider> _providers; public LoadDirectiveProcessor(IEnumerable<ILoadDirectiveProvider> providers) { _providers = providers ?? Enumerable.Empty<ILoadDirectiveProvider>(); } protected override IEnumerable<string> GetDirectiveNames() { return new[] { "#l", "#load" }; } protected override Uri CreateUriFromLegacyFormat(string[] tokens) { var builder = new StringBuilder(); builder.Append("local:"); var id = tokens.Select(value => value.UnQuote()).Skip(1).FirstOrDefault(); builder.Append("?path=" + id); return new Uri(builder.ToString()); } protected override void AddToContext(IScriptAnalyzerContext context, Uri uri) { var reference = new LoadReference(uri); foreach (var provider in _providers) { if (provider.CanLoad(context, reference)) { provider.Load(context, reference); } } } } }
using System; using System.Collections.Generic; using System.Threading.Tasks; using EventSourcingPoc.Messages; using EventSourcingPoc.Shopping.Messages.Shop; using EventSourcingPoc.Shopping.WebApi.Models; using Microsoft.AspNetCore.Mvc; using static EventSourcingPoc.Shopping.Application.Bootstrapper; namespace EventSourcingPoc.Shopping.WebApi.Controllers { [Route("api")] [Produces("application/json")] public class ShoppingCartController : Controller { private readonly PretendApplication _app; public ShoppingCartController(PretendApplication app) { _app = app; } [Route(template: "Customer/{customerId}/ShoppingCart")] [HttpGet] public async Task<IEnumerable<Guid>> GetCarts(Guid customerId) { return await _app.ShoppingCartReadModelRepository.GetCartsAsync(customerId); } [Route(template: "Customer/{customerId}/ShoppingCart")] [HttpPost] public async Task CreateNewCart(Guid customerId) { await _app.SendAsync(new CreateNewCart(Guid.NewGuid(), customerId)); } [Route(template: "ShoppingCart/{id}/Product/{productId}")] [HttpPost] public async Task AddProductToCart(Guid id, Guid productId, [FromBody] AddProductToCartDTO dto) { await _app.SendAsync(new AddProductToCart(id, productId, dto.Price)); } [Route(template: "ShoppingCart/{id}/Product/{productId}")] [HttpDelete] public async Task RemoveProductFromCart(Guid id, Guid productId) { await _app.SendAsync(new RemoveProductFromCart(id, productId)); } [Route(template: "ShoppingCart/{id}/Product")] [HttpDelete] public async Task EmptyCart(Guid id) { await _app.SendAsync(new EmptyCart(id)); } [Route(template: "ShoppingCart/{id}/Checkout")] [HttpPut] public async Task Checkout(Guid id) { await _app.SendAsync(new Checkout(id)); } } }
using System.Numerics; namespace UniVRM10 { public static class ArrayExtensions { public static Vector3 ToVector3(this float[] src, Vector3 defaultValue = default) { if (src.Length != 3) return defaultValue; var v = new Vector3(); v.X = src[0]; v.Y = src[1]; v.Z = src[2]; return v; } public static Quaternion ToQuaternion(this float[] src) { if (src.Length != 4) return Quaternion.Identity; var v = new Quaternion(src[0], src[1], src[2], src[3]); return v; } } }
using System.Collections.Generic; using System.Threading.Tasks; using FplClient.Data; namespace FplClient { public interface IFplPlayerClient { Task<ICollection<FplPlayer>> GetAllPlayers(); Task<FplPlayerSummary> GetPlayer(int playerId); } }
namespace Medic.FileImport.Contracts { public interface INotifiable { internal void Notify(string message); } }
#region Copyright Syncfusion Inc. 2001-2021. // Copyright Syncfusion Inc. 2001-2021. All rights reserved. // Use of this code is subject to the terms of our license. // A copy of the current license can be obtained at any time by e-mailing // licensing@syncfusion.com. Any infringement will be prosecuted under // applicable laws. #endregion using System; using CoreGraphics; using Syncfusion.SfDataGrid; using Syncfusion.iOS.PopupLayout; using UIKit; namespace SampleBrowser { public class TheaterTile : GridCell { TheaterLayout theaterLayout; UIImageView infoImage; UILabel theaterTitle; UILabel theaterLocation; UILabel timing1; UILabel timing2; UILabel overlayTags; SfPopupLayout infopopup; SfPopupLayout termsAndConditionsPopup; object rowData; SfDataGrid dataGrid; UILabel message; public TheaterTile() { theaterLayout = new TheaterLayout(); infoImage = new UIImageView(); infoImage.Alpha = 0.54f; infoImage.UserInteractionEnabled = true; var tapGesture = new UITapGestureRecognizer(DisplayInfo) { NumberOfTapsRequired = 1 }; infoImage.AddGestureRecognizer(tapGesture); theaterTitle = new UILabel(); theaterTitle.Font = UIFont.PreferredCaption1; theaterLocation = new UILabel(); theaterLocation.Font = UIFont.PreferredFootnote; theaterLocation.TextColor = UIColor.LightGray; timing1 = new UILabel(); timing1.TextColor = UIColor.FromRGB(0, 124, 238); timing1.Font = UIFont.PreferredCaption2; timing1.TextAlignment = UITextAlignment.Center; timing1.Layer.BorderColor = UIColor.FromRGBA(0, 124, 238, 26).CGColor; timing1.Layer.BorderWidth = 0.5f; timing1.UserInteractionEnabled = true; var timingTapGesture = new UITapGestureRecognizer(TimingTapped) { NumberOfTapsRequired = 1 }; timing1.AddGestureRecognizer(timingTapGesture); timing2 = new UILabel(); timing2.TextColor = UIColor.FromRGB(0, 124, 238); timing2.Font = UIFont.PreferredCaption2; timing2.TextAlignment = UITextAlignment.Center; timing2.Layer.BorderColor = UIColor.FromRGBA(0, 124, 238, 26).CGColor; timing2.UserInteractionEnabled = true; var timingTapGesture2 = new UITapGestureRecognizer(TimingTapped) { NumberOfTapsRequired = 1 }; timing2.AddGestureRecognizer(timingTapGesture2); timing2.Layer.BorderWidth = 0.5f; theaterLayout.AddSubview(theaterTitle); theaterLayout.AddSubview(theaterLocation); theaterLayout.AddSubview(timing1); theaterLayout.AddSubview(timing2); theaterLayout.AddSubview(infoImage); this.AddSubview(theaterLayout); this.CanRendererUnload = false; } private void TimingTapped() { DisplayTermsAndCondtionsPopup(); } private void DisplayTermsAndCondtionsPopup() { termsAndConditionsPopup = new SfPopupLayout(); termsAndConditionsPopup.IsOpen = false; termsAndConditionsPopup.PopupView.HeaderTitle = "Terms & Conditions"; termsAndConditionsPopup.PopupView.BackgroundColor = UIColor.White; termsAndConditionsPopup.PopupView.ShowHeader = true; termsAndConditionsPopup.PopupView.PopupStyle.HeaderBackgroundColor = UIColor.White; UIView view = new UIView(); message = new UILabel(); view.BackgroundColor = UIColor.White; message.TextColor = UIColor.Gray; message.Font = UIFont.SystemFontOfSize(14); message.AutoresizingMask = UIViewAutoresizing.All; termsAndConditionsPopup.PopupView.ShowCloseButton = false; view.AddSubview(message); termsAndConditionsPopup.PopupView.PopupStyle.BorderColor = UIColor.LightGray; termsAndConditionsPopup.PopupView.AppearanceMode = AppearanceMode.TwoButton; termsAndConditionsPopup.PopupView.HeaderHeight = 40; termsAndConditionsPopup.PopupView.FooterHeight = 40; termsAndConditionsPopup.PopupView.ShowFooter = true; message.Text = "1. Children below the age of 18 cannot be admitted for movies certified A. \n2. Please carry proof of age for movies certified A. \n3. Drinking and alcohol is strictly prohibited inside the premises. \n4. Please purchase tickets for children above age of 3."; message.Lines = 10; message.TextAlignment = UITextAlignment.Left; message.LineBreakMode = UILineBreakMode.WordWrap; termsAndConditionsPopup.PopupView.AcceptButtonText = "Accept"; termsAndConditionsPopup.PopupView.DeclineButtonText = "Decline"; termsAndConditionsPopup.StaysOpen = true; termsAndConditionsPopup.PopupView.ContentView = view; termsAndConditionsPopup.PopupView.PopupStyle.AcceptButtonTextColor = UIColor.FromRGB(0, 124, 238); termsAndConditionsPopup.PopupView.PopupStyle.DeclineButtonTextColor = UIColor.FromRGB(0, 124, 238); termsAndConditionsPopup.PopupView.PopupStyle.AcceptButtonBackgroundColor = UIColor.White; termsAndConditionsPopup.PopupView.PopupStyle.DeclineButtonBackgroundColor = UIColor.White; termsAndConditionsPopup.PopupView.AcceptButtonClicked += PopupView_AcceptButtonClicked; termsAndConditionsPopup.PopupView.AppearanceMode = AppearanceMode.TwoButton; if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) { termsAndConditionsPopup.PopupView.PopupStyle.HeaderFontSize = 14; message.Font = UIFont.PreferredCaption1; termsAndConditionsPopup.PopupView.Frame = new CGRect(-1, -1, this.DataColumn.Renderer.DataGrid.Frame.Width - 20, this.DataColumn.Renderer.DataGrid.Frame.Height / 1.75); } else { termsAndConditionsPopup.PopupView.PopupStyle.HeaderFontSize = 20; message.Font = UIFont.PreferredBody; termsAndConditionsPopup.PopupView.Frame = new CGRect(-1, -1, (this.DataColumn.Renderer.DataGrid.Frame.Width / 10) *6, this.DataColumn.Renderer.DataGrid.Frame.Height / 3); } termsAndConditionsPopup.IsOpen = true; message.Frame = new CGRect(10, 0, termsAndConditionsPopup.PopupView.Frame.Width - 20, view.Frame.Height); } private void PopupView_AcceptButtonClicked(object sender, System.ComponentModel.CancelEventArgs e) { if (termsAndConditionsPopup.PopupView.AcceptButtonText == "Accept") { termsAndConditionsPopup.PopupView.ContentView = CreateSeatSelectionPage(); termsAndConditionsPopup.StaysOpen = true; e.Cancel = true; } else if(termsAndConditionsPopup.PopupView.AcceptButtonText == "Proceed") { overlayTags = new UILabel(); overlayTags.Hidden = false; overlayTags.Text = "Tickets booked successfully"; overlayTags.Layer.CornerRadius = 20f; overlayTags.TextColor = UIColor.White; overlayTags.TextAlignment = UITextAlignment.Center; overlayTags.ClipsToBounds = true; overlayTags.Font = UIFont.SystemFontOfSize(14); overlayTags.BackgroundColor = UIColor.FromRGB(101.0f / 255.0f, 101.0f / 255.0f, 101.0f / 255.0f); overlayTags.Layer.ZPosition = 1000; dataGrid.Superview.AddSubview(overlayTags); overlayTags.Frame = new CoreGraphics.CGRect((dataGrid.Superview.Frame.Right / 2) - 100, dataGrid.Superview.Frame.Bottom - 20, 200, 40); UIView.Animate(0.5, 0, UIViewAnimationOptions.CurveLinear, () => { overlayTags.Alpha = 1.0f; }, () => { UIView.Animate(3.0, () => { overlayTags.Alpha = 0.0f; }); } ); } } private UIView CreateSeatSelectionPage() { UIView seatSelectionMainLayout = new UIView(); seatSelectionMainLayout.BackgroundColor = UIColor.White; SeatSelectionLayout numberOfSeatsLayout = new SeatSelectionLayout(termsAndConditionsPopup); numberOfSeatsLayout.Frame = new CGRect(5, 5, termsAndConditionsPopup.PopupView.Frame.Width - 10, 42); numberOfSeatsLayout.AddSubview(CreateSeatSelectionLayout("1")); numberOfSeatsLayout.AddSubview(CreateSeatSelectionLayout("2")); numberOfSeatsLayout.AddSubview(CreateSeatSelectionLayout("3")); numberOfSeatsLayout.AddSubview(CreateSeatSelectionLayout("4")); numberOfSeatsLayout.AddSubview(CreateSeatSelectionLayout("5")); numberOfSeatsLayout.AddSubview(CreateSeatSelectionLayout("6")); numberOfSeatsLayout.AddSubview(CreateSeatSelectionLayout("7")); numberOfSeatsLayout.AddSubview(CreateSeatSelectionLayout("8")); UILabel title2 = new UILabel(); title2.Text = "Select your seat class"; title2.TextColor = UIColor.Black; title2.Font = UIFont.SystemFontOfSize(14); title2.Frame = new CGRect(15, 92, termsAndConditionsPopup.PopupView.Frame.Width, 16); UILabel clas = new UILabel(); clas.Text = "Silver"; clas.TextColor = UIColor.Gray; clas.Font = UIFont.PreferredCaption1; clas.Frame = new CGRect(15, 133, 60, 20); UILabel cost = new UILabel(); cost.Text = "$ 19.69"; cost.TextColor = UIColor.Black; cost.Font = UIFont.PreferredCaption1; cost.Frame = new CGRect(termsAndConditionsPopup.PopupView.Frame.Width /2 - 60, 133, 60, 20); UILabel avail = new UILabel(); avail.Text = "Available"; avail.TextColor = UIColor.Green; avail.Font = UIFont.PreferredCaption1; avail.Frame = new CGRect(termsAndConditionsPopup.PopupView.Frame.Width - 80, 133, 60, 20); UILabel clas2 = new UILabel(); clas2.Text = "Premier"; clas2.TextColor = UIColor.Gray; clas2.Font = UIFont.PreferredCaption1; clas2.Frame = new CGRect(15, 153, 60, 20); UILabel cost2 = new UILabel(); cost2.Text = "$ 23.65"; cost2.TextColor = UIColor.Black; cost2.Font = UIFont.PreferredCaption1; cost2.Frame = new CGRect(termsAndConditionsPopup.PopupView.Frame.Width / 2 - 60, 153, 60, 20); UILabel avail2 = new UILabel(); avail2.Text = "Unavailable"; avail2.TextColor = UIColor.Red; avail2.Font = UIFont.PreferredCaption1; avail2.Frame = new CGRect(termsAndConditionsPopup.PopupView.Frame.Width - 80, 153, 80, 20); seatSelectionMainLayout.AddSubview(numberOfSeatsLayout); seatSelectionMainLayout.AddSubview(title2); seatSelectionMainLayout.AddSubview(clas); seatSelectionMainLayout.AddSubview(cost); seatSelectionMainLayout.AddSubview(avail); seatSelectionMainLayout.AddSubview(clas2); seatSelectionMainLayout.AddSubview(cost2); seatSelectionMainLayout.AddSubview(avail2); termsAndConditionsPopup.PopupView.HeaderTitle = "How many seats ?"; termsAndConditionsPopup.PopupView.PopupStyle.HeaderTextColor = UIColor.Black; termsAndConditionsPopup.PopupView.PopupStyle.HeaderBackgroundColor = UIColor.White; termsAndConditionsPopup.PopupView.PopupStyle.BorderThickness = 1; termsAndConditionsPopup.PopupView.ShowFooter = true; termsAndConditionsPopup.PopupView.ShowCloseButton = true; termsAndConditionsPopup.PopupView.AppearanceMode = AppearanceMode.OneButton; termsAndConditionsPopup.PopupView.FooterHeight = 40; termsAndConditionsPopup.PopupView.AcceptButtonText = "Proceed"; termsAndConditionsPopup.PopupView.PopupStyle.AcceptButtonBackgroundColor = UIColor.FromRGB(0, 124, 238); termsAndConditionsPopup.PopupView.PopupStyle.AcceptButtonTextColor = UIColor.White; return seatSelectionMainLayout; } private UILabel CreateSeatSelectionLayout(string count) { var seatCountLabel = new UILabel(); if (count == "2") { seatCountLabel.BackgroundColor = UIColor.FromRGB(0, 124, 238); seatCountLabel.TextColor = UIColor.White; } else { seatCountLabel.BackgroundColor = UIColor.White; seatCountLabel.TextColor = UIColor.Black; } seatCountLabel.Text = count; seatCountLabel.Font = UIFont.BoldSystemFontOfSize(12); seatCountLabel.TextAlignment = UITextAlignment.Center; seatCountLabel.UserInteractionEnabled = true; var tapGesture = new UITapGestureRecognizer(SeatSelected) { NumberOfTapsRequired = 1 }; seatCountLabel.AddGestureRecognizer(tapGesture); return seatCountLabel; } void SeatSelected(UITapGestureRecognizer tasture) { foreach (var v in tasture.View.Superview.Subviews) { (v as UILabel).TextColor = UIColor.Black; v.BackgroundColor = UIColor.White; } tasture.View.BackgroundColor = UIColor.FromRGB(0, 124, 238); (tasture.View as UILabel).TextColor = UIColor.White; } private void DisplayInfo() { DisplayInfoPopup(); } private void DisplayInfoPopup() { infopopup = new SfPopupLayout(); infopopup.IsOpen = false; infopopup.PopupView.AppearanceMode = AppearanceMode.OneButton; infopopup.PopupView.HeaderTitle = (rowData as TicketBookingInfo).TheaterName; infopopup.PopupView.BackgroundColor = UIColor.White; infopopup.PopupView.ShowCloseButton = true; infopopup.PopupView.PopupStyle.HeaderTextColor = UIColor.Black; infopopup.PopupView.PopupStyle.HeaderTextAlignment = UIKit.UITextAlignment.Center; infopopup.PopupView.PopupStyle.HeaderBackgroundColor = UIColor.White; infopopup.PopupView.ShowFooter = false; infopopup.PopupView.FooterHeight = 35; infopopup.PopupView.HeaderHeight = 30; infopopup.StaysOpen = false; infopopup.PopupView.PopupStyle.HeaderFontSize = 16; infopopup.PopupView.ShowHeader = true; infopopup.PopupView.Frame = new CGRect(-1, -1, this.DataColumn.Renderer.DataGrid.Frame.Width - 40, this.DataColumn.Renderer.DataGrid.Frame.Height / 2); if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) { infopopup.PopupView.PopupStyle.HeaderFontSize = 14; infopopup.PopupView.Frame = new CGRect(-1, -1, this.DataColumn.Renderer.DataGrid.Frame.Width - 20, this.DataColumn.Renderer.DataGrid.Frame.Height / 1.75); } else { infopopup.PopupView.PopupStyle.HeaderFontSize = 20; infopopup.PopupView.Frame = new CGRect(-1, -1, (this.DataColumn.Renderer.DataGrid.Frame.Width / 10) * 6, this.DataColumn.Renderer.DataGrid.Frame.Height / 3.5); } infopopup.PopupView.ContentView = CreateInfoPopupContent(); infopopup.IsOpen = true; } private UIView CreateInfoPopupContent() { UIView mainview = new UIView(); UILabel location = new UILabel(); location.Lines = 10; location.Font = UIFont.PreferredCaption1; location.TextColor = UIColor.FromRGB(0,124, 238); location.LineBreakMode = UILineBreakMode.WordWrap; location.Text = (rowData as TicketBookingInfo).TheaterLocation + "421 E DRACHMAN TUCSON AZ 85705 - 7598 USA"; UILabel facilitiesLabel = new UILabel(); facilitiesLabel.Text = "Available Facilities"; facilitiesLabel.TextAlignment = UITextAlignment.Center; UIImageView mtick = new UIImageView(); mtick.Image = UIImage.FromFile("Images/Popup_MTicket.png"); UIImageView park = new UIImageView(); park.Image = UIImage.FromFile("Images/Popup_Parking.png"); UIImageView food = new UIImageView(); food.Image = UIImage.FromFile("Images/Popup_FoodCourt.png"); UILabel ticketLabel = new UILabel(); ticketLabel.Text = "M-Ticket"; ticketLabel.TextColor = UIColor.Black; ticketLabel.Font = UIFont.PreferredCaption2; UILabel parkingLabel = new UILabel(); parkingLabel.Text = "Parking"; parkingLabel.TextColor = UIColor.Black; parkingLabel.Font = UIFont.PreferredCaption2; UILabel foodLabel = new UILabel(); foodLabel.Text = "Food Court"; foodLabel.TextColor = UIColor.Black; foodLabel.Font = UIFont.PreferredCaption2; mainview.AddSubview(location); mainview.AddSubview(facilitiesLabel); mainview.AddSubview(mtick); mainview.AddSubview(park); mainview.AddSubview(food); mainview.AddSubview(ticketLabel); mainview.AddSubview(parkingLabel); mainview.AddSubview(foodLabel); if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) { location.Frame = new CGRect(Bounds.Left + 16, Bounds.Top + 20, 240, 40); facilitiesLabel.Frame = new CGRect(0, location.Frame.Bottom + 12, infopopup.PopupView.Frame.Width, 40); mtick.Frame = new CGRect(Bounds.Left + 55, facilitiesLabel.Frame.Bottom + 10, 20, 20); park.Frame = new CGRect(mtick.Frame.Right + 65, facilitiesLabel.Frame.Bottom + 10, 20, 20); food.Frame = new CGRect(park.Frame.Right + 55, facilitiesLabel.Frame.Bottom + 10, 20, 20); ticketLabel.Frame = new CGRect(Bounds.Left + 45, mtick.Frame.Bottom + 10, 50, 20); parkingLabel.Frame = new CGRect(ticketLabel.Frame.Right + 35, mtick.Frame.Bottom + 10, 50, 20); foodLabel.Frame = new CGRect(parkingLabel.Frame.Right + 15, mtick.Frame.Bottom + 10, 60, 20); } else { location.Frame = new CGRect(Bounds.Left + 16, Bounds.Top + 20, infopopup.PopupView.Frame.Width, 60); facilitiesLabel.Frame = new CGRect(0, location.Frame.Bottom + 12, infopopup.PopupView.Frame.Width, 40); mtick.Frame = new CGRect(Bounds.Width / 6, facilitiesLabel.Frame.Bottom + 10, 20, 20); park.Frame = new CGRect(mtick.Frame.Right + 75, facilitiesLabel.Frame.Bottom + 10, 20, 20); food.Frame = new CGRect(park.Frame.Right + 75, facilitiesLabel.Frame.Bottom + 10, 20, 20); ticketLabel.Frame = new CGRect(Bounds.Width / 7, mtick.Frame.Bottom + 10, 50, 20); parkingLabel.Frame = new CGRect(ticketLabel.Frame.Right + 55, mtick.Frame.Bottom + 10, 50, 20); foodLabel.Frame = new CGRect(parkingLabel.Frame.Right + 40, mtick.Frame.Bottom + 10, 60, 20); } return mainview; } protected override void UnLoad() { this.RemoveFromSuperview(); } public override void LayoutSubviews() { base.LayoutSubviews(); dataGrid = this.DataColumn.Renderer.DataGrid; rowData = (this.DataColumn.RowData); infoImage.Image = (rowData as TicketBookingInfo).InfoImage; theaterTitle.Text = (rowData as TicketBookingInfo).TheaterName; theaterLocation.Text = (rowData as TicketBookingInfo).TheaterLocation; timing1.Text = (rowData as TicketBookingInfo).Timing1; timing2.Text = (rowData as TicketBookingInfo).Timing2; if (timing2.Text == null) timing2.Hidden = true; this.theaterLayout.Frame = new CGRect(Bounds.Left, Bounds.Top, Bounds.Width, Bounds.Height); } } public class TheaterLayout : UIView { public TheaterLayout() { } public override void LayoutSubviews() { this.Subviews[0].Frame = new CGRect(Bounds.Left + 16, Bounds.Top + 16, Bounds.Width - 60, 25); this.Subviews[1].Frame = new CGRect(Bounds.Left + 16, this.Subviews[0].Frame.Bottom + 6, Bounds.Width - 60 ,25); this.Subviews[2].Frame = new CGRect(Bounds.Left + 16, this.Subviews[1].Frame.Bottom + 6, 80,32); this.Subviews[3].Frame = new CGRect(this.Subviews[2].Frame.Right + 10, this.Subviews[1].Frame.Bottom + 6, 80,32); this.Subviews[4].Frame = new CGRect(this.Subviews[1].Frame.Right, Bounds.Height / 2 - 12 , 24, 24); } } public class SeatSelectionLayout : UIView { SfPopupLayout popup; public SeatSelectionLayout(SfPopupLayout pop) { popup = pop; } public override void LayoutSubviews() { nfloat temp = 0; for (int i = 0; i < this.Subviews.Length; i++) { this.Subviews[i].Frame = new CGRect(temp, this.Frame.Top, (popup.PopupView.Frame.Width - 10) / 8, 42); temp = temp + ((popup.PopupView.Frame.Width - 10) / 8); } } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.ServiceModel.Security; namespace System.ServiceModel.Channels { public abstract class StreamUpgradeBindingElement : BindingElement { protected StreamUpgradeBindingElement() { } protected StreamUpgradeBindingElement(StreamUpgradeBindingElement elementToBeCloned) : base(elementToBeCloned) { } public abstract StreamUpgradeProvider BuildClientStreamUpgradeProvider(BindingContext context); } }
namespace UsageOrderingLibrary { [DefinitionLibrary.Enum.All] public enum Enum { [DefinitionLibrary.Field.All] EnumValue } }
using System.Collections; using System.Collections.Generic; using UnityEngine; using Run4YourLife.Interactables; public class BreakBossSkillOnPhysicInteraction : MonoBehaviour { private void OnTriggerEnter(Collider collider) { if (gameObject.activeInHierarchy) { CheckBossSkillBreakableAndSendBreakEvent(collider.gameObject); } } private void CheckBossSkillBreakableAndSendBreakEvent(GameObject gameObject) { IBossSkillBreakable bossSkillBreakable = gameObject.GetComponent<IBossSkillBreakable>(); if (bossSkillBreakable != null) { bossSkillBreakable.Break(); } } }
using cs4rsa_core.BaseClasses; namespace cs4rsa_core.Dialogs.Implements { class SubjectDownloadingViewModel : ViewModelBase { private string _subjectName; public string SubjectName { get { return _subjectName; } set { _subjectName = value; OnPropertyChanged(); } } private string _subjectCode; public string SubjectCode { get { return _subjectCode; } set { _subjectCode = value; OnPropertyChanged(); } } } }
using System; using LSLib.LS.Enums; namespace Divine.CLI { internal class CommandLineLogger { private static readonly LogLevel LogLevelOption = CommandLineActions.LogLevel; public static void LogFatal(string message, int errorCode) { Log(LogLevel.FATAL, message, errorCode); } public static void LogError(string message) { Log(LogLevel.ERROR, message); } public static void LogWarn(string message) { Log(LogLevel.WARN, message); } public static void LogInfo(string message) { Log(LogLevel.INFO, message); } public static void LogDebug(string message) { Log(LogLevel.DEBUG, message); } public static void LogTrace(string message) { Log(LogLevel.TRACE, message); } public static void LogAll(string message) { Log(LogLevel.ALL, message); } private static void Log(LogLevel logLevel, string message, int errorCode = -1) { if (LogLevelOption == LogLevel.OFF && logLevel != LogLevel.FATAL) { return; } switch (logLevel) { case LogLevel.FATAL: { if (LogLevelOption > LogLevel.OFF) { Console.WriteLine($"[FATAL] {message}"); } if (errorCode == -1) { Environment.Exit((int) LogLevel.FATAL); } else { Environment.Exit((int) LogLevel.FATAL + errorCode); } break; } case LogLevel.ERROR: { if (LogLevelOption < logLevel) { break; } Console.WriteLine($"[ERROR] {message}"); break; } case LogLevel.WARN: { if (LogLevelOption < logLevel) { break; } Console.WriteLine($"[WARN] {message}"); break; } case LogLevel.INFO: { if (LogLevelOption < logLevel) { break; } Console.WriteLine($"[INFO] {message}"); break; } case LogLevel.DEBUG: { if (LogLevelOption < logLevel) { break; } Console.WriteLine($"[DEBUG] {message}"); break; } case LogLevel.TRACE: { if (LogLevelOption < logLevel) { break; } Console.WriteLine($"[TRACE] {message}"); break; } } } } }
using Brewery.ToolSdk.Registry; using Microsoft.Extensions.DependencyInjection; namespace Brewery.ProjectTool.Registry; internal static class RegistryServiceExtensions { public static IServiceCollection AddRegistries(this IServiceCollection services) { return services.AddSingleton(typeof(IRegistry<>), typeof(ClassRegistry<>)); } }
using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System; using System.Collections; using System.Collections.Generic; using UnityEngine; public class JsontTestObject { public enum TestEnum { V1, V2, V333 } [JsonConverter(typeof(StringEnumConverter))] public TestEnum SomeKind { get; private set; } [JsonProperty("player_name")] public string Name { get; set; } [JsonProperty("position")] private Vector3 Position { get; set; } [JsonProperty("rotation")] [JsonConverter(typeof(QuaternionConverter))] private Quaternion Rotation { get; set; } [JsonProperty("creation_date")] public DateTime CreationDate { get; } [JsonProperty("expiration_date")] public DateTime ExpirationDate { get; } public JsontTestObject () { Position = new Vector3(1, 2, 3); Rotation = Quaternion.Euler(10.0f, 20.0f, 50.0f); CreationDate = DateTime.Now; ExpirationDate = CreationDate + TimeSpan.FromDays(10); } }
using System; using System.Collections.Generic; using System.IO; using System.Xml; using ECode.Core; using ECode.Utility; namespace ECode.Configuration { public class XmlConfigParser { const string ROOT_TAG = "configuration"; const string ADD_TAG = "add"; const string NAMESPACE_TAG = "namespace"; const string NAME_ATTR = "name"; const string VALUE_ATTR = "value"; public static ICollection<ConfigItem> Parse(string xml) { AssertUtil.ArgumentNotEmpty(xml, nameof(xml)); var doc = new XmlDocument(); doc.XmlResolver = null; doc.LoadXml(xml); var root = doc.DocumentElement; if (root.LocalName != ROOT_TAG) { throw new ConfigurationException($"Root element isnot '{ROOT_TAG}'"); } return Parse(root).Values; } public static ICollection<ConfigItem> Parse(Stream stream) { AssertUtil.ArgumentNotNull(stream, nameof(stream)); if (!stream.CanRead) { throw new ArgumentException($"Argument '{nameof(stream)}' cannot be read"); } var doc = new XmlDocument(); doc.XmlResolver = null; doc.Load(stream); var root = doc.DocumentElement; if (root.LocalName != ROOT_TAG) { throw new ConfigurationException($"Root element isnot '{ROOT_TAG}'"); } return Parse(root).Values; } public static ICollection<ConfigItem> Parse(TextReader reader) { AssertUtil.ArgumentNotNull(reader, nameof(reader)); var doc = new XmlDocument(); doc.XmlResolver = null; doc.Load(reader); var root = doc.DocumentElement; if (root.LocalName != ROOT_TAG) { throw new ConfigurationException($"Root element isnot '{ROOT_TAG}'"); } return Parse(root).Values; } static IDictionary<string, ConfigItem> Parse(XmlElement parentElement, NamespaceItem parentItem = null) { var itemsByKey = new SortedDictionary<string, ConfigItem>(StringComparer.InvariantCultureIgnoreCase); foreach (XmlNode childNode in parentElement.ChildNodes) { if (childNode.NodeType != XmlNodeType.Element) { continue; } var element = (XmlElement)childNode; if (element.LocalName == ADD_TAG) { if (!element.HasAttribute(NAME_ATTR) || string.IsNullOrWhiteSpace(element.GetAttribute(NAME_ATTR))) { throw new ConfigurationException($"Attribute '{NAME_ATTR}' is required", element.OuterXml); } var keyValueItem = new KeyValueItem(element.GetAttribute(NAME_ATTR), parentItem); keyValueItem.Value = element.InnerText; if (element.HasAttribute(VALUE_ATTR)) { keyValueItem.Value = element.GetAttribute(VALUE_ATTR); } itemsByKey[keyValueItem.Key] = keyValueItem; } else if (element.LocalName == NAMESPACE_TAG) { if (!element.HasAttribute(NAME_ATTR) || string.IsNullOrWhiteSpace(element.GetAttribute(NAME_ATTR))) { throw new ConfigurationException($"Attribute '{NAME_ATTR}' is required", element.OuterXml); } var namespaceItem = new NamespaceItem(element.GetAttribute(NAME_ATTR), parentItem); namespaceItem.Children = Parse(element, namespaceItem); itemsByKey[namespaceItem.Key] = namespaceItem; } else { throw new ConfigurationException($"Unsupported element '{element.LocalName}'", element.OuterXml); } } return itemsByKey; } } }