max_stars_repo_path
stringlengths
4
294
max_stars_repo_name
stringlengths
5
116
max_stars_count
float64
0
82k
id
stringlengths
1
8
content
stringlengths
1
1.04M
score
float64
-0.88
3.59
int_score
int64
0
4
aliyun-net-sdk-companyreg/Companyreg/Transform/V20190508/ListCompanyRegConsultationsResponseUnmarshaller.cs
pengweiqhca/aliyun-openapi-net-sdk
572
9599653
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ using System; using System.Collections.Generic; using Aliyun.Acs.Core.Transform; using Aliyun.Acs.companyreg.Model.V20190508; namespace Aliyun.Acs.companyreg.Transform.V20190508 { public class ListCompanyRegConsultationsResponseUnmarshaller { public static ListCompanyRegConsultationsResponse Unmarshall(UnmarshallerContext _ctx) { ListCompanyRegConsultationsResponse listCompanyRegConsultationsResponse = new ListCompanyRegConsultationsResponse(); listCompanyRegConsultationsResponse.HttpResponse = _ctx.HttpResponse; listCompanyRegConsultationsResponse.RequestId = _ctx.StringValue("ListCompanyRegConsultations.RequestId"); listCompanyRegConsultationsResponse.TotalItemNum = _ctx.IntegerValue("ListCompanyRegConsultations.TotalItemNum"); listCompanyRegConsultationsResponse.CurrentPageNum = _ctx.IntegerValue("ListCompanyRegConsultations.CurrentPageNum"); listCompanyRegConsultationsResponse.PageSize = _ctx.IntegerValue("ListCompanyRegConsultations.PageSize"); listCompanyRegConsultationsResponse.TotalPageNum = _ctx.IntegerValue("ListCompanyRegConsultations.TotalPageNum"); listCompanyRegConsultationsResponse.PrePage = _ctx.BooleanValue("ListCompanyRegConsultations.PrePage"); listCompanyRegConsultationsResponse.NextPage = _ctx.BooleanValue("ListCompanyRegConsultations.NextPage"); List<ListCompanyRegConsultationsResponse.ListCompanyRegConsultations_CompanyRegConsultation> listCompanyRegConsultationsResponse_data = new List<ListCompanyRegConsultationsResponse.ListCompanyRegConsultations_CompanyRegConsultation>(); for (int i = 0; i < _ctx.Length("ListCompanyRegConsultations.Data.Length"); i++) { ListCompanyRegConsultationsResponse.ListCompanyRegConsultations_CompanyRegConsultation companyRegConsultation = new ListCompanyRegConsultationsResponse.ListCompanyRegConsultations_CompanyRegConsultation(); companyRegConsultation.BizId = _ctx.StringValue("ListCompanyRegConsultations.Data["+ i +"].BizId"); companyRegConsultation.ConsultInfo = _ctx.StringValue("ListCompanyRegConsultations.Data["+ i +"].ConsultInfo"); companyRegConsultation.GmtModified = _ctx.LongValue("ListCompanyRegConsultations.Data["+ i +"].GmtModified"); companyRegConsultation.City = _ctx.StringValue("ListCompanyRegConsultations.Data["+ i +"].City"); companyRegConsultation.PlatformName = _ctx.StringValue("ListCompanyRegConsultations.Data["+ i +"].PlatformName"); companyRegConsultation.InboundPhone = _ctx.StringValue("ListCompanyRegConsultations.Data["+ i +"].InboundPhone"); companyRegConsultation.OutboundPhone = _ctx.StringValue("ListCompanyRegConsultations.Data["+ i +"].OutboundPhone"); listCompanyRegConsultationsResponse_data.Add(companyRegConsultation); } listCompanyRegConsultationsResponse.Data = listCompanyRegConsultationsResponse_data; return listCompanyRegConsultationsResponse; } } }
0.730469
1
AbhsChinese.Repository/IRepository/IStudentPassportRepository.cs
GuoQqizz/SmartChinese
0
9599661
using AbhsChinese.Domain.Dto.Request.School; using AbhsChinese.Domain.Dto.Response.School; using AbhsChinese.Domain.Entity; using AbhsChinese.Repository.RepositoryBase; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace AbhsChinese.Repository.IRepository { public interface IStudentPassportRepository : IRepositoryBase<Bas_StudentPassport> { int Register(Bas_StudentPassport entity); Bas_StudentPassport Login(string passportKey,string password); int CheckUniqueAccount(string account); Bas_StudentPassport Get(int id); bool IsBindFaceLogin(int studentId); bool IsExistPhone(string phone); bool Update(Bas_StudentPassport entity); Bas_StudentPassport GetPassportByStuIdAndType(int studentId,int passportType); Bas_StudentPassport GetPassportByPassportAndType(string passportKey, int passportType); Bas_StudentPassport GetByPassport(string passportKey); } }
0.941406
1
BaiTap8/BaiTap8/IBook.cs
KienVu1504/Aptech-C-Sharp-Final-Examination
2
9599669
namespace BaiTap8 { public interface IBook { public string this[int i] { get;set; } //property in C# = getter/setter = function/method public string Title { get; set; } public string Author { get; set; } public string Publisher { get; set; } public int Year { get; set; } public string ISBN { get; set; } public void Show(); } }
0.796875
1
src/Orchard.Web/Modules/Orchard.Roles/Models/RolesPermissionsRecord.cs
pochuan0720/OrchardMeso1.10.2
0
9599677
using Newtonsoft.Json; namespace Orchard.Roles.Models { [JsonObject(MemberSerialization.OptIn)] public class RolesPermissionsRecord { [JsonProperty] public virtual int Id { get; set; } public virtual RoleRecord Role { get; set; } [JsonProperty] public virtual PermissionRecord Permission { get; set; } } }
0.949219
1
PKI/CertificateServices/ExitModule/ExitModuleConfig.cs
PKISolutions/pkix.net
16
9599685
namespace PKI.CertificateServices.ExitModule { class ExitModuleConfig { public SubscriptionEventEnum Subscription { get; set; } } }
0.233398
0
src/Component/BlazorComponent/Mixins/Delayable/BDelayable.cs
masastack/BlazorComponent
0
9599693
using Microsoft.AspNetCore.Components; using Microsoft.JSInterop; namespace BlazorComponent; public class BDelayable : BDomComponentBase, IAsyncDisposable { [Parameter] public int OpenDelay { get; set; } [Parameter] public int CloseDelay { get; set; } private IJSObjectReference? _module; private DotNetObjectReference<BDelayable> _dotNetRef; protected bool IsActive { get; private set; } protected override async Task OnAfterRenderAsync(bool firstRender) { if (firstRender) { _dotNetRef = DotNetObjectReference.Create(this); _module = await Js.InvokeAsync<IJSObjectReference>("import", "./_content/BlazorComponent/js/delayable.js"); await _module!.InvokeVoidAsync("init", _dotNetRef, OpenDelay, CloseDelay); } await base.OnAfterRenderAsync(firstRender); } [JSInvokable] public async Task SetActive(bool value) { await OnActiveUpdating(value); IsActive = value; await OnActiveUpdated(value); StateHasChanged(); } protected virtual Task OnActiveUpdating(bool value) { return Task.CompletedTask; } protected virtual Task OnActiveUpdated(bool value) { return Task.CompletedTask; } protected async Task RunOpenDelayAsync() { if (_module is not null) { await _module.InvokeVoidAsync("runDelay", _dotNetRef, "open"); } else { await SetActive(true); } } protected async Task RunCloseDelayAsync() { if (_module is not null) { await _module.InvokeVoidAsync("runDelay", _dotNetRef, "close"); } else { await SetActive(false); } } public async ValueTask DisposeAsync() { try { if (_module is not null && _dotNetRef is not null) { await _module.InvokeVoidAsync("remove", _dotNetRef); await _module.DisposeAsync(); } _dotNetRef?.Dispose(); } catch (Exception) { // ignored } } }
1.34375
1
framework/windows-workflow-foundation/application/HiringRequestProcess/CS/InternalClient/UserControls/InboxItemTable.ascx.cs
joseocampo/samples
2,197
9599701
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------- using System.Collections.Generic; using System.Web.UI; using Contoso.InboxService; namespace Microsoft.Samples.WebClient { public partial class UserControls_InboxItemTable : System.Web.UI.UserControl { public IList<InboxItem> InboxItems { get; set; } public string ActionText { get; set; } public string ActionUri { get; set; } public string HeaderStyle { get; set; } public bool IncludeStateInUri { get; set; } protected override void Render(HtmlTextWriter writer) { writer.WriteLine("<table rules=\"all\" style=\"border-collapse:collapse;\">"); writer.WriteLine("<tr class=\"{0}\">", HeaderStyle); writer.WriteLine("<td width=\"30px\">&nbsp;</td>"); writer.WriteLine("<td width=\"315px\">Id</td>"); writer.WriteLine("<td width=\"450px\">Title</td>"); writer.WriteLine("<td width=\"200px\">State</td>"); writer.WriteLine("<td width=\"100px\">&nbsp;</td>"); writer.WriteLine("</tr>"); bool alternate = true; if (this.InboxItems != null) { foreach (InboxItem item in this.InboxItems) { writer.WriteLine("<tr bgcolor=\"{0}\">", (alternate ? "whitesmoke" : "white")); writer.WriteLine("<td align=\"center\" width=\"30px\"><img src=\"../images/foundation_icon.gif\"></td>"); writer.WriteLine(string.Format("<td width=\"315px\">{0}</td>", item.RequestId)); writer.WriteLine(string.Format("<td width=\"450px\">{0}</td>", item.Title)); writer.WriteLine(string.Format("<td width=\"200px\">{0}</td>", item.State)); if (this.IncludeStateInUri) { writer.WriteLine(string.Format("<td><a href=\"{0}?id={1}&state={2}\">{3}</a></td>", this.ActionUri, item.RequestId, item.State, this.ActionText)); } else { writer.WriteLine(string.Format("<td><a href=\"{0}?id={1}\">{2}</a></td>", this.ActionUri, item.RequestId, this.ActionText)); } writer.WriteLine("</tr>"); alternate = !alternate; } } writer.WriteLine("</table>"); } } }
1.5625
2
NeoSwagger.NSwag.CLI/InMemoryVariables.cs
search-for-the-one/NeoSwagger.NSwag.CLI
1
9599709
using System; using System.Collections.Generic; namespace NeoSwagger.NSwag.CLI { public class InMemoryVariables : Dictionary<string, string>, IVariables { public InMemoryVariables() : base(StringComparer.Ordinal) { } } }
0.417969
0
Obfuscar/Settings.cs
jgmamxmn/Obfuscar-JGMA-Branch
0
9599717
#region Copyright (c) 2007 <NAME> <<EMAIL>> /// <copyright> /// Copyright (c) 2007 <NAME> <<EMAIL>> /// /// Permission is hereby granted, free of charge, to any person obtaining a copy /// of this software and associated documentation files (the "Software"), to deal /// in the Software without restriction, including without limitation the rights /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell /// copies of the Software, and to permit persons to whom the Software is /// furnished to do so, subject to the following conditions: /// /// The above copyright notice and this permission notice shall be included in /// all copies or substantial portions of the Software. /// /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN /// THE SOFTWARE. /// </copyright> #endregion using System; using System.Xml; namespace Obfuscar { class Settings { public Settings(Variables vars) { InPath = Environment.ExpandEnvironmentVariables(vars.GetValue("InPath", ".")); OutPath = Environment.ExpandEnvironmentVariables(vars.GetValue("OutPath", ".")); LogFilePath = Environment.ExpandEnvironmentVariables(vars.GetValue("LogFile", "")); MarkedOnly = XmlConvert.ToBoolean(vars.GetValue("MarkedOnly", "false")); RenameFields = XmlConvert.ToBoolean(vars.GetValue("RenameFields", "true")); RenameProperties = XmlConvert.ToBoolean(vars.GetValue("RenameProperties", "true")); RenameEvents = XmlConvert.ToBoolean(vars.GetValue("RenameEvents", "true")); KeepPublicApi = XmlConvert.ToBoolean(vars.GetValue("KeepPublicApi", "true")); HidePrivateApi = XmlConvert.ToBoolean(vars.GetValue("HidePrivateApi", "true")); ReuseNames = XmlConvert.ToBoolean(vars.GetValue("ReuseNames", "true")); UseUnicodeNames = XmlConvert.ToBoolean(vars.GetValue("UseUnicodeNames", "false")); UseKoreanNames = XmlConvert.ToBoolean(vars.GetValue("UseKoreanNames", "false")); CustomAlphabetFile = vars.GetValue("CustomAlphabetFile", ""); // JGMA added this CustomAlphabetRange = vars.GetValue("CustomAlphabetRange", ""); // JGMA added this HideStrings = XmlConvert.ToBoolean(vars.GetValue("HideStrings", "true")); Optimize = XmlConvert.ToBoolean(vars.GetValue("OptimizeMethods", "true")); SuppressIldasm = XmlConvert.ToBoolean(vars.GetValue("SuppressIldasm", "true")); XmlMapping_deprecated = XmlConvert.ToBoolean(vars.GetValue("XmlMapping", "false")); // JGMA renamed this 2021-01-12 MappingFormat = vars.GetValue("MappingFormat", "default"); // JGMA added this 2021-01-12 RegenerateDebugInfo = XmlConvert.ToBoolean(vars.GetValue("RegenerateDebugInfo", "false")); } public bool RegenerateDebugInfo { get; } public string InPath { get; } public string OutPath { get; } public bool MarkedOnly { get; } public string LogFilePath { get; } public bool RenameFields { get; } public bool RenameProperties { get; } public bool RenameEvents { get; } public bool KeepPublicApi { get; } public bool HidePrivateApi { get; } public bool ReuseNames { get; } public bool HideStrings { get; } public bool Optimize { get; } public bool SuppressIldasm { get; } /// <summary> /// JGMA 2021-01-12: Prefer MappingFormat. XmlMapping only relevant if MappingFormat undefined. /// </summary> public bool XmlMapping_deprecated { get; } // JGMA renamed this /// <summary> /// JGMA 2021-01-12: Valid values: 'default', 'text', 'xml', 'tsv', 'json'. TSV and JSON are the sexy new thang. /// </summary> public string MappingFormat { get; } // JGMA added this public bool UseUnicodeNames { get; } /// <summary> /// JGMA: If set to a file on disk, 128 random chars will be chosen from the specified alphabet file. /// </summary> public string CustomAlphabetFile { get; } // JGMA added this /// <summary> /// Lists ANSI/Unicode int values corresponding to chars /// May include one or more entries, separated by commas. Each entry can be a single int e.g. '65' or /// a range with a hyphen e.g. '65-90'. /// </summary> public string CustomAlphabetRange { get; } // JGMA added this public bool UseKoreanNames { get; } } }
1.195313
1
Gearset/Components/Finder/Finder.cs
PumpkinPaul/Gearset
20
9599725
using System; using Gearset.UserInterface; using Microsoft.Xna.Framework; namespace Gearset.Components.Finder { /// <summary> /// Lets the user search for objects in the game. /// </summary> public class Finder : Gear { float _searchDelay; public FinderConfig Config { get; private set; } readonly IUserInterface _userInterface; public Finder(IUserInterface userInterface) : base(GearsetSettings.Instance.FinderConfig) { Config = GearsetSettings.Instance.FinderConfig; _userInterface = userInterface; _userInterface.CreateFinder(this); Config.SearchTextChanged += (sender, args) => _searchDelay = .25f; _searchDelay = .25f; } protected override void OnVisibleChanged() { _userInterface.FinderVisible = Visible; } public override void Update(GameTime gameTime) { if (_searchDelay > 0) { var dt = (float)gameTime.ElapsedGameTime.TotalSeconds; _searchDelay -= dt; if (_searchDelay <= 0 && Config.SearchText != null) { _searchDelay = 0; if (Config.SearchFunction != null) _userInterface.FinderSearch(Config.SearchFunction(Config.SearchText)); else _userInterface.FinderSearch(DefaultSearchFunction(Config.SearchText)); } } base.Update(gameTime); } /// <summary> /// The default search function. It will search through the GameComponentCollection of the Game. /// </summary> static FinderResult DefaultSearchFunction(String queryString) { var result = new FinderResult(); var searchParams = queryString.Split(new [] { ' ' }, StringSplitOptions.RemoveEmptyEntries); // Split the query if (searchParams.Length == 0) { searchParams = new [] { String.Empty }; } else { // Ignore case. for (var i = 0; i < searchParams.Length; i++) searchParams[i] = searchParams[i].ToUpper(); } foreach (var component in GearsetResources.Game.Components) { var matches = true; var type = component.GetType().ToString(); if (component is GearsetComponentBase) continue; // Check if it matches all search params. foreach (var t in searchParams) { if (component.ToString().ToUpper().Contains(t) || type.ToUpper().Contains(t)) continue; matches = false; break; } if (matches) result.Add(new ObjectDescription(component, type)); } return result; } } }
2.03125
2
SocialOpinionAPI/DTO/Users/UserDTO.cs
WestDiscGolf/SocialOpinion-Public
50
9599733
using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Text; namespace SocialOpinionAPI.DTO.Users { public class Url { [JsonProperty("start")] public int start { get; set; } [JsonProperty("end")] public int end { get; set; } [JsonProperty("url")] public string url { get; set; } [JsonProperty("expanded_url")] public string expanded_url { get; set; } [JsonProperty("display_url")] public string display_url { get; set; } } public class Urls { [JsonProperty("urls")] public IList<Url> urls { get; set; } } public class Hashtag { [JsonProperty("start")] public int start { get; set; } [JsonProperty("end")] public int end { get; set; } [JsonProperty("tag")] public string tag { get; set; } } public class Mention { [JsonProperty("start")] public int start { get; set; } [JsonProperty("end")] public int end { get; set; } [JsonProperty("username")] public string username { get; set; } } public class Description { [JsonProperty("hashtags")] public IList<Hashtag> hashtags { get; set; } [JsonProperty("mentions")] public IList<Mention> mentions { get; set; } } public class Entities { [JsonProperty("url")] public Url url { get; set; } [JsonProperty("description")] public Description description { get; set; } } public class PublicMetrics { [JsonProperty("followers_count")] public int followers_count { get; set; } [JsonProperty("following_count")] public int following_count { get; set; } [JsonProperty("tweet_count")] public int tweet_count { get; set; } [JsonProperty("listed_count")] public int listed_count { get; set; } } public class Data { [JsonProperty("created_at")] public DateTime created_at { get; set; } [JsonProperty("description")] public string description { get; set; } [JsonProperty("entities")] public Entities entities { get; set; } [JsonProperty("id")] public string id { get; set; } [JsonProperty("location")] public string location { get; set; } [JsonProperty("name")] public string name { get; set; } [JsonProperty("pinned_tweet_id")] public string pinned_tweet_id { get; set; } [JsonProperty("profile_image_url")] public string profile_image_url { get; set; } [JsonProperty("protected")] public bool is_protected { get; set; } [JsonProperty("public_metrics")] public PublicMetrics public_metrics { get; set; } [JsonProperty("url")] public string url { get; set; } [JsonProperty("username")] public string username { get; set; } [JsonProperty("verified")] public bool verified { get; set; } } public class Attachments { [JsonProperty("media_keys")] public IList<string> media_keys { get; set; } } public class Tweet { [JsonProperty("attachments")] public Attachments attachments { get; set; } [JsonProperty("author_id")] public string author_id { get; set; } [JsonProperty("created_at")] public DateTime created_at { get; set; } [JsonProperty("entities")] public Entities entities { get; set; } [JsonProperty("id")] public string id { get; set; } [JsonProperty("lang")] public string lang { get; set; } [JsonProperty("possibly_sensitive")] public bool possibly_sensitive { get; set; } [JsonProperty("public_metrics")] public PublicMetrics public_metrics { get; set; } [JsonProperty("source")] public string source { get; set; } [JsonProperty("text")] public string text { get; set; } } public class Includes { [JsonProperty("tweets")] public IList<Tweet> tweets { get; set; } } public class UserDTO { [JsonProperty("data")] public Data data { get; set; } [JsonProperty("includes")] public Includes includes { get; set; } } public class UsersDTO { [JsonProperty("data")] public IList<Data> data { get; set; } [JsonProperty("includes")] public Includes includes { get; set; } } }
0.917969
1
csharp-impl/src/test/resources/parsing/Issue40.cs
consulo/consulo-csharp
49
9599741
public class Test { public int this[int a] { get { } } }
0.386719
0
Data Structures and Algorithms Projects/Homework-DataStructuresEfficiency/2. StoringArticles/Article.cs
vladislav-karamfilov/TelerikAcademy
14
9599749
using System; using System.Text; class Article : IComparable<Article> { public Article(string barcode, string vendor, string title, double price) { this.Barcode = barcode; this.Vendor = vendor; this.Title = title; this.Price = price; } public string Barcode { get; private set; } public string Vendor { get; private set; } public string Title { get; private set; } public double Price { get; private set; } public override string ToString() { StringBuilder output = new StringBuilder(); output.Append('['); output.AppendFormat("Barcode: {0}; ", this.Barcode); output.AppendFormat("Vendor: {0}; ", this.Vendor); output.AppendFormat("Title: {0}; ", this.Title); output.AppendFormat("Price: {0:C}", this.Price); output.Append(']'); return output.ToString(); } public int CompareTo(Article other) { if (this == null ^ other == null) { return this == null ? -1 : 1; } if (this == null && other == null) { return 0; } return this.Barcode.CompareTo(other.Barcode); } }
1.828125
2
grapher/Models/Options/Directionality/DirectionalityOptions.cs
matthewstrasiotto/rawaccel
1
9599757
using System; using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace grapher.Models.Options.Directionality { public class DirectionalityOptions { public DirectionalityOptions( Panel containingPanel, Label directionalityLabel, Label directionalityX, Label directionalityY, Label directionalityActiveValueTitle, Option lpNorm, OptionXY domain, OptionXY range, CheckBox wholeCheckBox, CheckBox byComponentCheckBox, int top) { ContainingPanel = containingPanel; DirectionalityLabel = directionalityLabel; DirectionalityX = directionalityX; DirectionalityY = directionalityY; DirectionalityActiveValueTitle = directionalityActiveValueTitle; LpNorm = lpNorm; Domain = domain; Range = range; WholeCheckBox = wholeCheckBox; ByComponentCheckBox = byComponentCheckBox; ContainingPanel.Paint += Panel_Paint; DirectionalityLabel.Click += Title_click; ContainingPanel.Top = top; DirectionalityLabel.Left = Constants.DirectionalityTitlePad; DirectionalityLabel.Top = Constants.DirectionalityTitlePad; IsHidden = false; ToWhole(); Hide(); } public Panel ContainingPanel { get; } public Label DirectionalityLabel { get; } public Label DirectionalityX { get; } public Label DirectionalityY { get; } public Label DirectionalityActiveValueTitle { get; } public Option LpNorm { get; } public OptionXY Domain { get; } public OptionXY Range { get; } public CheckBox WholeCheckBox { get; } public CheckBox ByComponentCheckBox { get; } public int OpenHeight { get => WholeCheckBox.Bottom - DirectionalityLabel.Top + 2 * Constants.DirectionalityTitlePad; } public int ClosedHeight { get => DirectionalityLabel.Height + 2 * Constants.DirectionalityTitlePad; } private bool IsHidden { get; set; } public DomainArgs GetDomainArgs() { if (!ByComponentCheckBox.Checked) { return new DomainArgs { domainXY = new Vec2<double> { x = Domain.Fields.X, y = Domain.Fields.Y, }, lpNorm = LpNorm.Field.Data, }; } else { return new DomainArgs { domainXY = new Vec2<double> { x = 1, y = 1, }, lpNorm = 2, }; } } public Vec2<double> GetRangeXY() { if (!ByComponentCheckBox.Checked) { return new Vec2<double> { x = Range.Fields.X, y = Range.Fields.Y, }; } else { return new Vec2<double> { x = 1, y = 1, }; } } public void SetActiveValues(DriverSettings settings) { Domain.SetActiveValues(settings.domainArgs.domainXY.x, settings.domainArgs.domainXY.y); LpNorm.SetActiveValue(settings.domainArgs.lpNorm); Range.SetActiveValues(settings.rangeXY.x, settings.rangeXY.y); } public void Hide() { if (!IsHidden) { DirectionalityX.Hide(); DirectionalityY.Hide(); DirectionalityActiveValueTitle.Hide(); LpNorm.Hide(); Domain.Hide(); Range.Hide(); WholeCheckBox.Hide(); ByComponentCheckBox.Hide(); DirectionalityLabel.Text = Constants.DirectionalityTitleClosed; DrawHidden(); IsHidden = true; } } public void Show() { if (IsHidden) { DirectionalityX.Show(); DirectionalityY.Show(); DirectionalityActiveValueTitle.Show(); LpNorm.Show(); Domain.Show(); Range.Show(); Range.Fields.LockCheckBox.Hide(); WholeCheckBox.Show(); ByComponentCheckBox.Show(); DirectionalityLabel.Text = Constants.DirectionalityTitleOpen; DrawShown(); IsHidden = false; } } public void ToByComponent() { LpNorm.SetToUnavailable(); Domain.SetToUnavailable(); Range.SetToUnavailable(); } public void ToWhole() { LpNorm.SetToAvailable(); Domain.SetToAvailable(); Range.SetToAvailable(); } private void DrawHidden() { ContainingPanel.Height = ClosedHeight; ContainingPanel.Invalidate(); } private void DrawShown() { ContainingPanel.Height = OpenHeight; ContainingPanel.Invalidate(); } private void Panel_Paint(object sender, PaintEventArgs e) { Color col = Color.DarkGray; ButtonBorderStyle bbs = ButtonBorderStyle.Dashed; int thickness = 2; ControlPaint.DrawBorder(e.Graphics, this.ContainingPanel.ClientRectangle, col, thickness, bbs, col, thickness, bbs, col, thickness, bbs, col, thickness, bbs); } private void Title_click(object sender, EventArgs e) { if (IsHidden) { Show(); } else { Hide(); } } } }
1.507813
2
Assets/Instructions.cs
edwardbiden/YOLO
0
9599765
using UnityEngine; using System.Collections; public class Instructions : MonoBehaviour { public GameObject instructions; public GameObject startMenu; public void Start () { instructions.SetActive(false); startMenu.SetActive(true); } public void ShowInstructions () { instructions.SetActive(true); startMenu.SetActive(false); } public void BackButton () { instructions.SetActive(false); startMenu.SetActive(true); } public void Startgame () { instructions.SetActive(false); startMenu.SetActive(false); } }
1.4375
1
src/Microsoft.DocAsCode.Plugins/DependencyTransitivity.cs
StevenTCramer/docfx
4
9599773
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. namespace Microsoft.DocAsCode.Plugins { public enum DependencyTransitivity { None, SameType, All, } }
0.382813
0
Peach.Core.OS.Windows/Debuggers/DebugEngine/Tlb/__MIDL___MIDL_itf_DbgEng_0001_0073_0046.cs
JoeyJiao/peach
10
9599781
namespace Peach.Core.Debuggers.DebugEngine.Tlb { using System; public enum __MIDL___MIDL_itf_DbgEng_0001_0073_0046 { DEBUG_ENGOPT_IGNORE_LOADER_EXCEPTIONS = 0x10 } }
0.390625
0
com/netfx/src/framework/data/system/data/xmlschema.cs
npocmaka/Windows-Server-2003
17
9599789
//------------------------------------------------------------------------------ // <copyright file="XMLSchema.cs" company="Microsoft"> // Copyright (c) Microsoft Corporation. All rights reserved. // </copyright> //------------------------------------------------------------------------------ namespace System.Data { using System; using System.Xml; using System.Xml.Schema; using System.Diagnostics; using System.Collections; using System.Globalization; using System.ComponentModel; internal class XMLSchema { internal static void SetProperties(Object instance, XmlAttributeCollection attrs) { // This is called from both XSD and XDR schemas. // Do we realy need it in XSD ??? for (int i = 0; i < attrs.Count; i++) { if (attrs[i].NamespaceURI == Keywords.MSDNS) { string name = attrs[i].LocalName; string value = attrs[i].Value; if (name == "DefaultValue") continue; PropertyDescriptor pd = TypeDescriptor.GetProperties(instance)[name]; if (pd != null) { // Standard property Type type = pd.PropertyType; TypeConverter converter = TypeDescriptor.GetConverter(type); object propValue; if (converter.CanConvertFrom(typeof(string))) { propValue = converter.ConvertFromString(value); }else if (type == typeof(Type)) { propValue = Type.GetType(value); }else if (type == typeof(CultureInfo)) { propValue = new CultureInfo(value); }else { throw ExceptionBuilder.CannotConvert(value,type.FullName); } pd.SetValue(instance, propValue); } } } }// SetProperties internal static bool FEqualIdentity(XmlNode node, String name, String ns) { if (node != null && node.LocalName == name && node.NamespaceURI == ns) return true; return false; } internal static bool GetBooleanAttribute(XmlElement element, String attrName, String attrNS, bool defVal) { string value = element.GetAttribute(attrName, attrNS); if (value == null || value.Length == 0) { return defVal; } if ((value == Keywords.TRUE) || (value == Keywords.ONE_DIGIT)){ return true; } if ((value == Keywords.FALSE) || (value == Keywords.ZERO_DIGIT)){ return false; } // Error processing: throw ExceptionBuilder.InvalidAttributeValue(attrName, value); } internal static String GetStringAttribute(XmlElement element, String attrName, String attrNS, String defVal) { string value = element.GetAttribute(attrName, attrNS); if (value == null || value.Length == 0) { return defVal; } return value; } internal static string GenUniqueColumnName(string proposedName, DataTable table) { if (table.Columns.IndexOf(proposedName) >= 0) { for (int i=0; i <= table.Columns.Count; i++) { string tempName = proposedName + "_" + (i).ToString(); if (table.Columns.IndexOf(tempName) >= 0) { continue; } else { return tempName; } } } return proposedName; } internal static string GenUniqueTableName(string proposedName, DataSet ds ) { if (ds.Tables.IndexOf(proposedName) >= 0) { for (int i=0; i <= ds.Tables.Count; i++) { string tempName = proposedName + "_" + (i).ToString(); if (ds.Tables.IndexOf(tempName) >= 0) { continue; } else { return tempName; } } } return proposedName; } } internal class ConstraintTable { public DataTable table; public XmlSchemaIdentityConstraint constraint; public ConstraintTable(DataTable t, XmlSchemaIdentityConstraint c) { table = t; constraint = c; } } internal class XSDSchema : XMLSchema { XmlSchema _schemaRoot = null; XmlSchemaElement dsElement = null; DataSet _ds = null; String _schemaUri = null; String _schemaName = null; private ArrayList ColumnExpressions; private Hashtable ConstraintNodes; private ArrayList RefTables; private ArrayList complexTypes; private void CollectElementsAnnotations(XmlSchema schema, XmlSchemaObjectCollection elements, XmlSchemaObjectCollection annotations) { foreach(object item in schema.Items) { if (item is XmlSchemaAnnotation) { annotations.Add((XmlSchemaAnnotation)item); } if (item is XmlSchemaElement) { elements.Add((XmlSchemaElement)item); } } foreach(XmlSchemaExternal include in schema.Includes) { if (include.Schema != null) { CollectElementsAnnotations(include.Schema, elements, annotations); } } } internal static string QualifiedName(string name) { int iStart = name.IndexOf(":"); if (iStart == -1) return Keywords.XSD_PREFIXCOLON + name; else return name; } internal static void SetProperties(Object instance, XmlAttribute[] attrs) { // This is called from both XSD and XDR schemas. // Do we realy need it in XSD ??? if (attrs == null) return; for (int i = 0; i < attrs.Length; i++) { if (attrs[i].NamespaceURI == Keywords.MSDNS) { string name = attrs[i].LocalName; string value = attrs[i].Value; if (name == "DefaultValue" || name == "Ordinal" || name == "Locale") continue; if (name == "DataType") { DataColumn col = instance as DataColumn; if (col != null) { Type dataType = Type.GetType(value); col.DataType = dataType; } continue; } PropertyDescriptor pd = TypeDescriptor.GetProperties(instance)[name]; if (pd != null) { // Standard property Type type = pd.PropertyType; TypeConverter converter = TypeDescriptor.GetConverter(type); object propValue; if (converter.CanConvertFrom(typeof(string))) { propValue = converter.ConvertFromString(value); }else if (type == typeof(Type)) { propValue = Type.GetType(value); }else if (type == typeof(CultureInfo)) { propValue = new CultureInfo(value); }else { throw ExceptionBuilder.CannotConvert(value,type.FullName); } pd.SetValue(instance, propValue); } } } }// SetProperties private static void SetExtProperties(Object instance, XmlAttribute[] attrs) { PropertyCollection props = null; if (attrs == null) return; for (int i = 0; i < attrs.Length; i++) { if (attrs[i].NamespaceURI == Keywords.MSPROPNS) { if(props == null) { object val = TypeDescriptor.GetProperties(instance)["ExtendedProperties"].GetValue(instance); Debug.Assert(val is PropertyCollection, "We can set values only for classes that have ExtendedProperties"); props = (PropertyCollection) val; } string propName = XmlConvert.DecodeName(attrs[i].LocalName); if (instance is ForeignKeyConstraint) { if (propName.StartsWith(Keywords.MSD_FK_PREFIX)) propName = propName.Substring(3); else continue; } if ((instance is DataRelation) && (propName.StartsWith(Keywords.MSD_REL_PREFIX))) { propName = propName.Substring(4); } props.Add(propName, attrs[i].Value); } } }// SetExtProperties internal String GetMsdataAttribute(XmlSchemaAnnotated node, String ln) { XmlAttribute[] nodeAttributes = node.UnhandledAttributes; if (nodeAttributes!=null) for(int i=0; i<nodeAttributes.Length;i++) if (nodeAttributes[i].LocalName == ln && nodeAttributes[i].NamespaceURI == Keywords.MSDNS) return nodeAttributes[i].Value; return null; } internal void HandleRelation(XmlElement node) { HandleRelation(node, false); } private static void SetExtProperties(Object instance, XmlAttributeCollection attrs) { PropertyCollection props = null; for (int i = 0; i < attrs.Count; i++) { if (attrs[i].NamespaceURI == Keywords.MSPROPNS) { if(props == null) { object val = TypeDescriptor.GetProperties(instance)["ExtendedProperties"].GetValue(instance); Debug.Assert(val is PropertyCollection, "We can set values only for classes that have ExtendedProperties"); props = (PropertyCollection) val; } string propName = XmlConvert.DecodeName(attrs[i].LocalName); props.Add(propName, attrs[i].Value); } } }// SetExtProperties internal void HandleRelation(XmlElement node, bool fNested) { string strName; string parentName; string childName; string [] parentNames; string [] childNames; string value; bool fCreateConstraints = false; //if we have a relation, //we do not have constraints DataRelationCollection rels = _ds.Relations; DataRelation relation; DataColumn [] parentKey; DataColumn [] childKey; DataTable parent; DataTable child; int keyLength; strName = XmlConvert.DecodeName(node.GetAttribute(Keywords.NAME)); for (int i = 0; i < rels.Count; ++i) { if (0 == String.Compare(rels[i].RelationName, strName, false, CultureInfo.InvariantCulture)) return; } parentName = node.GetAttribute(Keywords.MSD_PARENT, Keywords.MSDNS); if (parentName == null || parentName.Length==0) throw ExceptionBuilder.RelationParentNameMissing(strName); parentName = XmlConvert.DecodeName(parentName); childName = node.GetAttribute(Keywords.MSD_CHILD, Keywords.MSDNS); if (childName == null || childName.Length==0) throw ExceptionBuilder.RelationChildNameMissing(strName); childName = XmlConvert.DecodeName(childName); value = node.GetAttribute(Keywords.MSD_PARENTKEY, Keywords.MSDNS); if (value == null || value.Length==0) throw ExceptionBuilder.RelationTableKeyMissing(strName); parentNames = value.TrimEnd(null).Split(new char[] {Keywords.MSD_KEYFIELDSEP, Keywords.MSD_KEYFIELDOLDSEP}); value = node.GetAttribute(Keywords.MSD_CHILDKEY, Keywords.MSDNS); if (value == null || value.Length==0) throw ExceptionBuilder.RelationChildKeyMissing(strName); childNames = value.TrimEnd(null).Split(new char[] {Keywords.MSD_KEYFIELDSEP, Keywords.MSD_KEYFIELDOLDSEP}); keyLength = parentNames.Length; if (keyLength != childNames.Length) throw ExceptionBuilder.MismatchKeyLength(); parentKey = new DataColumn[keyLength]; childKey = new DataColumn[keyLength]; parent = _ds.Tables[parentName]; if (parent == null) throw ExceptionBuilder.ElementTypeNotFound(parentName); child = _ds.Tables[childName]; if (child == null) throw ExceptionBuilder.ElementTypeNotFound(childName); for (int i = 0; i < keyLength; i++) { parentKey[i] = parent.Columns[XmlConvert.DecodeName(parentNames[i])]; if (parentKey[i] == null) throw ExceptionBuilder.ElementTypeNotFound(parentNames[i]); childKey[i] = child.Columns[XmlConvert.DecodeName(childNames[i])]; if (childKey[i] == null) throw ExceptionBuilder.ElementTypeNotFound(childNames[i]); } relation = new DataRelation(strName, parentKey, childKey, fCreateConstraints); relation.Nested = fNested; SetExtProperties(relation, node.Attributes); _ds.Relations.Add(relation); } private bool HasAttributes(XmlSchemaObjectCollection attributes){ foreach (XmlSchemaObject so in attributes) { if (so is XmlSchemaAttribute) { return true; } if (so is XmlSchemaAttributeGroup) { return true; } if (so is XmlSchemaAttributeGroupRef) { return true; } } return false; } private bool IsDatasetParticle(XmlSchemaParticle pt){ XmlSchemaObjectCollection items = GetParticleItems(pt); if (items == null) return false; // empty element, threat it as table foreach (XmlSchemaAnnotated el in items){ if (el is XmlSchemaElement) { if(((XmlSchemaElement)el).RefName.Name!="") continue; if (!IsTable ((XmlSchemaElement)el)) return false; continue; } if (el is XmlSchemaParticle) { if (!IsDatasetParticle((XmlSchemaParticle)el)) return false; } } return true; } private XmlSchemaElement FindDatasetElement(XmlSchemaObjectCollection elements) { foreach(XmlSchemaElement XmlElement in elements) { if (GetBooleanAttribute(XmlElement, Keywords.MSD_ISDATASET, /*default:*/ false)) return XmlElement; } if (elements.Count == 1) { //let's see if this element looks like a DataSet XmlSchemaElement node = (XmlSchemaElement)elements[0]; if (!GetBooleanAttribute(node, Keywords.MSD_ISDATASET, /*default:*/ true)) return null; XmlSchemaComplexType ct = node.SchemaType as XmlSchemaComplexType; if (ct == null) return null; while (ct != null) { if (HasAttributes(ct.Attributes)) return null; XmlSchemaParticle particle = GetParticle(ct); if (particle != null) { if (!IsDatasetParticle(particle)) return null; // it's a table } if (ct.BaseSchemaType is XmlSchemaComplexType) ct = (XmlSchemaComplexType)ct.BaseSchemaType; else break; } //if we are here there all elements are tables return node; } return null; } public void LoadSchema(XmlSchema schemaRoot , DataSet ds) { //Element schemaRoot, DataSet ds) { ConstraintNodes = new Hashtable(); RefTables = new ArrayList(); ColumnExpressions = new ArrayList(); complexTypes = new ArrayList(); if (schemaRoot == null) return; _schemaRoot = schemaRoot; _ds = ds; ds.fIsSchemaLoading = true; _schemaName = schemaRoot.Id; _schemaUri = schemaRoot.TargetNamespace; if (_schemaUri == null) _schemaUri = string.Empty; if (_schemaName == "" || _schemaName == null) _schemaName = "NewDataSet"; ds.DataSetName = XmlConvert.DecodeName(_schemaName); ds.Namespace = _schemaUri; XmlSchemaObjectCollection annotations = new XmlSchemaObjectCollection(); XmlSchemaObjectCollection elements = new XmlSchemaObjectCollection(); CollectElementsAnnotations(schemaRoot, elements, annotations); dsElement = FindDatasetElement(elements); // Walk all the top level Element tags. foreach (XmlSchemaElement element in elements) { if (element == dsElement) continue; String typeName = GetInstanceName(element); if (RefTables.Contains(typeName)) continue; DataTable table = HandleTable(element); } if (dsElement!=null) HandleDataSet(dsElement); foreach (XmlSchemaAnnotation annotation in annotations) { HandleRelations(annotation, false); } for (int i=0; i<ColumnExpressions.Count; i++) ((DataColumn)(ColumnExpressions[i])).BindExpression(); for (int i=0; i<ColumnExpressions.Count; i++) { DataTable table = ((DataColumn)(ColumnExpressions[i])).Table; table.Columns.columnQueue = new ColumnQueue(table, table.Columns.columnQueue); } foreach (DataTable dt in ds.Tables) { if (dt.nestedParentRelation == null && dt.Namespace == ds.Namespace) dt.tableNamespace = null; } ds.fIsSchemaLoading = false; //reactivate column computations } private void HandleRelations(XmlSchemaAnnotation ann, bool fNested) { foreach (object __items in ann.Items) if (__items is XmlSchemaAppInfo) { XmlNode[] relations = ((XmlSchemaAppInfo) __items).Markup; for (int i = 0; i<relations.Length; i++) if (FEqualIdentity(relations[i], Keywords.MSD_RELATION, Keywords.MSDNS)) HandleRelation((XmlElement)relations[i], fNested); } } internal XmlSchemaObjectCollection GetParticleItems(XmlSchemaParticle pt){ if (pt is XmlSchemaSequence) return ((XmlSchemaSequence)pt).Items; if (pt is XmlSchemaAll) return ((XmlSchemaAll)pt).Items; if (pt is XmlSchemaChoice) return ((XmlSchemaChoice)pt).Items; if (pt is XmlSchemaAny) return null; // the code below is a little hack for the SOM behavior if (pt is XmlSchemaElement) { XmlSchemaObjectCollection Items = new XmlSchemaObjectCollection(); Items.Add(pt); return Items; } if (pt is XmlSchemaGroupRef) return GetParticleItems( ((XmlSchemaGroupRef)pt).Particle ); // should never get here. return null; } internal void HandleParticle(XmlSchemaParticle pt, DataTable table, ArrayList tableChildren, bool isBase){ XmlSchemaObjectCollection items = GetParticleItems(pt); if (items == null) return; foreach (XmlSchemaAnnotated item in items){ XmlSchemaElement el = item as XmlSchemaElement; if (el != null) { DataTable child = null; if (((el.Name == null) && (el.RefName.Name == table.EncodedTableName)) || (IsTable(el) && el.Name == table.TableName)) child = table; else child = HandleTable ((XmlSchemaElement)el); if (child==null) HandleElementColumn((XmlSchemaElement)el, table, isBase); else { DataRelation relation = null; if (el.Annotation != null) HandleRelations(el.Annotation, true); DataRelationCollection childRelations = table.ChildRelations; for (int j = 0; j < childRelations.Count; j++) { if (!childRelations[j].Nested) continue; if (child == childRelations[j].ChildTable) relation = childRelations[j]; } if (relation == null) { tableChildren.Add(child); } else { Debug.Assert(relation.ParentKey.columns.Length == 1, "Invalid nested relation: multi-column parentkey"); } } } else { HandleParticle((XmlSchemaParticle)item, table, tableChildren, isBase); } } } internal void HandleAttributes(XmlSchemaObjectCollection attributes, DataTable table, bool isBase) { foreach (XmlSchemaObject so in attributes) { if (so is XmlSchemaAttribute) { HandleAttributeColumn((XmlSchemaAttribute) so, table, isBase); } else { // XmlSchemaAttributeGroupRef XmlSchemaAttributeGroup schemaGroup = _schemaRoot.AttributeGroups[((XmlSchemaAttributeGroupRef) so).RefName] as XmlSchemaAttributeGroup; if (schemaGroup!=null) { HandleAttributeGroup(schemaGroup, table, isBase); } } } } private void HandleAttributeGroup(XmlSchemaAttributeGroup attributeGroup, DataTable table, bool isBase) { foreach (XmlSchemaObject obj in attributeGroup.Attributes) { if (obj is XmlSchemaAttribute) { HandleAttributeColumn((XmlSchemaAttribute) obj, table, isBase); } else { // XmlSchemaAttributeGroupRef XmlSchemaAttributeGroupRef attributeGroupRef = (XmlSchemaAttributeGroupRef)obj; XmlSchemaAttributeGroup attributeGroupResolved; if (attributeGroup.RedefinedAttributeGroup != null && attributeGroupRef.RefName == new XmlQualifiedName(attributeGroup.Name, _schemaRoot.TargetNamespace)) { attributeGroupResolved = (XmlSchemaAttributeGroup)attributeGroup.RedefinedAttributeGroup; } else { attributeGroupResolved = (XmlSchemaAttributeGroup)_schemaRoot.AttributeGroups[attributeGroupRef.RefName]; } if (attributeGroupResolved != null) { HandleAttributeGroup(attributeGroupResolved, table, isBase); } } } } internal void HandleComplexType(XmlSchemaComplexType ct, DataTable table, ArrayList tableChildren, bool isNillable){ if (complexTypes.Contains(ct)) throw ExceptionBuilder.CircularComplexType(ct.Name); bool isBase = false; complexTypes.Add(ct); if (ct.ContentModel != null) { /* HandleParticle(ct.CompiledParticle, table, tableChildren, isBase); foreach (XmlSchemaAttribute s in ct.Attributes){ HandleAttributeColumn(s, table, isBase); } */ if (ct.ContentModel is XmlSchemaComplexContent) { XmlSchemaAnnotated cContent = ((XmlSchemaComplexContent) (ct.ContentModel)).Content; if (cContent is XmlSchemaComplexContentExtension) { XmlSchemaComplexContentExtension ccExtension = ((XmlSchemaComplexContentExtension) cContent ); HandleAttributes(ccExtension.Attributes, table, isBase); if (ct.BaseSchemaType is XmlSchemaComplexType) { HandleComplexType((XmlSchemaComplexType)ct.BaseSchemaType, table, tableChildren, isNillable); } else { HandleSimpleContentColumn(ccExtension.BaseTypeName.Name, table, isBase, ct.ContentModel.UnhandledAttributes, isNillable); } if (ccExtension.Particle != null) HandleParticle(ccExtension.Particle, table, tableChildren, isBase); } else { Debug.Assert(cContent is XmlSchemaComplexContentRestriction, "Expected complexContent extension or restriction"); XmlSchemaComplexContentRestriction ccRestriction = ((XmlSchemaComplexContentRestriction) cContent ); HandleAttributes(ccRestriction.Attributes, table, isBase); if (ccRestriction.Particle != null) HandleParticle(ccRestriction.Particle, table, tableChildren, isBase); } } else { Debug.Assert(ct.ContentModel is XmlSchemaSimpleContent, "expected simpleContent or complexContent"); XmlSchemaAnnotated cContent = ((XmlSchemaSimpleContent) (ct.ContentModel)).Content; if (cContent is XmlSchemaSimpleContentExtension) { XmlSchemaSimpleContentExtension ccExtension = ((XmlSchemaSimpleContentExtension) cContent ); HandleAttributes(ccExtension.Attributes, table, isBase); if (ct.BaseSchemaType is XmlSchemaComplexType) { HandleComplexType((XmlSchemaComplexType)ct.BaseSchemaType, table, tableChildren, isNillable); } else { HandleSimpleContentColumn(ccExtension.BaseTypeName.Name, table, isBase, ct.ContentModel.UnhandledAttributes, isNillable); } //BUG BUG: what do we do if the base is a simpleType } else { Debug.Assert(cContent is XmlSchemaSimpleContentRestriction, "Expected SimpleContent extension or restriction"); XmlSchemaSimpleContentRestriction ccRestriction = ((XmlSchemaSimpleContentRestriction) cContent ); HandleAttributes(ccRestriction.Attributes, table, isBase); } } } else { isBase = true; HandleAttributes(ct.Attributes, table, isBase); if (ct.Particle != null) HandleParticle(ct.Particle, table, tableChildren, isBase); } complexTypes.Remove(ct); } internal XmlSchemaParticle GetParticle(XmlSchemaComplexType ct){ if (ct.ContentModel != null) { if (ct.ContentModel is XmlSchemaComplexContent) { XmlSchemaAnnotated cContent = ((XmlSchemaComplexContent) (ct.ContentModel)).Content; if (cContent is XmlSchemaComplexContentExtension) { return ((XmlSchemaComplexContentExtension) cContent ).Particle; } else { Debug.Assert(cContent is XmlSchemaComplexContentRestriction, "Expected complexContent extension or restriction"); return ((XmlSchemaComplexContentRestriction) cContent ).Particle; } } else { Debug.Assert(ct.ContentModel is XmlSchemaSimpleContent, "expected simpleContent or complexContent"); return null; } } else { return ct.Particle; } } internal DataColumn FindField(DataTable table, string field) { bool attribute = false; String colName = field; if (field.StartsWith("@")) { attribute = true; colName = field.Substring(1); } String [] split = colName.Split(':'); colName = split [split.Length - 1]; colName = XmlConvert.DecodeName(colName); DataColumn col = table.Columns[colName]; if (col == null ) throw ExceptionBuilder.InvalidField(field); bool _attribute = (col.ColumnMapping == MappingType.Attribute) || (col.ColumnMapping == MappingType.Hidden); if (_attribute != attribute) throw ExceptionBuilder.InvalidField(field); return col; } internal DataColumn[] BuildKey(XmlSchemaIdentityConstraint keyNode, DataTable table){ ArrayList keyColumns = new ArrayList(); foreach (XmlSchemaXPath node in keyNode.Fields) { keyColumns.Add(FindField(table, node.XPath)); } DataColumn [] key = new DataColumn[keyColumns.Count]; keyColumns.CopyTo(key, 0); return key; } internal bool GetBooleanAttribute(XmlSchemaAnnotated element, String attrName, bool defVal) { string value = GetMsdataAttribute(element, attrName); if (value == null || value.Length == 0) { return defVal; } if (value == Keywords.TRUE) { return true; } if (value == Keywords.FALSE) { return false; } // Error processing: throw ExceptionBuilder.InvalidAttributeValue(attrName, value); } internal String GetStringAttribute(XmlSchemaAnnotated element, String attrName, String defVal) { string value = GetMsdataAttribute(element, attrName); if (value == null || value.Length == 0) { return defVal; } return value; } /* <key name="fk"> <selector>../Customers</selector> <field>ID</field> </key> <keyref refer="fk"> <selector>.</selector> <field>CustID</field> </keyref> */ internal static AcceptRejectRule TranslateAcceptRejectRule( string strRule ) { if (strRule == "Cascade") return AcceptRejectRule.Cascade; else if (strRule == "None") return AcceptRejectRule.None; else return ForeignKeyConstraint.AcceptRejectRule_Default; } internal static Rule TranslateRule( string strRule ) { if (strRule == "Cascade") return Rule.Cascade; else if (strRule == "None") return Rule.None; else if (strRule == "SetDefault") return Rule.SetDefault; else if (strRule == "SetNull") return Rule.SetNull; else return ForeignKeyConstraint.Rule_Default; } internal void HandleKeyref(XmlSchemaKeyref keyref) { string refer = XmlConvert.DecodeName(keyref.Refer.Name); // BUGBUG check here!!! string name = XmlConvert.DecodeName(keyref.Name); name = GetStringAttribute( keyref, "ConstraintName", /*default:*/ name); // we do not process key defined outside the current node String tableName = GetTableName(keyref); DataTable table = _ds.Tables[tableName]; if (table == null) return; if (refer == null || refer.Length == 0) throw ExceptionBuilder.MissingRefer(name); ConstraintTable key = (ConstraintTable) ConstraintNodes[refer]; if (key == null) { throw ExceptionBuilder.InvalidKey(name); } DataColumn[] pKey = BuildKey(key.constraint, key.table); DataColumn[] fKey = BuildKey(keyref, table); ForeignKeyConstraint fkc = null; if (GetBooleanAttribute(keyref, Keywords.MSD_CONSTRAINTONLY, /*default:*/ false)) { int iExisting = fKey[0].Table.Constraints.InternalIndexOf(name); if (iExisting > -1) { if (fKey[0].Table.Constraints[iExisting].ConstraintName != name) iExisting = -1; } if (iExisting < 0) { fkc = new ForeignKeyConstraint( name, pKey, fKey ); fKey[0].Table.Constraints.Add(fkc); } } else { string relName = XmlConvert.DecodeName(GetStringAttribute( keyref, Keywords.MSD_RELATIONNAME, keyref.Name)); if (relName == null || relName.Length == 0) relName = name; int iExisting = fKey[0].Table.DataSet.Relations.InternalIndexOf(relName); if (iExisting > -1) { if (fKey[0].Table.DataSet.Relations[iExisting].RelationName != relName) iExisting = -1; } DataRelation relation = null; if (iExisting < 0) { relation = new DataRelation(relName, pKey, fKey); SetExtProperties(relation, keyref.UnhandledAttributes); pKey[0].Table.DataSet.Relations.Add(relation); fkc = relation.ChildKeyConstraint; fkc.ConstraintName = name; } else { relation = fKey[0].Table.DataSet.Relations[iExisting]; } if (GetBooleanAttribute(keyref, Keywords.MSD_ISNESTED, /*default:*/ false)) relation.Nested = true; } string acceptRejectRule = GetMsdataAttribute(keyref, Keywords.MSD_ACCEPTREJECTRULE); string updateRule = GetMsdataAttribute(keyref, Keywords.MSD_UPDATERULE); string deleteRule = GetMsdataAttribute(keyref, Keywords.MSD_DELETERULE); if (fkc != null) { if (acceptRejectRule != null) fkc.AcceptRejectRule = TranslateAcceptRejectRule(acceptRejectRule); if (updateRule != null) fkc.UpdateRule = TranslateRule(updateRule); if (deleteRule != null) fkc.DeleteRule = TranslateRule(deleteRule); SetExtProperties(fkc, keyref.UnhandledAttributes); } } internal void HandleConstraint(XmlSchemaIdentityConstraint keyNode){ String name = null; name = XmlConvert.DecodeName(keyNode.Name); if (name==null || name.Length==0) throw ExceptionBuilder.MissingAttribute(Keywords.NAME); if (ConstraintNodes.ContainsKey(name)) throw ExceptionBuilder.DuplicateConstraintRead(name); // we do not process key defined outside the current node String tableName = GetTableName(keyNode); DataTable table = _ds.Tables[tableName]; if (table == null) return; ConstraintNodes.Add(name, new ConstraintTable(table, keyNode)); bool fPrimaryKey = GetBooleanAttribute(keyNode, Keywords.MSD_PRIMARYKEY, /*default:*/ false); name = GetStringAttribute(keyNode, "ConstraintName", /*default:*/ name); DataColumn[] key = BuildKey(keyNode, table); if (0 < key.Length) { UniqueConstraint found = (UniqueConstraint) key[0].Table.Constraints.FindConstraint(new UniqueConstraint(name, key)); if (found == null) { key[0].Table.Constraints.Add(name, key, fPrimaryKey); SetExtProperties(key[0].Table.Constraints[name], keyNode.UnhandledAttributes); } else { key = found.Columns; SetExtProperties(found, keyNode.UnhandledAttributes); if (fPrimaryKey) key[0].Table.PrimaryKey = key; } if (keyNode is XmlSchemaKey) { for (int i=0; i<key.Length; i++) key[i].AllowDBNull = false; } } } internal DataTable InstantiateSimpleTable(XmlSchemaElement node) { DataTable table; String typeName = XmlConvert.DecodeName(GetInstanceName(node)); String _TableUri; _TableUri = node.QualifiedName.Namespace; table = _ds.Tables[typeName, _TableUri]; if (table!=null) { throw ExceptionBuilder.DuplicateDeclaration(typeName); } table = new DataTable( typeName); table.Namespace = _TableUri; table.Namespace = GetStringAttribute(node, "targetNamespace", table.Namespace); table.MinOccurs = node.MinOccurs; table.MaxOccurs = node.MaxOccurs; SetProperties(table, node.UnhandledAttributes); SetExtProperties(table, node.UnhandledAttributes); HandleElementColumn(node, table, false); table.Columns[0].ColumnName = typeName+"_Column"; table.Columns[0].ColumnMapping = MappingType.SimpleContent; _ds.Tables.Add(table); // handle all the unique and key constraints related to this table if ((dsElement != null) && (dsElement.Constraints!=null)) { foreach (XmlSchemaIdentityConstraint key in dsElement.Constraints) { if (key is XmlSchemaKeyref) continue; if (GetTableName(key) == table.TableName) HandleConstraint(key); } } table.fNestedInDataset = false; return (table); } internal string GetInstanceName(XmlSchemaAnnotated node) { string instanceName = null; Debug.Assert( (node is XmlSchemaElement) || (node is XmlSchemaAttribute), "GetInstanceName should only be called on attribute or elements"); if (node is XmlSchemaElement) { XmlSchemaElement el = (XmlSchemaElement) node; instanceName = el.Name != null ? el.Name : el.RefName.Name; } else if (node is XmlSchemaAttribute) { XmlSchemaAttribute el = (XmlSchemaAttribute) node; instanceName = el.Name != null ? el.Name : el.RefName.Name; } Debug.Assert( (instanceName != null) && (instanceName!=""), "instanceName cannot be null or empty. There's an error in the XSD compiler"); return instanceName; } // Sequences of handling Elements, Attributes and Text-only column should be the same as in InferXmlSchema internal DataTable InstantiateTable(XmlSchemaElement node, XmlSchemaComplexType typeNode, bool isRef) { DataTable table; String typeName = GetInstanceName(node); ArrayList tableChildren = new ArrayList(); String _TableUri; _TableUri = node.QualifiedName.Namespace; table = _ds.Tables[XmlConvert.DecodeName(typeName), _TableUri]; if (table!=null) { if (isRef) return table; else throw ExceptionBuilder.DuplicateDeclaration(typeName); } if (isRef) RefTables.Add(typeName); table = new DataTable( XmlConvert.DecodeName(typeName) ); table.typeName = node.SchemaTypeName; table.Namespace = _TableUri; table.Namespace = GetStringAttribute(node, "targetNamespace", table.Namespace); //table.Prefix = node.Prefix; String value= GetStringAttribute(typeNode, Keywords.MSD_CASESENSITIVE, "") ; if (value!=""){ if (value == Keywords.TRUE) table.CaseSensitive = true; if (value == Keywords.FALSE) table.CaseSensitive = false; } value = GetMsdataAttribute(node, Keywords.MSD_LOCALE); if (value!=null && value.Length != 0) { table.Locale = new CultureInfo(value); } table.MinOccurs = node.MinOccurs; table.MaxOccurs = node.MaxOccurs; _ds.Tables.Add(table); HandleComplexType(typeNode, table, tableChildren, node.IsNillable); for (int i=0; i < table.Columns.Count ; i++) table.Columns[i].SetOrdinal(i); /* if (xmlContent == XmlContent.Mixed) { string textColumn = GenUniqueColumnName(table.TableName+ "_Text", table); table.XmlText = new DataColumn(textColumn, typeof(string), null, MappingType.Text); } */ SetProperties(table, node.UnhandledAttributes); SetExtProperties(table, node.UnhandledAttributes); // handle all the unique and key constraints related to this table if ((dsElement != null) && (dsElement.Constraints!=null)) { foreach (XmlSchemaIdentityConstraint key in dsElement.Constraints) { if (key is XmlSchemaKeyref) continue; if (GetTableName(key) == table.TableName) HandleConstraint(key); } } foreach(DataTable _tableChild in tableChildren) { if (_tableChild != table && table.Namespace == _tableChild.Namespace) _tableChild.tableNamespace = null; if ((dsElement != null) && (dsElement.Constraints!=null)) { foreach (XmlSchemaIdentityConstraint key in dsElement.Constraints) { XmlSchemaKeyref keyref = key as XmlSchemaKeyref; if (keyref == null) continue; bool isNested = GetBooleanAttribute(keyref, Keywords.MSD_ISNESTED, /*default:*/ false); if (!isNested) continue; if (GetTableName(keyref) == _tableChild.TableName) HandleKeyref(keyref); } } DataRelation relation = null; DataRelationCollection childRelations = table.ChildRelations; for (int j = 0; j < childRelations.Count; j++) { if (!childRelations[j].Nested) continue; if (_tableChild == childRelations[j].ChildTable) relation = childRelations[j]; } if (relation!=null) continue; DataColumn parentKey = table.AddUniqueKey(); // foreign key in the child table DataColumn childKey = _tableChild.AddForeignKey(parentKey); // create relationship // setup relationship between parent and this table relation = new DataRelation(table.TableName + "_" + _tableChild.TableName, parentKey, childKey, true); relation.Nested = true; _tableChild.DataSet.Relations.Add(relation); } return (table); } private class NameTypeComparer : IComparer { public int Compare(object x, object y) {return String.Compare(((NameType)x).name, ((NameType)y).name, false, CultureInfo.InvariantCulture);} } private class NameType : IComparable { public String name; public Type type; public NameType(String n, Type t) { name = n; type = t; } public int CompareTo(object obj) { return String.Compare(name, (string)obj, false, CultureInfo.InvariantCulture); } }; // XSD spec: http://www.w3.org/TR/xmlschema-2/ // April: http://www.w3.org/TR/2000/WD-xmlschema-2-20000407/datatypes.html // Fabr: http://www.w3.org/TR/2000/WD-xmlschema-2-20000225/ private static NameType[] mapNameTypeXsd = { new NameType("string" , typeof(string) ), /* XSD Apr */ new NameType("normalizedString" , typeof(string) ), /* XSD Apr */ new NameType("boolean" , typeof(bool) ), /* XSD Apr */ new NameType("float" , typeof(Single) ), /* XSD Apr */ new NameType("double" , typeof(double) ), /* XSD Apr */ new NameType("decimal" , typeof(decimal) ), /* XSD 2001 March */ new NameType("duration" , typeof(TimeSpan)), /* XSD Apr */ new NameType("base64Binary" , typeof(Byte[]) ), /* XSD Apr : abstruct */ new NameType("hexBinary" , typeof(Byte[]) ), /* XSD Apr : abstruct */ new NameType("anyURI" , typeof(System.Uri) ), /* XSD Apr */ new NameType("ID" , typeof(string) ), /* XSD Apr */ new NameType("IDREF" , typeof(string) ), /* XSD Apr */ new NameType("ENTITY" , typeof(string) ), /* XSD Apr */ new NameType("NOTATION" , typeof(string) ), /* XSD Apr */ new NameType("QName" , typeof(string) ), /* XSD Apr */ new NameType("language" , typeof(string) ), /* XSD Apr */ new NameType("IDREFS" , typeof(string) ), /* XSD Apr */ new NameType("ENTITIES" , typeof(string) ), /* XSD Apr */ new NameType("NMTOKEN" , typeof(string) ), /* XSD Apr */ new NameType("NMTOKENS" , typeof(string) ), /* XSD Apr */ new NameType("Name" , typeof(string) ), /* XSD Apr */ new NameType("NCName" , typeof(string) ), /* XSD Apr */ new NameType("integer" , typeof(Int64) ), /* XSD Apr */ new NameType("nonPositiveInteger" , typeof(Int64) ), /* XSD Apr */ new NameType("negativeInteger" , typeof(Int64) ), /* XSD Apr */ new NameType("long" , typeof(Int64) ), /* XSD Apr */ new NameType("int" , typeof(Int32) ), /* XSD Apr */ new NameType("short" , typeof(Int16) ), /* XSD Apr */ new NameType("byte" , typeof(SByte) ), /* XSD Apr */ new NameType("nonNegativeInteger" , typeof(UInt64) ), /* XSD Apr */ new NameType("unsignedLong" , typeof(UInt64) ), /* XSD Apr */ new NameType("unsignedInt" , typeof(UInt32) ), /* XSD Apr */ new NameType("unsignedShort" , typeof(UInt16) ), /* XSD Apr */ new NameType("unsignedByte" , typeof(Byte) ), /* XSD Apr */ new NameType("positiveInteger" , typeof(UInt64) ), /* XSD Apr */ new NameType("dateTime" , typeof(DateTime)), /* XSD Apr */ new NameType("time" , typeof(DateTime)), /* XSD Apr */ new NameType("date" , typeof(DateTime)), /* XSD Apr */ new NameType("gYear" , typeof(DateTime)), /* XSD Apr */ new NameType("gYearMonth" , typeof(DateTime)), /* XSD Apr */ new NameType("gMonth" , typeof(DateTime)), /* XSD Apr */ new NameType("gMonthDay" , typeof(DateTime)), /* XSD Apr */ new NameType("gDay" , typeof(DateTime)), /* XSD Apr */ }; private static bool _wasSorted; private static NameType FindNameType(string name) { if(! _wasSorted) { lock(typeof(NameType)) { if(! _wasSorted) { NameTypeComparer comparer = new NameTypeComparer(); // REVIEW: (davidgut) why not sort the static list? Array.Sort(mapNameTypeXsd, comparer); _wasSorted = true; } } } int index = Array.BinarySearch(mapNameTypeXsd, name); if (index < 0) { throw ExceptionBuilder.UndefinedDatatype(name); } return mapNameTypeXsd[index]; } private Type ParseDataType(string dt) { NameType nt = FindNameType(dt); return nt.type; } internal static Boolean IsXsdType(string name) { if(! _wasSorted) { lock(typeof(NameType)) { if(! _wasSorted) { NameTypeComparer comparer = new NameTypeComparer(); // REVIEW: (davidgut) why not sort the static list? Array.Sort(mapNameTypeXsd, comparer); _wasSorted = true; } } } int index = Array.BinarySearch(mapNameTypeXsd, name); if (index < 0) { #if DEBUG // Let's check that we realy don't have this name: foreach (NameType nt in mapNameTypeXsd) { Debug.Assert(nt.name != name, "FindNameType('" + name + "') -- failed. Existed name not found"); } #endif return false; } Debug.Assert(mapNameTypeXsd[index].name == name, "FindNameType('" + name + "') -- failed. Wrong name found"); return true; } internal XmlSchemaAnnotated FindTypeNode(XmlSchemaAnnotated node) { XmlSchemaAttribute attr = node as XmlSchemaAttribute; XmlSchemaElement el = node as XmlSchemaElement; bool isAttr = attr != null; String _type = isAttr ? attr.SchemaTypeName.Name : el.SchemaTypeName.Name; XmlSchemaAnnotated typeNode; if (_type == null || _type == String.Empty) { _type = isAttr ? attr.RefName.Name : el.RefName.Name; if (_type == null || _type == String.Empty) typeNode = (XmlSchemaAnnotated) (isAttr ? attr.SchemaType : el.SchemaType); else typeNode = isAttr ? FindTypeNode((XmlSchemaAnnotated)_schemaRoot.Attributes[attr.RefName]) :FindTypeNode((XmlSchemaAnnotated)_schemaRoot.Elements[el.RefName]); } else typeNode = (XmlSchemaAnnotated)_schemaRoot.SchemaTypes[isAttr ? ((XmlSchemaAttribute)node).SchemaTypeName : ((XmlSchemaElement)node).SchemaTypeName]; return typeNode; } internal void HandleSimpleContentColumn(String strType, DataTable table, bool isBase, XmlAttribute[] attrs, bool isNillable){ Type type = null; if (strType == null) { return; } type = ParseDataType(strType); DataColumn column; string columnName = table.TableName+"_text"; bool isToAdd = true; if ((!isBase) && (table.Columns.Contains(columnName, true))){ column = table.Columns[columnName]; isToAdd = false; } else { column = new DataColumn(columnName, type, null, MappingType.SimpleContent); } SetProperties(column, attrs); SetExtProperties(column, attrs); String tmp = "-1"; string defValue = null; //try to see if attributes contain allownull column.AllowDBNull = isNillable; if(attrs!=null) for(int i=0; i< attrs.Length;i++) { if ( attrs[i].LocalName == Keywords.MSD_ALLOWDBNULL && attrs[i].NamespaceURI == Keywords.MSDNS) if ( attrs[i].Value == Keywords.FALSE) column.AllowDBNull = false; if ( attrs[i].LocalName == Keywords.MSD_ORDINAL && attrs[i].NamespaceURI == Keywords.MSDNS) tmp = attrs[i].Value; if ( attrs[i].LocalName == Keywords.MSD_DEFAULTVALUE && attrs[i].NamespaceURI == Keywords.MSDNS) defValue = attrs[i].Value; } int ordinal = (int)Convert.ChangeType(tmp, typeof(int)); //SetExtProperties(column, attr.UnhandledAttributes); if ((column.Expression!=null)&&(column.Expression.Length!=0)) { ColumnExpressions.Add(column); } column.XmlDataType = strType; column.SimpleType = null; //column.Namespace = typeNode.SourceUri; if (isToAdd) { if(ordinal>-1 && ordinal<table.Columns.Count) table.Columns.AddAt(ordinal, column); else table.Columns.Add(column); } if (defValue != null) try { column.DefaultValue = column.ConvertXmlToObject(defValue); } catch (System.FormatException) { throw ExceptionBuilder.CannotConvert(defValue, type.FullName); } } internal void HandleAttributeColumn(XmlSchemaAttribute attrib, DataTable table, bool isBase){ Type type = null; XmlSchemaAttribute attr = attrib.Name != null ? attrib : (XmlSchemaAttribute) _schemaRoot.Attributes[attrib.RefName]; XmlSchemaAnnotated typeNode = FindTypeNode(attr); String strType = null; SimpleType xsdType = null; if (typeNode == null) { strType = attr.SchemaTypeName.Name; if (strType == null || strType.Length == 0) { strType = ""; type = typeof(string); } else { type = ParseDataType(attr.SchemaTypeName.Name); } } else if (typeNode is XmlSchemaSimpleType) { // UNDONE: parse simple type xsdType = new SimpleType((XmlSchemaSimpleType)typeNode); type = ParseDataType(xsdType.BaseType); strType = xsdType.Name; if(xsdType.Length == 1 && type == typeof(string)) { type = typeof(Char); } } else if (typeNode is XmlSchemaElement) { strType = ((XmlSchemaElement)typeNode).SchemaTypeName.Name; type = ParseDataType(strType); } else { if (typeNode.Id == null) throw ExceptionBuilder.DatatypeNotDefined(); else throw ExceptionBuilder.UndefinedDatatype(typeNode.Id); } DataColumn column; string columnName = XmlConvert.DecodeName(GetInstanceName(attr)); bool isToAdd = true; if ((!isBase) && (table.Columns.Contains(columnName, true))){ column = table.Columns[columnName]; isToAdd = false; } else { column = new DataColumn(columnName, type, null, MappingType.Attribute); } SetProperties(column, attr.UnhandledAttributes); SetExtProperties(column, attr.UnhandledAttributes); if ((column.Expression!=null)&&(column.Expression.Length!=0)) { ColumnExpressions.Add(column); } column.XmlDataType = strType; column.SimpleType = xsdType; column.AllowDBNull = !(attrib.Use == XmlSchemaUse.Required); column.Namespace = attrib.QualifiedName.Namespace; column.Namespace = GetStringAttribute(attrib, "targetNamespace", column.Namespace); if (isToAdd) table.Columns.Add(column); if (attrib.Use == XmlSchemaUse.Prohibited) { column.ColumnMapping = MappingType.Hidden; column.AllowDBNull = GetBooleanAttribute(attr, Keywords.MSD_ALLOWDBNULL, true) ; String defValue = GetMsdataAttribute(attr, Keywords.MSD_DEFAULTVALUE); if (defValue != null) try { column.DefaultValue = column.ConvertXmlToObject(defValue); } catch (System.FormatException) { throw ExceptionBuilder.CannotConvert(defValue, type.FullName); } } // XDR March change string strDefault = (attrib.Use == XmlSchemaUse.Required) ? GetMsdataAttribute(attr, Keywords.MSD_DEFAULTVALUE) : attr.DefaultValue; if ((attr.Use == XmlSchemaUse.Optional) && (strDefault == null )) strDefault = attr.FixedValue; if (strDefault != null) try { column.DefaultValue = column.ConvertXmlToObject(strDefault); } catch (System.FormatException) { throw ExceptionBuilder.CannotConvert(strDefault, type.FullName); } } internal void HandleElementColumn(XmlSchemaElement elem, DataTable table, bool isBase){ Type type = null; XmlSchemaElement el = elem.Name != null ? elem : (XmlSchemaElement) _schemaRoot.Elements[elem.RefName]; if (el == null) // it's possible due to some XSD compiler optimizations return; // do nothing XmlSchemaAnnotated typeNode = FindTypeNode(el); String strType = null; SimpleType xsdType = null; if (typeNode == null) { strType = el.SchemaTypeName.Name; if (strType == null || strType.Length == 0) { strType = ""; type = typeof(string); } else { type = ParseDataType(el.SchemaTypeName.Name); } } else if (typeNode is XmlSchemaSimpleType) { // UNDONE: parse simple type XmlSchemaSimpleType simpleTypeNode = typeNode as XmlSchemaSimpleType; xsdType = new SimpleType(simpleTypeNode); simpleTypeNode = xsdType.XmlBaseType!= null ? _schemaRoot.SchemaTypes[xsdType.XmlBaseType] as XmlSchemaSimpleType : null; while (simpleTypeNode != null) { xsdType.LoadTypeValues(simpleTypeNode); simpleTypeNode = xsdType.XmlBaseType!= null ? _schemaRoot.SchemaTypes[xsdType.XmlBaseType] as XmlSchemaSimpleType : null; } type = ParseDataType(xsdType.BaseType); strType = xsdType.Name; if(xsdType.Length == 1 && type == typeof(string)) { type = typeof(Char); } } else if (typeNode is XmlSchemaElement) { strType = ((XmlSchemaElement)typeNode).SchemaTypeName.Name; type = ParseDataType(strType); } else { if (typeNode.Id == null) throw ExceptionBuilder.DatatypeNotDefined(); else throw ExceptionBuilder.UndefinedDatatype(typeNode.Id); } DataColumn column; string columnName = XmlConvert.DecodeName(GetInstanceName(el)); bool isToAdd = true; if ((!isBase) && (table.Columns.Contains(columnName, true))){ column = table.Columns[columnName]; isToAdd = false; } else { column = new DataColumn(columnName, type, null, MappingType.Element); } SetProperties(column, el.UnhandledAttributes); SetExtProperties(column, el.UnhandledAttributes); if ((column.Expression!=null)&&(column.Expression.Length!=0)) { ColumnExpressions.Add(column); } column.XmlDataType = strType; column.SimpleType = xsdType; column.AllowDBNull = (elem.MinOccurs == 0 ) || elem.IsNillable; column.Namespace = elem.QualifiedName.Namespace; column.Namespace = GetStringAttribute(el, "targetNamespace", column.Namespace); String tmp = GetStringAttribute(elem, Keywords.MSD_ORDINAL, "-1"); int ordinal = (int)Convert.ChangeType(tmp, typeof(int)); if(isToAdd) { if(ordinal>-1 && ordinal<table.Columns.Count) table.Columns.AddAt(ordinal, column); else table.Columns.Add(column); } if (column.Namespace == table.Namespace) column._columnUri = null; // to not raise a column change namespace again string strDefault = el.DefaultValue; if (strDefault != null ) try { column.DefaultValue = column.ConvertXmlToObject(strDefault); } catch (System.FormatException) { throw ExceptionBuilder.CannotConvert(strDefault, type.FullName); } } internal void HandleDataSet(XmlSchemaElement node) { string dsName = node.Name; _ds.Locale = new CultureInfo(0x409); String value = GetMsdataAttribute(node, Keywords.MSD_LOCALE); if (value!=null && value.Length != 0) { _ds.Locale = new CultureInfo(value); } SetProperties(_ds, node.UnhandledAttributes); SetExtProperties(_ds, node.UnhandledAttributes); if (dsName != null && dsName.Length != 0) _ds.DataSetName = XmlConvert.DecodeName(dsName); Debug.Assert(node.SchemaType is XmlSchemaComplexType, "dataset node can only be complexType"); XmlSchemaComplexType ct = (XmlSchemaComplexType) FindTypeNode(node); if (ct.Particle != null) { XmlSchemaObjectCollection items = GetParticleItems(ct.Particle); if (items == null) return; foreach (XmlSchemaAnnotated el in items){ if (el is XmlSchemaElement) { if(((XmlSchemaElement)el).RefName.Name!="") continue; DataTable child = HandleTable ((XmlSchemaElement)el); if (child!=null) { child.fNestedInDataset = true; } } } } // Handle the non-nested keyref constraints if (node.Constraints != null) { foreach (XmlSchemaIdentityConstraint key in node.Constraints) { XmlSchemaKeyref keyref = key as XmlSchemaKeyref; if (keyref == null) continue; bool isNested = GetBooleanAttribute(keyref, Keywords.MSD_ISNESTED, /*default:*/ false); if (isNested) continue; HandleKeyref(keyref); } } } private String GetTableName(XmlSchemaIdentityConstraint key) { string xpath = key.Selector.XPath; string [] split = xpath.Split('/',':'); String tableName = split[split.Length - 1]; //get the last string after '/' and ':' if ((tableName == null) || (tableName == "")) throw ExceptionBuilder.InvalidSelector(xpath); tableName = XmlConvert.DecodeName(tableName); return tableName; } internal bool IsTable(XmlSchemaElement node) { if (node.MaxOccurs == decimal.Zero) return false; Object typeNode = FindTypeNode(node); if ( (node.MaxOccurs > decimal.One) && typeNode == null ){ return true; } if ((typeNode==null) || !(typeNode is XmlSchemaComplexType)) { return false; } XmlSchemaComplexType ctNode = (XmlSchemaComplexType) typeNode; if (ctNode.IsAbstract) return false; return true; } internal DataTable HandleTable(XmlSchemaElement node) { if (!IsTable(node)) return null; Object typeNode = FindTypeNode(node); if ( (node.MaxOccurs > decimal.One) && typeNode == null ){ return InstantiateSimpleTable(node); } DataTable table = InstantiateTable(node,(XmlSchemaComplexType)typeNode, (node.RefName != null)); table.fNestedInDataset = false; return table; } } }
1.359375
1
src/PuzzleCMS.Core/PuzzleCMS.Core.Multitenancy/Internal/ConfigureMultitenantServicesBuilder`1.cs
Courio-Dev/UnobtrusiveMultitenancy
5
9599797
namespace PuzzleCMS.Core.Multitenancy.Internal { using System; using System.Linq; using System.Reflection; using Microsoft.Extensions.DependencyInjection; internal class ConfigureMultitenantServicesBuilder<TTenant> { public ConfigureMultitenantServicesBuilder(MethodInfo configure) { MethodInfo = configure; } public MethodInfo MethodInfo { get; } public Action<IServiceCollection, TTenant> Build(object instance) => (services, tenant) => Invoke(instance, services, tenant); private IServiceCollection Invoke(object instance, IServiceCollection services, TTenant tenant) { InvokeCore(instance, services, tenant); return services; } private void InvokeCore(object instance, IServiceCollection services, TTenant tenant) { if (MethodInfo == null) { return; } // Only support IServiceCollection parameters ParameterInfo[] parameters = MethodInfo.GetParameters(); if (parameters.Length > 2 || parameters.Any(p => (p.ParameterType != typeof(IServiceCollection)) && (p.ParameterType != typeof(TTenant)))) { throw new InvalidOperationException("The ConfigurePerTenantServices method must take only two parameter one of type IServiceCollection and one of type TTenant."); } object[] arguments = new object[MethodInfo.GetParameters().Length]; if (parameters.Length > 0) { arguments[0] = services; arguments[1] = tenant; } MethodInfo.Invoke(instance, arguments); } } }
1.117188
1
PGM Jam March 2022/Assets/Scripts/Entities/PhantomAttack.cs
PlotArmorStudios/PGM-Jam-2022
0
9599805
using System; using System.Collections; using System.Collections.Generic; using UnityEngine; public class PhantomAttack : MonoBehaviour { public static event Action<float> OnPhantomAttack; [SerializeField] private float _attackRange = 10; [SerializeField] private float _attackDamage = 25; private Entity _entity; private void Start() { _entity = GetComponentInParent<Entity>(); } public void Attack() { if (Vector3.Distance(transform.position, _entity.PlayerTarget.transform.position) <= _attackRange) { Debug.Log("Phantom Attack trigger"); OnPhantomAttack?.Invoke(_attackDamage); } } }
1.351563
1
Tornado.Common/Enums/IEnumInfo.cs
kiruxak/tornado
1
9599813
using System.Collections.Generic; namespace PoeParser.Common { public interface IEnumInfo<TValue> : IReadOnlyList<IEnumValueInfo<TValue>> { new IEnumValueInfo<TValue> this[int index] { get; } IEnumValueInfo<TValue> this[TValue value] { get; } } }
0.832031
1
alura/course_dotnet_core_002/CasaDoCodigo/CasaDoCodigo.Web/Controllers/SignUpController.cs
flaviogf/Cursos
2
9599821
using CasaDoCodigo.Web.Database; using CasaDoCodigo.Web.Lib; using CasaDoCodigo.Web.Models; using CasaDoCodigo.Web.ViewModels.SignUp; using Microsoft.AspNetCore.Mvc; using System.Threading.Tasks; namespace CasaDoCodigo.Web.Controllers { public class SignUpController : Controller { private readonly ApplicationContext _context; private readonly IAuth _auth; public SignUpController(ApplicationContext context, IAuth auth) { _context = context; _auth = auth; } public async Task<IActionResult> Create() { return View(); } public async Task<IActionResult> Store(StoreSignUpViewModel viewModel) { var user = new User { Name = viewModel.Name, Email = viewModel.Email, Phone = viewModel.Phone }; await _context.Users.AddAsync(user); await _context.SaveChangesAsync(); await _auth.Login(user); return RedirectToAction("Create", "Address"); } } }
1.148438
1
High-Quality-Code-Part-1/07. High-quality-Methods/Methods/Student.cs
Camyul/Modul_2_CSharp
0
9599829
using System; namespace Methods { public class Student { private string firstName; private string lastName; public Student(string firstName, string lastName) { this.FirstName = firstName; this.LastName = lastName; } public string FirstName { get { return this.firstName; } set { if (string.IsNullOrEmpty(value)) { throw new ArgumentNullException("String cannot be null or empty"); } this.firstName = value; } } public string LastName { get { return this.lastName; } set { if (string.IsNullOrEmpty(value)) { throw new ArgumentNullException("String cannot be null or empty"); } this.lastName = value; } } public string OtherInfo { get; set; } public bool IsOlderThan(Student other) { DateTime firstDate = this.GetDate(this.OtherInfo); DateTime secondDate = this.GetDate(other.OtherInfo); bool isOlder = true; if (firstDate < secondDate) { isOlder = false; } return isOlder; } private DateTime GetDate(string otherInfo) { DateTime date = DateTime.Parse(otherInfo.Substring(otherInfo.Length - 10)); return date; } } }
1.851563
2
src/Butter/Internal/DecimalImpl.cs
ahives/Butter
0
9599837
namespace Butter.Internal { using Builders; using Specification; class DecimalImpl : Decimal { string _id; bool _nullable; int _scale; int _precision; int _index; public DecimalImpl() { _nullable = false; _scale = 2; _precision = 3; } public Decimal Id(string id) { _id = id; return this; } public Decimal Index(int index) { _index = index; return this; } public Decimal IsNullable() { _nullable = true; return this; } public Decimal Scale(int scale) { _scale = scale; return this; } public Decimal Precision(int precision) { _precision = precision; return this; } public DecimalField Build() => new DecimalFieldImpl(_id, _index, _scale, _precision, _nullable); } }
0.988281
1
HotsBpHelper/Configuration/BpServiceConfigParser.cs
wakuflair/HotsBpHelper
10
9599845
using System; using System.IO; using System.Text; using HotsBpHelper.Utils; namespace HotsBpHelper.Configuration { public class BpServiceConfigParser : ConfigureFileParser { private static readonly string BpServiceConfigPath = Path.GetFullPath(@".\Service\Variables.ini"); private const string LoadedKey = "BpServiceQuestionLoaded"; private const string HotsweekAskedKey = "BpWeekQuestionAsked"; public BpServiceConfigParser() : base(BpServiceConfigPath) { } public bool GetLoaded() { var isLoaded = GetConfigurationValue(LoadedKey); return !string.IsNullOrEmpty(isLoaded); } public bool GetHotsweekAsked() { var asked = GetConfigurationValue(HotsweekAskedKey); return !string.IsNullOrEmpty(asked); } public static void PopulateConfigurationSettings() { var parser = new BpServiceConfigParser(); if (!App.HasServiceAsked) App.HasServiceAsked = parser.GetLoaded(); if (!App.HasHotsweekAsked) App.HasHotsweekAsked = parser.GetHotsweekAsked(); } public static void WriteConfig() { var parser = new BpServiceConfigParser(); if (App.HasServiceAsked) parser.AllValues[LoadedKey] = "1"; if (App.HasHotsweekAsked) parser.AllValues[HotsweekAskedKey] = "1"; var sb = new StringBuilder(); foreach (var tuple in parser.AllValues) { sb.AppendLine(WriteConfigurationValue(tuple.Key, tuple.Value)); } File.WriteAllText(BpServiceConfigPath, sb.ToString()); } } }
1.351563
1
tvn-cosine.ai/tvn-cosine.ai.demo/search/nqueens/NQueensWithBreadthFirstSearch.cs
itoledo/Birdie.Tesseract
0
9599853
using tvn.cosine.exceptions; using tvn.cosine.ai.environment.nqueens; using tvn.cosine.ai.search.framework; using tvn.cosine.ai.search.framework.agent; using tvn.cosine.ai.search.framework.api; using tvn.cosine.ai.search.framework.problem; using tvn.cosine.ai.search.framework.problem.api; using tvn.cosine.ai.search.framework.qsearch; using tvn.cosine.ai.search.uninformed; namespace tvn_cosine.ai.demo.search.nqueens { public class NQueensWithBreadthFirstSearch : NQueensDemoBase { static void Main(params string[] args) { nQueensWithBreadthFirstSearch(); } static void nQueensWithBreadthFirstSearch() { try { System.Console.WriteLine("\nNQueensDemo BFS -->"); IProblem<NQueensBoard, QueenAction> problem = NQueensFunctions.createIncrementalFormulationProblem(boardSize); ISearchForActions<NQueensBoard, QueenAction> search = new BreadthFirstSearch<NQueensBoard, QueenAction>(new TreeSearch<NQueensBoard, QueenAction>()); SearchAgent<NQueensBoard, QueenAction> agent = new SearchAgent<NQueensBoard, QueenAction>(problem, search); printActions(agent.getActions()); printInstrumentation(agent.getInstrumentation()); } catch (Exception e) { throw e; } } } }
1.382813
1
DigitalLearningSolutions.Web.Tests/ViewModels/TrackingSystem/Centre/ContractDetails/ContractDetailsViewModelTests.cs
TechnologyEnhancedLearning/DLSV2
2
9599861
namespace DigitalLearningSolutions.Web.Tests.ViewModels.TrackingSystem.Centre.ContractDetails { using System.Collections.Generic; using DigitalLearningSolutions.Data.Models.User; using DigitalLearningSolutions.Data.Tests.TestHelpers; using DigitalLearningSolutions.Web.ViewModels.TrackingSystem.Centre.ContractDetails; using FluentAssertions; using NUnit.Framework; public class ContractDetailsViewModelTests { [Test] public void AdminUsers_and_Centre_populate_expected_values() { // Given var centre = CentreTestHelper.GetDefaultCentre( cmsAdministratorSpots: 3, cmsManagerSpots: 13, ccLicenceSpots: 14, trainerSpots: 15, customCourses: 12, serverSpaceUsed: 1024, serverSpaceBytes: 1073741824 ); var adminUsersAtCentre = GetAdminUsersForTest(); // When var viewModel = new ContractDetailsViewModel(adminUsersAtCentre, centre, 10); // Then viewModel.Administrators.Should().Be("7"); viewModel.Supervisors.Should().Be("6"); viewModel.CmsAdministrators.Should().Be("3 / 3"); viewModel.CmsAdministratorsColour.Should().Be("red"); viewModel.CmsManagers.Should().Be("2 / 13"); viewModel.CmsManagersColour.Should().Be("green"); viewModel.ContentCreators.Should().Be("2 / 14"); viewModel.ContentCreatorsColour.Should().Be("green"); viewModel.Trainers.Should().Be("1 / 15"); viewModel.TrainersColour.Should().Be("green"); viewModel.CustomCourses.Should().Be("10 / 12"); viewModel.CustomCoursesColour.Should().Be("yellow"); viewModel.ServerSpace.Should().Be("1KB / 1GB"); viewModel.ServerSpaceColour.Should().Be("green"); } [Test] public void AdminUsers_and_Centre_populate_expected_values_with_no_limit() { // Given var centre = CentreTestHelper.GetDefaultCentre( cmsAdministratorSpots: -1, cmsManagerSpots: -1, ccLicenceSpots: -1, trainerSpots: -1, customCourses: 12, serverSpaceUsed: 0, serverSpaceBytes: 0 ); var adminUsersAtCentre = GetAdminUsersForTest(); // When var viewModel = new ContractDetailsViewModel(adminUsersAtCentre, centre, 10); // Then viewModel.Administrators.Should().Be("7"); viewModel.Supervisors.Should().Be("6"); viewModel.CmsAdministrators.Should().Be("3"); viewModel.CmsAdministratorsColour.Should().Be("blue"); viewModel.CmsManagers.Should().Be("2"); viewModel.CmsManagersColour.Should().Be("blue"); viewModel.ContentCreators.Should().Be("2"); viewModel.ContentCreatorsColour.Should().Be("blue"); viewModel.Trainers.Should().Be("1"); viewModel.TrainersColour.Should().Be("blue"); viewModel.CustomCourses.Should().Be("10 / 12"); viewModel.CustomCoursesColour.Should().Be("yellow"); viewModel.ServerSpace.Should().Be("0B / 0B"); viewModel.ServerSpaceColour.Should().Be("grey"); } private List<AdminUser> GetAdminUsersForTest() { return new List<AdminUser> { UserTestHelper.GetDefaultAdminUser( isCentreAdmin: true, isSupervisor: true, isContentManager: true, importOnly: true, isContentCreator: false, isTrainer: true ), UserTestHelper.GetDefaultAdminUser( isCentreAdmin: true, isSupervisor: true, isContentManager: true, importOnly: false, isContentCreator: true, isTrainer: false ), UserTestHelper.GetDefaultAdminUser( isCentreAdmin: true, isSupervisor: true, isContentManager: false, importOnly: true, isContentCreator: true, isTrainer: false ), UserTestHelper.GetDefaultAdminUser( isCentreAdmin: true, isSupervisor: true, isContentManager: true, importOnly: true, isContentCreator: false, isTrainer: false ), UserTestHelper.GetDefaultAdminUser( isCentreAdmin: true, isSupervisor: true, isContentManager: true, importOnly: true, isContentCreator: false, isTrainer: false ), UserTestHelper.GetDefaultAdminUser( isCentreAdmin: true, isSupervisor: true, isContentManager: true, importOnly: false, isContentCreator: false, isTrainer: false ), UserTestHelper.GetDefaultAdminUser( isCentreAdmin: true, isSupervisor: false, isContentManager: false, importOnly: false, isContentCreator: false, isTrainer: false ), UserTestHelper.GetDefaultAdminUser( isCentreAdmin: false, isSupervisor: false, isContentManager: false, importOnly: false, isContentCreator: false, isTrainer: false ) }; } } }
1.3125
1
test/Nexus.Link.Libraries.Core.Tests/Logging/TestQueueToAsyncLogger.cs
nexus-link/Nexus.Link.Libraries
0
9599869
using System; using System.Threading; using System.Threading.Tasks; using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; using Nexus.Link.Libraries.Core.Application; using Nexus.Link.Libraries.Core.Logging; using UT = Microsoft.VisualStudio.TestTools.UnitTesting; namespace Nexus.Link.Libraries.Core.Tests.Logging { [TestClass] public class TestQueueToAsyncLogger { private LogRecord _loggedRecord; private string _loggedCorrelationId; private QueueToAsyncLogger _queueLogger; private int _callsToFallback; [TestInitialize] public void Initialize() { FulcrumApplicationHelper.UnitTestSetup(typeof(TestLogHelper).FullName); // Mock fallback logger _callsToFallback = 0; var fallbackLoggerMock = new Mock<IFallbackLogger>(); fallbackLoggerMock .Setup(logger => logger.SafeLog(It.IsAny<LogSeverityLevel>(), It.IsAny<string>())) .Callback((LogSeverityLevel sl, string m) => Interlocked.Increment(ref _callsToFallback)); FulcrumApplication.Setup.FallbackLogger = fallbackLoggerMock.Object; // Mock async logger var asyncLoggerMock = new Mock<IAsyncLogger>(); asyncLoggerMock .Setup(logger => logger.LogAsync(It.IsAny<LogRecord>(), It.IsAny<CancellationToken>())) .Callback((LogRecord logRecord, CancellationToken ct) => { _loggedRecord = logRecord; _loggedCorrelationId = FulcrumApplication.Context.CorrelationId; }) .Returns(Task.CompletedTask); _queueLogger = new QueueToAsyncLogger(asyncLoggerMock.Object) {KeepQueueAliveTimeSpan = TimeSpan.Zero}; } [TestMethod] public void LogRecordIsUnchanged() { var expectedLogRecord = new LogRecord() { Message = Guid.NewGuid().ToString(), SeverityLevel = LogSeverityLevel.Error, Exception = new TestException("test"), TimeStamp = DateTimeOffset.Now, Location = Guid.NewGuid().ToString(), StackTrace = Guid.NewGuid().ToString() }; _queueLogger.LogSync(expectedLogRecord); while (_queueLogger.OnlyForUnitTest_HasBackgroundWorkerForLogging) Thread.Sleep(10); UT.Assert.AreEqual(expectedLogRecord, _loggedRecord); UT.Assert.AreEqual(0, _callsToFallback); } [TestMethod] public void CorrelationIdIsPreserved() { var expectedLogRecord = new LogRecord() { Message = Guid.NewGuid().ToString(), SeverityLevel = LogSeverityLevel.Error, TimeStamp = DateTimeOffset.Now }; var expectedCorrelationId1 = Guid.NewGuid().ToString(); FulcrumApplication.Context.CorrelationId = expectedCorrelationId1; _queueLogger.LogSync(expectedLogRecord); while (_queueLogger.OnlyForUnitTest_HasBackgroundWorkerForLogging) Thread.Sleep(10); UT.Assert.AreEqual(expectedCorrelationId1, _loggedCorrelationId); UT.Assert.AreEqual(0, _callsToFallback); } private class TestException : Exception { public TestException(string message) : base(message) { } } } }
1.484375
1
tests/SettingsTable.Tests/AutoMockDataAttribute.cs
denismaster/settings-table
0
9599877
using AutoFixture; using AutoFixture.AutoMoq; using AutoFixture.Xunit2; namespace SettingsTable.Tests { public class AutoMockDataAttribute : AutoDataAttribute { public AutoMockDataAttribute() : base(() => new Fixture().Customize(new AutoMoqCustomization())) { } } }
0.664063
1
Microsoft.Crm.Sdk.Proxy/Messages/SearchRequest.cs
develmax/Crm.Sdk.Core
0
9599885
using Microsoft.Xrm.Sdk; using System.Runtime.Serialization; namespace Microsoft.Crm.Sdk.Messages { /// <summary>Contains the data needed to search for available time slots that fulfill the specified appointment request.</summary> [DataContract(Namespace = "http://schemas.microsoft.com/crm/2011/Contracts")] public sealed class SearchRequest : OrganizationRequest { /// <summary>Gets or sets the appointment request.</summary> /// <returns>Type: <see cref="T:Microsoft.Crm.Sdk.Messages.AppointmentRequest"></see>The appointment request.</returns> public AppointmentRequest AppointmentRequest { get { return this.Parameters.Contains(nameof (AppointmentRequest)) ? (AppointmentRequest) this.Parameters[nameof (AppointmentRequest)] : (AppointmentRequest) null; } set { this.Parameters[nameof (AppointmentRequest)] = (object) value; } } /// <summary>Initializes a new instance of the <see cref="T:Microsoft.Crm.Sdk.Messages.SearchRequest"></see> class.</summary> public SearchRequest() { this.RequestName = "Search"; this.AppointmentRequest = (AppointmentRequest) null; } } }
1
1
TradeDangerousGUI/SettingsForm.Designer.cs
eyeonus/TDHelper
0
9599893
namespace TDHelper { partial class SettingsForm { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SettingsForm)); this.extraRunParameters = new System.Windows.Forms.TextBox(); this.label1 = new System.Windows.Forms.Label(); this.okButton = new System.Windows.Forms.Button(); this.cancelButton = new System.Windows.Forms.Button(); this.overrideDisableNetLogs = new System.Windows.Forms.CheckBox(); this.overrideDoNotUpdate = new System.Windows.Forms.CheckBox(); this.overrideCopySystemToClipboard = new System.Windows.Forms.CheckBox(); this.overrideGroupBox = new System.Windows.Forms.GroupBox(); this.validateEdcePath = new System.Windows.Forms.Button(); this.edcePathBox = new System.Windows.Forms.TextBox(); this.label5 = new System.Windows.Forms.Label(); this.tvFontSelectorButton = new System.Windows.Forms.Button(); this.currentTVFontBox = new System.Windows.Forms.TextBox(); this.currentTVFontLabel = new System.Windows.Forms.Label(); this.validateNetLogsPath = new System.Windows.Forms.Button(); this.validateTDPath = new System.Windows.Forms.Button(); this.validatePythonPath = new System.Windows.Forms.Button(); this.netLogsPathBox = new System.Windows.Forms.TextBox(); this.tdPathBox = new System.Windows.Forms.TextBox(); this.pythonPathBox = new System.Windows.Forms.TextBox(); this.label4 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.resetButton = new System.Windows.Forms.Button(); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); this.rebuyPercentage = new System.Windows.Forms.NumericUpDown(); this.miscGroupBox = new System.Windows.Forms.GroupBox(); this.chkQuiet = new System.Windows.Forms.CheckBox(); this.lblRebuyPercentage = new System.Windows.Forms.Label(); this.testSystemsCheckBox = new System.Windows.Forms.CheckBox(); this.verboseLabel = new System.Windows.Forms.Label(); this.verbosityComboBox = new System.Windows.Forms.ComboBox(); this.chkProgress = new System.Windows.Forms.CheckBox(); this.chkSummary = new System.Windows.Forms.CheckBox(); this.overrideGroupBox.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.rebuyPercentage)).BeginInit(); this.miscGroupBox.SuspendLayout(); this.SuspendLayout(); // // extraRunParameters // this.extraRunParameters.Location = new System.Drawing.Point(97, 254); this.extraRunParameters.Name = "extraRunParameters"; this.extraRunParameters.Size = new System.Drawing.Size(257, 20); this.extraRunParameters.TabIndex = 13; this.toolTip1.SetToolTip(this.extraRunParameters, "This text will be added on to the end of the Run command [caution!]"); this.extraRunParameters.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Generic_KeyDown); // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(6, 257); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(85, 13); this.label1.TabIndex = 1; this.label1.Text = "Run parameters:"; // // okButton // this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.okButton.Location = new System.Drawing.Point(300, 395); this.okButton.Name = "okButton"; this.okButton.Size = new System.Drawing.Size(75, 28); this.okButton.TabIndex = 16; this.okButton.Text = "OK"; this.okButton.UseVisualStyleBackColor = true; this.okButton.Click += new System.EventHandler(this.OkButton_Click); // // cancelButton // this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.cancelButton.Location = new System.Drawing.Point(12, 395); this.cancelButton.Name = "cancelButton"; this.cancelButton.Size = new System.Drawing.Size(75, 28); this.cancelButton.TabIndex = 14; this.cancelButton.Text = "Cancel"; this.cancelButton.UseVisualStyleBackColor = true; this.cancelButton.Click += new System.EventHandler(this.CancelButton_Click); // // overrideDisableNetLogs // this.overrideDisableNetLogs.AutoSize = true; this.overrideDisableNetLogs.Location = new System.Drawing.Point(6, 14); this.overrideDisableNetLogs.Name = "overrideDisableNetLogs"; this.overrideDisableNetLogs.Size = new System.Drawing.Size(107, 17); this.overrideDisableNetLogs.TabIndex = 2; this.overrideDisableNetLogs.Text = "Disable Net Logs"; this.overrideDisableNetLogs.UseVisualStyleBackColor = true; // // overrideDoNotUpdate // this.overrideDoNotUpdate.AutoSize = true; this.overrideDoNotUpdate.Location = new System.Drawing.Point(6, 37); this.overrideDoNotUpdate.Name = "overrideDoNotUpdate"; this.overrideDoNotUpdate.Size = new System.Drawing.Size(130, 17); this.overrideDoNotUpdate.TabIndex = 3; this.overrideDoNotUpdate.Text = "Disable Auto-updating"; this.overrideDoNotUpdate.UseVisualStyleBackColor = true; // // overrideCopySystemToClipboard // this.overrideCopySystemToClipboard.AutoSize = true; this.overrideCopySystemToClipboard.Location = new System.Drawing.Point(6, 60); this.overrideCopySystemToClipboard.Name = "overrideCopySystemToClipboard"; this.overrideCopySystemToClipboard.Size = new System.Drawing.Size(244, 17); this.overrideCopySystemToClipboard.TabIndex = 4; this.overrideCopySystemToClipboard.Text = "Copy unrecognized system names to clipboard"; this.overrideCopySystemToClipboard.UseVisualStyleBackColor = true; // // overrideGroupBox // this.overrideGroupBox.Controls.Add(this.chkSummary); this.overrideGroupBox.Controls.Add(this.chkProgress); this.overrideGroupBox.Controls.Add(this.testSystemsCheckBox); this.overrideGroupBox.Controls.Add(this.verboseLabel); this.overrideGroupBox.Controls.Add(this.verbosityComboBox); this.overrideGroupBox.Controls.Add(this.validateEdcePath); this.overrideGroupBox.Controls.Add(this.edcePathBox); this.overrideGroupBox.Controls.Add(this.label5); this.overrideGroupBox.Controls.Add(this.tvFontSelectorButton); this.overrideGroupBox.Controls.Add(this.currentTVFontBox); this.overrideGroupBox.Controls.Add(this.currentTVFontLabel); this.overrideGroupBox.Controls.Add(this.validateNetLogsPath); this.overrideGroupBox.Controls.Add(this.validateTDPath); this.overrideGroupBox.Controls.Add(this.validatePythonPath); this.overrideGroupBox.Controls.Add(this.netLogsPathBox); this.overrideGroupBox.Controls.Add(this.tdPathBox); this.overrideGroupBox.Controls.Add(this.pythonPathBox); this.overrideGroupBox.Controls.Add(this.label4); this.overrideGroupBox.Controls.Add(this.label3); this.overrideGroupBox.Controls.Add(this.label2); this.overrideGroupBox.Controls.Add(this.overrideCopySystemToClipboard); this.overrideGroupBox.Controls.Add(this.overrideDisableNetLogs); this.overrideGroupBox.Controls.Add(this.overrideDoNotUpdate); this.overrideGroupBox.Controls.Add(this.label1); this.overrideGroupBox.Controls.Add(this.extraRunParameters); this.overrideGroupBox.Location = new System.Drawing.Point(12, 12); this.overrideGroupBox.Name = "overrideGroupBox"; this.overrideGroupBox.Size = new System.Drawing.Size(363, 318); this.overrideGroupBox.TabIndex = 7; this.overrideGroupBox.TabStop = false; this.overrideGroupBox.Text = "Overrides"; // // validateEdcePath // this.validateEdcePath.Location = new System.Drawing.Point(330, 219); this.validateEdcePath.Name = "validateEdcePath"; this.validateEdcePath.Size = new System.Drawing.Size(24, 20); this.validateEdcePath.TabIndex = 16; this.validateEdcePath.Text = "..."; this.validateEdcePath.UseVisualStyleBackColor = true; this.validateEdcePath.Click += new System.EventHandler(this.ValidateEdcePath_Click); // // edcePathBox // this.edcePathBox.Location = new System.Drawing.Point(97, 219); this.edcePathBox.Name = "edcePathBox"; this.edcePathBox.Size = new System.Drawing.Size(227, 20); this.edcePathBox.TabIndex = 15; // // label5 // this.label5.AutoSize = true; this.label5.Location = new System.Drawing.Point(28, 222); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(64, 13); this.label5.TabIndex = 14; this.label5.Text = "EDCE Path:"; // // tvFontSelectorButton // this.tvFontSelectorButton.Location = new System.Drawing.Point(331, 115); this.tvFontSelectorButton.Name = "tvFontSelectorButton"; this.tvFontSelectorButton.Size = new System.Drawing.Size(24, 20); this.tvFontSelectorButton.TabIndex = 6; this.tvFontSelectorButton.Text = "..."; this.toolTip1.SetToolTip(this.tvFontSelectorButton, "Ctrl+Click to reset the TreeView font to the default"); this.tvFontSelectorButton.UseVisualStyleBackColor = true; this.tvFontSelectorButton.Click += new System.EventHandler(this.TvFontSelectorButton_Click); // // currentTVFontBox // this.currentTVFontBox.Location = new System.Drawing.Point(98, 115); this.currentTVFontBox.Name = "currentTVFontBox"; this.currentTVFontBox.Size = new System.Drawing.Size(227, 20); this.currentTVFontBox.TabIndex = 5; // // currentTVFontLabel // this.currentTVFontLabel.AutoSize = true; this.currentTVFontLabel.Location = new System.Drawing.Point(13, 118); this.currentTVFontLabel.Name = "currentTVFontLabel"; this.currentTVFontLabel.Size = new System.Drawing.Size(79, 13); this.currentTVFontLabel.TabIndex = 13; this.currentTVFontLabel.Text = "TreeView Font:"; // // validateNetLogsPath // this.validateNetLogsPath.Location = new System.Drawing.Point(331, 193); this.validateNetLogsPath.Name = "validateNetLogsPath"; this.validateNetLogsPath.Size = new System.Drawing.Size(24, 20); this.validateNetLogsPath.TabIndex = 12; this.validateNetLogsPath.Text = "..."; this.validateNetLogsPath.UseVisualStyleBackColor = true; this.validateNetLogsPath.Click += new System.EventHandler(this.ValidateNetLogsPath_Click); // // validateTDPath // this.validateTDPath.Location = new System.Drawing.Point(331, 167); this.validateTDPath.Name = "validateTDPath"; this.validateTDPath.Size = new System.Drawing.Size(24, 20); this.validateTDPath.TabIndex = 10; this.validateTDPath.Text = "..."; this.validateTDPath.UseVisualStyleBackColor = true; this.validateTDPath.Click += new System.EventHandler(this.ValidateTDPath_Click); // // validatePythonPath // this.validatePythonPath.Location = new System.Drawing.Point(331, 141); this.validatePythonPath.Name = "validatePythonPath"; this.validatePythonPath.Size = new System.Drawing.Size(24, 20); this.validatePythonPath.TabIndex = 8; this.validatePythonPath.Text = "..."; this.validatePythonPath.UseVisualStyleBackColor = true; this.validatePythonPath.Click += new System.EventHandler(this.ValidatePythonPath_Click); // // netLogsPathBox // this.netLogsPathBox.Location = new System.Drawing.Point(98, 193); this.netLogsPathBox.Name = "netLogsPathBox"; this.netLogsPathBox.Size = new System.Drawing.Size(227, 20); this.netLogsPathBox.TabIndex = 11; // // tdPathBox // this.tdPathBox.Location = new System.Drawing.Point(98, 167); this.tdPathBox.Name = "tdPathBox"; this.tdPathBox.Size = new System.Drawing.Size(227, 20); this.tdPathBox.TabIndex = 9; // // pythonPathBox // this.pythonPathBox.Location = new System.Drawing.Point(98, 141); this.pythonPathBox.Name = "pythonPathBox"; this.pythonPathBox.Size = new System.Drawing.Size(227, 20); this.pythonPathBox.TabIndex = 7; // // label4 // this.label4.AutoSize = true; this.label4.Location = new System.Drawing.Point(14, 197); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(78, 13); this.label4.TabIndex = 6; this.label4.Text = "Net Logs Path:"; // // label3 // this.label3.AutoSize = true; this.label3.Location = new System.Drawing.Point(24, 144); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(68, 13); this.label3.TabIndex = 5; this.label3.Text = "Python Path:"; // // label2 // this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(42, 170); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(50, 13); this.label2.TabIndex = 4; this.label2.Text = "TD Path:"; // // resetButton // this.resetButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.resetButton.Location = new System.Drawing.Point(151, 395); this.resetButton.Name = "resetButton"; this.resetButton.Size = new System.Drawing.Size(84, 28); this.resetButton.TabIndex = 15; this.resetButton.Text = "Reset Settings"; this.resetButton.UseVisualStyleBackColor = true; this.resetButton.Click += new System.EventHandler(this.ResetButton_Click); // // rebuyPercentage // this.rebuyPercentage.DecimalPlaces = 2; this.rebuyPercentage.Location = new System.Drawing.Point(111, 19); this.rebuyPercentage.Maximum = new decimal(new int[] { 100000, 0, 0, 131072}); this.rebuyPercentage.Name = "rebuyPercentage"; this.rebuyPercentage.Size = new System.Drawing.Size(60, 20); this.rebuyPercentage.TabIndex = 5; this.rebuyPercentage.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; this.toolTip1.SetToolTip(this.rebuyPercentage, "Percentage of ship cost for rebuy."); // // miscGroupBox // this.miscGroupBox.Controls.Add(this.chkQuiet); this.miscGroupBox.Controls.Add(this.rebuyPercentage); this.miscGroupBox.Controls.Add(this.lblRebuyPercentage); this.miscGroupBox.Location = new System.Drawing.Point(12, 336); this.miscGroupBox.Name = "miscGroupBox"; this.miscGroupBox.Size = new System.Drawing.Size(363, 50); this.miscGroupBox.TabIndex = 17; this.miscGroupBox.TabStop = false; this.miscGroupBox.Text = "Misc."; // // chkQuiet // this.chkQuiet.AutoSize = true; this.chkQuiet.Location = new System.Drawing.Point(216, 22); this.chkQuiet.Name = "chkQuiet"; this.chkQuiet.Size = new System.Drawing.Size(75, 17); this.chkQuiet.TabIndex = 6; this.chkQuiet.Text = "Play Alerts"; this.chkQuiet.UseVisualStyleBackColor = true; // // lblRebuyPercentage // this.lblRebuyPercentage.AutoSize = true; this.lblRebuyPercentage.Location = new System.Drawing.Point(6, 22); this.lblRebuyPercentage.Name = "lblRebuyPercentage"; this.lblRebuyPercentage.Size = new System.Drawing.Size(99, 13); this.lblRebuyPercentage.TabIndex = 2; this.lblRebuyPercentage.Text = "Rebuy Percentage:"; // // testSystemsCheckBox // this.testSystemsCheckBox.AutoSize = true; this.testSystemsCheckBox.Location = new System.Drawing.Point(6, 83); this.testSystemsCheckBox.Name = "testSystemsCheckBox"; this.testSystemsCheckBox.Size = new System.Drawing.Size(210, 17); this.testSystemsCheckBox.TabIndex = 61; this.testSystemsCheckBox.TabStop = false; this.testSystemsCheckBox.Text = "Notify when entering unknown systems"; this.testSystemsCheckBox.UseVisualStyleBackColor = true; // // verboseLabel // this.verboseLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.verboseLabel.AutoSize = true; this.verboseLabel.Location = new System.Drawing.Point(38, 291); this.verboseLabel.Name = "verboseLabel"; this.verboseLabel.Size = new System.Drawing.Size(53, 13); this.verboseLabel.TabIndex = 60; this.verboseLabel.Text = "Verbosity:"; this.toolTip1.SetToolTip(this.verboseLabel, "Verbosity of output results"); // // verbosityComboBox // this.verbosityComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.verbosityComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.verbosityComboBox.Items.AddRange(new object[] { "", "-v", "-vv", "-vvv"}); this.verbosityComboBox.Location = new System.Drawing.Point(97, 288); this.verbosityComboBox.Name = "verbosityComboBox"; this.verbosityComboBox.Size = new System.Drawing.Size(46, 21); this.verbosityComboBox.TabIndex = 59; this.verbosityComboBox.TabStop = false; // // chkProgress // this.chkProgress.AutoSize = true; this.chkProgress.Location = new System.Drawing.Point(156, 290); this.chkProgress.Name = "chkProgress"; this.chkProgress.Size = new System.Drawing.Size(97, 17); this.chkProgress.TabIndex = 68; this.chkProgress.TabStop = false; this.chkProgress.Text = "Show Progress"; this.toolTip1.SetToolTip(this.chkProgress, "Show the progress of the calculations."); this.chkProgress.UseVisualStyleBackColor = true; // // chkSummary // this.chkSummary.AutoSize = true; this.chkSummary.Location = new System.Drawing.Point(259, 290); this.chkSummary.Name = "chkSummary"; this.chkSummary.Size = new System.Drawing.Size(69, 17); this.chkSummary.TabIndex = 69; this.chkSummary.TabStop = false; this.chkSummary.Text = "Summary"; this.toolTip1.SetToolTip(this.chkSummary, "Show run output in summary form."); this.chkSummary.UseVisualStyleBackColor = true; // // SettingsForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(387, 430); this.Controls.Add(this.miscGroupBox); this.Controls.Add(this.resetButton); this.Controls.Add(this.overrideGroupBox); this.Controls.Add(this.cancelButton); this.Controls.Add(this.okButton); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "SettingsForm"; this.ShowIcon = false; this.Text = "Misc. Settings"; this.Load += new System.EventHandler(this.SettingsForm_Load); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Generic_KeyDown); this.overrideGroupBox.ResumeLayout(false); this.overrideGroupBox.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.rebuyPercentage)).EndInit(); this.miscGroupBox.ResumeLayout(false); this.miscGroupBox.PerformLayout(); this.ResumeLayout(false); } #endregion private System.Windows.Forms.TextBox extraRunParameters; private System.Windows.Forms.Label label1; private System.Windows.Forms.Button okButton; private System.Windows.Forms.Button cancelButton; private System.Windows.Forms.CheckBox overrideDisableNetLogs; private System.Windows.Forms.CheckBox overrideDoNotUpdate; private System.Windows.Forms.CheckBox overrideCopySystemToClipboard; private System.Windows.Forms.GroupBox overrideGroupBox; private System.Windows.Forms.Label label4; private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label2; private System.Windows.Forms.Button validateNetLogsPath; private System.Windows.Forms.Button validateTDPath; private System.Windows.Forms.Button validatePythonPath; private System.Windows.Forms.TextBox netLogsPathBox; private System.Windows.Forms.TextBox tdPathBox; private System.Windows.Forms.TextBox pythonPathBox; private System.Windows.Forms.Button resetButton; private System.Windows.Forms.Button tvFontSelectorButton; private System.Windows.Forms.TextBox currentTVFontBox; private System.Windows.Forms.Label currentTVFontLabel; private System.Windows.Forms.ToolTip toolTip1; private System.Windows.Forms.GroupBox miscGroupBox; private System.Windows.Forms.Label lblRebuyPercentage; private System.Windows.Forms.NumericUpDown rebuyPercentage; private System.Windows.Forms.Button validateEdcePath; private System.Windows.Forms.TextBox edcePathBox; private System.Windows.Forms.Label label5; private System.Windows.Forms.CheckBox chkQuiet; private System.Windows.Forms.CheckBox testSystemsCheckBox; private System.Windows.Forms.Label verboseLabel; private System.Windows.Forms.ComboBox verbosityComboBox; private System.Windows.Forms.CheckBox chkProgress; private System.Windows.Forms.CheckBox chkSummary; } }
1.148438
1
XamKit.Shared/Styles/PopupStyles.xaml.cs
MarkoMajamaki/XamKit
1
9599901
using Xamarin.Forms; namespace XamKit { public partial class PopupStyles : ResourceDictionary { public PopupStyles() { InitializeComponent(); } } }
0.363281
0
source/MikhailKhalizev.Max/source/Program/Auto/z-1010-d90b.cs
mikhail-khalizev/max
3
9599909
using System; using MikhailKhalizev.Processor.x86.BinToCSharp; namespace MikhailKhalizev.Max.Program { public partial class RawProgram { [MethodInfo("0x1010_d90b-cbea0792")] public void Method_1010_d90b() { ii(0x1010_d90b, 5); push(0x108); /* push 0x108 */ ii(0x1010_d910, 5); call(Definitions.sys_check_available_stack_size, 0x5_843d);/* call 0x10165d52 */ ii(0x1010_d915, 1); push(ebx); /* push ebx */ ii(0x1010_d916, 1); push(ecx); /* push ecx */ ii(0x1010_d917, 1); push(edx); /* push edx */ ii(0x1010_d918, 1); push(esi); /* push esi */ ii(0x1010_d919, 1); push(edi); /* push edi */ ii(0x1010_d91a, 1); push(ebp); /* push ebp */ ii(0x1010_d91b, 2); mov(ebp, esp); /* mov ebp, esp */ ii(0x1010_d91d, 6); sub(esp, 0xec); /* sub esp, 0xec */ ii(0x1010_d923, 4); mov(memb[ss, ebp - 4], 0); /* mov byte [ebp-0x4], 0x0 */ ii(0x1010_d927, 6); lea(eax, memd[ss, ebp - 232]); /* lea eax, [ebp-0xe8] */ ii(0x1010_d92d, 5); call(0x1010_d71b, -0x217); /* call 0x1010d71b */ l_0x1010_d932: ii(0x1010_d932, 7); cmp(memb[ds, 0x101c_5630], 1); /* cmp byte [0x101c5630], 0x1 */ ii(0x1010_d939, 2); if(jnz(0x1010_d940, 5)) goto l_0x1010_d940;/* jnz 0x1010d940 */ ii(0x1010_d93b, 5); call(0x1012_ac94, 0x1_d354); /* call 0x1012ac94 */ l_0x1010_d940: ii(0x1010_d940, 5); call(/* sys */ 0x1016_b208, 0x5_d8c3);/* call 0x1016b208 */ ii(0x1010_d945, 6); mov(memd[ss, ebp - 216], eax); /* mov [ebp-0xd8], eax */ ii(0x1010_d94b, 7); cmp(memd[ss, ebp - 216], 0); /* cmp dword [ebp-0xd8], 0x0 */ ii(0x1010_d952, 2); if(jle(0x1010_d960, 0xc)) goto l_0x1010_d960;/* jle 0x1010d960 */ ii(0x1010_d954, 10); cmp(memd[ss, ebp - 216], 0x7000); /* cmp dword [ebp-0xd8], 0x7000 */ ii(0x1010_d95e, 2); if(jl(0x1010_d962, 2)) goto l_0x1010_d962;/* jl 0x1010d962 */ l_0x1010_d960: ii(0x1010_d960, 2); jmp(0x1010_d966, 4); goto l_0x1010_d966;/* jmp 0x1010d966 */ l_0x1010_d962: ii(0x1010_d962, 4); mov(memb[ss, ebp - 4], 0); /* mov byte [ebp-0x4], 0x0 */ l_0x1010_d966: ii(0x1010_d966, 10); mov(memd[ss, ebp - 236], 0); /* mov dword [ebp-0xec], 0x0 */ ii(0x1010_d970, 2); jmp(0x1010_d97e, 0xc); goto l_0x1010_d97e;/* jmp 0x1010d97e */ l_0x1010_d972: ii(0x1010_d972, 6); mov(eax, memd[ss, ebp - 236]); /* mov eax, [ebp-0xec] */ ii(0x1010_d978, 6); inc(memd[ss, ebp - 236]); /* inc dword [ebp-0xec] */ l_0x1010_d97e: ii(0x1010_d97e, 7); movsx(eax, memw[ss, ebp - 236]); /* movsx eax, word [ebp-0xec] */ ii(0x1010_d985, 3); cmp(eax, 0xc); /* cmp eax, 0xc */ ii(0x1010_d988, 6); if(jge(0x1010_da4d, 0xbf)) goto l_0x1010_da4d;/* jge 0x1010da4d */ ii(0x1010_d98e, 7); movsx(eax, memw[ss, ebp - 236]); /* movsx eax, word [ebp-0xec] */ ii(0x1010_d995, 3); shl(eax, 2); /* shl eax, 0x2 */ ii(0x1010_d998, 8); cmp(memd[ds, eax + ebp - 200], 0); /* cmp dword [eax+ebp-0xc8], 0x0 */ ii(0x1010_d9a0, 6); if(jz(0x1010_da48, 0xa2)) goto l_0x1010_da48;/* jz 0x1010da48 */ ii(0x1010_d9a6, 7); movsx(eax, memw[ss, ebp - 236]); /* movsx eax, word [ebp-0xec] */ ii(0x1010_d9ad, 5); add(eax, 0x7000); /* add eax, 0x7000 */ ii(0x1010_d9b2, 6); cmp(eax, memd[ss, ebp - 216]); /* cmp eax, [ebp-0xd8] */ ii(0x1010_d9b8, 2); if(jnz(0x1010_d9dc, 0x22)) goto l_0x1010_d9dc;/* jnz 0x1010d9dc */ ii(0x1010_d9ba, 4); cmp(memb[ss, ebp - 4], 0); /* cmp byte [ebp-0x4], 0x0 */ ii(0x1010_d9be, 2); if(jnz(0x1010_d9d6, 0x16)) goto l_0x1010_d9d6;/* jnz 0x1010d9d6 */ ii(0x1010_d9c0, 7); movsx(eax, memw[ss, ebp - 236]); /* movsx eax, word [ebp-0xec] */ ii(0x1010_d9c7, 3); shl(eax, 2); /* shl eax, 0x2 */ ii(0x1010_d9ca, 7); mov(eax, memd[ds, eax + ebp - 200]); /* mov eax, [eax+ebp-0xc8] */ ii(0x1010_d9d1, 5); call(0x100c_fbbe, -0x3_de18); /* call 0x100cfbbe */ l_0x1010_d9d6: ii(0x1010_d9d6, 4); mov(memb[ss, ebp - 4], 1); /* mov byte [ebp-0x4], 0x1 */ ii(0x1010_d9da, 2); jmp(0x1010_da4d, 0x71); goto l_0x1010_da4d;/* jmp 0x1010da4d */ l_0x1010_d9dc: ii(0x1010_d9dc, 7); movsx(edx, memw[ss, ebp - 236]); /* movsx edx, word [ebp-0xec] */ ii(0x1010_d9e3, 3); imul(edx, edx, 0xc); /* imul edx, edx, 0xc */ ii(0x1010_d9e6, 6); mov(eax, memd[ss, ebp - 216]); /* mov eax, [ebp-0xd8] */ ii(0x1010_d9ec, 7); cmp(eax, memd[ds, edx + ebp - 148]); /* cmp eax, [edx+ebp-0x94] */ ii(0x1010_d9f3, 2); if(jnz(0x1010_da0c, 0x17)) goto l_0x1010_da0c;/* jnz 0x1010da0c */ ii(0x1010_d9f5, 7); movsx(eax, memw[ss, ebp - 236]); /* movsx eax, word [ebp-0xec] */ ii(0x1010_d9fc, 3); imul(eax, eax, 0xc); /* imul eax, eax, 0xc */ ii(0x1010_d9ff, 7); mov(eax, memd[ds, eax + ebp - 152]); /* mov eax, [eax+ebp-0x98] */ ii(0x1010_da06, 6); mov(memd[ss, ebp - 216], eax); /* mov [ebp-0xd8], eax */ l_0x1010_da0c: ii(0x1010_da0c, 7); movsx(edx, memw[ss, ebp - 236]); /* movsx edx, word [ebp-0xec] */ ii(0x1010_da13, 3); imul(edx, edx, 0xc); /* imul edx, edx, 0xc */ ii(0x1010_da16, 6); mov(eax, memd[ss, ebp - 216]); /* mov eax, [ebp-0xd8] */ ii(0x1010_da1c, 7); cmp(eax, memd[ds, edx + ebp - 152]); /* cmp eax, [edx+ebp-0x98] */ ii(0x1010_da23, 2); if(jnz(0x1010_da48, 0x23)) goto l_0x1010_da48;/* jnz 0x1010da48 */ ii(0x1010_da25, 10); add(memd[ss, ebp - 216], 0xffff_fc18);/* add dword [ebp-0xd8], 0xfffffc18 */ ii(0x1010_da2f, 7); movsx(edx, memw[ss, ebp - 236]); /* movsx edx, word [ebp-0xec] */ ii(0x1010_da36, 3); imul(edx, edx, 0xc); /* imul edx, edx, 0xc */ ii(0x1010_da39, 6); lea(eax, memd[ss, ebp - 232]); /* lea eax, [ebp-0xe8] */ ii(0x1010_da3f, 7); call_abs(memd[ds, edx + ebp - 144]); /* call dword [edx+ebp-0x90] */ ii(0x1010_da46, 2); jmp(0x1010_da4d, 5); goto l_0x1010_da4d;/* jmp 0x1010da4d */ l_0x1010_da48: ii(0x1010_da48, 5); jmp(0x1010_d972, -0xdb); goto l_0x1010_d972;/* jmp 0x1010d972 */ l_0x1010_da4d: ii(0x1010_da4d, 7); cmp(memd[ss, ebp - 228], 0); /* cmp dword [ebp-0xe4], 0x0 */ ii(0x1010_da54, 2); if(jnz(0x1010_da5f, 9)) goto l_0x1010_da5f;/* jnz 0x1010da5f */ ii(0x1010_da56, 7); cmp(memd[ss, ebp - 224], 0); /* cmp dword [ebp-0xe0], 0x0 */ ii(0x1010_da5d, 2); if(jz(0x1010_da61, 2)) goto l_0x1010_da61;/* jz 0x1010da61 */ l_0x1010_da5f: ii(0x1010_da5f, 2); jmp(0x1010_da66, 5); goto l_0x1010_da66;/* jmp 0x1010da66 */ l_0x1010_da61: ii(0x1010_da61, 5); jmp(0x1010_d932, -0x134); goto l_0x1010_d932;/* jmp 0x1010d932 */ l_0x1010_da66: ii(0x1010_da66, 6); lea(eax, memd[ss, ebp - 232]); /* lea eax, [ebp-0xe8] */ ii(0x1010_da6c, 5); call(0x1010_d7fa, -0x277); /* call 0x1010d7fa */ ii(0x1010_da71, 7); cmp(memd[ss, ebp - 224], 0); /* cmp dword [ebp-0xe0], 0x0 */ ii(0x1010_da78, 2); if(jz(0x1010_da83, 9)) goto l_0x1010_da83;/* jz 0x1010da83 */ ii(0x1010_da7a, 7); mov(memd[ss, ebp - 8], 0); /* mov dword [ebp-0x8], 0x0 */ ii(0x1010_da81, 2); jmp(0x1010_da9b, 0x18); goto l_0x1010_da9b;/* jmp 0x1010da9b */ l_0x1010_da83: ii(0x1010_da83, 7); movsx(edx, memw[ss, ebp - 220]); /* movsx edx, word [ebp-0xdc] */ ii(0x1010_da8a, 5); mov(eax, 0x45); /* mov eax, 0x45 */ ii(0x1010_da8f, 5); call(0x100c_aafc, -0x4_2f98); /* call 0x100caafc */ ii(0x1010_da94, 7); mov(memd[ss, ebp - 8], 1); /* mov dword [ebp-0x8], 0x1 */ l_0x1010_da9b: ii(0x1010_da9b, 3); mov(eax, memd[ss, ebp - 8]); /* mov eax, [ebp-0x8] */ ii(0x1010_da9e, 2); mov(esp, ebp); /* mov esp, ebp */ ii(0x1010_daa0, 1); pop(ebp); /* pop ebp */ ii(0x1010_daa1, 1); pop(edi); /* pop edi */ ii(0x1010_daa2, 1); pop(esi); /* pop esi */ ii(0x1010_daa3, 1); pop(edx); /* pop edx */ ii(0x1010_daa4, 1); pop(ecx); /* pop ecx */ ii(0x1010_daa5, 1); pop(ebx); /* pop ebx */ ii(0x1010_daa6, 1); ret(); /* ret */ } } }
1.328125
1
PhatHanhSach.Model/TonKho.cs
grazerjink/PhatHanhSach
0
9599917
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated from a template. // // Manual changes to this file may cause unexpected behavior in your application. // Manual changes to this file will be overwritten if the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace PhatHanhSach.Model { using System; using System.Collections.Generic; public partial class TonKho { public int Id { get; set; } public Nullable<int> IdSach { get; set; } public Nullable<int> SoLuong { get; set; } public Nullable<System.DateTime> ThoiGian { get; set; } public Nullable<int> TangGiam { get; set; } public virtual Sach Sach { get; set; } } }
0.566406
1
FOAD_C#/exercicesWinform/WindowsFormsAppMenu/FormLogin.cs
Whyuki/CDA_2005
0
9599925
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace WindowsFormsAppMenu { public partial class FormLogin : Form { private bool loginIsOk; public FormLogin() { InitializeComponent(); loginIsOk = false; } public bool LoginIsOk { get => loginIsOk; set => loginIsOk = value; } private void buttonAnnuler_Click(object sender, EventArgs e) { this.Close(); } private void ValiderSaisie() { if (textBoxLogin.Text == "nyadmin" && textBoxPassword.Text == "<PASSWORD>") { loginIsOk = true; this.Close(); } else { errorProviderLogin.SetError(buttonOk, "Echec de l'identification"); } } private void buttonOk_Click(object sender, EventArgs e) { this.ValiderSaisie(); } private void textBoxLogin_TextChanged(object sender, EventArgs e) { errorProviderLogin.Clear(); } private void textBoxPassword_TextChanged(object sender, EventArgs e) { errorProviderLogin.Clear(); } private void textBoxLogin_KeyPress(object sender, KeyPressEventArgs e) { this.ValiderSaisie(); } private void textBoxPassword_KeyPress(object sender, KeyPressEventArgs e) { this.ValiderSaisie(); } private void click_Enter(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)Keys.Enter) { e.Handled = true; this.ValiderSaisie(); } } } }
1.390625
1
archive/src/VolleyManagement.Backend/VolleyManagement.UI/Views/Home/Index.cshtml
VolleyManagement/volley-management
10
9599933
@{ ViewBag.Title = "Volley Managemnt"; } <h2>Index</h2> <li>@Html.ActionLink("MVC", "Index", "Tournaments", new { area = "Mvc" }, new { })</li> <li>@Html.ActionLink("Web API", "Index", new { area = "WebApi" })</li>
0.494141
0
MonoDevelop.AddinMaker/AddinBrowser/ExtensionNodeBuilder.cs
netonjm/MonoDevelop.AddinMaker
0
9599941
using System; using Mono.Addins.Description; using MonoDevelop.Ide.Gui.Components; using Gtk; using MonoDevelop.Components; namespace MonoDevelop.AddinMaker.AddinBrowser { class ExtensionNodeBuilder : TypeNodeBuilder, ITreeDetailBuilder { public override Type NodeDataType { get { return typeof(Extension); } } public override string GetNodeName (ITreeNavigator thisNode, object dataObject) { var extension = (Extension)dataObject; return extension.Path; } public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo) { var extension = (Extension)dataObject; nodeInfo.Label = extension.Path; } public Control GetDetailWidget (object dataObject) { return new ExtensionDetailWidget ((Extension)dataObject); } } class ExtensionDetailWidget : AppKit.NSStackView { public Extension Extension { get; private set; } public ExtensionDetailWidget (Extension ext) { this.Extension = ext; Distribution = AppKit.NSStackViewDistribution.Fill; Orientation = AppKit.NSUserInterfaceLayoutOrientation.Vertical; TranslatesAutoresizingMaskIntoConstraints = false; var label = new AppKit.NSTextField () { TranslatesAutoresizingMaskIntoConstraints = false, Bezeled = false, DrawsBackground = false, Editable = false, Selectable = false, StringValue = ext.Path }; AddArrangedSubview (label); } } }
1.171875
1
src/environments/Backend.Fx.AspNetCore/Mvc/Execution/FlushFilter.cs
marcwittke/Backend.Fx
3
9599949
using Backend.Fx.Environment.Persistence; using Microsoft.AspNetCore.Mvc.Filters; namespace Backend.Fx.AspNetCore.Mvc.Execution { /// <summary> /// Makes sure that possible dirty objects are flushed to the persistence layer when the MVC action was executed. This will reveal /// persistence related problems early and makes them easier to diagnose. /// </summary> public class FlushFilter : IActionFilter { public void OnActionExecuting(ActionExecutingContext context) { } public void OnActionExecuted(ActionExecutedContext context) { context.HttpContext.GetInstanceProvider().GetInstance<ICanFlush>().Flush(); } } }
1.242188
1
Core/Kachuwa.Core/Configuration/KachuwaConfigChangeListner.cs
amritdumre10/Kachuwa
0
9599957
using System.Threading.Tasks; using Microsoft.AspNetCore.Hosting; namespace Kachuwa.Configuration { public class KachuwaConfigChangeListner : IConfigChangeListner { private readonly IApplicationLifetime _applicationLifetime; public KachuwaConfigChangeListner(IApplicationLifetime applicationLifetime) { _applicationLifetime = applicationLifetime; } public async Task<bool> Update() { _applicationLifetime.StopApplication(); return true; } } }
0.699219
1
client/framework/UnityCsReference-master/Editor/Mono/UIElements/Controls/BaseCompositeField.cs
HelloWindows/AccountBook-
1
9599965
// Unity C# reference source // Copyright (c) Unity Technologies. For terms of use, see // https://unity3d.com/legal/licenses/Unity_Reference_Only_License using System; using System.Collections.Generic; using UnityEngine; using UnityEngine.UIElements; namespace UnityEditor.UIElements { public abstract class BaseCompositeField<TValueType, TField, TFieldValue> : BaseField<TValueType> where TField : TextValueField<TFieldValue>, new() { internal struct FieldDescription { public delegate void WriteDelegate(ref TValueType val, TFieldValue fieldValue); internal readonly string name; internal readonly string ussName; internal readonly Func<TValueType, TFieldValue> read; internal readonly WriteDelegate write; public FieldDescription(string name, string ussName, Func<TValueType, TFieldValue> read, WriteDelegate write) { this.name = name; this.ussName = ussName; this.read = read; this.write = write; } } private VisualElement GetSpacer() { var spacer = new VisualElement(); spacer.AddToClassList(spacerUssClassName); spacer.visible = false; spacer.focusable = false; return spacer; } List<TField> m_Fields; internal List<TField> fields => m_Fields; internal abstract FieldDescription[] DescribeFields(); bool m_ShouldUpdateDisplay; public new static readonly string ussClassName = "unity-composite-field"; public new static readonly string labelUssClassName = ussClassName + "__label"; public new static readonly string inputUssClassName = ussClassName + "__input"; public static readonly string spacerUssClassName = ussClassName + "__field-spacer"; public static readonly string multilineVariantUssClassName = ussClassName + "--multi-line"; public static readonly string fieldGroupUssClassName = ussClassName + "__field-group"; public static readonly string fieldUssClassName = ussClassName + "__field"; public static readonly string firstFieldVariantUssClassName = fieldUssClassName + "--first"; public static readonly string twoLinesVariantUssClassName = ussClassName + "--two-lines"; protected BaseCompositeField(string label, int fieldsByLine) : base(label, null) { delegatesFocus = false; visualInput.focusable = false; AddToClassList(ussClassName); labelElement.AddToClassList(labelUssClassName); visualInput.AddToClassList(inputUssClassName); m_ShouldUpdateDisplay = true; m_Fields = new List<TField>(); FieldDescription[] fieldDescriptions = DescribeFields(); int numberOfLines = 1; if (fieldsByLine > 1) { numberOfLines = fieldDescriptions.Length / fieldsByLine; } var isMultiLine = false; if (numberOfLines > 1) { isMultiLine = true; AddToClassList(multilineVariantUssClassName); } for (int i = 0; i < numberOfLines; i++) { VisualElement newLineGroup = null; if (isMultiLine) { newLineGroup = new VisualElement(); newLineGroup.AddToClassList(fieldGroupUssClassName); } bool firstField = true; for (int j = i * fieldsByLine; j < ((i * fieldsByLine) + fieldsByLine); j++) { var desc = fieldDescriptions[j]; var field = new TField() { name = desc.ussName }; field.delegatesFocus = true; field.AddToClassList(fieldUssClassName); if (firstField) { field.AddToClassList(firstFieldVariantUssClassName); firstField = false; } field.label = desc.name; field.RegisterValueChangedCallback(e => { TValueType cur = value; desc.write(ref cur, e.newValue); // Here, just check and make sure the text is updated in the basic field and is the same as the value... // For example, backspace done on a selected value will empty the field (text == "") but the value will be 0. // Or : a text of "2+3" is valid until enter is pressed, so not equal to a value of "5". if (e.newValue.ToString() != ((TField)e.currentTarget).text) { m_ShouldUpdateDisplay = false; } value = cur; m_ShouldUpdateDisplay = true; }); m_Fields.Add(field); if (isMultiLine) { newLineGroup.Add(field); } else { visualInput.hierarchy.Add(field); } } if (fieldsByLine < 3) { int fieldsToAdd = 3 - fieldsByLine; for (int countToAdd = 0; countToAdd < fieldsToAdd; countToAdd++) { if (isMultiLine) { newLineGroup.Add(GetSpacer()); } else { visualInput.hierarchy.Add(GetSpacer()); } } } if (isMultiLine) { visualInput.hierarchy.Add(newLineGroup); } } UpdateDisplay(); } private void UpdateDisplay() { if (m_Fields.Count != 0) { var i = 0; FieldDescription[] fieldDescriptions = DescribeFields(); foreach (var fd in fieldDescriptions) { m_Fields[i].value = (fd.read(rawValue)); i++; } } } public override void SetValueWithoutNotify(TValueType newValue) { var displayNeedsUpdate = m_ShouldUpdateDisplay && !EqualityComparer<TValueType>.Default.Equals(rawValue, newValue); // Make sure to call the base class to set the value... base.SetValueWithoutNotify(newValue); // Before Updating the display, just check if the value changed... if (displayNeedsUpdate) { UpdateDisplay(); } } } }
1.421875
1
dotnet/__EXT__/SplitPannelExample/Split_Panel.fiddle/Split Panel/Common/Native/Win32/NativeCore.cs
dantincu/turmerik
0
9599973
// ------------------------------------------------------ // ---------- Copyright (c) 2017 <NAME> ---------- // ------------------------------------------------------ // ------------------------------------------------------ // ------------------------------------------------------ // ------------------------------------------------------ // ------------------------------------------------------ // ------------------------------------------------------ // ------------------------------------------------------ // ------------------------------------------------------ // ------------------------------------------------------ // ------------------------------------------------------ // ------------------------------------------------------ using System; using System.Runtime.InteropServices; using System.Runtime.ConstrainedExecution; using System.Security; namespace Common.Native.Win32 { public static class NativeCore { public const int False = 0; public const int True = 1; public enum ErrorCodes : uint { Ok = 0 } [Flags] public enum DuplicateOptions : uint { CloseSource = 0x01, SameAccess = 0x02, } [StructLayout(LayoutKind.Sequential)] public struct SecurityAttributes { public int Length; public IntPtr pSecurityDescriptor; public int InheritHandle; } [DllImport("kernel32.dll", SetLastError = true)] [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] [SuppressUnmanagedCodeSecurity] [return: MarshalAs(UnmanagedType.Bool)] public static extern bool CloseHandle(IntPtr hObject); [DllImport("kernel32.dll", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static extern bool DuplicateHandle(IntPtr hSourceProc, IntPtr hSource, IntPtr hTargetProc, out IntPtr hTarget, DuplicateOptions desiredAccess, [MarshalAs(UnmanagedType.Bool)] bool inheritHandle, DuplicateOptions options); } }
0.15332
0
Step4/XPenC/XPenC.DataAccess.SqlServer.EntityFramework/Tests/InMemoryDbContextOptionsBuilder.cs
AndreVianna/CleanCodeWorkshop
0
9599981
using System; using Microsoft.EntityFrameworkCore; namespace XPenC.DataAccess.SqlServer.EntityFramework.Tests { public static class InMemoryDbContextOptionsBuilder<TContext> where TContext : DbContext { public static DbContextOptions<TContext> Build() { return new DbContextOptionsBuilder<TContext>() .UseInMemoryDatabase(RandomDbName) .EnableSensitiveDataLogging() .EnableDetailedErrors() .Options; } private static string RandomDbName => $"InMemory-{Guid.NewGuid().ToString()}"; } }
1.039063
1
ConnectionTester/Program.cs
O-Debegnach/Supervisor-de-Comercio
1
9599989
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Net.Sockets; using System.Text; using System.Threading; using System.Threading.Tasks; namespace ConnectionTester { public class Cliente { private static NetworkStream stream; private static StreamWriter streamw; private static StreamReader streamr; private static readonly TcpClient client = new TcpClient(); private string _infoRecibida = ""; private readonly string nick = "clt"; public string Nick => nick; public Cliente(string nick) { this.nick = nick; } public bool Connected => client.Connected; public delegate void DelegadoInfoRecibida(string s); public event DelegadoInfoRecibida InfoRecibida; public string InformacionRecibida { get => _infoRecibida; set { if (value != _infoRecibida) { _infoRecibida = value; } } } public void Post(string s) { streamw.WriteLine(nick + "þ" + s); streamw.Flush(); } public void Stop() { client.Close(); } public void Listen() { string s; while (client.Connected) { try { s = streamr.ReadLine(); InfoRecibida?.Invoke(s); } catch { InfoRecibida?.Invoke(""); } } } public bool Conectar(string host) { try { client.Connect(host, 8000); if (client.Connected) { Thread t = new Thread(Listen); stream = client.GetStream(); streamw = new StreamWriter(stream); streamr = new StreamReader(stream); streamw.WriteLine(nick); streamw.Flush(); t.Start(); Console.WriteLine("Conexion exitosa!"); return true; } else { return false; //MessageBox.Show("Servidor no Disponible"); } } catch (SocketException se) { Console.WriteLine($"Error code {se.ErrorCode}: {se.Message}"); return false; } catch (ObjectDisposedException oe) { Console.WriteLine($"Error code {oe.InnerException}: {oe.Message}"); return false; } catch (Exception e) { Console.WriteLine(e.Message); return false; //MessageBox.Show("Servidor no Disponible"); } } } class Program { static void Main(string[] args) { Cliente cliente = new Cliente("tester"); Console.Write("Ingrese la IP: "); string ip = Console.ReadLine(); cliente.Conectar(ip); Console.Write("Presione cualquier tecla para salir"); Console.ReadKey(); } } }
1.820313
2
src/SKIT.FlurlHttpClient.ByteDance.MicroApp/Models/Apps/Message/AppsMessageCustomSendRequest.cs
lucio-c/DotNetCore.SKIT.FlurlHttpClient.ByteDance
11
9599997
using System; using System.Collections.Generic; namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.Models { /// <summary> /// <para>表示 [POST] /apps/message/custom/send 接口的请求。</para> /// </summary> public class AppsMessageCustomSendRequest : ByteDanceMicroAppRequest { /// <summary> /// 获取或设置用户的 OpenId。 /// </summary> [Newtonsoft.Json.JsonProperty("open_id")] [System.Text.Json.Serialization.JsonPropertyName("open_id")] public string OpenId { get; set; } = string.Empty; /// <summary> /// 获取或设置消息类型。 /// </summary> [Newtonsoft.Json.JsonProperty("msg_type")] [System.Text.Json.Serialization.JsonPropertyName("msg_type")] public string MessageType { get; set; } = string.Empty; /// <summary> /// 获取或设置文本内容。 /// </summary> [Newtonsoft.Json.JsonProperty("content")] [System.Text.Json.Serialization.JsonPropertyName("content")] public string? Content { get; set; } /// <summary> /// 获取或设置图片 URL。 /// </summary> [Newtonsoft.Json.JsonProperty("pic_url")] [System.Text.Json.Serialization.JsonPropertyName("pic_url")] public string? PictureUrl { get; set; } } }
0.921875
1