content
stringlengths
5
1.04M
avg_line_length
float64
1.75
12.9k
max_line_length
int64
2
244k
alphanum_fraction
float64
0
0.98
licenses
list
repository_name
stringlengths
7
92
path
stringlengths
3
249
size
int64
5
1.04M
lang
stringclasses
2 values
using System.Collections.Generic; using System.IO.Abstractions.TestingHelpers; namespace Prepend.Tests.TestData { public class Fakes { public MockFileSystem BuildFakeFileSystemWithoutPrepend() { var fakeFileSystem = new MockFileSystem(new Dictionary<string, MockFileData> { { @"T:\TestFiles\file-01.txt", new MockFileData("file-01-Contents") }, { @"T:\TestFiles\file-02.doc", new MockFileData(new byte[] { 0x12, 0x34, 0x56, 0xd2 }) }, { @"T:\TestFiles\file-03.txt", new MockFileData("file-03-Contents") }, { @"T:\TestFiles\file-04.junk", new MockFileData(new byte[] { 0x12, 0x34, 0x56, 0xd2 }) }, { @"T:\TestFiles\file-05", new MockFileData(new byte[] { 0x12, 0x34, 0x56, 0xd2 }) }, }); return fakeFileSystem; } public MockFileSystem BuildFakeFileSystemWithPrepend() { var fakeFileSystem = new MockFileSystem(new Dictionary<string, MockFileData> { { @"T:\TestFiles\aaa100 - file-01.txt", new MockFileData(@"file-01-Contents") }, { @"T:\TestFiles\file-02.doc", new MockFileData(new byte[] { 0x12, 0x34, 0x56, 0xd2 }) }, { @"T:\TestFiles\aaa101 - file-03.txt", new MockFileData(@"file-03-Contents") }, { @"T:\TestFiles\file-04.junk", new MockFileData(new byte[] { 0x12, 0x34, 0x56, 0xd2 }) }, { @"T:\TestFiles\file-05", new MockFileData(new byte[] { 0x12, 0x34, 0x56, 0xd2 }) }, }); return fakeFileSystem; } } }
46.764706
106
0.583648
[ "MIT" ]
joelcaples/Prepend
prepend.tests/TestData/Fakes.cs
1,592
C#
using System; using Akavache.Sqlite3; // Note: This class file is *required* for iOS to work correctly, and is // also a good idea for Android if you enable "Link All Assemblies". namespace BetterChoiceShared { [Preserve] public static class LinkerPreserve { static LinkerPreserve() { throw new Exception(typeof(SQLitePersistentBlobCache).FullName); } } public class PreserveAttribute : Attribute { } }
21.409091
76
0.666667
[ "MIT" ]
vivekgits/BetterChoiceApp
BetterChoice/AkavacheSqliteLinkerOverride.cs
471
C#
using System; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading; using System.Threading.Tasks; namespace System.IO.Ports { public class SerialDevice:IDisposable { public const int READING_BUFFER_SIZE = 1024; private readonly CancellationTokenSource cts = new CancellationTokenSource(); private CancellationToken CancellationToken => cts.Token; private int? fd; private readonly IntPtr readingBuffer = Marshal.AllocHGlobal(READING_BUFFER_SIZE); protected readonly string portName; protected readonly BaudRate baudRate; public event Action<object, byte[]> DataReceived; public SerialDevice(string portName, BaudRate baudRate) { this.portName = portName; this.baudRate = baudRate; } public void Open() { // open serial port int fd = Libc.open(portName, Libc.OpenFlags.O_RDWR | Libc.OpenFlags.O_NONBLOCK); if (fd == -1) { throw new Exception($"failed to open port ({portName})"); } // set baud rate byte[] termiosData = new byte[256]; Libc.tcgetattr(fd, termiosData); Libc.cfsetspeed(termiosData, baudRate); Libc.tcsetattr(fd, 0, termiosData); // start reading this.fd = fd; Task.Run((Action)StartReading, CancellationToken); } private void StartReading() { if (!fd.HasValue) { throw new Exception(); } while (true) { CancellationToken.ThrowIfCancellationRequested(); int res = Libc.read(fd.Value, readingBuffer, READING_BUFFER_SIZE); if (res != -1) { byte[] buf = new byte[res]; Marshal.Copy(readingBuffer, buf, 0, res); OnDataReceived(buf); } Thread.Sleep(50); } } protected virtual void OnDataReceived(byte[] data) { DataReceived?.Invoke(this, data); } public bool IsOpened => fd.HasValue; public void Close() { if (!fd.HasValue) { throw new Exception(); } cts.Cancel(); Libc.close(fd.Value); Marshal.FreeHGlobal(readingBuffer); } public void Write(byte[] buf) { if (!fd.HasValue) { throw new Exception(); } IntPtr ptr = Marshal.AllocHGlobal(buf.Length); Marshal.Copy(buf, 0, ptr, buf.Length); Libc.write(fd.Value, ptr, buf.Length); Marshal.FreeHGlobal(ptr); } public void Read(byte[] buf) { if (!fd.HasValue) { throw new Exception(); } IntPtr ptr = Marshal.AllocHGlobal(buf.Length); Marshal.Copy(buf, 0, ptr, buf.Length); Libc.read(fd.Value, ptr, buf.Length); Marshal.FreeHGlobal(ptr); } public static string[] GetPortNames() { int p = (int)Environment.OSVersion.Platform; List<string> serial_ports = new List<string>(); // Are we on Unix? if (p == 4 || p == 128 || p == 6) { string[] ttys = System.IO.Directory.GetFiles("/dev/", "tty*"); foreach (string dev in ttys) { //Arduino MEGAs show up as ttyACM due to their different USB<->RS232 chips if (dev.StartsWith("/dev/ttyS") || dev.StartsWith("/dev/ttyUSB") || dev.StartsWith("/dev/ttyACM") || dev.StartsWith("/dev/ttyAMA") || dev.StartsWith("/dev/serial")) { serial_ports.Add(dev); //Console.WriteLine("Serial list: {0}", dev); } } //newer Pi with bluetooth map serial ttys = System.IO.Directory.GetFiles("/dev/", "serial*"); foreach (string dev in ttys) { serial_ports.Add(dev); } } return serial_ports.ToArray(); } public void Dispose() { GC.SuppressFinalize(this); if (IsOpened) { Close(); } } } }
28.847561
94
0.480659
[ "MIT" ]
JawadJaber/serialapp-master
nuget/SerialDevice.cs
4,731
C#
namespace Lockstep.Network { public interface IMessage { ushort opcode { get; set; } } public interface IRequest : IMessage { int RpcId { get; set; } } public interface IResponse : IMessage { int Error { get; set; } string Message { get; set; } int RpcId { get; set; } } public class ResponseMessage : IResponse { public ushort opcode { get; set; } public int Error { get; set; } public string Message { get; set; } public int RpcId { get; set; } } }
26.571429
46
0.560932
[ "MIT" ]
JulyXm/UnityBuilder
Assets/Code/Framework/Network/IMessage.cs
558
C#
// ========================================================================== // Squidex Headless CMS // ========================================================================== // Copyright (c) Squidex UG (haftungsbeschraenkt) // All rights reserved. Licensed under the MIT license. // ========================================================================== using System.Collections.Generic; using System.Linq; using FluentAssertions; using Squidex.Domain.Apps.Core.Schemas; using Squidex.Domain.Apps.Core.TestHelpers; using Squidex.Infrastructure.Collections; using Squidex.Infrastructure.Validation; using Xunit; namespace Squidex.Domain.Apps.Entities.Schemas.DomainObject.Guards.FieldProperties { public class NumberFieldPropertiesTests : IClassFixture<TranslationsFixture> { [Fact] public void Should_not_add_error_if_sut_is_valid() { var sut = new NumberFieldProperties { MinValue = 0, MaxValue = 100, DefaultValue = 5 }; var errors = FieldPropertiesValidator.Validate(sut).ToList(); Assert.Empty(errors); } [Fact] public void Should_add_error_if_min_value_greater_than_max_value() { var sut = new NumberFieldProperties { MinValue = 10, MaxValue = 5 }; var errors = FieldPropertiesValidator.Validate(sut).ToList(); errors.Should().BeEquivalentTo( new List<ValidationError> { new ValidationError("Max value must be greater than min value.", "MinValue", "MaxValue") }); } [Fact] public void Should_add_error_if_radio_button_has_no_allowed_values() { var sut = new NumberFieldProperties { Editor = NumberFieldEditor.Radio }; var errors = FieldPropertiesValidator.Validate(sut).ToList(); errors.Should().BeEquivalentTo( new List<ValidationError> { new ValidationError("Radio buttons or dropdown list need allowed values.", "AllowedValues") }); } [Fact] public void Should_add_error_if_editor_is_not_valid() { var sut = new NumberFieldProperties { Editor = (NumberFieldEditor)123 }; var errors = FieldPropertiesValidator.Validate(sut).ToList(); errors.Should().BeEquivalentTo( new List<ValidationError> { new ValidationError("Editor is not a valid value.", "Editor") }); } [Theory] [InlineData(NumberFieldEditor.Radio)] public void Should_add_error_if_inline_editing_is_not_allowed_for_editor(NumberFieldEditor editor) { var sut = new NumberFieldProperties { InlineEditable = true, Editor = editor, AllowedValues = ReadonlyList.Create(1.0) }; var errors = FieldPropertiesValidator.Validate(sut).ToList(); errors.Should().BeEquivalentTo( new List<ValidationError> { new ValidationError("Inline editing is not allowed for Radio editor.", "InlineEditable", "Editor") }); } [Theory] [InlineData(NumberFieldEditor.Input)] [InlineData(NumberFieldEditor.Dropdown)] [InlineData(NumberFieldEditor.Stars)] public void Should_not_add_error_if_inline_editing_is_allowed_for_editor(NumberFieldEditor editor) { var sut = new NumberFieldProperties { InlineEditable = true, Editor = editor, AllowedValues = ReadonlyList.Create(1.0) }; var errors = FieldPropertiesValidator.Validate(sut).ToList(); Assert.Empty(errors); } } }
35.831776
133
0.581116
[ "MIT" ]
Squidex/squidex
backend/tests/Squidex.Domain.Apps.Entities.Tests/Schemas/DomainObject/Guards/FieldProperties/NumberFieldPropertiesTests.cs
3,836
C#
using System; using System.Collections.Generic; using System.Text; using System.IO; using System.Reflection; namespace QuickJS.Binding { public class PlainMethodCodeGen : IDisposable { protected CodeGenerator cg; public PlainMethodCodeGen(CodeGenerator cg, string sig) { this.cg = cg; this.cg.cs.AppendLine(sig); this.cg.cs.AppendLine("{"); this.cg.cs.AddTabLevel(); } public void Dispose() { this.cg.cs.DecTabLevel(); this.cg.cs.AppendLine("}"); } public void AddStatement(string fmt, params object[] args) { this.cg.cs.AppendLine(fmt, args); } public void AddModuleEntry(string moduleName, string runtimeVarName, string moduleVarName, TypeBindingInfo typeBindingInfo) { var csType = this.cg.bindingManager.GetCSTypeFullName(typeBindingInfo.type); var csNamespace = this.cg.bindingManager.prefs.ns; var csBindingName = typeBindingInfo.csBindingName; var jsNamespace = CodeGenUtils.Concat(", ", CodeGenUtils.ConcatAsLiteral(", ", typeBindingInfo.tsTypeNaming.jsNamespaceSlice), $"\"{typeBindingInfo.tsTypeNaming.jsNameNormalized}\""); var preload = typeBindingInfo.preload ? "true" : "false"; AddStatement($"{runtimeVarName}.AddTypeReference({moduleVarName}, typeof({csType}), {csNamespace}.{csBindingName}.Bind, {preload}, {jsNamespace});"); } } }
35.954545
196
0.615676
[ "MIT" ]
ialex32x/unity-jsb
Assets/jsb/Source/Binding/Editor/Codegen/CodeGenHelper_PlainMethod.cs
1,582
C#
using System; using System.Collections.Generic; using System.Linq; using Api.Game.ValueObjects; namespace Api.Game.Aggregates { public class Board { public static BoardState State { get; private set; } public static void Initialize(List<Colour> colours = null) { Pattern.GenerateCombination(colours); GameHistoric.Reset(); State = BoardState.Initialized; } public static (int colour, int positionAndColour, bool result) CheckPattern(List<Colour> checkedColours) { var pattern = Pattern.GetPattern().ToList(); var foreachPosition = 0; List<Colour> positionAndColour = new List<Colour>(), colour = new List<Colour>(); if (State != BoardState.Initialized) return (0, 0, false); checkedColours.ForEach(checkedColour => { if (checkedColour == pattern[foreachPosition]) { positionAndColour.Add(checkedColour); } else { if (pattern.Any(c => c == checkedColour) && !positionAndColour.Contains(checkedColour) && !colour.Contains(checkedColour)) { colour.Add(checkedColour); } } foreachPosition++; }); GameHistoric.AddCombinationChecked(checkedColours); CheckIfGameIsFinished(positionAndColour.Count); return (colour.Count, positionAndColour.Count, true); } public static void Finish() { State = BoardState.FinishedByUser; } private static void CheckIfGameIsFinished(int positionAndColour) { State = positionAndColour == Constants.RowSize ? BoardState.Discovered : GameHistoric.GetGameHistoric().Count == Constants.BoardSize ? BoardState.GameOver : BoardState.Initialized; } } }
31.630769
125
0.558852
[ "Apache-2.0" ]
vferras/MasterMind
src/Api/Game/Aggregates/Board.cs
2,056
C#
namespace AnimalFarm { using System; using AnimalFarm.Models; class Program { static void Main(string[] args) { string name = Console.ReadLine(); int age = int.Parse(Console.ReadLine()); try { Chicken chicken = new Chicken(name, age); Console.WriteLine( "Chicken {0} (age {1}) can produce {2} eggs per day.", chicken.Name, chicken.Age, chicken.ProductPerDay); } catch (Exception ex) { Console.WriteLine(ex.Message); } } } }
24.37931
74
0.432815
[ "MIT" ]
delbusque/My-SoftUni-projects-homework-and-exercises
C#OOP/EncapsulationExercise/AnimalFarm/AnimalFarm/Program.cs
709
C#
/* * Copyright (c) 2018 THL A29 Limited, a Tencent company. All Rights Reserved. * * Licensed 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. */ namespace TencentCloud.Vod.V20180717.Models { using Newtonsoft.Json; using System.Collections.Generic; using TencentCloud.Common; public class MediaContentReviewSegmentItem : AbstractModel { /// <summary> /// 嫌疑片段起始的偏移时间,单位:秒。 /// </summary> [JsonProperty("StartTimeOffset")] public float? StartTimeOffset{ get; set; } /// <summary> /// 嫌疑片段结束的偏移时间,单位:秒。 /// </summary> [JsonProperty("EndTimeOffset")] public float? EndTimeOffset{ get; set; } /// <summary> /// 嫌疑片段涉及令人反感的信息的分数。 /// </summary> [JsonProperty("Confidence")] public float? Confidence{ get; set; } /// <summary> /// 嫌疑片段涉及令人反感的信息的结果标签。 /// </summary> [JsonProperty("Label")] public string Label{ get; set; } /// <summary> /// 嫌疑片段鉴别涉及令人反感的信息的结果建议,取值范围: /// <li>pass。</li> /// <li>review。</li> /// <li>block。</li> /// </summary> [JsonProperty("Suggestion")] public string Suggestion{ get; set; } /// <summary> /// 嫌疑图片 URL (图片不会永久存储,到达 /// PicUrlExpireTime 时间点后图片将被删除)。 /// </summary> [JsonProperty("Url")] public string Url{ get; set; } /// <summary> /// 该字段已废弃,请使用 PicUrlExpireTime。 /// </summary> [JsonProperty("PicUrlExpireTimeStamp")] public long? PicUrlExpireTimeStamp{ get; set; } /// <summary> /// 嫌疑图片 URL 失效时间,使用 [ISO 日期格式](https://cloud.tencent.com/document/product/266/11732#I)。 /// </summary> [JsonProperty("PicUrlExpireTime")] public string PicUrlExpireTime{ get; set; } /// <summary> /// For internal usage only. DO NOT USE IT. /// </summary> public override void ToMap(Dictionary<string, string> map, string prefix) { this.SetParamSimple(map, prefix + "StartTimeOffset", this.StartTimeOffset); this.SetParamSimple(map, prefix + "EndTimeOffset", this.EndTimeOffset); this.SetParamSimple(map, prefix + "Confidence", this.Confidence); this.SetParamSimple(map, prefix + "Label", this.Label); this.SetParamSimple(map, prefix + "Suggestion", this.Suggestion); this.SetParamSimple(map, prefix + "Url", this.Url); this.SetParamSimple(map, prefix + "PicUrlExpireTimeStamp", this.PicUrlExpireTimeStamp); this.SetParamSimple(map, prefix + "PicUrlExpireTime", this.PicUrlExpireTime); } } }
33.463918
99
0.601972
[ "Apache-2.0" ]
TencentCloud/tencentcloud-sdk-dotnet
TencentCloud/Vod/V20180717/Models/MediaContentReviewSegmentItem.cs
3,554
C#
namespace Alpaca.Markets; /// <summary> /// Encapsulates request parameters for <see cref="AlpacaDataClient.ListNewsArticlesAsync(NewsArticlesRequest,System.Threading.CancellationToken)"/> call. /// </summary> public sealed class NewsArticlesRequest : Validation.IRequest, IHistoricalRequest<NewsArticlesRequest, INewsArticle> { private readonly HashSet<String> _symbols = new (StringComparer.Ordinal); /// <summary> /// Creates new instance of <see cref="NewsArticlesRequest"/> object. /// </summary> public NewsArticlesRequest() { } /// <summary> /// Creates new instance of <see cref="NewsArticlesRequest"/> object. /// </summary> /// <param name="symbols">Asset names for data retrieval.</param> public NewsArticlesRequest( IEnumerable<String> symbols) => _symbols.UnionWith(symbols.EnsureNotNull()); /// <summary> /// Gets assets names list for data retrieval. /// </summary> [UsedImplicitly] public IReadOnlyCollection<String> Symbols => _symbols; /// <summary> /// Gets or sets inclusive date interval for filtering items in response. /// </summary> [UsedImplicitly] public Interval<DateTime>? TimeInterval { get; set; } /// <summary> /// Gets or sets articles sorting (by <see cref="INewsArticle.UpdatedAtUtc"/> property) direction. /// </summary> [UsedImplicitly] public SortDirection? SortDirection { get; set; } /// <summary> /// Gets or sets flag for sending <see cref="INewsArticle.Content"/> property value for each news article. /// </summary> [UsedImplicitly] public Boolean? SendFullContentForItems { get; set; } /// <summary> /// Gets or sets flag for excluding news articles that do not contain <see cref="INewsArticle.Content"/> /// property value (just <see cref="INewsArticle.Headline"/> and <see cref="INewsArticle.Summary"/> values). /// </summary> [UsedImplicitly] public Boolean? ExcludeItemsWithoutContent { get; set; } /// <summary> /// Gets the pagination parameters for the request (page size and token). /// </summary> [UsedImplicitly] public Pagination Pagination { get; } = new (); internal async ValueTask<UriBuilder> GetUriBuilderAsync( HttpClient httpClient) => new UriBuilder(httpClient.BaseAddress!) { Query = await Pagination.QueryBuilder .AddParameter("symbols", Symbols) .AddParameter("start", TimeInterval?.From, "O") .AddParameter("end", TimeInterval?.Into, "O") .AddParameter("sort", SortDirection) .AddParameter("include_content", SendFullContentForItems) .AddParameter("exclude_contentless", ExcludeItemsWithoutContent) .AsStringAsync().ConfigureAwait(false) }.AppendPath("../../v1beta1/news"); IEnumerable<RequestValidationException?> Validation.IRequest.GetExceptions() { yield return Pagination.TryValidatePageSize(Pagination.MaxNewsPageSize); yield return Symbols.TryValidateSymbolName(); } NewsArticlesRequest IHistoricalRequest<NewsArticlesRequest, INewsArticle>.GetValidatedRequestWithoutPageToken() => new NewsArticlesRequest(Symbols) { TimeInterval = TimeInterval, SortDirection = SortDirection, SendFullContentForItems = SendFullContentForItems, ExcludeItemsWithoutContent = ExcludeItemsWithoutContent } .WithPageSize(Pagination.Size ?? Pagination.MaxNewsPageSize); }
39.402174
154
0.666207
[ "Apache-2.0" ]
ooples/alpaca-trade-api-csharp
Alpaca.Markets/Parameters/NewsArticlesRequest.cs
3,627
C#
using System.Collections; using System.Collections.Generic; using UnityEngine; public class QuestSystem : MonoBehaviour { private static ArrayList quests = new ArrayList(); public static QuestSystem instance; private void Awake() { instance = this; } // Start is called before the first frame update void Start() { DontDestroyOnLoad(this); } // Update is called once per frame void Update() { } public static ArrayList GetCurrentQuests() { // Loop through quests to find current quests ArrayList currents = new ArrayList(); foreach (Quest q in quests) { if (q.current) { currents.Add(q); } } return currents; } public static void SetCurrentQuest(Quest quest) { quest.UpdateCurrent(true); } public static void AddQuest(Quest quest) { if (quests.IndexOf(quest) < 0) { quests.Add(quest); } } public static Quest getQuest(Quest quest) { return (Quest) quests[quests.IndexOf(quest)]; } public static bool contains(Quest quest) { return quests.IndexOf(quest) >= 0; } public static void RemoveQuest(Quest quest) { quests.Remove(quest); } }
20.53125
54
0.592846
[ "MIT" ]
esl1350/PaperPlanes
Assets/Scripts/Quests/QuestSystem.cs
1,314
C#
using System; using System.Collections.Generic; using System.Linq; using System.Security.Cryptography; using System.Text; using SULS.Data; using SULS.Models; namespace SULS.Services { public class UserService : IUserService { private readonly SULSContext context; public UserService(SULSContext context) { this.context = context; } private string HashPassword(string password) { using (SHA256 sha256Hash = SHA256.Create()) { return Encoding.UTF8.GetString(sha256Hash.ComputeHash(Encoding.UTF8.GetBytes(password))); } } public string CreateUser(string username, string email, string password) { if (context.Users.Any(u => u.Username == username)) { return null; } var user = new User { Email = email, Username = username, Password = HashPassword(password) }; context.Users.Add(user); context.SaveChanges(); return user.Id; } public User GetByUsernameAndPassword(string username, string password) { return context.Users.SingleOrDefault(u => u.Username == username && u.Password == HashPassword(password)); } } }
25.611111
118
0.566161
[ "MIT" ]
KostadinovK/CSharp-Web
01-C# Web Basics/07-Exam 16.06.2019/SULS/Apps/SULS/SULS.Services/UserService.cs
1,385
C#
using System.Web; using System.Web.Optimization; namespace LoggerService { public class BundleConfig { // For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862 public static void RegisterBundles(BundleCollection bundles) { bundles.Add(new ScriptBundle("~/bundles/jquery").Include( "~/Scripts/jquery-{version}.js")); // Use the development version of Modernizr to develop with and learn from. Then, when you're // ready for production, use the build tool at http://modernizr.com to pick only the tests you need. bundles.Add(new ScriptBundle("~/bundles/modernizr").Include( "~/Scripts/modernizr-*")); bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include( "~/Scripts/bootstrap.js", "~/Scripts/respond.js")); bundles.Add(new StyleBundle("~/Content/css").Include( "~/Content/bootstrap.css", "~/Content/site.css", "~/Content/layout-styles.css")); } } }
38.833333
112
0.571674
[ "Apache-2.0" ]
rahulmaddineni/Error-Logger
LoggerService/App_Start/BundleConfig.cs
1,167
C#
using Microsoft.Maui.Controls.CustomAttributes; using Microsoft.Maui.Controls.Internals; #if UITEST using Microsoft.Maui.Controls.Compatibility.UITests; using Xamarin.UITest; using NUnit.Framework; #endif namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues { #if UITEST [Category(UITestCategories.ManualReview)] #endif [Preserve(AllMembers = true)] [Issue(IssueTracker.Github, 8988, "App freezes on iPadOS 13.3 when in split view mode (multi-tasking) and change between pages", PlatformAffected.iOS)] public class Issue8988 : TestContentPage // or TestFlyoutPage, etc ... { SecondPage secondPage; protected override void Init() { secondPage = new SecondPage(); var layout = new StackLayout(); var label = new Label { Text = "Click Next to push a modal, pop it, and push it again, you should see the second page a 2nd time without glitches.", VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, HorizontalTextAlignment = TextAlignment.Center }; var button = new Button { Text = "NextPage", Command = new Command(async () => { await Navigation.PushModalAsync(secondPage, false); }) }; layout.Children.Add(label); layout.Children.Add(button); BackgroundColor = Color.YellowGreen; Content = layout; } [Preserve(AllMembers = true)] class SecondPage : ContentPage { public SecondPage() { var layout = new StackLayout(); var label = new Label { Text = "This is the Second Page! Pop me and push again. I should look the same", VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, HorizontalTextAlignment = TextAlignment.Center }; var button = new Button { Text = "Go Back to Main Page", Command = new Command(() => Navigation.PopModalAsync(false)) }; layout.Children.Add(label); layout.Children.Add(button); BackgroundColor = Color.Yellow; Content = layout; } protected override void LayoutChildren(double x, double y, double width, double height) { base.LayoutChildren(x, y, width, height); } protected override void InvalidateMeasure() { base.InvalidateMeasure(); } } } }
26.37931
152
0.703268
[ "MIT" ]
Eilon/maui
src/Compatibility/ControlGallery/src/Issues.Shared/Issue8988.cs
2,297
C#
/* * This file is part of logview4net (logview4net.sourceforge.net) * Copyright 2008 Johan Idstam * * * This source code is released under the Artistic License 2.0. */ using System; using System.Data; using System.Data.SqlClient; using System.IO; using System.Windows.Forms; using System.Xml.Serialization; namespace logview4net.Listeners { /// <summary> /// This clas manages the configuration af a SqlListener /// </summary> public partial class SqlListenerConfigurator : UserControl, IListenerConfigurator { private ILog _log = Logger.GetLogger("logview4net.Listeners.SqlListenerConfigurator"); private SqlListener _listener = new SqlListener(); /// <summary> /// Initializes a new instance of the <see cref="SqlListenerConfigurator"/> class. /// </summary> public SqlListenerConfigurator() { if (_log.Enabled) _log.Debug(GetHashCode(), "SqlListenerConfigurator"); InitializeComponent(); } /// <summary> /// Initializes a new instance of the <see cref="SqlListenerConfigurator"/> class. /// </summary> /// <param name="listner">The listner.</param> public SqlListenerConfigurator(ListenerBase listner) { if (_log.Enabled) _log.Debug(GetHashCode(), "SqlListenerConfigurator(IListener)"); InitializeComponent(); _listener = (SqlListener) listner; UpdateControls(); txtServer.Enabled = false; txtUser.Enabled = false; txtPassword.Enabled = false; chkWinAuthentication.Enabled = false; cboDatabase.Enabled = false; cboTable.Enabled = false; cboColumn.Enabled = false; chkTail.Enabled = false; } #region IListenerConfigurator Members /// <summary> /// Gets the caption. /// </summary> /// <value>The caption.</value> public string Caption { get { return "SQL Listener: " + _listener.MessagePrefix ; } } /// <summary> /// Gets or sets the configuration data for an implementation of this interface. /// </summary> /// <value></value> public string Configuration { get { return _listener.GetConfiguration(); } set { if (_log.Enabled) _log.Debug(GetHashCode(), "Configuration Set"); var xs = new XmlSerializer(_listener.GetType()); var sr = new StringReader(value); _listener = (SqlListener) xs.Deserialize(sr); UpdateControls(); } } public void UpdateControls() { txtServer.Text = _listener.Server; txtUser.Text = _listener.User; txtPassword.Text = _listener.Password; chkWinAuthentication.Checked = _listener.WinAuthentication; txtPrefix.Text = _listener.MessagePrefix; cboDatabase.Text = _listener.Database; cboTable.Text = _listener.Table; cboColumn.Text = _listener.Column; txtIntervall.Text = _listener.Interval.ToString(); chkTail.Checked = _listener.StartAtEnd; chkTimestamp.Checked = _listener.ShowTimestamp; txtFormat.Text = _listener.TimestampFormat == "" ? ListenerHelper.DefaultTimestampFormat : _listener.TimestampFormat; } /// <summary> /// Gets the listener for an implementation of this interface /// </summary> /// <value></value> public ListenerBase ListenerBase { get { return _listener; } set { _listener = (SqlListener) value; } } #endregion private void txtPrefix_TextChanged(object sender, EventArgs e) { _listener.MessagePrefix = txtPrefix.Text; Text = txtPrefix.Text; } private void txtServer_TextChanged(object sender, EventArgs e) { _listener.Server = txtServer.Text; } private void txtUser_TextChanged(object sender, EventArgs e) { _listener.User = txtUser.Text; } private void txtPassword_TextChanged(object sender, EventArgs e) { _listener.Password = txtPassword.Text; } private void cboDatabase_SelectedIndexChanged(object sender, EventArgs e) { _listener.Database = cboDatabase.Text; } private void cboTable_SelectedIndexChanged(object sender, EventArgs e) { _listener.Table = cboTable.Text; } private void cboColumn_SelectedIndexChanged(object sender, EventArgs e) { _listener.Column = cboColumn.Text; } private void chkWinAuthentication_CheckedChanged(object sender, EventArgs e) { _listener.WinAuthentication = chkWinAuthentication.Checked; } private void txtIntervall_TextChanged(object sender, EventArgs e) { int foo; if(int.TryParse(txtIntervall.Text, out foo)) { _listener.Interval = foo; } } private void chkTail_CheckedChanged(object sender, EventArgs e) { _listener.StartAtEnd = chkTail.Checked; } private void cboDatabase_DropDown(object sender, EventArgs e) { Cursor = Cursors.WaitCursor; fillCombo((ComboBox) sender, "SELECT Name FROM master..sysdatabases ORDER BY Name"); Cursor = Cursors.Default; } private void cboTable_DropDown(object sender, EventArgs e) { Cursor = Cursors.WaitCursor; var changeDB = "use [" + cboDatabase.Text + "]; "; var sql = "SELECT TABLE_NAME as Name FROM INFORMATION_SCHEMA.TABLES ORDER BY TABLE_NAME"; fillCombo((ComboBox) sender, changeDB + sql); Cursor = Cursors.Default; } private void cboColumn_DropDown(object sender, EventArgs e) { var changeDB = "use [" + cboDatabase.Text + "]; "; var sql = "SELECT COLUMN_NAME as Name FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='" + cboTable.Text + "'" + " ORDER BY COLUMN_NAME"; fillCombo((ComboBox) sender, changeDB + sql); } private void fillCombo(ComboBox cbo, string sql) { if (_log.Enabled) _log.Debug(GetHashCode(), "fillCombo " + cbo.Name + " " + sql); var cn = getOpenConnection(); if (cn == null) { return; } else { var da = new SqlDataAdapter(sql, cn); var ds = new DataSet(); da.Fill(ds); cbo.DataSource = ds.Tables[0]; cbo.DisplayMember = "Name"; da.Dispose(); cn.Dispose(); } } private SqlConnection getOpenConnection() { if (_log.Enabled) _log.Debug(GetHashCode(), "getOpenConnection"); try { _log.Debug(GetHashCode(), "Creating db connection"); var csb = new SqlConnectionStringBuilder(); if (chkWinAuthentication.Checked) { csb.IntegratedSecurity = true; } else { csb.UserID = txtUser.Text; ; csb.Password = txtPassword.Text; } csb.DataSource = txtServer.Text; var cn = new SqlConnection(csb.ConnectionString); cn.Open(); return cn; } catch (Exception ex) { _log.Debug(GetHashCode(), "Tried to open database.", ex); return null; } } private void chkTimestamp_CheckedChanged(object sender, EventArgs e) { txtFormat.Enabled = chkTimestamp.Checked; _listener.ShowTimestamp = chkTimestamp.Checked; } private void txtFormat_TextChanged(object sender, EventArgs e) { _listener.TimestampFormat = txtFormat.Text; } } }
33.486486
130
0.542603
[ "Artistic-2.0" ]
idstam/logview4net
src/logview4net.mslisteners/SqlListenerConfigurator.cs
8,673
C#
// MapTileSource.cs // Script#/Libraries/Microsoft/BingMaps // This source code is subject to terms and conditions of the Apache License, Version 2.0. // using System; using System.Runtime.CompilerServices; namespace Microsoft.Maps { // TODO: Other members [ScriptImport] [ScriptName("TileSource")] public class MapTileSource { public MapTileSource(MapTileSourceOptions options) { } public int GetHeight() { return 0; } public string GetUriConstructor() { return null; } public int GetWidth() { return 0; } } }
19.363636
90
0.610329
[ "Apache-2.0" ]
AmanArnold/dsharp
src/Libraries/Microsoft/BingMaps/MapTileSource.cs
639
C#
// <copyright file="ExistedUserSignInTest.cs" company="Mozilla"> // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, you can obtain one at http://mozilla.org/MPL/2.0/. // </copyright> namespace FirefoxPrivateVPNUITest { using FirefoxPrivateVPNUITest.Screens; using Microsoft.VisualStudio.TestTools.UnitTesting; /// <summary> /// This Sign In test is for users who already registered and paid. /// </summary> [TestClass] public class ExistedUserSignInTest { private FirefoxPrivateVPNSession vpnClient; private BrowserSession browser; /// <summary> /// Initialize browser and vpn client sessions. /// </summary> [TestInitialize] public void TestInitialize() { this.browser = new BrowserSession(); this.vpnClient = new FirefoxPrivateVPNSession(); Utils.RearrangeWindows(this.vpnClient, this.browser); } /// <summary> /// Dispose both vpn and browser sessions. /// </summary> [TestCleanup] public void TestCleanup() { this.vpnClient.Dispose(); this.browser.Dispose(); } /// <summary> /// The test steps. /// </summary> [TestMethod] public void TestExistingUserSignIn() { // Switch to VPN client session this.vpnClient.Session.SwitchTo(); LandingScreen landingScreen = new LandingScreen(this.vpnClient.Session); landingScreen.ClickGetStartedButton(); // User Sign In via web browser UserCommonOperation.UserSignIn(this.vpnClient, this.browser); // Main Screen this.vpnClient.Session.SwitchTo(); MainScreen mainScreen = new MainScreen(this.vpnClient.Session); Assert.AreEqual("VPN is off", mainScreen.GetTitle()); // Setting Screen UserCommonOperation.UserSignOut(this.vpnClient); } } }
32.921875
195
0.611296
[ "MPL-2.0" ]
Conjuror/guardian-vpn-windows
test/smoke/FirefoxPrivateVPNUITest/FirefoxPrivateVPNUITest/Tests/ExistedUserSignInTest.cs
2,109
C#
namespace Huten.App.Examples { using System; public sealed class Example_02 : Example { public override void Execute() { var a = QueryStringBuilder.Create() .AppendSection("document") .AppendSection(666.ToString()) .Build(); // "/document/666" Console.WriteLine(a); var b = QueryStringBuilder.Create() .AppendSection("users") .AppendSection(666.ToString()) .AppendSection("name") .Build(); // "/users/666/name" Console.WriteLine(b); var c = QueryStringBuilder.Create("https://mysite.com") .AppendSection("api") .AppendSection("users") .AppendSection(666.ToString()) .AppendSection("name") .Build(); // "https://mysite.com/api/users/666/name" Console.WriteLine(c); } } }
27.459459
67
0.482283
[ "MIT" ]
do-loop/huten
src/Huten/Huten.App/Examples/Example_02.cs
1,018
C#
using Arragro.Common.Repository; using Arragro.TestBase; using System; using System.Linq; using Xunit; namespace Arragro.EF6.IntegrationTests { public class IntegrationTests { private void WithDbContext(Action<FooContext> action) { using (var context = new FooContext()) { action.Invoke(context); } } public IntegrationTests() { WithDbContext(x => { if (x.Database.Exists()) x.Database.Delete(); x.Database.CreateIfNotExists(); }); } [Fact] public void add_record_to_database() { WithDbContext(x => { x.ModelFoos.Add(new ModelFoo { Name = "Test" }); x.SaveChanges(); var modelFoo = x.ModelFoos.Single(); Assert.Equal("Test", modelFoo.Name); Assert.NotEqual(default(int), modelFoo.Id); }); } [Fact] public void use_ModelFooService_to_interact_with_SqlServerCE() { using (var context = new FooContext()) { var modelFooRepository = new ModelFooRepository(context); var modelFooService = new ModelFooService(modelFooRepository); var modelFoo = modelFooService.InsertOrUpdate(new ModelFoo { Name = "Test" }); modelFooService.SaveChanges(); Assert.NotEqual(default(int), modelFoo.Id); } } [Fact] public void use_ModelFooService_to_interact_with_InMemoryRepository() { var modelFooRepository = new InMemoryRepository<ModelFoo, int>(); var modelFooService = new ModelFooService(modelFooRepository); var modelFoo = modelFooService.InsertOrUpdate(new ModelFoo { Name = "Test" }); modelFooService.SaveChanges(); Assert.NotEqual(default(int), modelFoo.Id); } } }
29.549296
94
0.534795
[ "BSD-3-Clause" ]
Arragro/Arragro
tests/Arragro.EF6.IntegrationTests/IntegrationTests.cs
2,100
C#
using System; namespace Serilog.Sinks.Amazon.Kinesis { /// <summary> /// Args for event raised when log sending errors. /// </summary> public class LogSendErrorEventArgs : EventArgs { /// <summary> /// Initializes a new instance of the <see cref="LogSendErrorEventArgs"/> class. /// </summary> /// <param name="message"></param> /// <param name="exception"></param> public LogSendErrorEventArgs(string message, Exception exception) { Message = message; Exception = exception; } /// <summary> /// A message with details of the error. /// </summary> public string Message { get; set; } /// <summary> /// The underlying exception. /// </summary> public Exception Exception { get; set; } } }
27.967742
88
0.554787
[ "Apache-2.0" ]
Boostability/serilog-sinks-amazonkinesis
src/Serilog.Sinks.Amazon.Kinesis/Common/LogSendErrorEventArgs.cs
869
C#
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace GabyCakes.API.Models { public enum Category { Cupcakes, Brownies, Cookies, Cakes } public class Product { public int Id { get; set; } public Category Category { get; set; } public string Title { get; set; } public string Description { get; set; } public string ImagePath { get; set; } public decimal Price { get; set; } public uint MinimumQuantity { get { return Category == Category.Cakes ? 1u : 12u; } } } }
21.212121
61
0.541429
[ "MIT" ]
ciband/gabycakes
GabyCakes.API/Models/Products.cs
702
C#
using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using Jerrycurl.Cqs.Sessions; using Jerrycurl.Relations; namespace Jerrycurl.Cqs.Language { public class ParameterStore : Collection<IParameter> { private readonly Dictionary<IField, IParameter> innerMap = new Dictionary<IField, IParameter>(); public char? Prefix { get; } public ParameterStore(char? prefix = null) { this.Prefix = prefix; } public IParameter Add(IField field) { if (field == null) throw new ArgumentNullException(nameof(field)); if (!this.innerMap.TryGetValue(field, out IParameter param)) { string paramName = $"{this.Prefix}P{this.innerMap.Count}"; this.innerMap.Add(field, param = new Parameter(paramName, field)); this.Add(param); } return param; } public IList<IParameter> Add(ITuple tuple) => tuple?.Select(this.Add).ToList() ?? throw new ArgumentNullException(nameof(tuple)); public IList<IParameter> Add(IRelation relation) { if (relation == null) throw new ArgumentNullException(nameof(relation)); using IRelationReader reader = relation.GetReader(); List<IParameter> parameters = new List<IParameter>(); while (reader.Read()) parameters.AddRange(this.Add(reader)); return parameters; } } }
28.303571
104
0.596845
[ "MIT" ]
rhodosaur/jerrycurl
src/Mvc/Jerrycurl.Cqs/Language/ParameterStore.cs
1,587
C#
namespace CoreGame.Models { public enum PlayerSideSelection { SavePigeons, BurnPigeons } }
21.4
37
0.691589
[ "BSD-3-Clause" ]
Devin0xFFFFFF/singed-feathers
CoreGame/Models/PlayerSideSelection.cs
109
C#
// // ISeparatorMenuItemBackend.cs // // Author: // Lluis Sanchez <lluis@xamarin.com> // // Copyright (c) 2012 Xamarin Inc // // 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. using System; namespace Xwt.Backends { public interface ISeparatorMenuItemBackend: IMenuItemBackend { } }
37.771429
80
0.75416
[ "MIT" ]
Bert1974/xwt
Xwt/Xwt.Backends/ISeparatorMenuItemBackend.cs
1,322
C#
using System.IO; using System.Linq; using Vs.VoorzieningenEnRegelingen.Core.TestData; using Xunit; using YamlDotNet.RepresentationModel; using YamlDotNet.Serialization; namespace Vs.Rules.Core.Tests { /// <summary></summary> public class YamlTests { private string Order(string s) { return string.Join(",", s.Trim(',').Split(',').OrderBy(i => i)); } /// <summary> /// Determines whether this instance [can deserialize yaml]. /// </summary> [Fact] public void Yaml_Can_Deserialize_Root_Nodes() { var map = YamlRuleParser.Map(YamlTestFileLoader.Load(@"Rijksoverheid/Zorgtoeslag.yaml")); // Load the stream var s = ""; foreach (var entry in map.Children) { s += (((YamlScalarNode)entry.Key).Value) + ","; } Assert.True("berekening,formules,stuurinformatie,tabellen" == Order(s)); } [Fact] public void Yaml_Passes_AttributeNaming_Stuurinformatie() { var map = YamlRuleParser.Map(YamlTestFileLoader.Load(@"Rijksoverheid/Zorgtoeslag.yaml")); var s = ""; foreach (var entry in (YamlMappingNode)map.Children[new YamlScalarNode("stuurinformatie")]) { s += (((YamlScalarNode)entry.Key).Value) + ","; } Assert.True("bron,domein,jaar,onderwerp,organisatie,status,type,versie" == Order(s)); } [Fact] public void Yaml_Passes_AttributeValues_Stuurinformatie() { var map = YamlRuleParser.Map(YamlTestFileLoader.Load(@"Rijksoverheid/Zorgtoeslag.yaml")); var s = ""; var entries = (YamlMappingNode)map.Children[new YamlScalarNode("stuurinformatie")]; foreach (var entry in entries) { s += entry.Value + ","; } Assert.True("1.0,2019,belastingdienst,https://download.belastingdienst.nl/toeslagen/docs/berekening_zorgtoeslag_2019_tg0821z91fd.pdf,ontwikkel,toeslagen,zorg,zorgtoeslag" == Order(s)); } [Fact] public void Yaml_Can_Convert_To_Json() { var deserializer = new DeserializerBuilder().Build(); var yamlObject = deserializer.Deserialize(new StringReader(YamlTestFileLoader.Load(@"Rijksoverheid/Zorgtoeslag.yaml"))); var serializer = new SerializerBuilder() .JsonCompatible() .Build(); var json = serializer.Serialize(yamlObject); } [Fact] public void Yaml_Can_Parse_Formulas() { var yamlParser = new YamlRuleParser(YamlTestFileLoader.Load(@"Rijksoverheid/Zorgtoeslag.yaml"), null); var functions = yamlParser.Formulas(); Assert.True(functions.Count() == 11); Assert.True(functions.ElementAt(1).Name == "maximaalvermogen"); Assert.True(functions.ElementAt(1).IsSituational == true); } [Fact] public void Yaml_Can_Deserialize_Tables() { var yamlParser = new YamlRuleParser(YamlTestFileLoader.Load(@"Rijksoverheid/Zorgtoeslag.yaml"), null); var tabellen = yamlParser.Tabellen(); Assert.True(tabellen.Count() == 1); var tabel = tabellen.Single(); Assert.True(tabel.Name == "woonlandfactoren"); Assert.True(tabel.ColumnTypes.Count == 2); Assert.True(tabel.ColumnTypes[0].Name == "woonland"); Assert.True(tabel.ColumnTypes[1].Name == "factor"); } } }
38.221053
196
0.592399
[ "MIT" ]
sjefvanleeuwen/morstead
src/rules/Vs.Rules.Core.Tests/YamlTests.cs
3,631
C#
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.34209 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace WpfUserControlLibrary1.Properties { /// <summary> /// A strongly-typed resource class, for looking up localized strings, etc. /// </summary> // This class was auto-generated by the StronglyTypedResourceBuilder // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Resources() { } /// <summary> /// Returns the cached ResourceManager instance used by this class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { get { if ((resourceMan == null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WpfUserControlLibrary1.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } /// <summary> /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } } }
43.952381
188
0.613218
[ "MIT" ]
JYang17/SampleCode
Samples/Wpf1/WpfUserControlLibrary1/Properties/Resources.Designer.cs
2,771
C#
using Microsoft.EntityFrameworkCore; using TrafficSignal.Web.DomainModels; namespace TrafficSignal.API.DbContexts { public class TrafficSignalDBContext : DbContext { public TrafficSignalDBContext(DbContextOptions<TrafficSignalDBContext> options) : base(options) { } public DbSet<TrafficJunction> TrafficJunctions { get; set; } public DbSet<TrafficLight> TrafficLights { get; set; } protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); } } }
27.857143
103
0.697436
[ "MIT" ]
gaureshph/TrafficSignalTest
TrafficSignal.API/DbContexts/TrafficSignalDBContext.cs
587
C#
namespace scrapy.net; public class EngineStartedEventArgs { public EngineStartedEventArgs(ScrapyApplication scrapyApplication, IEnumerable<Spider<IResponse>> spiders) { ScrapyApplication = scrapyApplication; Spiders = spiders; } public ScrapyApplication ScrapyApplication { get; } public IEnumerable<Spider<IResponse>> Spiders { get; } }
28.923077
110
0.742021
[ "MIT" ]
malisancube/scrapydev
src/scrapy.net/core/events/EngineStartedEventArgs.cs
378
C#
using Bottlecap.Net.GraphQL.Generation; using System.IO; using Xunit; namespace IntegrationTests.Bottlecap.Net.GraphQL.Generation { public class BaseTests { protected const string NAMESPACE = "Tests"; protected void ActAndAssertGeneratedResult(Generator generator, string testName) { // Act var result = generator.Generate(NAMESPACE); // Assert using (var stream = typeof(BaseTests).Assembly.GetManifestResourceStream($"IntegrationTests.Bottlecap.Net.GraphQL.Generation.ExpectedData.{testName}")) { Assert.NotNull(stream); using (var reader = new StreamReader(stream)) { var expectedData = reader.ReadToEnd(); Assert.Equal(expectedData.Trim(), result.Trim()); } } } } }
30.827586
163
0.591723
[ "MIT" ]
BottlecapDave/Bottlecap.Net.GraphQL.Generation
src/Tests/IntegrationTests.Bottlecap.Net.GraphQL.Generation/BaseTests.cs
896
C#
// Copyright (c) Josef Pihrt. All rights reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeFixes; using Microsoft.CodeAnalysis.Diagnostics; using Roslynator.CSharp.CodeFixes; using Xunit; namespace Roslynator.CSharp.Analysis.Tests { public class RCS1123AddParenthesesWhenNecessaryTests : AbstractCSharpFixVerifier { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticDescriptors.AddParenthesesWhenNecessary; public override DiagnosticAnalyzer Analyzer { get; } = new AddParenthesesWhenNecessaryAnalyzer(); public override CodeFixProvider FixProvider { get; } = new AddParenthesesWhenNecessaryCodeFixProvider(); [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddParenthesesWhenNecessary)] public async Task Test() { await VerifyDiagnosticAndFixAsync(@" class C { void M() { bool a = false, b = false, c = false, d = false; if ([|a #if DEBUG && b #endif && c|] || d) { } } } ", @" class C { void M() { bool a = false, b = false, c = false, d = false; if ((a #if DEBUG && b #endif && c) || d) { } } } "); } [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddParenthesesWhenNecessary)] public async Task Test_SuppressNullableWarningExpression() { await VerifyDiagnosticAndFixAsync(@" #nullable enable class C { string? M() { var c = new C(); string s = [|c.M()?.ToString()|]!.ToString(); return null; } } ", @" #nullable enable class C { string? M() { var c = new C(); string s = (c.M()?.ToString())!.ToString(); return null; } } "); } [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddParenthesesWhenNecessary)] public async Task TestNoDiagnostic_PreprocessorDirectives() { await VerifyNoDiagnosticAsync(@" class C { void M() { bool a = false, b = false, c = false, d = false; if (a #if X && c || d) #else //X #if X2 #else //X2 #endif //X2 && b && c || d) #endif //X { } } } "); } } }
20.541667
160
0.57931
[ "Apache-2.0" ]
RickeyEstes/Roslynator
src/Tests/Analyzers.Tests/RCS1123AddParenthesesWhenNecessaryTests.cs
2,467
C#
#nullable enable using System; using System.Linq; using System.Threading.Tasks; using Content.Server.GameObjects.Components.Mobs; using Content.Server.GameObjects.Components.Observer; using Content.Server.GameObjects.Components.Power.ApcNetComponents; using Content.Server.GameObjects.EntitySystems; using Content.Server.Interfaces; using Content.Server.Mobs; using Content.Server.Utility; using Content.Shared.GameObjects.Components.Damage; using Content.Shared.GameObjects.Components.Medical; using Content.Shared.Interfaces.GameObjects.Components; using Content.Shared.Preferences; using Robust.Server.GameObjects; using Robust.Server.GameObjects.Components.Container; using Robust.Server.GameObjects.Components.UserInterface; using Robust.Server.Interfaces.GameObjects; using Robust.Server.Interfaces.Player; using Robust.Shared.GameObjects; using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Maths; using Robust.Shared.Network; using Robust.Shared.Serialization; using Robust.Shared.ViewVariables; namespace Content.Server.GameObjects.Components.Medical { [RegisterComponent] [ComponentReference(typeof(IActivate))] public class CloningPodComponent : SharedCloningPodComponent, IActivate { [Dependency] private readonly IServerPreferencesManager _prefsManager = null!; [Dependency] private readonly IEntityManager _entityManager = null!; [Dependency] private readonly IPlayerManager _playerManager = null!; [ViewVariables] private bool Powered => !Owner.TryGetComponent(out PowerReceiverComponent? receiver) || receiver.Powered; [ViewVariables] private BoundUserInterface? UserInterface => Owner.GetUIOrNull(CloningPodUIKey.Key); private ContainerSlot _bodyContainer = default!; private Mind? _capturedMind; private CloningPodStatus _status; private float _cloningProgress = 0; private float _cloningTime; public override void ExposeData(ObjectSerializer serializer) { base.ExposeData(serializer); serializer.DataField(ref _cloningTime, "cloningTime", 10f); } public override void Initialize() { base.Initialize(); if (UserInterface != null) { UserInterface.OnReceiveMessage += OnUiReceiveMessage; } _bodyContainer = ContainerManagerComponent.Ensure<ContainerSlot>($"{Name}-bodyContainer", Owner); //TODO: write this so that it checks for a change in power events for GORE POD cases var newState = GetUserInterfaceState(); UserInterface?.SetState(newState); UpdateUserInterface(); Owner.EntityManager.EventBus.SubscribeEvent<GhostComponent.GhostReturnMessage>(EventSource.Local, this, HandleGhostReturn); } public void Update(float frametime) { if (_bodyContainer.ContainedEntity != null && Powered) { _cloningProgress += frametime; _cloningProgress = MathHelper.Clamp(_cloningProgress, 0f, _cloningTime); } if (_cloningProgress >= _cloningTime && _bodyContainer.ContainedEntity != null && _capturedMind?.Session.AttachedEntity == _bodyContainer.ContainedEntity && Powered) { _bodyContainer.Remove(_bodyContainer.ContainedEntity); _capturedMind = null; _cloningProgress = 0f; _status = CloningPodStatus.Idle; UpdateAppearance(); } UpdateUserInterface(); } public override void OnRemove() { if (UserInterface != null) { UserInterface.OnReceiveMessage -= OnUiReceiveMessage; } Owner.EntityManager.EventBus.UnsubscribeEvent<GhostComponent.GhostReturnMessage>(EventSource.Local, this); base.OnRemove(); } private void UpdateUserInterface() { if (!Powered) return; UserInterface?.SetState(GetUserInterfaceState()); } private CloningPodBoundUserInterfaceState GetUserInterfaceState() { return new CloningPodBoundUserInterfaceState(CloningSystem.getIdToUser(), _cloningProgress, (_status == CloningPodStatus.Cloning)); } private void UpdateAppearance() { if (Owner.TryGetComponent(out AppearanceComponent? appearance)) { appearance.SetData(CloningPodVisuals.Status, _status); } } public void Activate(ActivateEventArgs eventArgs) { if (!Powered || !eventArgs.User.TryGetComponent(out IActorComponent? actor)) { return; } UserInterface?.Open(actor.playerSession); } private void OnUiReceiveMessage(ServerBoundUserInterfaceMessage obj) { if (!(obj.Message is CloningPodUiButtonPressedMessage message)) return; switch (message.Button) { case UiButton.Clone: if (message.ScanId == null) return; if (_bodyContainer.ContainedEntity != null || !CloningSystem.Minds.TryGetValue(message.ScanId.Value, out var mind)) { return; } var dead = mind.OwnedEntity.TryGetComponent<IDamageableComponent>(out var damageable) && damageable.CurrentDamageState == DamageState.Dead; if (!dead) return; var mob = _entityManager.SpawnEntity("HumanMob_Content", Owner.Transform.MapPosition); var client = _playerManager.GetSessionByUserId(mind.UserId!.Value); var profile = GetPlayerProfileAsync(client.UserId); mob.GetComponent<HumanoidAppearanceComponent>().UpdateFromProfile(profile); mob.Name = profile.Name; _bodyContainer.Insert(mob); _capturedMind = mind; Owner.EntityManager.EventBus.RaiseEvent(EventSource.Local, new CloningStartedMessage(_capturedMind)); _status = CloningPodStatus.NoMind; UpdateAppearance(); break; case UiButton.Eject: if (_bodyContainer.ContainedEntity == null || _cloningProgress < _cloningTime) break; _bodyContainer.Remove(_bodyContainer.ContainedEntity!); _capturedMind = null; _cloningProgress = 0f; _status = CloningPodStatus.Idle; UpdateAppearance(); break; default: throw new ArgumentOutOfRangeException(); } } public class CloningStartedMessage : EntitySystemMessage { public CloningStartedMessage(Mind capturedMind) { CapturedMind = capturedMind; } public Mind CapturedMind { get; } } private HumanoidCharacterProfile GetPlayerProfileAsync(NetUserId userId) { return (HumanoidCharacterProfile) _prefsManager.GetPreferences(userId).SelectedCharacter; } private void HandleGhostReturn(GhostComponent.GhostReturnMessage message) { if (message.Sender == _capturedMind) { //If the captured mind is in a ghost, we want to get rid of it. _capturedMind.VisitingEntity?.Delete(); //Transfer the mind to the new mob _capturedMind.TransferTo(_bodyContainer.ContainedEntity); _status = CloningPodStatus.Cloning; UpdateAppearance(); } } } }
35.012876
118
0.611915
[ "MIT" ]
AlphaQwerty/space-station-14
Content.Server/GameObjects/Components/Medical/CloningPodComponent.cs
8,160
C#
using UnityEngine; using System.Collections; public class Player : MonoBehaviour { public string playerName; void Start () { } void Update () { } }
9.823529
37
0.652695
[ "MIT" ]
hau5tastic/zombies
Assets/Scripts/Player.cs
169
C#
using System; namespace HunterPie.Core.LPlayer.Jobs { public class ChargeBladeEventArgs : EventArgs { public float VialChargeGauge; public float ShieldBuffTimer; public float SwordBuffTimer; public float PoweraxeTimer; public int Vials; public ChargeBladeEventArgs(ChargeBlade weapon) { VialChargeGauge = weapon.VialChargeGauge; ShieldBuffTimer = weapon.ShieldBuffTimer; SwordBuffTimer = weapon.SwordBuffTimer; PoweraxeTimer = weapon.PoweraxeTimer; Vials = weapon.Vials; } } public class ChargeBlade : Job { private float vialChargeGauge; private float shieldBuffTimer; private float swordBuffTimer; private int vials; private float poweraxeTimer; public float VialChargeGauge { get => vialChargeGauge; set { if (value > TimeSpan.MaxValue.TotalSeconds) return; if (value != vialChargeGauge) { vialChargeGauge = value; Dispatch(OnVialChargeGaugeChange); } } } public float ShieldBuffTimer { get => shieldBuffTimer; set { if (value > TimeSpan.MaxValue.TotalSeconds) return; if (value != shieldBuffTimer) { shieldBuffTimer = value; Dispatch(OnShieldBuffChange); } } } public float SwordBuffTimer { get => swordBuffTimer; set { if (value > TimeSpan.MaxValue.TotalSeconds) return; if (value != swordBuffTimer) { swordBuffTimer = value; Dispatch(OnSwordBuffChange); } } } public int Vials { get => vials; set { if (value != vials) { vials = value; Dispatch(OnVialsChange); } } } public float PoweraxeTimer { get => poweraxeTimer; set { if (value > TimeSpan.MaxValue.TotalSeconds) return; if (value != poweraxeTimer) { poweraxeTimer = value; Dispatch(OnPoweraxeBuffChange); } } } public override int SafijiivaMaxHits => 8; public delegate void ChargeBladeEvents(object source, ChargeBladeEventArgs args); public event ChargeBladeEvents OnVialChargeGaugeChange; public event ChargeBladeEvents OnShieldBuffChange; public event ChargeBladeEvents OnSwordBuffChange; public event ChargeBladeEvents OnVialsChange; public event ChargeBladeEvents OnPoweraxeBuffChange; private void Dispatch(ChargeBladeEvents e) => e?.Invoke(this, new ChargeBladeEventArgs(this)); } }
30.028302
102
0.514609
[ "MIT" ]
pedrodelapena/HunterPie
HunterPie/Core/LPlayer/Jobs/ChargeBlade.cs
3,185
C#
using System; namespace GuruComponents.Netrix.WebEditing.Elements { /// <summary> /// This enumaration is used to determine the rules between cells. /// </summary> /// <remarks> /// Rules are /// an HTML 4.0 feature to control lines between rows and columns separatly. /// The default value is "All", which is in effect the same behavior as "NotSet". /// </remarks> public enum RulesType { /// <summary> /// No rules set. Behavior inherited. /// </summary> NotSet = 0, /// <summary> /// No rules drawn. /// </summary> None = 1, /// <summary> /// Draw rules around column groups. /// </summary> Groups = 2, /// <summary> /// Draw rules for rows (horizontal). /// </summary> Rows = 3, /// <summary> /// Draw rules for columns (vertical). /// </summary> Cols = 4, /// <summary> /// Draw all rules (Default behavior). /// </summary> All = 5, } }
26.95
85
0.505566
[ "MIT" ]
andydunkel/netrix
Netrix2.0/NetRixMain/NetRix/WebEditing/Elements/Tables/RulesType_Enum.cs
1,078
C#
using System.Xml.Linq; namespace WixSharp.Bootstrapper { /// <summary> /// Defines a registry search based on WiX RegistrySearch element (Util Extension). /// </summary> /// <example>The following is an example of adding a UtilRegistrySearch fragment into a Bundle definition. /// <code> /// bootstrapper.AddWixFragment("Wix/Bundle", /// new UtilRegistrySearch /// { /// Root = RegistryHive.LocalMachine, /// Key = @"Key=SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full", /// Value = "Version", /// Result = SearchResult.exists, /// Variable = "Netfx4FullVersion" /// }); /// </code> /// </example> public class UtilRegistrySearch : WixObject, IXmlAware { /// <summary> /// Id of the search that this one should come after. /// </summary> [Xml] public string After; /// <summary> /// Condition for evaluating the search. If this evaluates to false, the search is not executed at all. /// </summary> [Xml] public string Condition; /// <summary> /// Key to search for. /// </summary> [Xml] public string Key; /// <summary> /// Optional value to search for under the given Key. /// </summary> [Xml] public string Value; /// <summary> /// Name of the variable in which to place the result of the search. /// </summary> [Xml] public string Variable; /// <summary> /// Registry root hive to search under. /// </summary> public RegistryHive Root; /// <summary> /// Instructs the search to look in the 64-bit registry when the value is 'yes'. When the value is 'no', the search looks in the 32-bit registry. The default value is 'no'. /// </summary> [Xml] public bool? Win64; /// <summary> /// Rather than saving the matching registry value into the variable, a RegistrySearch can save an attribute of the matching entry instead. This attribute's value must be one of the following: /// <para> /// <c>exists</c> - Saves true if a matching registry entry is found; false otherwise. /// </para> /// <c>value</c> - Saves the value of the registry key in the variable. This is the default. /// </summary> [Xml] public SearchResult? Result; /// <summary> /// Whether to expand any environment variables in REG_SZ, REG_EXPAND_SZ, or REG_MULTI_SZ values. /// </summary> [Xml] public bool? ExpandEnvironmentVariables; /// <summary> /// What format to return the value in. This attribute's value must be one of the following: /// <para> /// <c>raw</c> - Returns the unformatted value directly from the registry.For example, a REG_DWORD value of '1' is returned as '1', not '#1'.</para> /// <c>compatible</c> - Returns the value formatted as Windows Installer would.For example, a REG_DWORD value of '1' is returned as '#1', not '1'. /// </summary> [Xml] public SearchFormat? Format; /// <summary> /// Emits WiX XML. /// </summary> /// <returns></returns> public XElement ToXml() { return this.ToXElement(WixExtension.Util.ToXName("RegistrySearch")) .SetAttribute("Root", Root); } } }
37.029703
200
0.537701
[ "MIT" ]
Bajotumn/wixsharp
Source/src/WixSharp/Bootstrapper/UtilRegistrySearch.cs
3,740
C#
// Copyright 2005-2010 Gallio Project - http://www.gallio.org/ // Portions Copyright 2000-2004 Jonathan de Halleux // // Licensed 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.Runtime.Serialization; namespace Gallio.Runner { /// <summary> /// The type of exception thrown when the test runner or one of its /// supportive components like a test domain fails in an unrecoverable manner. /// </summary> /// <remarks> /// <para> /// It can happen that the test results will be lost or incomplete. /// </para> /// </remarks> [Serializable] public class RunnerException : Exception { /// <summary> /// Creates an exception. /// </summary> public RunnerException() { } /// <summary> /// Creates an exception. /// </summary> /// <param name="message">The message.</param> public RunnerException(string message) : base(message) { } /// <summary> /// Creates an exception. /// </summary> /// <param name="message">The message.</param> /// <param name="innerException">The inner exception.</param> public RunnerException(string message, Exception innerException) : base(message, innerException) { } /// <summary> /// Creates an exception from serialization info. /// </summary> /// <param name="info">The serialization info.</param> /// <param name="context">The streaming context.</param> protected RunnerException(SerializationInfo info, StreamingContext context) : base(info, context) { } } }
32.957143
84
0.598179
[ "ECL-2.0", "Apache-2.0" ]
Gallio/mbunit-v3
src/Gallio/Gallio/Runner/RunnerException.cs
2,307
C#
#region licence // ===================================================== // EfSchemeCompare Project - project to compare EF schema to SQL schema // Filename: Test44MockCompareEfChangeSql.cs // Date Created: 2016/04/06 // // Under the MIT License (MIT) // // Written by Jon Smith : GitHub JonPSmith, www.thereformedprogrammer.net // ===================================================== #endregion using System.Collections.Generic; using System.Linq; using CompareCore; using CompareCore.EFInfo; using CompareCore.SqlInfo; using NUnit.Framework; using Tests.Helpers; namespace Tests.UnitTests { public class Test44MockCompareEfChangeSql { [Test] public void Test01CompareSameMockDataOk() { //SETUP var efData = LoadJsonHelpers.DeserializeData<List<EfTableInfo>>("EfTableInfos01*.json"); var sqlData = LoadJsonHelpers.DeserializeData<SqlAllInfo>("SqlAllInfo01*.json"); var comparer = new EfCompare("SqlRefString", sqlData.TableInfos.ToDictionary(x => x.CombinedName)); //EXECUTE var status = comparer.CompareEfWithSql(efData, sqlData); //VERIFY status.ShouldBeValid(); } //------------------------------------------------- //Table errors [Test] public void Test05CompareMockDataChangeTableNameOk() { //SETUP var efData = LoadJsonHelpers.DeserializeData<List<EfTableInfo>>("EfTableInfos01*.json"); var sqlData = LoadJsonHelpers.DeserializeObjectWithSingleAlteration<SqlAllInfo>("SqlAllInfo01*.json", "NewDataName", "TableInfos", 0, "TableName"); var sqlInfoDict = sqlData.TableInfos.ToDictionary(x => x.CombinedName); var comparer = new EfCompare("SqlRefString", sqlInfoDict); //EXECUTE var status = comparer.CompareEfWithSql(efData, sqlData); //VERIFY status.ShouldBeValid(false); status.GetAllErrors().ShouldEqual("Missing Table: The SQL SqlRefString does not contain a table called [dbo].[DataTop]. Needed by EF class DataTop.\n" + "Missing SQL Table: Could not find the SQL table called [dbo].[DataTop].", status.GetAllErrors()); status.HasWarnings.ShouldEqual(false); sqlInfoDict.Keys.Count.ShouldEqual(1); sqlInfoDict.ContainsKey("[dbo].[NewDataName]").ShouldEqual(true); } //----------------------------------------------------- //column errors [Test] public void Test10CompareMockDataChangeColumnNameOk() { //SETUP var efData = LoadJsonHelpers.DeserializeData<List<EfTableInfo>>("EfTableInfos01*.json"); var sqlData = LoadJsonHelpers.DeserializeObjectWithSingleAlteration<SqlAllInfo>("SqlAllInfo01*.json", "BadColName", "TableInfos", 0, "ColumnInfos", 0, "ColumnName"); var comparer = new EfCompare("SqlRefString", sqlData.TableInfos.ToDictionary(x => x.CombinedName)); //EXECUTE var status = comparer.CompareEfWithSql(efData, sqlData); //VERIFY status.ShouldBeValid(false); status.GetAllErrors().ShouldEqual("Missing Column: The SQL SqlRefString table [dbo].[DataTop] does not contain a column called DataTopId. Needed by EF class DataTop.\n"+ "Missing Foreign Key: EF has a Many-to-One relationship between DataChild.Parent and DataTop but we don't find that in SQL.", status.GetAllErrors()); string.Join(",", status.Warnings).ShouldEqual("Warning: SQL SqlRefString table [dbo].[DataTop] has a column called BadColName (.NET type System.Int32) that EF does not access.", string.Join(",", status.Warnings)); } [Test] public void Test11CompareMockDataChangeColumnSqlTypeOk() { //SETUP var efData = LoadJsonHelpers.DeserializeData<List<EfTableInfo>>("EfTableInfos01*.json"); var sqlData = LoadJsonHelpers.DeserializeObjectWithSingleAlteration<SqlAllInfo>("SqlAllInfo01*.json", "bit", "TableInfos", 0, "ColumnInfos", 0, "SqlTypeName"); var comparer = new EfCompare("SqlRefString", sqlData.TableInfos.ToDictionary(x => x.CombinedName)); //EXECUTE var status = comparer.CompareEfWithSql(efData, sqlData); //VERIFY status.ShouldBeValid(false); status.GetAllErrors().ShouldEqual("Column Type: The SQL SqlRefString column [dbo].[DataTop].DataTopId type does not match EF. SQL type = bit, EF type = int.", status.GetAllErrors()); status.HasWarnings.ShouldEqual(false, string.Join(",", status.Warnings)); } [Test] public void Test12CompareMockDataChangePrimaryKeyOk() { //SETUP var efData = LoadJsonHelpers.DeserializeData<List<EfTableInfo>>("EfTableInfos01*.json"); var sqlData = LoadJsonHelpers.DeserializeObjectWithSingleAlteration<SqlAllInfo>("SqlAllInfo01*.json", false, "TableInfos", 0, "ColumnInfos", 0, "IsPrimaryKey"); var comparer = new EfCompare("SqlRefString", sqlData.TableInfos.ToDictionary(x => x.CombinedName)); //EXECUTE var status = comparer.CompareEfWithSql(efData, sqlData); //VERIFY status.ShouldBeValid(false); status.GetAllErrors().ShouldEqual("Primary Key: The SQL SqlRefString column [dbo].[DataTop].DataTopId primary key settings don't match. SQL says it is NOT a key, EF says it is a key.\n"+ "Missing Foreign Key: EF has a Many-to-One relationship between DataChild.Parent and DataTop but we don't find that in SQL.", status.GetAllErrors()); status.HasWarnings.ShouldEqual(false, string.Join(",", status.Warnings)); } [Test] public void Test13CompareMockDataChangePrimaryKeyOrderOk() { //SETUP var efData = LoadJsonHelpers.DeserializeData<List<EfTableInfo>>("EfTableInfos01*.json"); var sqlData = LoadJsonHelpers.DeserializeObjectWithSingleAlteration<SqlAllInfo>("SqlAllInfo01*.json", 2, "TableInfos", 0, "ColumnInfos", 0, "PrimaryKeyOrder"); var comparer = new EfCompare("SqlRefString", sqlData.TableInfos.ToDictionary(x => x.CombinedName)); //EXECUTE var status = comparer.CompareEfWithSql(efData, sqlData); //VERIFY status.ShouldBeValid(false); status.GetAllErrors().ShouldEqual("Primary Key Order: The SQL SqlRefString column [dbo].[DataTop].DataTopId primary key order does not match. SQL order = 2, EF order = 1.", status.GetAllErrors()); status.HasWarnings.ShouldEqual(false, string.Join(",", status.Warnings)); } [Test] public void Test14CompareMockDataChangeIsNullableOk() { //SETUP var efData = LoadJsonHelpers.DeserializeData<List<EfTableInfo>>("EfTableInfos01*.json"); var sqlData = LoadJsonHelpers.DeserializeObjectWithSingleAlteration<SqlAllInfo>("SqlAllInfo01*.json", true, "TableInfos", 0, "ColumnInfos", 0, "IsNullable"); var comparer = new EfCompare("SqlRefString", sqlData.TableInfos.ToDictionary(x => x.CombinedName)); //EXECUTE var status = comparer.CompareEfWithSql(efData, sqlData); //VERIFY status.ShouldBeValid(false); status.GetAllErrors().ShouldEqual("Column Nullable: SQL SqlRefString column [dbo].[DataTop].DataTopId nullablity does not match. SQL is NULL, EF is NOT NULL.", status.GetAllErrors()); status.HasWarnings.ShouldEqual(false, string.Join(",", status.Warnings)); } [Test] public void Test15CompareMockDataChangeMaxLengthOk() { //SETUP var efData = LoadJsonHelpers.DeserializeData<List<EfTableInfo>>("EfTableInfos01*.json"); var sqlData = LoadJsonHelpers.DeserializeObjectWithSingleAlteration<SqlAllInfo>("SqlAllInfo01*.json", 2, "TableInfos", 0, "ColumnInfos", 0, "MaxLength"); var comparer = new EfCompare("SqlRefString", sqlData.TableInfos.ToDictionary(x => x.CombinedName)); //EXECUTE var status = comparer.CompareEfWithSql(efData, sqlData); //VERIFY status.ShouldBeValid(false); status.GetAllErrors().ShouldEqual("MaxLength: The SQL SqlRefString column [dbo].[DataTop].DataTopId, type System.Int32, length does not match EF. SQL length = 2, EF length = 4.", status.GetAllErrors()); status.HasWarnings.ShouldEqual(false, string.Join(",", status.Warnings)); } [Test] public void Test15CompareMockDataChangeMaxLengthMaxLengthSqlOk() { //SETUP var efData = LoadJsonHelpers.DeserializeData<List<EfTableInfo>>("EfTableInfos01*.json"); var sqlData = LoadJsonHelpers.DeserializeObjectWithSingleAlteration<SqlAllInfo>("SqlAllInfo01*.json", -1, "TableInfos", 0, "ColumnInfos", 0, "MaxLength"); var comparer = new EfCompare("SqlRefString", sqlData.TableInfos.ToDictionary(x => x.CombinedName)); //EXECUTE var status = comparer.CompareEfWithSql(efData, sqlData); //VERIFY status.ShouldBeValid(); status.HasWarnings.ShouldEqual(true); string.Join(",", status.Warnings).ShouldEqual("Warning: MaxLength: The SQL SqlRefString column [dbo].[DataTop].DataTopId, type System.Int32, is at max length, but EF length is at 4."); } [Test] public void Test16CompareMockDataRemoveColumnInToBeCheckedOk() { //SETUP var efData = LoadJsonHelpers.DeserializeData<List<EfTableInfo>>("EfTableInfos01*.json"); var sqlData = LoadJsonHelpers.DeserializeObjectWithSingleRemoval<SqlAllInfo>("SqlAllInfo01*.json", "TableInfos", 0, "ColumnInfos", 0); var comparer = new EfCompare("SqlRefString", sqlData.TableInfos.ToDictionary(x => x.CombinedName)); //EXECUTE var status = comparer.CompareEfWithSql(efData, sqlData); //VERIFY status.ShouldBeValid(false); status.GetAllErrors().ShouldEqual("Missing Column: The SQL SqlRefString table [dbo].[DataTop] does not contain a column called DataTopId. Needed by EF class DataTop.\n"+ "Missing Foreign Key: EF has a Many-to-One relationship between DataChild.Parent and DataTop but we don't find that in SQL.", status.GetAllErrors()); status.HasWarnings.ShouldEqual(false, string.Join(",", status.Warnings)); } //-------------------------------------------------- //foreign key errors [Test] public void Test20CompareMockDataChangeForeignKeyParentTableNameOk() { //SETUP var efData = LoadJsonHelpers.DeserializeData<List<EfTableInfo>>("EfTableInfos01*.json"); var sqlData = LoadJsonHelpers.DeserializeObjectWithSingleAlteration<SqlAllInfo>("SqlAllInfo01*.json", "BadName", "ForeignKeys", 0, "ParentTableName"); var comparer = new EfCompare("SqlRefString", sqlData.TableInfos.ToDictionary(x => x.CombinedName)); //EXECUTE var status = comparer.CompareEfWithSql(efData, sqlData); //VERIFY status.ShouldBeValid(false); status.GetAllErrors().ShouldEqual("Missing Foreign Key: EF has a Many-to-One relationship between DataChild.Parent and DataTop but we don't find that in SQL.", status.GetAllErrors()); status.HasWarnings.ShouldEqual(false, string.Join(",", status.Warnings)); } [Ignore("CompareEfWithSql will NOT catch this error")] [Test] public void Test21CompareMockDataChangeForeignKeyParentColNameOk() { //SETUP var efData = LoadJsonHelpers.DeserializeData<List<EfTableInfo>>("EfTableInfos01*.json"); var sqlData = LoadJsonHelpers.DeserializeObjectWithSingleAlteration<SqlAllInfo>("SqlAllInfo01*.json", "BadName", "ForeignKeys", 0, "ParentColName"); var comparer = new EfCompare("SqlRefString", sqlData.TableInfos.ToDictionary(x => x.CombinedName)); //EXECUTE var status = comparer.CompareEfWithSql(efData, sqlData); //VERIFY status.ShouldBeValid(false); status.GetAllErrors().ShouldEqual("Missing Foreign key: The 'RefUnitTest' SQL database has a foreign key Parent: DataChild.DataTopId, Referenced: DataTop.DataTopId, which is missing in the 'ToBeCheckUnitTest' database.", status.GetAllErrors()); string.Join(",", status.Warnings).ShouldEqual("Warning: The 'ToBeCheckUnitTest' database has a foreign key Parent: DataChild.BadName, Referenced: DataTop.DataTopId, which the 'RefUnitTest' database did not have.", string.Join(",", status.Warnings)); } [Test] public void Test22CompareMockDataChangeForeignKeyReferencedTableNameOk() { //SETUP var efData = LoadJsonHelpers.DeserializeData<List<EfTableInfo>>("EfTableInfos01*.json"); var sqlData = LoadJsonHelpers.DeserializeObjectWithSingleAlteration<SqlAllInfo>("SqlAllInfo01*.json", "BadName", "ForeignKeys", 0, "ReferencedTableName"); var comparer = new EfCompare("SqlRefString", sqlData.TableInfos.ToDictionary(x => x.CombinedName)); //EXECUTE var status = comparer.CompareEfWithSql(efData, sqlData); //VERIFY status.ShouldBeValid(false); status.GetAllErrors().ShouldEqual("Missing Foreign Key: EF has a Many-to-One relationship between DataChild.Parent and DataTop but we don't find that in SQL.", status.GetAllErrors()); status.HasWarnings.ShouldEqual(false, string.Join(",", status.Warnings)); } [Test] public void Test23CompareMockDataChangeForeignKeyReferencedColNameOk() { //SETUP var efData = LoadJsonHelpers.DeserializeData<List<EfTableInfo>>("EfTableInfos01*.json"); var sqlData = LoadJsonHelpers.DeserializeObjectWithSingleAlteration<SqlAllInfo>("SqlAllInfo01*.json", "BadName", "ForeignKeys", 0, "ReferencedColName"); var comparer = new EfCompare("SqlRefString", sqlData.TableInfos.ToDictionary(x => x.CombinedName)); //EXECUTE var status = comparer.CompareEfWithSql(efData, sqlData); //VERIFY status.ShouldBeValid(false); status.GetAllErrors().ShouldEqual("Missing Foreign Key: EF has a Many-to-One relationship between DataChild.Parent and DataTop but we don't find that in SQL.", status.GetAllErrors()); status.HasWarnings.ShouldEqual(false, string.Join(",", status.Warnings)); } [Test] public void Test24CompareMockDataChangeForeignKeyReferencedColNameOk() { //SETUP var efData = LoadJsonHelpers.DeserializeData<List<EfTableInfo>>("EfTableInfos01*.json"); var sqlData = LoadJsonHelpers.DeserializeObjectWithSingleAlteration<SqlAllInfo>("SqlAllInfo01*.json", "BadName", "ForeignKeys", 0, "DeleteAction"); var comparer = new EfCompare("SqlRefString", sqlData.TableInfos.ToDictionary(x => x.CombinedName)); //EXECUTE var status = comparer.CompareEfWithSql(efData, sqlData); //VERIFY status.ShouldBeValid(false); status.GetAllErrors().ShouldEqual("Cascade Delete: The Many-to-One relationship between DataChild.Parent and DataTop has different cascase delete value. SQL foreign key say BadName, EF setting is CASCADE.", status.GetAllErrors()); status.HasWarnings.ShouldEqual(false, string.Join(",", status.Warnings)); } // status.GetAllErrors().ShouldEqual("Missing Index: The 'RefUnitTest' SQL database has an index [dbo].[DataChild].DataTopId: (not primary key, not clustered, not unique), which is missing in the 'ToBeCheckUnitTest' database.", status.GetAllErrors()); // status.ShouldBeValid(false); // //VERIFY // var status = comparer.CompareEfWithSql(efData, sqlData); // //EXECUTE // var sqlData = LoadJsonHelpers.DeserializeObjectWithSingleAlteration<SqlAllInfo>("SqlAllInfo01*.json", "BadName", "Indexes", 0, "TableName"); // var efData = LoadJsonHelpers.DeserializeData<List<EfTableInfo>>("EfTableInfos01*.json"); // var comparer = new EfCompare("SqlRefString",""); // //SETUP //{ //public void Test30CompareMockDataChangeIndexTableNameOk() //[Test] //!!NOT IMPLEMENTED YET //Indexes //------------------------------------------- // string.Join(",", status.Warnings).ShouldEqual("Warning: The 'ToBeCheckUnitTest' database has an index [dbo].[BadName].DataTopId: (not primary key, not clustered, not unique), which the 'RefUnitTest' database did not have.", string.Join(",", status.Warnings)); //} //[Test] //public void Test31CompareMockDataChangeIndexColumnNameOk() //{ // //SETUP // var comparer = new EfCompare("SqlRefString",""); // var efData = LoadJsonHelpers.DeserializeData<List<EfTableInfo>>("EfTableInfos01*.json"); // var sqlData = LoadJsonHelpers.DeserializeObjectWithSingleAlteration<SqlAllInfo>("SqlAllInfo01*.json", "BadName", "Indexes", 0, "ColumnName"); // //EXECUTE // var status = comparer.CompareEfWithSql(efData, sqlData); // //VERIFY // status.ShouldBeValid(false); // status.GetAllErrors().ShouldEqual("Missing Index: The 'RefUnitTest' SQL database has an index [dbo].[DataChild].DataTopId: (not primary key, not clustered, not unique), which is missing in the 'ToBeCheckUnitTest' database.", status.GetAllErrors()); // string.Join(",", status.Warnings).ShouldEqual("Warning: The 'ToBeCheckUnitTest' database has an index [dbo].[DataChild].BadName: (not primary key, not clustered, not unique), which the 'RefUnitTest' database did not have.", string.Join(",", status.Warnings)); //} //[Test] //public void Test32CompareMockDataChangeIndexIsPrimaryIndexOk() //{ // //SETUP // var comparer = new EfCompare("SqlRefString",""); // var efData = LoadJsonHelpers.DeserializeData<List<EfTableInfo>>("EfTableInfos01*.json"); // var sqlData = LoadJsonHelpers.DeserializeObjectWithSingleAlteration<SqlAllInfo>("SqlAllInfo01*.json", true, "Indexes", 0, "IsPrimaryIndex"); // //EXECUTE // var status = comparer.CompareEfWithSql(efData, sqlData); // //VERIFY // status.ShouldBeValid(false); // status.GetAllErrors().ShouldEqual("Index Mismatch: The 'RefUnitTest' SQL database, the index on [dbo].[DataChild].DataTopId is NOT a primary key index, while the index on the same table.column in SQL database ToBeCheckUnitTest is a primary key index.", status.GetAllErrors()); // status.HasWarnings.ShouldEqual(false, string.Join(",", status.Warnings)); //} //[Test] //public void Test33CompareMockDataChangeIndexClusteredOk() //{ // //SETUP // var comparer = new EfCompare("SqlRefString",""); // var efData = LoadJsonHelpers.DeserializeData<List<EfTableInfo>>("EfTableInfos01*.json"); // var sqlData = LoadJsonHelpers.DeserializeObjectWithSingleAlteration<SqlAllInfo>("SqlAllInfo01*.json", true, "Indexes", 0, "Clustered"); // //EXECUTE // var status = comparer.CompareEfWithSql(efData, sqlData); // //VERIFY // status.ShouldBeValid(false); // status.GetAllErrors().ShouldEqual("Index Mismatch: The 'RefUnitTest' SQL database, the index on [dbo].[DataChild].DataTopId is NOT clustered, while the index on the same table.column in SQL database ToBeCheckUnitTest is clustered.", status.GetAllErrors()); // status.HasWarnings.ShouldEqual(false, string.Join(",", status.Warnings)); //} //[Test] //public void Test34CompareMockDataChangeIndexIsUniqueOk() //{ // //SETUP // var comparer = new EfCompare("SqlRefString",""); // var efData = LoadJsonHelpers.DeserializeData<List<EfTableInfo>>("EfTableInfos01*.json"); // var sqlData = LoadJsonHelpers.DeserializeObjectWithSingleAlteration<SqlAllInfo>("SqlAllInfo01*.json", true, "Indexes", 0, "IsUnique"); // //EXECUTE // var status = comparer.CompareEfWithSql(efData, sqlData); // //VERIFY // status.ShouldBeValid(false); // status.GetAllErrors().ShouldEqual("Index Mismatch: The 'RefUnitTest' SQL database, index on [dbo].[DataChild].DataTopId is NOT unique, while the index on the same table.column in SQL database ToBeCheckUnitTest is unique.", status.GetAllErrors()); // status.HasWarnings.ShouldEqual(false, string.Join(",", status.Warnings)); //} //[Test] //public void Test35CompareMockDataChangeIndexRemoveNonPrimaryKeyInSetOk() //{ // //SETUP // var comparer = new EfCompare("SqlRefString",""); // var efData = LoadJsonHelpers.DeserializeData<List<EfTableInfo>>("EfTableInfos01*.json"); // var sqlData = LoadJsonHelpers.DeserializeObjectWithSingleRemoval<SqlAllInfo>("SqlAllInfo01*.json", "Indexes", 0); // //EXECUTE // var status = comparer.CompareEfWithSql(efData, sqlData); // //VERIFY // status.ShouldBeValid(false); // status.GetAllErrors().ShouldEqual("Missing Index: The 'RefUnitTest' SQL database has an index [dbo].[DataChild].DataTopId: (not primary key, not clustered, not unique), which is missing in the 'ToBeCheckUnitTest' database.", status.GetAllErrors()); // status.HasWarnings.ShouldEqual(false, string.Join(",", status.Warnings)); //} //[Test] //public void Test36CompareMockDataChangeIndexRemovePrimaryKeyInSetOk() //{ // //SETUP // var comparer = new EfCompare("SqlRefString",""); // var efData = LoadJsonHelpers.DeserializeData<List<EfTableInfo>>("EfTableInfos01*.json"); // var sqlData = LoadJsonHelpers.DeserializeObjectWithSingleRemoval<SqlAllInfo>("SqlAllInfo01*.json", "Indexes", 1); // //EXECUTE // var status = comparer.CompareEfWithSql(efData, sqlData); // //VERIFY // status.ShouldBeValid(false); // status.GetAllErrors().ShouldEqual("Missing Index: The 'RefUnitTest' SQL database has an index [dbo].[DataChild].DataChildId: (primary key, clustered, unique), which is missing in the 'ToBeCheckUnitTest' database.", status.GetAllErrors()); // status.HasWarnings.ShouldEqual(false, string.Join(",", status.Warnings)); //} } }
55.254762
290
0.643427
[ "MIT" ]
britebit/EfSchemaCompare
Tests/UnitTests/Test44MockCompareEfChangeSql.cs
23,209
C#
using System; using System.Text; using Microsoft.Extensions.Logging; using Xunit.Abstractions; namespace Http2Tests { /// <summary> /// A logger implementation that writes to the XUnit Test output /// </summary> public class XUnitOutputLogger : ILogger { private static readonly object _lock = new object(); private static readonly string _loglevelPadding = ": "; private static readonly string _newLineWithMessagePadding = Environment.NewLine + " "; private ITestOutputHelper _outputHelper; private string _name; private Func<string, LogLevel, bool> _filter; private bool _includeScopes; private System.Diagnostics.Stopwatch _sw; [ThreadStatic] private static StringBuilder _logBuilder; public XUnitOutputLogger( string name, Func<string, LogLevel, bool> filter, bool includeScopes, ITestOutputHelper outputHelper) { if (name == null) { throw new ArgumentNullException(nameof(name)); } _name = name; _filter = filter; _includeScopes = includeScopes; _outputHelper = outputHelper; _sw = new System.Diagnostics.Stopwatch(); _sw.Start(); } public void Log<TState>( LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter) { if (!IsEnabled(logLevel)) { return; } if (formatter == null) { throw new ArgumentNullException(nameof(formatter)); } var message = formatter(state, exception); if (!string.IsNullOrEmpty(message) || exception != null) { WriteMessage(logLevel, _name, eventId.Id, message, exception); } } public virtual void WriteMessage( LogLevel logLevel, string logName, int eventId, string message, Exception exception) { var logBuilder = _logBuilder; _logBuilder = null; if (logBuilder == null) { logBuilder = new StringBuilder(); } // Example: // INFO: ConsoleApp.Program[10] // Request received if (!string.IsNullOrEmpty(message)) { logBuilder.Append(_sw.ElapsedMilliseconds); logBuilder.Append(" "); logBuilder.Append(GetLogLevelString(logLevel)); logBuilder.Append(_loglevelPadding); logBuilder.Append(logName); logBuilder.Append("["); logBuilder.Append(eventId); logBuilder.AppendLine("]"); if (_includeScopes) { GetScopeInformation(logBuilder); } var len = logBuilder.Length; logBuilder.Append(message); logBuilder.Replace( Environment.NewLine, _newLineWithMessagePadding, len, message.Length); } // Example: // System.InvalidOperationException // at Namespace.Class.Function() in File:line X if (exception != null) { // exception message if (!string.IsNullOrEmpty(message)) { logBuilder.AppendLine(); } logBuilder.Append(exception.ToString()); } if (logBuilder.Length > 0) { var logMessage = logBuilder.ToString(); lock (_lock) { _outputHelper.WriteLine(logMessage); } } logBuilder.Clear(); if (logBuilder.Capacity > 1024) { logBuilder.Capacity = 1024; } _logBuilder = logBuilder; } public bool IsEnabled(LogLevel logLevel) { if (_filter == null) return true; return _filter(_name, logLevel); } public class NullDisposeable : IDisposable { public void Dispose() { } public static IDisposable Instance { get; } = new NullDisposeable(); } public IDisposable BeginScope<TState>(TState state) { if (state == null) { throw new ArgumentNullException(nameof(state)); } return NullDisposeable.Instance; } private static string GetLogLevelString(LogLevel logLevel) { switch (logLevel) { case LogLevel.Trace: return "trce"; case LogLevel.Debug: return "dbug"; case LogLevel.Information: return "info"; case LogLevel.Warning: return "warn"; case LogLevel.Error: return "fail"; case LogLevel.Critical: return "crit"; default: throw new ArgumentOutOfRangeException(nameof(logLevel)); } } private void GetScopeInformation(StringBuilder builder) { } } public class XUnitOutputLoggerProvider : ILoggerProvider { private readonly ITestOutputHelper outputHelper; private int instanceId = 0; private static readonly bool XUnitLoggingEnabled = true; public XUnitOutputLoggerProvider(ITestOutputHelper outputHelper) { this.outputHelper = outputHelper; } public void Dispose() { } public ILogger CreateLogger(string categoryName) { if (XUnitLoggingEnabled) { var instId = System.Threading.Interlocked.Increment(ref instanceId); return new XUnitOutputLogger(categoryName, null, false, outputHelper); } return null; } } }
29.771028
99
0.509967
[ "MIT" ]
DotNetUz/http2dotnet
Http2Tests/XUnitOutputLogger.cs
6,371
C#
using NeteaseCloudMusic.Global.Model; using NeteaseCloudMusic.Wpf.Model; using Prism.Commands; using Prism.Events; using Prism.Interactivity.InteractionRequest; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; namespace NeteaseCloudMusic.Wpf { public static class Context { /// <summary> /// 当前的区域名 /// </summary> public const string RegionName = "MainRegion"; //public const string SupportFileExtension = "*.mp3|*.flac|*.cs"; public const string SupportFileExtension = "*.mp3|"; /// <summary> /// 每页请求的数据限制 /// </summary> public const int LimitPerPage = 30; /// <summary> /// 当前正在播放的歌曲列表 /// </summary> public static ObservableCollection<Music> CurrentPlayMusics { get; } = new ObservableCollection<Music>(); /// <summary> /// 表示播放的命令 /// </summary> public static CompositeCommand PlayCommand { get; } = new CompositeCommand(); /// <summary> /// 表示暂停的命令 /// </summary> public static CompositeCommand PauseCommand { get; } = new CompositeCommand(); /// <summary> /// 表示下一个的命令 /// </summary> public static CompositeCommand NextTrackCommand { get; } = new CompositeCommand(); /// <summary> /// 代表上一个的命令 /// </summary> public static CompositeCommand PrevTrackCommand { get; } = new CompositeCommand(); public static InteractionRequest<Notification> AutoDisplayPopupRequest { get; } = new InteractionRequest<Notification>(); } /// <summary> /// 当当前播放音乐发生变化的聚合事件参数 /// </summary> public class CurrentPlayMusicChangeEventArgs: PubSubEvent<Music> { } }
30.75
129
0.626016
[ "Apache-2.0" ]
trycatchfinnally/NeteaseCloudMusic
NetEasy/NeteaseCloudMusic.Wpf/Context.cs
1,995
C#
/// MIT License /// Copyright © 2021 pmcgoohan /// 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. using System; namespace AlexLatencyWindow { /// <summary> /// Written to support the thesis in 'Targeting Zero MEV - A Content Layer Solution' that randomizing transaction order within the latency width of a trustless network is as fair as any single honest node's view of the transaction order. /// /// For an explanation, consider this idealized view of the network: /// - Nodes are equally distributed around the world and latency is linear to the geographic distance between two nodes. /// - Each node sends one transaction to the pool over a 10 second period. /// - In this model we know precisely when each transaction was sent (in the real world this is impossible to know with zero trust). /// - For each node and each transaction we compare the node's view of the transaction timestamp (arrival time) with the objective view (send time). /// - We then calculate the mean and standard deviation of the error term. /// - This tells us how accurately any node can know the true objective transaction order. /// </summary> class Program { // parameter constants (you can fiddle with these) const int GlobalNodeWidthHeight = 100; // width and height of the world in nodes const double GlobalLatencyMs = 1000; // max latency between the two furthest nodes const double TxnSendWindowMs = 10000; // the maximum age of every transaction sent in the mempool // derived constants const double LatencyStepMs = GlobalLatencyMs / GlobalNodeWidthHeight; // ms latency between adjacent nodes const int GlobalTotalNodes = GlobalNodeWidthHeight * GlobalNodeWidthHeight; // the count of all nodes in the world const double TxnSendStepMs = TxnSendWindowMs / GlobalTotalNodes; static void Main(string[] args) { IdealizedLatencyWindow(); Console.WriteLine("press any key to exit"); Console.ReadKey(); } static void IdealizedLatencyWindow() { int txnNum = 0; double sumError = 0; double sumErrorCount = 0; double sumErrorSquared = 0; // send a transaction for for each node for (int x = 0; x < GlobalNodeWidthHeight; x++) { for (int y = 0; y < GlobalNodeWidthHeight; y++) { // space our transaction sends out to fill the transaction send width double txnSendTimestampMs = txnNum * TxnSendStepMs; // send time (objective) // and see when it arrives at each other node for (int x2 = 0; x2 < GlobalNodeWidthHeight; x2++) { for (int y2 = 0; y2 < GlobalNodeWidthHeight; y2++) { // ignore yourself if (x == x2 && y == y2) continue; // calculate the distance between this node and the originator double b = Math.Abs(x2 - x); double p = Math.Abs(y2 - y); double d = Math.Sqrt(b * b + p * p); // pythagoras's theorem // convert distance into latency double latencyMs = d * LatencyStepMs; // recieve time (subjective) double txnRecieveTimestampMs = txnSendTimestampMs + latencyMs; // error term (here is our proof that the error term is equivalent to latency- so let's spell it out) double error = txnRecieveTimestampMs - txnSendTimestampMs; sumError += error; sumErrorCount++; sumErrorSquared += error * error; } } // next transaction txnNum++; } } double avgErr = sumError / sumErrorCount; double variance = sumErrorSquared / sumErrorCount; double stdevErr = (double)Math.Sqrt((double)variance); Console.WriteLine("error term of each node's view of every transaction timestamp:", sumError / sumErrorCount); Console.WriteLine("avg error = {0} ms", avgErr); Console.WriteLine("stdev error = {0} ms", stdevErr); Console.WriteLine("avg + stddev = {0} ms <<< true timestamps are unknowable within this time", GlobalLatencyMs); Console.WriteLine("latency width = {0} ms <<< the above is equivalent to the latency width", GlobalLatencyMs); Console.WriteLine("which is proof that randomizing transaction order within the latency width of a trustless network is as fair as any single honest node's view of the transaction order"); } } }
61.12
465
0.610929
[ "MIT" ]
pmcgoohan/alex-latency-width
Program.cs
6,115
C#
#pragma warning disable 1591 //------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ [assembly: global::Android.Runtime.ResourceDesignerAttribute("MDHandbookApp.Droid.Resource", IsApplication=true)] namespace MDHandbookApp.Droid { [System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")] public partial class Resource { static Resource() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); } public static void UpdateIdValues() { global::Splat.Resource.String.library_name = global::MDHandbookApp.Droid.Resource.String.library_name; global::Xamarin.Forms.Platform.Android.Resource.Attribute.actionBarSize = global::MDHandbookApp.Droid.Resource.Attribute.actionBarSize; } public partial class Animation { // aapt resource value: 0x7f040000 public const int abc_fade_in = 2130968576; // aapt resource value: 0x7f040001 public const int abc_fade_out = 2130968577; // aapt resource value: 0x7f040002 public const int abc_grow_fade_in_from_bottom = 2130968578; // aapt resource value: 0x7f040003 public const int abc_popup_enter = 2130968579; // aapt resource value: 0x7f040004 public const int abc_popup_exit = 2130968580; // aapt resource value: 0x7f040005 public const int abc_shrink_fade_out_from_bottom = 2130968581; // aapt resource value: 0x7f040006 public const int abc_slide_in_bottom = 2130968582; // aapt resource value: 0x7f040007 public const int abc_slide_in_top = 2130968583; // aapt resource value: 0x7f040008 public const int abc_slide_out_bottom = 2130968584; // aapt resource value: 0x7f040009 public const int abc_slide_out_top = 2130968585; // aapt resource value: 0x7f04000a public const int design_bottom_sheet_slide_in = 2130968586; // aapt resource value: 0x7f04000b public const int design_bottom_sheet_slide_out = 2130968587; // aapt resource value: 0x7f04000c public const int design_fab_in = 2130968588; // aapt resource value: 0x7f04000d public const int design_fab_out = 2130968589; // aapt resource value: 0x7f04000e public const int design_snackbar_in = 2130968590; // aapt resource value: 0x7f04000f public const int design_snackbar_out = 2130968591; static Animation() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); } private Animation() { } } public partial class Attribute { // aapt resource value: 0x7f010004 public const int MediaRouteControllerWindowBackground = 2130771972; // aapt resource value: 0x7f010061 public const int actionBarDivider = 2130772065; // aapt resource value: 0x7f010062 public const int actionBarItemBackground = 2130772066; // aapt resource value: 0x7f01005b public const int actionBarPopupTheme = 2130772059; // aapt resource value: 0x7f010060 public const int actionBarSize = 2130772064; // aapt resource value: 0x7f01005d public const int actionBarSplitStyle = 2130772061; // aapt resource value: 0x7f01005c public const int actionBarStyle = 2130772060; // aapt resource value: 0x7f010057 public const int actionBarTabBarStyle = 2130772055; // aapt resource value: 0x7f010056 public const int actionBarTabStyle = 2130772054; // aapt resource value: 0x7f010058 public const int actionBarTabTextStyle = 2130772056; // aapt resource value: 0x7f01005e public const int actionBarTheme = 2130772062; // aapt resource value: 0x7f01005f public const int actionBarWidgetTheme = 2130772063; // aapt resource value: 0x7f01007b public const int actionButtonStyle = 2130772091; // aapt resource value: 0x7f010077 public const int actionDropDownStyle = 2130772087; // aapt resource value: 0x7f0100c9 public const int actionLayout = 2130772169; // aapt resource value: 0x7f010063 public const int actionMenuTextAppearance = 2130772067; // aapt resource value: 0x7f010064 public const int actionMenuTextColor = 2130772068; // aapt resource value: 0x7f010067 public const int actionModeBackground = 2130772071; // aapt resource value: 0x7f010066 public const int actionModeCloseButtonStyle = 2130772070; // aapt resource value: 0x7f010069 public const int actionModeCloseDrawable = 2130772073; // aapt resource value: 0x7f01006b public const int actionModeCopyDrawable = 2130772075; // aapt resource value: 0x7f01006a public const int actionModeCutDrawable = 2130772074; // aapt resource value: 0x7f01006f public const int actionModeFindDrawable = 2130772079; // aapt resource value: 0x7f01006c public const int actionModePasteDrawable = 2130772076; // aapt resource value: 0x7f010071 public const int actionModePopupWindowStyle = 2130772081; // aapt resource value: 0x7f01006d public const int actionModeSelectAllDrawable = 2130772077; // aapt resource value: 0x7f01006e public const int actionModeShareDrawable = 2130772078; // aapt resource value: 0x7f010068 public const int actionModeSplitBackground = 2130772072; // aapt resource value: 0x7f010065 public const int actionModeStyle = 2130772069; // aapt resource value: 0x7f010070 public const int actionModeWebSearchDrawable = 2130772080; // aapt resource value: 0x7f010059 public const int actionOverflowButtonStyle = 2130772057; // aapt resource value: 0x7f01005a public const int actionOverflowMenuStyle = 2130772058; // aapt resource value: 0x7f0100cb public const int actionProviderClass = 2130772171; // aapt resource value: 0x7f0100ca public const int actionViewClass = 2130772170; // aapt resource value: 0x7f010083 public const int activityChooserViewStyle = 2130772099; // aapt resource value: 0x7f0100a6 public const int alertDialogButtonGroupStyle = 2130772134; // aapt resource value: 0x7f0100a7 public const int alertDialogCenterButtons = 2130772135; // aapt resource value: 0x7f0100a5 public const int alertDialogStyle = 2130772133; // aapt resource value: 0x7f0100a8 public const int alertDialogTheme = 2130772136; // aapt resource value: 0x7f0100ba public const int allowStacking = 2130772154; // aapt resource value: 0x7f0100c1 public const int arrowHeadLength = 2130772161; // aapt resource value: 0x7f0100c2 public const int arrowShaftLength = 2130772162; // aapt resource value: 0x7f0100ad public const int autoCompleteTextViewStyle = 2130772141; // aapt resource value: 0x7f010032 public const int background = 2130772018; // aapt resource value: 0x7f010034 public const int backgroundSplit = 2130772020; // aapt resource value: 0x7f010033 public const int backgroundStacked = 2130772019; // aapt resource value: 0x7f0100f5 public const int backgroundTint = 2130772213; // aapt resource value: 0x7f0100f6 public const int backgroundTintMode = 2130772214; // aapt resource value: 0x7f0100c3 public const int barLength = 2130772163; // aapt resource value: 0x7f0100fb public const int behavior_hideable = 2130772219; // aapt resource value: 0x7f010121 public const int behavior_overlapTop = 2130772257; // aapt resource value: 0x7f0100fa public const int behavior_peekHeight = 2130772218; // aapt resource value: 0x7f010117 public const int borderWidth = 2130772247; // aapt resource value: 0x7f010080 public const int borderlessButtonStyle = 2130772096; // aapt resource value: 0x7f010111 public const int bottomSheetDialogTheme = 2130772241; // aapt resource value: 0x7f010112 public const int bottomSheetStyle = 2130772242; // aapt resource value: 0x7f01007d public const int buttonBarButtonStyle = 2130772093; // aapt resource value: 0x7f0100ab public const int buttonBarNegativeButtonStyle = 2130772139; // aapt resource value: 0x7f0100ac public const int buttonBarNeutralButtonStyle = 2130772140; // aapt resource value: 0x7f0100aa public const int buttonBarPositiveButtonStyle = 2130772138; // aapt resource value: 0x7f01007c public const int buttonBarStyle = 2130772092; // aapt resource value: 0x7f010045 public const int buttonPanelSideLayout = 2130772037; // aapt resource value: 0x7f0100ae public const int buttonStyle = 2130772142; // aapt resource value: 0x7f0100af public const int buttonStyleSmall = 2130772143; // aapt resource value: 0x7f0100bb public const int buttonTint = 2130772155; // aapt resource value: 0x7f0100bc public const int buttonTintMode = 2130772156; // aapt resource value: 0x7f01001b public const int cardBackgroundColor = 2130771995; // aapt resource value: 0x7f01001c public const int cardCornerRadius = 2130771996; // aapt resource value: 0x7f01001d public const int cardElevation = 2130771997; // aapt resource value: 0x7f01001e public const int cardMaxElevation = 2130771998; // aapt resource value: 0x7f010020 public const int cardPreventCornerOverlap = 2130772000; // aapt resource value: 0x7f01001f public const int cardUseCompatPadding = 2130771999; // aapt resource value: 0x7f0100b0 public const int checkboxStyle = 2130772144; // aapt resource value: 0x7f0100b1 public const int checkedTextViewStyle = 2130772145; // aapt resource value: 0x7f0100d3 public const int closeIcon = 2130772179; // aapt resource value: 0x7f010042 public const int closeItemLayout = 2130772034; // aapt resource value: 0x7f0100ec public const int collapseContentDescription = 2130772204; // aapt resource value: 0x7f0100eb public const int collapseIcon = 2130772203; // aapt resource value: 0x7f010108 public const int collapsedTitleGravity = 2130772232; // aapt resource value: 0x7f010104 public const int collapsedTitleTextAppearance = 2130772228; // aapt resource value: 0x7f0100bd public const int color = 2130772157; // aapt resource value: 0x7f01009e public const int colorAccent = 2130772126; // aapt resource value: 0x7f0100a2 public const int colorButtonNormal = 2130772130; // aapt resource value: 0x7f0100a0 public const int colorControlActivated = 2130772128; // aapt resource value: 0x7f0100a1 public const int colorControlHighlight = 2130772129; // aapt resource value: 0x7f01009f public const int colorControlNormal = 2130772127; // aapt resource value: 0x7f01009c public const int colorPrimary = 2130772124; // aapt resource value: 0x7f01009d public const int colorPrimaryDark = 2130772125; // aapt resource value: 0x7f0100a3 public const int colorSwitchThumbNormal = 2130772131; // aapt resource value: 0x7f0100d8 public const int commitIcon = 2130772184; // aapt resource value: 0x7f01003d public const int contentInsetEnd = 2130772029; // aapt resource value: 0x7f01003e public const int contentInsetLeft = 2130772030; // aapt resource value: 0x7f01003f public const int contentInsetRight = 2130772031; // aapt resource value: 0x7f01003c public const int contentInsetStart = 2130772028; // aapt resource value: 0x7f010021 public const int contentPadding = 2130772001; // aapt resource value: 0x7f010025 public const int contentPaddingBottom = 2130772005; // aapt resource value: 0x7f010022 public const int contentPaddingLeft = 2130772002; // aapt resource value: 0x7f010023 public const int contentPaddingRight = 2130772003; // aapt resource value: 0x7f010024 public const int contentPaddingTop = 2130772004; // aapt resource value: 0x7f010105 public const int contentScrim = 2130772229; // aapt resource value: 0x7f0100a4 public const int controlBackground = 2130772132; // aapt resource value: 0x7f010137 public const int counterEnabled = 2130772279; // aapt resource value: 0x7f010138 public const int counterMaxLength = 2130772280; // aapt resource value: 0x7f01013a public const int counterOverflowTextAppearance = 2130772282; // aapt resource value: 0x7f010139 public const int counterTextAppearance = 2130772281; // aapt resource value: 0x7f010035 public const int customNavigationLayout = 2130772021; // aapt resource value: 0x7f0100d2 public const int defaultQueryHint = 2130772178; // aapt resource value: 0x7f010075 public const int dialogPreferredPadding = 2130772085; // aapt resource value: 0x7f010074 public const int dialogTheme = 2130772084; // aapt resource value: 0x7f01002b public const int displayOptions = 2130772011; // aapt resource value: 0x7f010031 public const int divider = 2130772017; // aapt resource value: 0x7f010082 public const int dividerHorizontal = 2130772098; // aapt resource value: 0x7f0100c7 public const int dividerPadding = 2130772167; // aapt resource value: 0x7f010081 public const int dividerVertical = 2130772097; // aapt resource value: 0x7f0100bf public const int drawableSize = 2130772159; // aapt resource value: 0x7f010026 public const int drawerArrowStyle = 2130772006; // aapt resource value: 0x7f010094 public const int dropDownListViewStyle = 2130772116; // aapt resource value: 0x7f010078 public const int dropdownListPreferredItemHeight = 2130772088; // aapt resource value: 0x7f010089 public const int editTextBackground = 2130772105; // aapt resource value: 0x7f010088 public const int editTextColor = 2130772104; // aapt resource value: 0x7f0100b2 public const int editTextStyle = 2130772146; // aapt resource value: 0x7f010040 public const int elevation = 2130772032; // aapt resource value: 0x7f010135 public const int errorEnabled = 2130772277; // aapt resource value: 0x7f010136 public const int errorTextAppearance = 2130772278; // aapt resource value: 0x7f010044 public const int expandActivityOverflowButtonDrawable = 2130772036; // aapt resource value: 0x7f0100f7 public const int expanded = 2130772215; // aapt resource value: 0x7f010109 public const int expandedTitleGravity = 2130772233; // aapt resource value: 0x7f0100fe public const int expandedTitleMargin = 2130772222; // aapt resource value: 0x7f010102 public const int expandedTitleMarginBottom = 2130772226; // aapt resource value: 0x7f010101 public const int expandedTitleMarginEnd = 2130772225; // aapt resource value: 0x7f0100ff public const int expandedTitleMarginStart = 2130772223; // aapt resource value: 0x7f010100 public const int expandedTitleMarginTop = 2130772224; // aapt resource value: 0x7f010103 public const int expandedTitleTextAppearance = 2130772227; // aapt resource value: 0x7f01001a public const int externalRouteEnabledDrawable = 2130771994; // aapt resource value: 0x7f010115 public const int fabSize = 2130772245; // aapt resource value: 0x7f010119 public const int foregroundInsidePadding = 2130772249; // aapt resource value: 0x7f0100c0 public const int gapBetweenBars = 2130772160; // aapt resource value: 0x7f0100d4 public const int goIcon = 2130772180; // aapt resource value: 0x7f01011f public const int headerLayout = 2130772255; // aapt resource value: 0x7f010027 public const int height = 2130772007; // aapt resource value: 0x7f01003b public const int hideOnContentScroll = 2130772027; // aapt resource value: 0x7f01013b public const int hintAnimationEnabled = 2130772283; // aapt resource value: 0x7f010134 public const int hintEnabled = 2130772276; // aapt resource value: 0x7f010133 public const int hintTextAppearance = 2130772275; // aapt resource value: 0x7f01007a public const int homeAsUpIndicator = 2130772090; // aapt resource value: 0x7f010036 public const int homeLayout = 2130772022; // aapt resource value: 0x7f01002f public const int icon = 2130772015; // aapt resource value: 0x7f0100d0 public const int iconifiedByDefault = 2130772176; // aapt resource value: 0x7f01008a public const int imageButtonStyle = 2130772106; // aapt resource value: 0x7f010038 public const int indeterminateProgressStyle = 2130772024; // aapt resource value: 0x7f010043 public const int initialActivityCount = 2130772035; // aapt resource value: 0x7f010120 public const int insetForeground = 2130772256; // aapt resource value: 0x7f010028 public const int isLightTheme = 2130772008; // aapt resource value: 0x7f01011d public const int itemBackground = 2130772253; // aapt resource value: 0x7f01011b public const int itemIconTint = 2130772251; // aapt resource value: 0x7f01003a public const int itemPadding = 2130772026; // aapt resource value: 0x7f01011e public const int itemTextAppearance = 2130772254; // aapt resource value: 0x7f01011c public const int itemTextColor = 2130772252; // aapt resource value: 0x7f01010b public const int keylines = 2130772235; // aapt resource value: 0x7f0100cf public const int layout = 2130772175; // aapt resource value: 0x7f010000 public const int layoutManager = 2130771968; // aapt resource value: 0x7f01010e public const int layout_anchor = 2130772238; // aapt resource value: 0x7f010110 public const int layout_anchorGravity = 2130772240; // aapt resource value: 0x7f01010d public const int layout_behavior = 2130772237; // aapt resource value: 0x7f0100fc public const int layout_collapseMode = 2130772220; // aapt resource value: 0x7f0100fd public const int layout_collapseParallaxMultiplier = 2130772221; // aapt resource value: 0x7f01010f public const int layout_keyline = 2130772239; // aapt resource value: 0x7f0100f8 public const int layout_scrollFlags = 2130772216; // aapt resource value: 0x7f0100f9 public const int layout_scrollInterpolator = 2130772217; // aapt resource value: 0x7f01009b public const int listChoiceBackgroundIndicator = 2130772123; // aapt resource value: 0x7f010076 public const int listDividerAlertDialog = 2130772086; // aapt resource value: 0x7f010049 public const int listItemLayout = 2130772041; // aapt resource value: 0x7f010046 public const int listLayout = 2130772038; // aapt resource value: 0x7f010095 public const int listPopupWindowStyle = 2130772117; // aapt resource value: 0x7f01008f public const int listPreferredItemHeight = 2130772111; // aapt resource value: 0x7f010091 public const int listPreferredItemHeightLarge = 2130772113; // aapt resource value: 0x7f010090 public const int listPreferredItemHeightSmall = 2130772112; // aapt resource value: 0x7f010092 public const int listPreferredItemPaddingLeft = 2130772114; // aapt resource value: 0x7f010093 public const int listPreferredItemPaddingRight = 2130772115; // aapt resource value: 0x7f010030 public const int logo = 2130772016; // aapt resource value: 0x7f0100ef public const int logoDescription = 2130772207; // aapt resource value: 0x7f010122 public const int maxActionInlineWidth = 2130772258; // aapt resource value: 0x7f0100ea public const int maxButtonHeight = 2130772202; // aapt resource value: 0x7f0100c5 public const int measureWithLargestChild = 2130772165; // aapt resource value: 0x7f010005 public const int mediaRouteAudioTrackDrawable = 2130771973; // aapt resource value: 0x7f010006 public const int mediaRouteBluetoothIconDrawable = 2130771974; // aapt resource value: 0x7f010007 public const int mediaRouteButtonStyle = 2130771975; // aapt resource value: 0x7f010008 public const int mediaRouteCastDrawable = 2130771976; // aapt resource value: 0x7f010009 public const int mediaRouteChooserPrimaryTextStyle = 2130771977; // aapt resource value: 0x7f01000a public const int mediaRouteChooserSecondaryTextStyle = 2130771978; // aapt resource value: 0x7f01000b public const int mediaRouteCloseDrawable = 2130771979; // aapt resource value: 0x7f01000c public const int mediaRouteCollapseGroupDrawable = 2130771980; // aapt resource value: 0x7f01000d public const int mediaRouteConnectingDrawable = 2130771981; // aapt resource value: 0x7f01000e public const int mediaRouteControllerPrimaryTextStyle = 2130771982; // aapt resource value: 0x7f01000f public const int mediaRouteControllerSecondaryTextStyle = 2130771983; // aapt resource value: 0x7f010010 public const int mediaRouteControllerTitleTextStyle = 2130771984; // aapt resource value: 0x7f010011 public const int mediaRouteDefaultIconDrawable = 2130771985; // aapt resource value: 0x7f010012 public const int mediaRouteExpandGroupDrawable = 2130771986; // aapt resource value: 0x7f010013 public const int mediaRouteOffDrawable = 2130771987; // aapt resource value: 0x7f010014 public const int mediaRouteOnDrawable = 2130771988; // aapt resource value: 0x7f010015 public const int mediaRoutePauseDrawable = 2130771989; // aapt resource value: 0x7f010016 public const int mediaRoutePlayDrawable = 2130771990; // aapt resource value: 0x7f010017 public const int mediaRouteSpeakerGroupIconDrawable = 2130771991; // aapt resource value: 0x7f010018 public const int mediaRouteSpeakerIconDrawable = 2130771992; // aapt resource value: 0x7f010019 public const int mediaRouteTvIconDrawable = 2130771993; // aapt resource value: 0x7f01011a public const int menu = 2130772250; // aapt resource value: 0x7f010047 public const int multiChoiceItemLayout = 2130772039; // aapt resource value: 0x7f0100ee public const int navigationContentDescription = 2130772206; // aapt resource value: 0x7f0100ed public const int navigationIcon = 2130772205; // aapt resource value: 0x7f01002a public const int navigationMode = 2130772010; // aapt resource value: 0x7f0100cd public const int overlapAnchor = 2130772173; // aapt resource value: 0x7f0100f3 public const int paddingEnd = 2130772211; // aapt resource value: 0x7f0100f2 public const int paddingStart = 2130772210; // aapt resource value: 0x7f010098 public const int panelBackground = 2130772120; // aapt resource value: 0x7f01009a public const int panelMenuListTheme = 2130772122; // aapt resource value: 0x7f010099 public const int panelMenuListWidth = 2130772121; // aapt resource value: 0x7f010086 public const int popupMenuStyle = 2130772102; // aapt resource value: 0x7f010041 public const int popupTheme = 2130772033; // aapt resource value: 0x7f010087 public const int popupWindowStyle = 2130772103; // aapt resource value: 0x7f0100cc public const int preserveIconSpacing = 2130772172; // aapt resource value: 0x7f010116 public const int pressedTranslationZ = 2130772246; // aapt resource value: 0x7f010039 public const int progressBarPadding = 2130772025; // aapt resource value: 0x7f010037 public const int progressBarStyle = 2130772023; // aapt resource value: 0x7f0100da public const int queryBackground = 2130772186; // aapt resource value: 0x7f0100d1 public const int queryHint = 2130772177; // aapt resource value: 0x7f0100b3 public const int radioButtonStyle = 2130772147; // aapt resource value: 0x7f0100b4 public const int ratingBarStyle = 2130772148; // aapt resource value: 0x7f0100b5 public const int ratingBarStyleIndicator = 2130772149; // aapt resource value: 0x7f0100b6 public const int ratingBarStyleSmall = 2130772150; // aapt resource value: 0x7f010002 public const int reverseLayout = 2130771970; // aapt resource value: 0x7f010114 public const int rippleColor = 2130772244; // aapt resource value: 0x7f0100d6 public const int searchHintIcon = 2130772182; // aapt resource value: 0x7f0100d5 public const int searchIcon = 2130772181; // aapt resource value: 0x7f01008e public const int searchViewStyle = 2130772110; // aapt resource value: 0x7f0100b7 public const int seekBarStyle = 2130772151; // aapt resource value: 0x7f01007e public const int selectableItemBackground = 2130772094; // aapt resource value: 0x7f01007f public const int selectableItemBackgroundBorderless = 2130772095; // aapt resource value: 0x7f0100c8 public const int showAsAction = 2130772168; // aapt resource value: 0x7f0100c6 public const int showDividers = 2130772166; // aapt resource value: 0x7f0100e2 public const int showText = 2130772194; // aapt resource value: 0x7f010048 public const int singleChoiceItemLayout = 2130772040; // aapt resource value: 0x7f010001 public const int spanCount = 2130771969; // aapt resource value: 0x7f0100be public const int spinBars = 2130772158; // aapt resource value: 0x7f010079 public const int spinnerDropDownItemStyle = 2130772089; // aapt resource value: 0x7f0100b8 public const int spinnerStyle = 2130772152; // aapt resource value: 0x7f0100e1 public const int splitTrack = 2130772193; // aapt resource value: 0x7f01004a public const int srcCompat = 2130772042; // aapt resource value: 0x7f010003 public const int stackFromEnd = 2130771971; // aapt resource value: 0x7f0100ce public const int state_above_anchor = 2130772174; // aapt resource value: 0x7f01010c public const int statusBarBackground = 2130772236; // aapt resource value: 0x7f010106 public const int statusBarScrim = 2130772230; // aapt resource value: 0x7f0100db public const int submitBackground = 2130772187; // aapt resource value: 0x7f01002c public const int subtitle = 2130772012; // aapt resource value: 0x7f0100e4 public const int subtitleTextAppearance = 2130772196; // aapt resource value: 0x7f0100f1 public const int subtitleTextColor = 2130772209; // aapt resource value: 0x7f01002e public const int subtitleTextStyle = 2130772014; // aapt resource value: 0x7f0100d9 public const int suggestionRowLayout = 2130772185; // aapt resource value: 0x7f0100df public const int switchMinWidth = 2130772191; // aapt resource value: 0x7f0100e0 public const int switchPadding = 2130772192; // aapt resource value: 0x7f0100b9 public const int switchStyle = 2130772153; // aapt resource value: 0x7f0100de public const int switchTextAppearance = 2130772190; // aapt resource value: 0x7f010126 public const int tabBackground = 2130772262; // aapt resource value: 0x7f010125 public const int tabContentStart = 2130772261; // aapt resource value: 0x7f010128 public const int tabGravity = 2130772264; // aapt resource value: 0x7f010123 public const int tabIndicatorColor = 2130772259; // aapt resource value: 0x7f010124 public const int tabIndicatorHeight = 2130772260; // aapt resource value: 0x7f01012a public const int tabMaxWidth = 2130772266; // aapt resource value: 0x7f010129 public const int tabMinWidth = 2130772265; // aapt resource value: 0x7f010127 public const int tabMode = 2130772263; // aapt resource value: 0x7f010132 public const int tabPadding = 2130772274; // aapt resource value: 0x7f010131 public const int tabPaddingBottom = 2130772273; // aapt resource value: 0x7f010130 public const int tabPaddingEnd = 2130772272; // aapt resource value: 0x7f01012e public const int tabPaddingStart = 2130772270; // aapt resource value: 0x7f01012f public const int tabPaddingTop = 2130772271; // aapt resource value: 0x7f01012d public const int tabSelectedTextColor = 2130772269; // aapt resource value: 0x7f01012b public const int tabTextAppearance = 2130772267; // aapt resource value: 0x7f01012c public const int tabTextColor = 2130772268; // aapt resource value: 0x7f01004b public const int textAllCaps = 2130772043; // aapt resource value: 0x7f010072 public const int textAppearanceLargePopupMenu = 2130772082; // aapt resource value: 0x7f010096 public const int textAppearanceListItem = 2130772118; // aapt resource value: 0x7f010097 public const int textAppearanceListItemSmall = 2130772119; // aapt resource value: 0x7f01008c public const int textAppearanceSearchResultSubtitle = 2130772108; // aapt resource value: 0x7f01008b public const int textAppearanceSearchResultTitle = 2130772107; // aapt resource value: 0x7f010073 public const int textAppearanceSmallPopupMenu = 2130772083; // aapt resource value: 0x7f0100a9 public const int textColorAlertDialogListItem = 2130772137; // aapt resource value: 0x7f010113 public const int textColorError = 2130772243; // aapt resource value: 0x7f01008d public const int textColorSearchUrl = 2130772109; // aapt resource value: 0x7f0100f4 public const int theme = 2130772212; // aapt resource value: 0x7f0100c4 public const int thickness = 2130772164; // aapt resource value: 0x7f0100dd public const int thumbTextPadding = 2130772189; // aapt resource value: 0x7f010029 public const int title = 2130772009; // aapt resource value: 0x7f01010a public const int titleEnabled = 2130772234; // aapt resource value: 0x7f0100e9 public const int titleMarginBottom = 2130772201; // aapt resource value: 0x7f0100e7 public const int titleMarginEnd = 2130772199; // aapt resource value: 0x7f0100e6 public const int titleMarginStart = 2130772198; // aapt resource value: 0x7f0100e8 public const int titleMarginTop = 2130772200; // aapt resource value: 0x7f0100e5 public const int titleMargins = 2130772197; // aapt resource value: 0x7f0100e3 public const int titleTextAppearance = 2130772195; // aapt resource value: 0x7f0100f0 public const int titleTextColor = 2130772208; // aapt resource value: 0x7f01002d public const int titleTextStyle = 2130772013; // aapt resource value: 0x7f010107 public const int toolbarId = 2130772231; // aapt resource value: 0x7f010085 public const int toolbarNavigationButtonStyle = 2130772101; // aapt resource value: 0x7f010084 public const int toolbarStyle = 2130772100; // aapt resource value: 0x7f0100dc public const int track = 2130772188; // aapt resource value: 0x7f010118 public const int useCompatPadding = 2130772248; // aapt resource value: 0x7f0100d7 public const int voiceIcon = 2130772183; // aapt resource value: 0x7f01004c public const int windowActionBar = 2130772044; // aapt resource value: 0x7f01004e public const int windowActionBarOverlay = 2130772046; // aapt resource value: 0x7f01004f public const int windowActionModeOverlay = 2130772047; // aapt resource value: 0x7f010053 public const int windowFixedHeightMajor = 2130772051; // aapt resource value: 0x7f010051 public const int windowFixedHeightMinor = 2130772049; // aapt resource value: 0x7f010050 public const int windowFixedWidthMajor = 2130772048; // aapt resource value: 0x7f010052 public const int windowFixedWidthMinor = 2130772050; // aapt resource value: 0x7f010054 public const int windowMinWidthMajor = 2130772052; // aapt resource value: 0x7f010055 public const int windowMinWidthMinor = 2130772053; // aapt resource value: 0x7f01004d public const int windowNoTitle = 2130772045; static Attribute() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); } private Attribute() { } } public partial class Boolean { // aapt resource value: 0x7f0c0003 public const int abc_action_bar_embed_tabs = 2131492867; // aapt resource value: 0x7f0c0001 public const int abc_action_bar_embed_tabs_pre_jb = 2131492865; // aapt resource value: 0x7f0c0004 public const int abc_action_bar_expanded_action_views_exclusive = 2131492868; // aapt resource value: 0x7f0c0000 public const int abc_allow_stacked_button_bar = 2131492864; // aapt resource value: 0x7f0c0005 public const int abc_config_actionMenuItemAllCaps = 2131492869; // aapt resource value: 0x7f0c0002 public const int abc_config_allowActionMenuItemTextWithIcon = 2131492866; // aapt resource value: 0x7f0c0006 public const int abc_config_closeDialogWhenTouchOutside = 2131492870; // aapt resource value: 0x7f0c0007 public const int abc_config_showMenuShortcutsWhenKeyboardPresent = 2131492871; static Boolean() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); } private Boolean() { } } public partial class Color { // aapt resource value: 0x7f0b004c public const int abc_background_cache_hint_selector_material_dark = 2131427404; // aapt resource value: 0x7f0b004d public const int abc_background_cache_hint_selector_material_light = 2131427405; // aapt resource value: 0x7f0b004e public const int abc_color_highlight_material = 2131427406; // aapt resource value: 0x7f0b0004 public const int abc_input_method_navigation_guard = 2131427332; // aapt resource value: 0x7f0b004f public const int abc_primary_text_disable_only_material_dark = 2131427407; // aapt resource value: 0x7f0b0050 public const int abc_primary_text_disable_only_material_light = 2131427408; // aapt resource value: 0x7f0b0051 public const int abc_primary_text_material_dark = 2131427409; // aapt resource value: 0x7f0b0052 public const int abc_primary_text_material_light = 2131427410; // aapt resource value: 0x7f0b0053 public const int abc_search_url_text = 2131427411; // aapt resource value: 0x7f0b0005 public const int abc_search_url_text_normal = 2131427333; // aapt resource value: 0x7f0b0006 public const int abc_search_url_text_pressed = 2131427334; // aapt resource value: 0x7f0b0007 public const int abc_search_url_text_selected = 2131427335; // aapt resource value: 0x7f0b0054 public const int abc_secondary_text_material_dark = 2131427412; // aapt resource value: 0x7f0b0055 public const int abc_secondary_text_material_light = 2131427413; // aapt resource value: 0x7f0b004a public const int accent = 2131427402; // aapt resource value: 0x7f0b0008 public const int accent_material_dark = 2131427336; // aapt resource value: 0x7f0b0009 public const int accent_material_light = 2131427337; // aapt resource value: 0x7f0b000a public const int background_floating_material_dark = 2131427338; // aapt resource value: 0x7f0b000b public const int background_floating_material_light = 2131427339; // aapt resource value: 0x7f0b000c public const int background_material_dark = 2131427340; // aapt resource value: 0x7f0b000d public const int background_material_light = 2131427341; // aapt resource value: 0x7f0b000e public const int bright_foreground_disabled_material_dark = 2131427342; // aapt resource value: 0x7f0b000f public const int bright_foreground_disabled_material_light = 2131427343; // aapt resource value: 0x7f0b0010 public const int bright_foreground_inverse_material_dark = 2131427344; // aapt resource value: 0x7f0b0011 public const int bright_foreground_inverse_material_light = 2131427345; // aapt resource value: 0x7f0b0012 public const int bright_foreground_material_dark = 2131427346; // aapt resource value: 0x7f0b0013 public const int bright_foreground_material_light = 2131427347; // aapt resource value: 0x7f0b0014 public const int button_material_dark = 2131427348; // aapt resource value: 0x7f0b0015 public const int button_material_light = 2131427349; // aapt resource value: 0x7f0b0000 public const int cardview_dark_background = 2131427328; // aapt resource value: 0x7f0b0001 public const int cardview_light_background = 2131427329; // aapt resource value: 0x7f0b0002 public const int cardview_shadow_end_color = 2131427330; // aapt resource value: 0x7f0b0003 public const int cardview_shadow_start_color = 2131427331; // aapt resource value: 0x7f0b003e public const int design_fab_shadow_end_color = 2131427390; // aapt resource value: 0x7f0b003f public const int design_fab_shadow_mid_color = 2131427391; // aapt resource value: 0x7f0b0040 public const int design_fab_shadow_start_color = 2131427392; // aapt resource value: 0x7f0b0041 public const int design_fab_stroke_end_inner_color = 2131427393; // aapt resource value: 0x7f0b0042 public const int design_fab_stroke_end_outer_color = 2131427394; // aapt resource value: 0x7f0b0043 public const int design_fab_stroke_top_inner_color = 2131427395; // aapt resource value: 0x7f0b0044 public const int design_fab_stroke_top_outer_color = 2131427396; // aapt resource value: 0x7f0b0045 public const int design_snackbar_background_color = 2131427397; // aapt resource value: 0x7f0b0046 public const int design_textinput_error_color_dark = 2131427398; // aapt resource value: 0x7f0b0047 public const int design_textinput_error_color_light = 2131427399; // aapt resource value: 0x7f0b0016 public const int dim_foreground_disabled_material_dark = 2131427350; // aapt resource value: 0x7f0b0017 public const int dim_foreground_disabled_material_light = 2131427351; // aapt resource value: 0x7f0b0018 public const int dim_foreground_material_dark = 2131427352; // aapt resource value: 0x7f0b0019 public const int dim_foreground_material_light = 2131427353; // aapt resource value: 0x7f0b001a public const int foreground_material_dark = 2131427354; // aapt resource value: 0x7f0b001b public const int foreground_material_light = 2131427355; // aapt resource value: 0x7f0b001c public const int highlighted_text_material_dark = 2131427356; // aapt resource value: 0x7f0b001d public const int highlighted_text_material_light = 2131427357; // aapt resource value: 0x7f0b001e public const int hint_foreground_material_dark = 2131427358; // aapt resource value: 0x7f0b001f public const int hint_foreground_material_light = 2131427359; // aapt resource value: 0x7f0b0020 public const int material_blue_grey_800 = 2131427360; // aapt resource value: 0x7f0b0021 public const int material_blue_grey_900 = 2131427361; // aapt resource value: 0x7f0b0022 public const int material_blue_grey_950 = 2131427362; // aapt resource value: 0x7f0b0023 public const int material_deep_teal_200 = 2131427363; // aapt resource value: 0x7f0b0024 public const int material_deep_teal_500 = 2131427364; // aapt resource value: 0x7f0b0025 public const int material_grey_100 = 2131427365; // aapt resource value: 0x7f0b0026 public const int material_grey_300 = 2131427366; // aapt resource value: 0x7f0b0027 public const int material_grey_50 = 2131427367; // aapt resource value: 0x7f0b0028 public const int material_grey_600 = 2131427368; // aapt resource value: 0x7f0b0029 public const int material_grey_800 = 2131427369; // aapt resource value: 0x7f0b002a public const int material_grey_850 = 2131427370; // aapt resource value: 0x7f0b002b public const int material_grey_900 = 2131427371; // aapt resource value: 0x7f0b0048 public const int primary = 2131427400; // aapt resource value: 0x7f0b0049 public const int primaryDark = 2131427401; // aapt resource value: 0x7f0b002c public const int primary_dark_material_dark = 2131427372; // aapt resource value: 0x7f0b002d public const int primary_dark_material_light = 2131427373; // aapt resource value: 0x7f0b002e public const int primary_material_dark = 2131427374; // aapt resource value: 0x7f0b002f public const int primary_material_light = 2131427375; // aapt resource value: 0x7f0b0030 public const int primary_text_default_material_dark = 2131427376; // aapt resource value: 0x7f0b0031 public const int primary_text_default_material_light = 2131427377; // aapt resource value: 0x7f0b0032 public const int primary_text_disabled_material_dark = 2131427378; // aapt resource value: 0x7f0b0033 public const int primary_text_disabled_material_light = 2131427379; // aapt resource value: 0x7f0b0034 public const int ripple_material_dark = 2131427380; // aapt resource value: 0x7f0b0035 public const int ripple_material_light = 2131427381; // aapt resource value: 0x7f0b0036 public const int secondary_text_default_material_dark = 2131427382; // aapt resource value: 0x7f0b0037 public const int secondary_text_default_material_light = 2131427383; // aapt resource value: 0x7f0b0038 public const int secondary_text_disabled_material_dark = 2131427384; // aapt resource value: 0x7f0b0039 public const int secondary_text_disabled_material_light = 2131427385; // aapt resource value: 0x7f0b003a public const int switch_thumb_disabled_material_dark = 2131427386; // aapt resource value: 0x7f0b003b public const int switch_thumb_disabled_material_light = 2131427387; // aapt resource value: 0x7f0b0056 public const int switch_thumb_material_dark = 2131427414; // aapt resource value: 0x7f0b0057 public const int switch_thumb_material_light = 2131427415; // aapt resource value: 0x7f0b003c public const int switch_thumb_normal_material_dark = 2131427388; // aapt resource value: 0x7f0b003d public const int switch_thumb_normal_material_light = 2131427389; // aapt resource value: 0x7f0b004b public const int window_background = 2131427403; static Color() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); } private Color() { } } public partial class Dimension { // aapt resource value: 0x7f060019 public const int abc_action_bar_content_inset_material = 2131099673; // aapt resource value: 0x7f06000d public const int abc_action_bar_default_height_material = 2131099661; // aapt resource value: 0x7f06001a public const int abc_action_bar_default_padding_end_material = 2131099674; // aapt resource value: 0x7f06001b public const int abc_action_bar_default_padding_start_material = 2131099675; // aapt resource value: 0x7f06001d public const int abc_action_bar_icon_vertical_padding_material = 2131099677; // aapt resource value: 0x7f06001e public const int abc_action_bar_overflow_padding_end_material = 2131099678; // aapt resource value: 0x7f06001f public const int abc_action_bar_overflow_padding_start_material = 2131099679; // aapt resource value: 0x7f06000e public const int abc_action_bar_progress_bar_size = 2131099662; // aapt resource value: 0x7f060020 public const int abc_action_bar_stacked_max_height = 2131099680; // aapt resource value: 0x7f060021 public const int abc_action_bar_stacked_tab_max_width = 2131099681; // aapt resource value: 0x7f060022 public const int abc_action_bar_subtitle_bottom_margin_material = 2131099682; // aapt resource value: 0x7f060023 public const int abc_action_bar_subtitle_top_margin_material = 2131099683; // aapt resource value: 0x7f060024 public const int abc_action_button_min_height_material = 2131099684; // aapt resource value: 0x7f060025 public const int abc_action_button_min_width_material = 2131099685; // aapt resource value: 0x7f060026 public const int abc_action_button_min_width_overflow_material = 2131099686; // aapt resource value: 0x7f06000c public const int abc_alert_dialog_button_bar_height = 2131099660; // aapt resource value: 0x7f060027 public const int abc_button_inset_horizontal_material = 2131099687; // aapt resource value: 0x7f060028 public const int abc_button_inset_vertical_material = 2131099688; // aapt resource value: 0x7f060029 public const int abc_button_padding_horizontal_material = 2131099689; // aapt resource value: 0x7f06002a public const int abc_button_padding_vertical_material = 2131099690; // aapt resource value: 0x7f060011 public const int abc_config_prefDialogWidth = 2131099665; // aapt resource value: 0x7f06002b public const int abc_control_corner_material = 2131099691; // aapt resource value: 0x7f06002c public const int abc_control_inset_material = 2131099692; // aapt resource value: 0x7f06002d public const int abc_control_padding_material = 2131099693; // aapt resource value: 0x7f060012 public const int abc_dialog_fixed_height_major = 2131099666; // aapt resource value: 0x7f060013 public const int abc_dialog_fixed_height_minor = 2131099667; // aapt resource value: 0x7f060014 public const int abc_dialog_fixed_width_major = 2131099668; // aapt resource value: 0x7f060015 public const int abc_dialog_fixed_width_minor = 2131099669; // aapt resource value: 0x7f06002e public const int abc_dialog_list_padding_vertical_material = 2131099694; // aapt resource value: 0x7f060016 public const int abc_dialog_min_width_major = 2131099670; // aapt resource value: 0x7f060017 public const int abc_dialog_min_width_minor = 2131099671; // aapt resource value: 0x7f06002f public const int abc_dialog_padding_material = 2131099695; // aapt resource value: 0x7f060030 public const int abc_dialog_padding_top_material = 2131099696; // aapt resource value: 0x7f060031 public const int abc_disabled_alpha_material_dark = 2131099697; // aapt resource value: 0x7f060032 public const int abc_disabled_alpha_material_light = 2131099698; // aapt resource value: 0x7f060033 public const int abc_dropdownitem_icon_width = 2131099699; // aapt resource value: 0x7f060034 public const int abc_dropdownitem_text_padding_left = 2131099700; // aapt resource value: 0x7f060035 public const int abc_dropdownitem_text_padding_right = 2131099701; // aapt resource value: 0x7f060036 public const int abc_edit_text_inset_bottom_material = 2131099702; // aapt resource value: 0x7f060037 public const int abc_edit_text_inset_horizontal_material = 2131099703; // aapt resource value: 0x7f060038 public const int abc_edit_text_inset_top_material = 2131099704; // aapt resource value: 0x7f060039 public const int abc_floating_window_z = 2131099705; // aapt resource value: 0x7f06003a public const int abc_list_item_padding_horizontal_material = 2131099706; // aapt resource value: 0x7f06003b public const int abc_panel_menu_list_width = 2131099707; // aapt resource value: 0x7f06003c public const int abc_search_view_preferred_width = 2131099708; // aapt resource value: 0x7f060018 public const int abc_search_view_text_min_width = 2131099672; // aapt resource value: 0x7f06003d public const int abc_seekbar_track_background_height_material = 2131099709; // aapt resource value: 0x7f06003e public const int abc_seekbar_track_progress_height_material = 2131099710; // aapt resource value: 0x7f06003f public const int abc_select_dialog_padding_start_material = 2131099711; // aapt resource value: 0x7f06001c public const int abc_switch_padding = 2131099676; // aapt resource value: 0x7f060040 public const int abc_text_size_body_1_material = 2131099712; // aapt resource value: 0x7f060041 public const int abc_text_size_body_2_material = 2131099713; // aapt resource value: 0x7f060042 public const int abc_text_size_button_material = 2131099714; // aapt resource value: 0x7f060043 public const int abc_text_size_caption_material = 2131099715; // aapt resource value: 0x7f060044 public const int abc_text_size_display_1_material = 2131099716; // aapt resource value: 0x7f060045 public const int abc_text_size_display_2_material = 2131099717; // aapt resource value: 0x7f060046 public const int abc_text_size_display_3_material = 2131099718; // aapt resource value: 0x7f060047 public const int abc_text_size_display_4_material = 2131099719; // aapt resource value: 0x7f060048 public const int abc_text_size_headline_material = 2131099720; // aapt resource value: 0x7f060049 public const int abc_text_size_large_material = 2131099721; // aapt resource value: 0x7f06004a public const int abc_text_size_medium_material = 2131099722; // aapt resource value: 0x7f06004b public const int abc_text_size_menu_material = 2131099723; // aapt resource value: 0x7f06004c public const int abc_text_size_small_material = 2131099724; // aapt resource value: 0x7f06004d public const int abc_text_size_subhead_material = 2131099725; // aapt resource value: 0x7f06000f public const int abc_text_size_subtitle_material_toolbar = 2131099663; // aapt resource value: 0x7f06004e public const int abc_text_size_title_material = 2131099726; // aapt resource value: 0x7f060010 public const int abc_text_size_title_material_toolbar = 2131099664; // aapt resource value: 0x7f060009 public const int cardview_compat_inset_shadow = 2131099657; // aapt resource value: 0x7f06000a public const int cardview_default_elevation = 2131099658; // aapt resource value: 0x7f06000b public const int cardview_default_radius = 2131099659; // aapt resource value: 0x7f06005f public const int design_appbar_elevation = 2131099743; // aapt resource value: 0x7f060060 public const int design_bottom_sheet_modal_elevation = 2131099744; // aapt resource value: 0x7f060061 public const int design_bottom_sheet_modal_peek_height = 2131099745; // aapt resource value: 0x7f060062 public const int design_fab_border_width = 2131099746; // aapt resource value: 0x7f060063 public const int design_fab_elevation = 2131099747; // aapt resource value: 0x7f060064 public const int design_fab_image_size = 2131099748; // aapt resource value: 0x7f060065 public const int design_fab_size_mini = 2131099749; // aapt resource value: 0x7f060066 public const int design_fab_size_normal = 2131099750; // aapt resource value: 0x7f060067 public const int design_fab_translation_z_pressed = 2131099751; // aapt resource value: 0x7f060068 public const int design_navigation_elevation = 2131099752; // aapt resource value: 0x7f060069 public const int design_navigation_icon_padding = 2131099753; // aapt resource value: 0x7f06006a public const int design_navigation_icon_size = 2131099754; // aapt resource value: 0x7f060057 public const int design_navigation_max_width = 2131099735; // aapt resource value: 0x7f06006b public const int design_navigation_padding_bottom = 2131099755; // aapt resource value: 0x7f06006c public const int design_navigation_separator_vertical_padding = 2131099756; // aapt resource value: 0x7f060058 public const int design_snackbar_action_inline_max_width = 2131099736; // aapt resource value: 0x7f060059 public const int design_snackbar_background_corner_radius = 2131099737; // aapt resource value: 0x7f06006d public const int design_snackbar_elevation = 2131099757; // aapt resource value: 0x7f06005a public const int design_snackbar_extra_spacing_horizontal = 2131099738; // aapt resource value: 0x7f06005b public const int design_snackbar_max_width = 2131099739; // aapt resource value: 0x7f06005c public const int design_snackbar_min_width = 2131099740; // aapt resource value: 0x7f06006e public const int design_snackbar_padding_horizontal = 2131099758; // aapt resource value: 0x7f06006f public const int design_snackbar_padding_vertical = 2131099759; // aapt resource value: 0x7f06005d public const int design_snackbar_padding_vertical_2lines = 2131099741; // aapt resource value: 0x7f060070 public const int design_snackbar_text_size = 2131099760; // aapt resource value: 0x7f060071 public const int design_tab_max_width = 2131099761; // aapt resource value: 0x7f06005e public const int design_tab_scrollable_min_width = 2131099742; // aapt resource value: 0x7f060072 public const int design_tab_text_size = 2131099762; // aapt resource value: 0x7f060073 public const int design_tab_text_size_2line = 2131099763; // aapt resource value: 0x7f06004f public const int disabled_alpha_material_dark = 2131099727; // aapt resource value: 0x7f060050 public const int disabled_alpha_material_light = 2131099728; // aapt resource value: 0x7f060051 public const int highlight_alpha_material_colored = 2131099729; // aapt resource value: 0x7f060052 public const int highlight_alpha_material_dark = 2131099730; // aapt resource value: 0x7f060053 public const int highlight_alpha_material_light = 2131099731; // aapt resource value: 0x7f060000 public const int item_touch_helper_max_drag_scroll_per_frame = 2131099648; // aapt resource value: 0x7f060001 public const int item_touch_helper_swipe_escape_max_velocity = 2131099649; // aapt resource value: 0x7f060002 public const int item_touch_helper_swipe_escape_velocity = 2131099650; // aapt resource value: 0x7f060003 public const int mr_controller_volume_group_list_item_height = 2131099651; // aapt resource value: 0x7f060004 public const int mr_controller_volume_group_list_item_icon_size = 2131099652; // aapt resource value: 0x7f060005 public const int mr_controller_volume_group_list_max_height = 2131099653; // aapt resource value: 0x7f060008 public const int mr_controller_volume_group_list_padding_top = 2131099656; // aapt resource value: 0x7f060006 public const int mr_dialog_fixed_width_major = 2131099654; // aapt resource value: 0x7f060007 public const int mr_dialog_fixed_width_minor = 2131099655; // aapt resource value: 0x7f060054 public const int notification_large_icon_height = 2131099732; // aapt resource value: 0x7f060055 public const int notification_large_icon_width = 2131099733; // aapt resource value: 0x7f060056 public const int notification_subtext_size = 2131099734; static Dimension() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); } private Dimension() { } } public partial class Drawable { // aapt resource value: 0x7f020000 public const int abc_ab_share_pack_mtrl_alpha = 2130837504; // aapt resource value: 0x7f020001 public const int abc_action_bar_item_background_material = 2130837505; // aapt resource value: 0x7f020002 public const int abc_btn_borderless_material = 2130837506; // aapt resource value: 0x7f020003 public const int abc_btn_check_material = 2130837507; // aapt resource value: 0x7f020004 public const int abc_btn_check_to_on_mtrl_000 = 2130837508; // aapt resource value: 0x7f020005 public const int abc_btn_check_to_on_mtrl_015 = 2130837509; // aapt resource value: 0x7f020006 public const int abc_btn_colored_material = 2130837510; // aapt resource value: 0x7f020007 public const int abc_btn_default_mtrl_shape = 2130837511; // aapt resource value: 0x7f020008 public const int abc_btn_radio_material = 2130837512; // aapt resource value: 0x7f020009 public const int abc_btn_radio_to_on_mtrl_000 = 2130837513; // aapt resource value: 0x7f02000a public const int abc_btn_radio_to_on_mtrl_015 = 2130837514; // aapt resource value: 0x7f02000b public const int abc_btn_rating_star_off_mtrl_alpha = 2130837515; // aapt resource value: 0x7f02000c public const int abc_btn_rating_star_on_mtrl_alpha = 2130837516; // aapt resource value: 0x7f02000d public const int abc_btn_switch_to_on_mtrl_00001 = 2130837517; // aapt resource value: 0x7f02000e public const int abc_btn_switch_to_on_mtrl_00012 = 2130837518; // aapt resource value: 0x7f02000f public const int abc_cab_background_internal_bg = 2130837519; // aapt resource value: 0x7f020010 public const int abc_cab_background_top_material = 2130837520; // aapt resource value: 0x7f020011 public const int abc_cab_background_top_mtrl_alpha = 2130837521; // aapt resource value: 0x7f020012 public const int abc_control_background_material = 2130837522; // aapt resource value: 0x7f020013 public const int abc_dialog_material_background_dark = 2130837523; // aapt resource value: 0x7f020014 public const int abc_dialog_material_background_light = 2130837524; // aapt resource value: 0x7f020015 public const int abc_edit_text_material = 2130837525; // aapt resource value: 0x7f020016 public const int abc_ic_ab_back_mtrl_am_alpha = 2130837526; // aapt resource value: 0x7f020017 public const int abc_ic_clear_mtrl_alpha = 2130837527; // aapt resource value: 0x7f020018 public const int abc_ic_commit_search_api_mtrl_alpha = 2130837528; // aapt resource value: 0x7f020019 public const int abc_ic_go_search_api_mtrl_alpha = 2130837529; // aapt resource value: 0x7f02001a public const int abc_ic_menu_copy_mtrl_am_alpha = 2130837530; // aapt resource value: 0x7f02001b public const int abc_ic_menu_cut_mtrl_alpha = 2130837531; // aapt resource value: 0x7f02001c public const int abc_ic_menu_moreoverflow_mtrl_alpha = 2130837532; // aapt resource value: 0x7f02001d public const int abc_ic_menu_paste_mtrl_am_alpha = 2130837533; // aapt resource value: 0x7f02001e public const int abc_ic_menu_selectall_mtrl_alpha = 2130837534; // aapt resource value: 0x7f02001f public const int abc_ic_menu_share_mtrl_alpha = 2130837535; // aapt resource value: 0x7f020020 public const int abc_ic_search_api_mtrl_alpha = 2130837536; // aapt resource value: 0x7f020021 public const int abc_ic_star_black_16dp = 2130837537; // aapt resource value: 0x7f020022 public const int abc_ic_star_black_36dp = 2130837538; // aapt resource value: 0x7f020023 public const int abc_ic_star_half_black_16dp = 2130837539; // aapt resource value: 0x7f020024 public const int abc_ic_star_half_black_36dp = 2130837540; // aapt resource value: 0x7f020025 public const int abc_ic_voice_search_api_mtrl_alpha = 2130837541; // aapt resource value: 0x7f020026 public const int abc_item_background_holo_dark = 2130837542; // aapt resource value: 0x7f020027 public const int abc_item_background_holo_light = 2130837543; // aapt resource value: 0x7f020028 public const int abc_list_divider_mtrl_alpha = 2130837544; // aapt resource value: 0x7f020029 public const int abc_list_focused_holo = 2130837545; // aapt resource value: 0x7f02002a public const int abc_list_longpressed_holo = 2130837546; // aapt resource value: 0x7f02002b public const int abc_list_pressed_holo_dark = 2130837547; // aapt resource value: 0x7f02002c public const int abc_list_pressed_holo_light = 2130837548; // aapt resource value: 0x7f02002d public const int abc_list_selector_background_transition_holo_dark = 2130837549; // aapt resource value: 0x7f02002e public const int abc_list_selector_background_transition_holo_light = 2130837550; // aapt resource value: 0x7f02002f public const int abc_list_selector_disabled_holo_dark = 2130837551; // aapt resource value: 0x7f020030 public const int abc_list_selector_disabled_holo_light = 2130837552; // aapt resource value: 0x7f020031 public const int abc_list_selector_holo_dark = 2130837553; // aapt resource value: 0x7f020032 public const int abc_list_selector_holo_light = 2130837554; // aapt resource value: 0x7f020033 public const int abc_menu_hardkey_panel_mtrl_mult = 2130837555; // aapt resource value: 0x7f020034 public const int abc_popup_background_mtrl_mult = 2130837556; // aapt resource value: 0x7f020035 public const int abc_ratingbar_full_material = 2130837557; // aapt resource value: 0x7f020036 public const int abc_ratingbar_indicator_material = 2130837558; // aapt resource value: 0x7f020037 public const int abc_ratingbar_small_material = 2130837559; // aapt resource value: 0x7f020038 public const int abc_scrubber_control_off_mtrl_alpha = 2130837560; // aapt resource value: 0x7f020039 public const int abc_scrubber_control_to_pressed_mtrl_000 = 2130837561; // aapt resource value: 0x7f02003a public const int abc_scrubber_control_to_pressed_mtrl_005 = 2130837562; // aapt resource value: 0x7f02003b public const int abc_scrubber_primary_mtrl_alpha = 2130837563; // aapt resource value: 0x7f02003c public const int abc_scrubber_track_mtrl_alpha = 2130837564; // aapt resource value: 0x7f02003d public const int abc_seekbar_thumb_material = 2130837565; // aapt resource value: 0x7f02003e public const int abc_seekbar_track_material = 2130837566; // aapt resource value: 0x7f02003f public const int abc_spinner_mtrl_am_alpha = 2130837567; // aapt resource value: 0x7f020040 public const int abc_spinner_textfield_background_material = 2130837568; // aapt resource value: 0x7f020041 public const int abc_switch_thumb_material = 2130837569; // aapt resource value: 0x7f020042 public const int abc_switch_track_mtrl_alpha = 2130837570; // aapt resource value: 0x7f020043 public const int abc_tab_indicator_material = 2130837571; // aapt resource value: 0x7f020044 public const int abc_tab_indicator_mtrl_alpha = 2130837572; // aapt resource value: 0x7f020045 public const int abc_text_cursor_material = 2130837573; // aapt resource value: 0x7f020046 public const int abc_textfield_activated_mtrl_alpha = 2130837574; // aapt resource value: 0x7f020047 public const int abc_textfield_default_mtrl_alpha = 2130837575; // aapt resource value: 0x7f020048 public const int abc_textfield_search_activated_mtrl_alpha = 2130837576; // aapt resource value: 0x7f020049 public const int abc_textfield_search_default_mtrl_alpha = 2130837577; // aapt resource value: 0x7f02004a public const int abc_textfield_search_material = 2130837578; // aapt resource value: 0x7f02004b public const int design_fab_background = 2130837579; // aapt resource value: 0x7f02004c public const int design_snackbar_background = 2130837580; // aapt resource value: 0x7f02004d public const int ic_audiotrack = 2130837581; // aapt resource value: 0x7f02004e public const int ic_audiotrack_light = 2130837582; // aapt resource value: 0x7f02004f public const int ic_bluetooth_grey = 2130837583; // aapt resource value: 0x7f020050 public const int ic_bluetooth_white = 2130837584; // aapt resource value: 0x7f020051 public const int ic_cast_dark = 2130837585; // aapt resource value: 0x7f020052 public const int ic_cast_disabled_light = 2130837586; // aapt resource value: 0x7f020053 public const int ic_cast_grey = 2130837587; // aapt resource value: 0x7f020054 public const int ic_cast_light = 2130837588; // aapt resource value: 0x7f020055 public const int ic_cast_off_light = 2130837589; // aapt resource value: 0x7f020056 public const int ic_cast_on_0_light = 2130837590; // aapt resource value: 0x7f020057 public const int ic_cast_on_1_light = 2130837591; // aapt resource value: 0x7f020058 public const int ic_cast_on_2_light = 2130837592; // aapt resource value: 0x7f020059 public const int ic_cast_on_light = 2130837593; // aapt resource value: 0x7f02005a public const int ic_cast_white = 2130837594; // aapt resource value: 0x7f02005b public const int ic_close_dark = 2130837595; // aapt resource value: 0x7f02005c public const int ic_close_light = 2130837596; // aapt resource value: 0x7f02005d public const int ic_collapse = 2130837597; // aapt resource value: 0x7f02005e public const int ic_collapse_00000 = 2130837598; // aapt resource value: 0x7f02005f public const int ic_collapse_00001 = 2130837599; // aapt resource value: 0x7f020060 public const int ic_collapse_00002 = 2130837600; // aapt resource value: 0x7f020061 public const int ic_collapse_00003 = 2130837601; // aapt resource value: 0x7f020062 public const int ic_collapse_00004 = 2130837602; // aapt resource value: 0x7f020063 public const int ic_collapse_00005 = 2130837603; // aapt resource value: 0x7f020064 public const int ic_collapse_00006 = 2130837604; // aapt resource value: 0x7f020065 public const int ic_collapse_00007 = 2130837605; // aapt resource value: 0x7f020066 public const int ic_collapse_00008 = 2130837606; // aapt resource value: 0x7f020067 public const int ic_collapse_00009 = 2130837607; // aapt resource value: 0x7f020068 public const int ic_collapse_00010 = 2130837608; // aapt resource value: 0x7f020069 public const int ic_collapse_00011 = 2130837609; // aapt resource value: 0x7f02006a public const int ic_collapse_00012 = 2130837610; // aapt resource value: 0x7f02006b public const int ic_collapse_00013 = 2130837611; // aapt resource value: 0x7f02006c public const int ic_collapse_00014 = 2130837612; // aapt resource value: 0x7f02006d public const int ic_collapse_00015 = 2130837613; // aapt resource value: 0x7f02006e public const int ic_expand = 2130837614; // aapt resource value: 0x7f02006f public const int ic_expand_00000 = 2130837615; // aapt resource value: 0x7f020070 public const int ic_expand_00001 = 2130837616; // aapt resource value: 0x7f020071 public const int ic_expand_00002 = 2130837617; // aapt resource value: 0x7f020072 public const int ic_expand_00003 = 2130837618; // aapt resource value: 0x7f020073 public const int ic_expand_00004 = 2130837619; // aapt resource value: 0x7f020074 public const int ic_expand_00005 = 2130837620; // aapt resource value: 0x7f020075 public const int ic_expand_00006 = 2130837621; // aapt resource value: 0x7f020076 public const int ic_expand_00007 = 2130837622; // aapt resource value: 0x7f020077 public const int ic_expand_00008 = 2130837623; // aapt resource value: 0x7f020078 public const int ic_expand_00009 = 2130837624; // aapt resource value: 0x7f020079 public const int ic_expand_00010 = 2130837625; // aapt resource value: 0x7f02007a public const int ic_expand_00011 = 2130837626; // aapt resource value: 0x7f02007b public const int ic_expand_00012 = 2130837627; // aapt resource value: 0x7f02007c public const int ic_expand_00013 = 2130837628; // aapt resource value: 0x7f02007d public const int ic_expand_00014 = 2130837629; // aapt resource value: 0x7f02007e public const int ic_expand_00015 = 2130837630; // aapt resource value: 0x7f02007f public const int ic_media_pause = 2130837631; // aapt resource value: 0x7f020080 public const int ic_media_play = 2130837632; // aapt resource value: 0x7f020081 public const int ic_media_route_disabled_mono_dark = 2130837633; // aapt resource value: 0x7f020082 public const int ic_media_route_off_mono_dark = 2130837634; // aapt resource value: 0x7f020083 public const int ic_media_route_on_0_mono_dark = 2130837635; // aapt resource value: 0x7f020084 public const int ic_media_route_on_1_mono_dark = 2130837636; // aapt resource value: 0x7f020085 public const int ic_media_route_on_2_mono_dark = 2130837637; // aapt resource value: 0x7f020086 public const int ic_media_route_on_mono_dark = 2130837638; // aapt resource value: 0x7f020087 public const int ic_pause_dark = 2130837639; // aapt resource value: 0x7f020088 public const int ic_pause_light = 2130837640; // aapt resource value: 0x7f020089 public const int ic_play_dark = 2130837641; // aapt resource value: 0x7f02008a public const int ic_play_light = 2130837642; // aapt resource value: 0x7f02008b public const int ic_speaker_dark = 2130837643; // aapt resource value: 0x7f02008c public const int ic_speaker_group_dark = 2130837644; // aapt resource value: 0x7f02008d public const int ic_speaker_group_light = 2130837645; // aapt resource value: 0x7f02008e public const int ic_speaker_light = 2130837646; // aapt resource value: 0x7f02008f public const int ic_tv_dark = 2130837647; // aapt resource value: 0x7f020090 public const int ic_tv_light = 2130837648; // aapt resource value: 0x7f020091 public const int icon = 2130837649; // aapt resource value: 0x7f020092 public const int mr_dialog_material_background_dark = 2130837650; // aapt resource value: 0x7f020093 public const int mr_dialog_material_background_light = 2130837651; // aapt resource value: 0x7f020094 public const int mr_ic_audiotrack_light = 2130837652; // aapt resource value: 0x7f020095 public const int mr_ic_cast_dark = 2130837653; // aapt resource value: 0x7f020096 public const int mr_ic_cast_light = 2130837654; // aapt resource value: 0x7f020097 public const int mr_ic_close_dark = 2130837655; // aapt resource value: 0x7f020098 public const int mr_ic_close_light = 2130837656; // aapt resource value: 0x7f020099 public const int mr_ic_media_route_connecting_mono_dark = 2130837657; // aapt resource value: 0x7f02009a public const int mr_ic_media_route_connecting_mono_light = 2130837658; // aapt resource value: 0x7f02009b public const int mr_ic_media_route_mono_dark = 2130837659; // aapt resource value: 0x7f02009c public const int mr_ic_media_route_mono_light = 2130837660; // aapt resource value: 0x7f02009d public const int mr_ic_pause_dark = 2130837661; // aapt resource value: 0x7f02009e public const int mr_ic_pause_light = 2130837662; // aapt resource value: 0x7f02009f public const int mr_ic_play_dark = 2130837663; // aapt resource value: 0x7f0200a0 public const int mr_ic_play_light = 2130837664; // aapt resource value: 0x7f0200a1 public const int notification_template_icon_bg = 2130837665; static Drawable() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); } private Drawable() { } } public partial class Id { // aapt resource value: 0x7f07008b public const int action0 = 2131165323; // aapt resource value: 0x7f07005a public const int action_bar = 2131165274; // aapt resource value: 0x7f070001 public const int action_bar_activity_content = 2131165185; // aapt resource value: 0x7f070059 public const int action_bar_container = 2131165273; // aapt resource value: 0x7f070055 public const int action_bar_root = 2131165269; // aapt resource value: 0x7f070002 public const int action_bar_spinner = 2131165186; // aapt resource value: 0x7f07003b public const int action_bar_subtitle = 2131165243; // aapt resource value: 0x7f07003a public const int action_bar_title = 2131165242; // aapt resource value: 0x7f07005b public const int action_context_bar = 2131165275; // aapt resource value: 0x7f07008f public const int action_divider = 2131165327; // aapt resource value: 0x7f070003 public const int action_menu_divider = 2131165187; // aapt resource value: 0x7f070004 public const int action_menu_presenter = 2131165188; // aapt resource value: 0x7f070057 public const int action_mode_bar = 2131165271; // aapt resource value: 0x7f070056 public const int action_mode_bar_stub = 2131165270; // aapt resource value: 0x7f07003c public const int action_mode_close_button = 2131165244; // aapt resource value: 0x7f07003d public const int activity_chooser_view_content = 2131165245; // aapt resource value: 0x7f070049 public const int alertTitle = 2131165257; // aapt resource value: 0x7f07001e public const int always = 2131165214; // aapt resource value: 0x7f07001b public const int beginning = 2131165211; // aapt resource value: 0x7f07002a public const int bottom = 2131165226; // aapt resource value: 0x7f070044 public const int buttonPanel = 2131165252; // aapt resource value: 0x7f07008c public const int cancel_action = 2131165324; // aapt resource value: 0x7f07002b public const int center = 2131165227; // aapt resource value: 0x7f07002c public const int center_horizontal = 2131165228; // aapt resource value: 0x7f07002d public const int center_vertical = 2131165229; // aapt resource value: 0x7f070052 public const int checkbox = 2131165266; // aapt resource value: 0x7f070092 public const int chronometer = 2131165330; // aapt resource value: 0x7f070033 public const int clip_horizontal = 2131165235; // aapt resource value: 0x7f070034 public const int clip_vertical = 2131165236; // aapt resource value: 0x7f07001f public const int collapseActionView = 2131165215; // aapt resource value: 0x7f07004a public const int contentPanel = 2131165258; // aapt resource value: 0x7f070050 public const int custom = 2131165264; // aapt resource value: 0x7f07004f public const int customPanel = 2131165263; // aapt resource value: 0x7f070058 public const int decor_content_parent = 2131165272; // aapt resource value: 0x7f070040 public const int default_activity_button = 2131165248; // aapt resource value: 0x7f07006a public const int design_bottom_sheet = 2131165290; // aapt resource value: 0x7f070071 public const int design_menu_item_action_area = 2131165297; // aapt resource value: 0x7f070070 public const int design_menu_item_action_area_stub = 2131165296; // aapt resource value: 0x7f07006f public const int design_menu_item_text = 2131165295; // aapt resource value: 0x7f07006e public const int design_navigation_view = 2131165294; // aapt resource value: 0x7f07000e public const int disableHome = 2131165198; // aapt resource value: 0x7f07005c public const int edit_query = 2131165276; // aapt resource value: 0x7f07001c public const int end = 2131165212; // aapt resource value: 0x7f070097 public const int end_padder = 2131165335; // aapt resource value: 0x7f070023 public const int enterAlways = 2131165219; // aapt resource value: 0x7f070024 public const int enterAlwaysCollapsed = 2131165220; // aapt resource value: 0x7f070025 public const int exitUntilCollapsed = 2131165221; // aapt resource value: 0x7f07003e public const int expand_activities_button = 2131165246; // aapt resource value: 0x7f070051 public const int expanded_menu = 2131165265; // aapt resource value: 0x7f070035 public const int fill = 2131165237; // aapt resource value: 0x7f070036 public const int fill_horizontal = 2131165238; // aapt resource value: 0x7f07002e public const int fill_vertical = 2131165230; // aapt resource value: 0x7f070038 public const int @fixed = 2131165240; // aapt resource value: 0x7f070005 public const int home = 2131165189; // aapt resource value: 0x7f07000f public const int homeAsUp = 2131165199; // aapt resource value: 0x7f070042 public const int icon = 2131165250; // aapt resource value: 0x7f070020 public const int ifRoom = 2131165216; // aapt resource value: 0x7f07003f public const int image = 2131165247; // aapt resource value: 0x7f070096 public const int info = 2131165334; // aapt resource value: 0x7f070000 public const int item_touch_helper_previous_elevation = 2131165184; // aapt resource value: 0x7f07002f public const int left = 2131165231; // aapt resource value: 0x7f070090 public const int line1 = 2131165328; // aapt resource value: 0x7f070094 public const int line3 = 2131165332; // aapt resource value: 0x7f07000b public const int listMode = 2131165195; // aapt resource value: 0x7f070041 public const int list_item = 2131165249; // aapt resource value: 0x7f07008e public const int media_actions = 2131165326; // aapt resource value: 0x7f07001d public const int middle = 2131165213; // aapt resource value: 0x7f070037 public const int mini = 2131165239; // aapt resource value: 0x7f07007d public const int mr_art = 2131165309; // aapt resource value: 0x7f070072 public const int mr_chooser_list = 2131165298; // aapt resource value: 0x7f070075 public const int mr_chooser_route_desc = 2131165301; // aapt resource value: 0x7f070073 public const int mr_chooser_route_icon = 2131165299; // aapt resource value: 0x7f070074 public const int mr_chooser_route_name = 2131165300; // aapt resource value: 0x7f07007a public const int mr_close = 2131165306; // aapt resource value: 0x7f070080 public const int mr_control_divider = 2131165312; // aapt resource value: 0x7f070086 public const int mr_control_play_pause = 2131165318; // aapt resource value: 0x7f070089 public const int mr_control_subtitle = 2131165321; // aapt resource value: 0x7f070088 public const int mr_control_title = 2131165320; // aapt resource value: 0x7f070087 public const int mr_control_title_container = 2131165319; // aapt resource value: 0x7f07007b public const int mr_custom_control = 2131165307; // aapt resource value: 0x7f07007c public const int mr_default_control = 2131165308; // aapt resource value: 0x7f070077 public const int mr_dialog_area = 2131165303; // aapt resource value: 0x7f070076 public const int mr_expandable_area = 2131165302; // aapt resource value: 0x7f07008a public const int mr_group_expand_collapse = 2131165322; // aapt resource value: 0x7f07007e public const int mr_media_main_control = 2131165310; // aapt resource value: 0x7f070079 public const int mr_name = 2131165305; // aapt resource value: 0x7f07007f public const int mr_playback_control = 2131165311; // aapt resource value: 0x7f070078 public const int mr_title_bar = 2131165304; // aapt resource value: 0x7f070081 public const int mr_volume_control = 2131165313; // aapt resource value: 0x7f070082 public const int mr_volume_group_list = 2131165314; // aapt resource value: 0x7f070084 public const int mr_volume_item_icon = 2131165316; // aapt resource value: 0x7f070085 public const int mr_volume_slider = 2131165317; // aapt resource value: 0x7f070016 public const int multiply = 2131165206; // aapt resource value: 0x7f07006d public const int navigation_header_container = 2131165293; // aapt resource value: 0x7f070021 public const int never = 2131165217; // aapt resource value: 0x7f070010 public const int none = 2131165200; // aapt resource value: 0x7f07000c public const int normal = 2131165196; // aapt resource value: 0x7f070028 public const int parallax = 2131165224; // aapt resource value: 0x7f070046 public const int parentPanel = 2131165254; // aapt resource value: 0x7f070029 public const int pin = 2131165225; // aapt resource value: 0x7f070006 public const int progress_circular = 2131165190; // aapt resource value: 0x7f070007 public const int progress_horizontal = 2131165191; // aapt resource value: 0x7f070054 public const int radio = 2131165268; // aapt resource value: 0x7f070030 public const int right = 2131165232; // aapt resource value: 0x7f070017 public const int screen = 2131165207; // aapt resource value: 0x7f070026 public const int scroll = 2131165222; // aapt resource value: 0x7f07004e public const int scrollIndicatorDown = 2131165262; // aapt resource value: 0x7f07004b public const int scrollIndicatorUp = 2131165259; // aapt resource value: 0x7f07004c public const int scrollView = 2131165260; // aapt resource value: 0x7f070039 public const int scrollable = 2131165241; // aapt resource value: 0x7f07005e public const int search_badge = 2131165278; // aapt resource value: 0x7f07005d public const int search_bar = 2131165277; // aapt resource value: 0x7f07005f public const int search_button = 2131165279; // aapt resource value: 0x7f070064 public const int search_close_btn = 2131165284; // aapt resource value: 0x7f070060 public const int search_edit_frame = 2131165280; // aapt resource value: 0x7f070066 public const int search_go_btn = 2131165286; // aapt resource value: 0x7f070061 public const int search_mag_icon = 2131165281; // aapt resource value: 0x7f070062 public const int search_plate = 2131165282; // aapt resource value: 0x7f070063 public const int search_src_text = 2131165283; // aapt resource value: 0x7f070067 public const int search_voice_btn = 2131165287; // aapt resource value: 0x7f070068 public const int select_dialog_listview = 2131165288; // aapt resource value: 0x7f070053 public const int shortcut = 2131165267; // aapt resource value: 0x7f070011 public const int showCustom = 2131165201; // aapt resource value: 0x7f070012 public const int showHome = 2131165202; // aapt resource value: 0x7f070013 public const int showTitle = 2131165203; // aapt resource value: 0x7f070098 public const int sliding_tabs = 2131165336; // aapt resource value: 0x7f07006c public const int snackbar_action = 2131165292; // aapt resource value: 0x7f07006b public const int snackbar_text = 2131165291; // aapt resource value: 0x7f070027 public const int snap = 2131165223; // aapt resource value: 0x7f070045 public const int spacer = 2131165253; // aapt resource value: 0x7f070008 public const int split_action_bar = 2131165192; // aapt resource value: 0x7f070018 public const int src_atop = 2131165208; // aapt resource value: 0x7f070019 public const int src_in = 2131165209; // aapt resource value: 0x7f07001a public const int src_over = 2131165210; // aapt resource value: 0x7f070031 public const int start = 2131165233; // aapt resource value: 0x7f07008d public const int status_bar_latest_event_content = 2131165325; // aapt resource value: 0x7f070065 public const int submit_area = 2131165285; // aapt resource value: 0x7f07000d public const int tabMode = 2131165197; // aapt resource value: 0x7f070095 public const int text = 2131165333; // aapt resource value: 0x7f070093 public const int text2 = 2131165331; // aapt resource value: 0x7f07004d public const int textSpacerNoButtons = 2131165261; // aapt resource value: 0x7f070091 public const int time = 2131165329; // aapt resource value: 0x7f070043 public const int title = 2131165251; // aapt resource value: 0x7f070048 public const int title_template = 2131165256; // aapt resource value: 0x7f070099 public const int toolbar = 2131165337; // aapt resource value: 0x7f070032 public const int top = 2131165234; // aapt resource value: 0x7f070047 public const int topPanel = 2131165255; // aapt resource value: 0x7f070069 public const int touch_outside = 2131165289; // aapt resource value: 0x7f070009 public const int up = 2131165193; // aapt resource value: 0x7f070014 public const int useLogo = 2131165204; // aapt resource value: 0x7f07000a public const int view_offset_helper = 2131165194; // aapt resource value: 0x7f070083 public const int volume_item_container = 2131165315; // aapt resource value: 0x7f070022 public const int withText = 2131165218; // aapt resource value: 0x7f070015 public const int wrap_content = 2131165205; static Id() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); } private Id() { } } public partial class Integer { // aapt resource value: 0x7f090004 public const int abc_config_activityDefaultDur = 2131296260; // aapt resource value: 0x7f090005 public const int abc_config_activityShortDur = 2131296261; // aapt resource value: 0x7f090003 public const int abc_max_action_buttons = 2131296259; // aapt resource value: 0x7f090009 public const int bottom_sheet_slide_duration = 2131296265; // aapt resource value: 0x7f090006 public const int cancel_button_image_alpha = 2131296262; // aapt resource value: 0x7f090008 public const int design_snackbar_text_max_lines = 2131296264; // aapt resource value: 0x7f090000 public const int mr_controller_volume_group_list_animation_duration_ms = 2131296256; // aapt resource value: 0x7f090001 public const int mr_controller_volume_group_list_fade_in_duration_ms = 2131296257; // aapt resource value: 0x7f090002 public const int mr_controller_volume_group_list_fade_out_duration_ms = 2131296258; // aapt resource value: 0x7f090007 public const int status_bar_notification_info_maxnum = 2131296263; static Integer() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); } private Integer() { } } public partial class Interpolator { // aapt resource value: 0x7f050000 public const int mr_fast_out_slow_in = 2131034112; // aapt resource value: 0x7f050001 public const int mr_linear_out_slow_in = 2131034113; static Interpolator() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); } private Interpolator() { } } public partial class Layout { // aapt resource value: 0x7f030000 public const int abc_action_bar_title_item = 2130903040; // aapt resource value: 0x7f030001 public const int abc_action_bar_up_container = 2130903041; // aapt resource value: 0x7f030002 public const int abc_action_bar_view_list_nav_layout = 2130903042; // aapt resource value: 0x7f030003 public const int abc_action_menu_item_layout = 2130903043; // aapt resource value: 0x7f030004 public const int abc_action_menu_layout = 2130903044; // aapt resource value: 0x7f030005 public const int abc_action_mode_bar = 2130903045; // aapt resource value: 0x7f030006 public const int abc_action_mode_close_item_material = 2130903046; // aapt resource value: 0x7f030007 public const int abc_activity_chooser_view = 2130903047; // aapt resource value: 0x7f030008 public const int abc_activity_chooser_view_list_item = 2130903048; // aapt resource value: 0x7f030009 public const int abc_alert_dialog_button_bar_material = 2130903049; // aapt resource value: 0x7f03000a public const int abc_alert_dialog_material = 2130903050; // aapt resource value: 0x7f03000b public const int abc_dialog_title_material = 2130903051; // aapt resource value: 0x7f03000c public const int abc_expanded_menu_layout = 2130903052; // aapt resource value: 0x7f03000d public const int abc_list_menu_item_checkbox = 2130903053; // aapt resource value: 0x7f03000e public const int abc_list_menu_item_icon = 2130903054; // aapt resource value: 0x7f03000f public const int abc_list_menu_item_layout = 2130903055; // aapt resource value: 0x7f030010 public const int abc_list_menu_item_radio = 2130903056; // aapt resource value: 0x7f030011 public const int abc_popup_menu_item_layout = 2130903057; // aapt resource value: 0x7f030012 public const int abc_screen_content_include = 2130903058; // aapt resource value: 0x7f030013 public const int abc_screen_simple = 2130903059; // aapt resource value: 0x7f030014 public const int abc_screen_simple_overlay_action_mode = 2130903060; // aapt resource value: 0x7f030015 public const int abc_screen_toolbar = 2130903061; // aapt resource value: 0x7f030016 public const int abc_search_dropdown_item_icons_2line = 2130903062; // aapt resource value: 0x7f030017 public const int abc_search_view = 2130903063; // aapt resource value: 0x7f030018 public const int abc_select_dialog_material = 2130903064; // aapt resource value: 0x7f030019 public const int design_bottom_sheet_dialog = 2130903065; // aapt resource value: 0x7f03001a public const int design_layout_snackbar = 2130903066; // aapt resource value: 0x7f03001b public const int design_layout_snackbar_include = 2130903067; // aapt resource value: 0x7f03001c public const int design_layout_tab_icon = 2130903068; // aapt resource value: 0x7f03001d public const int design_layout_tab_text = 2130903069; // aapt resource value: 0x7f03001e public const int design_menu_item_action_area = 2130903070; // aapt resource value: 0x7f03001f public const int design_navigation_item = 2130903071; // aapt resource value: 0x7f030020 public const int design_navigation_item_header = 2130903072; // aapt resource value: 0x7f030021 public const int design_navigation_item_separator = 2130903073; // aapt resource value: 0x7f030022 public const int design_navigation_item_subheader = 2130903074; // aapt resource value: 0x7f030023 public const int design_navigation_menu = 2130903075; // aapt resource value: 0x7f030024 public const int design_navigation_menu_item = 2130903076; // aapt resource value: 0x7f030025 public const int mr_chooser_dialog = 2130903077; // aapt resource value: 0x7f030026 public const int mr_chooser_list_item = 2130903078; // aapt resource value: 0x7f030027 public const int mr_controller_material_dialog_b = 2130903079; // aapt resource value: 0x7f030028 public const int mr_controller_volume_item = 2130903080; // aapt resource value: 0x7f030029 public const int mr_playback_control = 2130903081; // aapt resource value: 0x7f03002a public const int mr_volume_control = 2130903082; // aapt resource value: 0x7f03002b public const int notification_media_action = 2130903083; // aapt resource value: 0x7f03002c public const int notification_media_cancel_action = 2130903084; // aapt resource value: 0x7f03002d public const int notification_template_big_media = 2130903085; // aapt resource value: 0x7f03002e public const int notification_template_big_media_narrow = 2130903086; // aapt resource value: 0x7f03002f public const int notification_template_lines = 2130903087; // aapt resource value: 0x7f030030 public const int notification_template_media = 2130903088; // aapt resource value: 0x7f030031 public const int notification_template_part_chronometer = 2130903089; // aapt resource value: 0x7f030032 public const int notification_template_part_time = 2130903090; // aapt resource value: 0x7f030033 public const int select_dialog_item_material = 2130903091; // aapt resource value: 0x7f030034 public const int select_dialog_multichoice_material = 2130903092; // aapt resource value: 0x7f030035 public const int select_dialog_singlechoice_material = 2130903093; // aapt resource value: 0x7f030036 public const int support_simple_spinner_dropdown_item = 2130903094; // aapt resource value: 0x7f030037 public const int tabs = 2130903095; // aapt resource value: 0x7f030038 public const int toolbar = 2130903096; static Layout() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); } private Layout() { } } public partial class String { // aapt resource value: 0x7f08000f public const int abc_action_bar_home_description = 2131230735; // aapt resource value: 0x7f080010 public const int abc_action_bar_home_description_format = 2131230736; // aapt resource value: 0x7f080011 public const int abc_action_bar_home_subtitle_description_format = 2131230737; // aapt resource value: 0x7f080012 public const int abc_action_bar_up_description = 2131230738; // aapt resource value: 0x7f080013 public const int abc_action_menu_overflow_description = 2131230739; // aapt resource value: 0x7f080014 public const int abc_action_mode_done = 2131230740; // aapt resource value: 0x7f080015 public const int abc_activity_chooser_view_see_all = 2131230741; // aapt resource value: 0x7f080016 public const int abc_activitychooserview_choose_application = 2131230742; // aapt resource value: 0x7f080017 public const int abc_capital_off = 2131230743; // aapt resource value: 0x7f080018 public const int abc_capital_on = 2131230744; // aapt resource value: 0x7f080019 public const int abc_search_hint = 2131230745; // aapt resource value: 0x7f08001a public const int abc_searchview_description_clear = 2131230746; // aapt resource value: 0x7f08001b public const int abc_searchview_description_query = 2131230747; // aapt resource value: 0x7f08001c public const int abc_searchview_description_search = 2131230748; // aapt resource value: 0x7f08001d public const int abc_searchview_description_submit = 2131230749; // aapt resource value: 0x7f08001e public const int abc_searchview_description_voice = 2131230750; // aapt resource value: 0x7f08001f public const int abc_shareactionprovider_share_with = 2131230751; // aapt resource value: 0x7f080020 public const int abc_shareactionprovider_share_with_application = 2131230752; // aapt resource value: 0x7f080021 public const int abc_toolbar_collapse_description = 2131230753; // aapt resource value: 0x7f080023 public const int appbar_scrolling_view_behavior = 2131230755; // aapt resource value: 0x7f080024 public const int bottom_sheet_behavior = 2131230756; // aapt resource value: 0x7f080025 public const int character_counter_pattern = 2131230757; // aapt resource value: 0x7f080026 public const int library_name = 2131230758; // aapt resource value: 0x7f080000 public const int mr_button_content_description = 2131230720; // aapt resource value: 0x7f080001 public const int mr_chooser_searching = 2131230721; // aapt resource value: 0x7f080002 public const int mr_chooser_title = 2131230722; // aapt resource value: 0x7f080003 public const int mr_controller_casting_screen = 2131230723; // aapt resource value: 0x7f080004 public const int mr_controller_close_description = 2131230724; // aapt resource value: 0x7f080005 public const int mr_controller_collapse_group = 2131230725; // aapt resource value: 0x7f080006 public const int mr_controller_disconnect = 2131230726; // aapt resource value: 0x7f080007 public const int mr_controller_expand_group = 2131230727; // aapt resource value: 0x7f080008 public const int mr_controller_no_info_available = 2131230728; // aapt resource value: 0x7f080009 public const int mr_controller_no_media_selected = 2131230729; // aapt resource value: 0x7f08000a public const int mr_controller_pause = 2131230730; // aapt resource value: 0x7f08000b public const int mr_controller_play = 2131230731; // aapt resource value: 0x7f08000c public const int mr_controller_stop = 2131230732; // aapt resource value: 0x7f08000d public const int mr_system_route_name = 2131230733; // aapt resource value: 0x7f08000e public const int mr_user_route_category_name = 2131230734; // aapt resource value: 0x7f080022 public const int status_bar_notification_info_overflow = 2131230754; static String() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); } private String() { } } public partial class Style { // aapt resource value: 0x7f0a00a1 public const int AlertDialog_AppCompat = 2131361953; // aapt resource value: 0x7f0a00a2 public const int AlertDialog_AppCompat_Light = 2131361954; // aapt resource value: 0x7f0a00a3 public const int Animation_AppCompat_Dialog = 2131361955; // aapt resource value: 0x7f0a00a4 public const int Animation_AppCompat_DropDownUp = 2131361956; // aapt resource value: 0x7f0a015a public const int Animation_Design_BottomSheetDialog = 2131362138; // aapt resource value: 0x7f0a00a5 public const int Base_AlertDialog_AppCompat = 2131361957; // aapt resource value: 0x7f0a00a6 public const int Base_AlertDialog_AppCompat_Light = 2131361958; // aapt resource value: 0x7f0a00a7 public const int Base_Animation_AppCompat_Dialog = 2131361959; // aapt resource value: 0x7f0a00a8 public const int Base_Animation_AppCompat_DropDownUp = 2131361960; // aapt resource value: 0x7f0a0018 public const int Base_CardView = 2131361816; // aapt resource value: 0x7f0a00a9 public const int Base_DialogWindowTitle_AppCompat = 2131361961; // aapt resource value: 0x7f0a00aa public const int Base_DialogWindowTitleBackground_AppCompat = 2131361962; // aapt resource value: 0x7f0a0051 public const int Base_TextAppearance_AppCompat = 2131361873; // aapt resource value: 0x7f0a0052 public const int Base_TextAppearance_AppCompat_Body1 = 2131361874; // aapt resource value: 0x7f0a0053 public const int Base_TextAppearance_AppCompat_Body2 = 2131361875; // aapt resource value: 0x7f0a003b public const int Base_TextAppearance_AppCompat_Button = 2131361851; // aapt resource value: 0x7f0a0054 public const int Base_TextAppearance_AppCompat_Caption = 2131361876; // aapt resource value: 0x7f0a0055 public const int Base_TextAppearance_AppCompat_Display1 = 2131361877; // aapt resource value: 0x7f0a0056 public const int Base_TextAppearance_AppCompat_Display2 = 2131361878; // aapt resource value: 0x7f0a0057 public const int Base_TextAppearance_AppCompat_Display3 = 2131361879; // aapt resource value: 0x7f0a0058 public const int Base_TextAppearance_AppCompat_Display4 = 2131361880; // aapt resource value: 0x7f0a0059 public const int Base_TextAppearance_AppCompat_Headline = 2131361881; // aapt resource value: 0x7f0a0026 public const int Base_TextAppearance_AppCompat_Inverse = 2131361830; // aapt resource value: 0x7f0a005a public const int Base_TextAppearance_AppCompat_Large = 2131361882; // aapt resource value: 0x7f0a0027 public const int Base_TextAppearance_AppCompat_Large_Inverse = 2131361831; // aapt resource value: 0x7f0a005b public const int Base_TextAppearance_AppCompat_Light_Widget_PopupMenu_Large = 2131361883; // aapt resource value: 0x7f0a005c public const int Base_TextAppearance_AppCompat_Light_Widget_PopupMenu_Small = 2131361884; // aapt resource value: 0x7f0a005d public const int Base_TextAppearance_AppCompat_Medium = 2131361885; // aapt resource value: 0x7f0a0028 public const int Base_TextAppearance_AppCompat_Medium_Inverse = 2131361832; // aapt resource value: 0x7f0a005e public const int Base_TextAppearance_AppCompat_Menu = 2131361886; // aapt resource value: 0x7f0a00ab public const int Base_TextAppearance_AppCompat_SearchResult = 2131361963; // aapt resource value: 0x7f0a005f public const int Base_TextAppearance_AppCompat_SearchResult_Subtitle = 2131361887; // aapt resource value: 0x7f0a0060 public const int Base_TextAppearance_AppCompat_SearchResult_Title = 2131361888; // aapt resource value: 0x7f0a0061 public const int Base_TextAppearance_AppCompat_Small = 2131361889; // aapt resource value: 0x7f0a0029 public const int Base_TextAppearance_AppCompat_Small_Inverse = 2131361833; // aapt resource value: 0x7f0a0062 public const int Base_TextAppearance_AppCompat_Subhead = 2131361890; // aapt resource value: 0x7f0a002a public const int Base_TextAppearance_AppCompat_Subhead_Inverse = 2131361834; // aapt resource value: 0x7f0a0063 public const int Base_TextAppearance_AppCompat_Title = 2131361891; // aapt resource value: 0x7f0a002b public const int Base_TextAppearance_AppCompat_Title_Inverse = 2131361835; // aapt resource value: 0x7f0a009a public const int Base_TextAppearance_AppCompat_Widget_ActionBar_Menu = 2131361946; // aapt resource value: 0x7f0a0064 public const int Base_TextAppearance_AppCompat_Widget_ActionBar_Subtitle = 2131361892; // aapt resource value: 0x7f0a0065 public const int Base_TextAppearance_AppCompat_Widget_ActionBar_Subtitle_Inverse = 2131361893; // aapt resource value: 0x7f0a0066 public const int Base_TextAppearance_AppCompat_Widget_ActionBar_Title = 2131361894; // aapt resource value: 0x7f0a0067 public const int Base_TextAppearance_AppCompat_Widget_ActionBar_Title_Inverse = 2131361895; // aapt resource value: 0x7f0a0068 public const int Base_TextAppearance_AppCompat_Widget_ActionMode_Subtitle = 2131361896; // aapt resource value: 0x7f0a0069 public const int Base_TextAppearance_AppCompat_Widget_ActionMode_Title = 2131361897; // aapt resource value: 0x7f0a006a public const int Base_TextAppearance_AppCompat_Widget_Button = 2131361898; // aapt resource value: 0x7f0a009b public const int Base_TextAppearance_AppCompat_Widget_Button_Inverse = 2131361947; // aapt resource value: 0x7f0a00ac public const int Base_TextAppearance_AppCompat_Widget_DropDownItem = 2131361964; // aapt resource value: 0x7f0a006b public const int Base_TextAppearance_AppCompat_Widget_PopupMenu_Large = 2131361899; // aapt resource value: 0x7f0a006c public const int Base_TextAppearance_AppCompat_Widget_PopupMenu_Small = 2131361900; // aapt resource value: 0x7f0a006d public const int Base_TextAppearance_AppCompat_Widget_Switch = 2131361901; // aapt resource value: 0x7f0a006e public const int Base_TextAppearance_AppCompat_Widget_TextView_SpinnerItem = 2131361902; // aapt resource value: 0x7f0a00ad public const int Base_TextAppearance_Widget_AppCompat_ExpandedMenu_Item = 2131361965; // aapt resource value: 0x7f0a006f public const int Base_TextAppearance_Widget_AppCompat_Toolbar_Subtitle = 2131361903; // aapt resource value: 0x7f0a0070 public const int Base_TextAppearance_Widget_AppCompat_Toolbar_Title = 2131361904; // aapt resource value: 0x7f0a0071 public const int Base_Theme_AppCompat = 2131361905; // aapt resource value: 0x7f0a00ae public const int Base_Theme_AppCompat_CompactMenu = 2131361966; // aapt resource value: 0x7f0a002c public const int Base_Theme_AppCompat_Dialog = 2131361836; // aapt resource value: 0x7f0a00af public const int Base_Theme_AppCompat_Dialog_Alert = 2131361967; // aapt resource value: 0x7f0a00b0 public const int Base_Theme_AppCompat_Dialog_FixedSize = 2131361968; // aapt resource value: 0x7f0a00b1 public const int Base_Theme_AppCompat_Dialog_MinWidth = 2131361969; // aapt resource value: 0x7f0a001c public const int Base_Theme_AppCompat_DialogWhenLarge = 2131361820; // aapt resource value: 0x7f0a0072 public const int Base_Theme_AppCompat_Light = 2131361906; // aapt resource value: 0x7f0a00b2 public const int Base_Theme_AppCompat_Light_DarkActionBar = 2131361970; // aapt resource value: 0x7f0a002d public const int Base_Theme_AppCompat_Light_Dialog = 2131361837; // aapt resource value: 0x7f0a00b3 public const int Base_Theme_AppCompat_Light_Dialog_Alert = 2131361971; // aapt resource value: 0x7f0a00b4 public const int Base_Theme_AppCompat_Light_Dialog_FixedSize = 2131361972; // aapt resource value: 0x7f0a00b5 public const int Base_Theme_AppCompat_Light_Dialog_MinWidth = 2131361973; // aapt resource value: 0x7f0a001d public const int Base_Theme_AppCompat_Light_DialogWhenLarge = 2131361821; // aapt resource value: 0x7f0a00b6 public const int Base_ThemeOverlay_AppCompat = 2131361974; // aapt resource value: 0x7f0a00b7 public const int Base_ThemeOverlay_AppCompat_ActionBar = 2131361975; // aapt resource value: 0x7f0a00b8 public const int Base_ThemeOverlay_AppCompat_Dark = 2131361976; // aapt resource value: 0x7f0a00b9 public const int Base_ThemeOverlay_AppCompat_Dark_ActionBar = 2131361977; // aapt resource value: 0x7f0a00ba public const int Base_ThemeOverlay_AppCompat_Light = 2131361978; // aapt resource value: 0x7f0a002e public const int Base_V11_Theme_AppCompat_Dialog = 2131361838; // aapt resource value: 0x7f0a002f public const int Base_V11_Theme_AppCompat_Light_Dialog = 2131361839; // aapt resource value: 0x7f0a0037 public const int Base_V12_Widget_AppCompat_AutoCompleteTextView = 2131361847; // aapt resource value: 0x7f0a0038 public const int Base_V12_Widget_AppCompat_EditText = 2131361848; // aapt resource value: 0x7f0a0073 public const int Base_V21_Theme_AppCompat = 2131361907; // aapt resource value: 0x7f0a0074 public const int Base_V21_Theme_AppCompat_Dialog = 2131361908; // aapt resource value: 0x7f0a0075 public const int Base_V21_Theme_AppCompat_Light = 2131361909; // aapt resource value: 0x7f0a0076 public const int Base_V21_Theme_AppCompat_Light_Dialog = 2131361910; // aapt resource value: 0x7f0a0098 public const int Base_V22_Theme_AppCompat = 2131361944; // aapt resource value: 0x7f0a0099 public const int Base_V22_Theme_AppCompat_Light = 2131361945; // aapt resource value: 0x7f0a009c public const int Base_V23_Theme_AppCompat = 2131361948; // aapt resource value: 0x7f0a009d public const int Base_V23_Theme_AppCompat_Light = 2131361949; // aapt resource value: 0x7f0a00bb public const int Base_V7_Theme_AppCompat = 2131361979; // aapt resource value: 0x7f0a00bc public const int Base_V7_Theme_AppCompat_Dialog = 2131361980; // aapt resource value: 0x7f0a00bd public const int Base_V7_Theme_AppCompat_Light = 2131361981; // aapt resource value: 0x7f0a00be public const int Base_V7_Theme_AppCompat_Light_Dialog = 2131361982; // aapt resource value: 0x7f0a00bf public const int Base_V7_Widget_AppCompat_AutoCompleteTextView = 2131361983; // aapt resource value: 0x7f0a00c0 public const int Base_V7_Widget_AppCompat_EditText = 2131361984; // aapt resource value: 0x7f0a00c1 public const int Base_Widget_AppCompat_ActionBar = 2131361985; // aapt resource value: 0x7f0a00c2 public const int Base_Widget_AppCompat_ActionBar_Solid = 2131361986; // aapt resource value: 0x7f0a00c3 public const int Base_Widget_AppCompat_ActionBar_TabBar = 2131361987; // aapt resource value: 0x7f0a0077 public const int Base_Widget_AppCompat_ActionBar_TabText = 2131361911; // aapt resource value: 0x7f0a0078 public const int Base_Widget_AppCompat_ActionBar_TabView = 2131361912; // aapt resource value: 0x7f0a0079 public const int Base_Widget_AppCompat_ActionButton = 2131361913; // aapt resource value: 0x7f0a007a public const int Base_Widget_AppCompat_ActionButton_CloseMode = 2131361914; // aapt resource value: 0x7f0a007b public const int Base_Widget_AppCompat_ActionButton_Overflow = 2131361915; // aapt resource value: 0x7f0a00c4 public const int Base_Widget_AppCompat_ActionMode = 2131361988; // aapt resource value: 0x7f0a00c5 public const int Base_Widget_AppCompat_ActivityChooserView = 2131361989; // aapt resource value: 0x7f0a0039 public const int Base_Widget_AppCompat_AutoCompleteTextView = 2131361849; // aapt resource value: 0x7f0a007c public const int Base_Widget_AppCompat_Button = 2131361916; // aapt resource value: 0x7f0a007d public const int Base_Widget_AppCompat_Button_Borderless = 2131361917; // aapt resource value: 0x7f0a007e public const int Base_Widget_AppCompat_Button_Borderless_Colored = 2131361918; // aapt resource value: 0x7f0a00c6 public const int Base_Widget_AppCompat_Button_ButtonBar_AlertDialog = 2131361990; // aapt resource value: 0x7f0a009e public const int Base_Widget_AppCompat_Button_Colored = 2131361950; // aapt resource value: 0x7f0a007f public const int Base_Widget_AppCompat_Button_Small = 2131361919; // aapt resource value: 0x7f0a0080 public const int Base_Widget_AppCompat_ButtonBar = 2131361920; // aapt resource value: 0x7f0a00c7 public const int Base_Widget_AppCompat_ButtonBar_AlertDialog = 2131361991; // aapt resource value: 0x7f0a0081 public const int Base_Widget_AppCompat_CompoundButton_CheckBox = 2131361921; // aapt resource value: 0x7f0a0082 public const int Base_Widget_AppCompat_CompoundButton_RadioButton = 2131361922; // aapt resource value: 0x7f0a00c8 public const int Base_Widget_AppCompat_CompoundButton_Switch = 2131361992; // aapt resource value: 0x7f0a001b public const int Base_Widget_AppCompat_DrawerArrowToggle = 2131361819; // aapt resource value: 0x7f0a00c9 public const int Base_Widget_AppCompat_DrawerArrowToggle_Common = 2131361993; // aapt resource value: 0x7f0a0083 public const int Base_Widget_AppCompat_DropDownItem_Spinner = 2131361923; // aapt resource value: 0x7f0a003a public const int Base_Widget_AppCompat_EditText = 2131361850; // aapt resource value: 0x7f0a0084 public const int Base_Widget_AppCompat_ImageButton = 2131361924; // aapt resource value: 0x7f0a00ca public const int Base_Widget_AppCompat_Light_ActionBar = 2131361994; // aapt resource value: 0x7f0a00cb public const int Base_Widget_AppCompat_Light_ActionBar_Solid = 2131361995; // aapt resource value: 0x7f0a00cc public const int Base_Widget_AppCompat_Light_ActionBar_TabBar = 2131361996; // aapt resource value: 0x7f0a0085 public const int Base_Widget_AppCompat_Light_ActionBar_TabText = 2131361925; // aapt resource value: 0x7f0a0086 public const int Base_Widget_AppCompat_Light_ActionBar_TabText_Inverse = 2131361926; // aapt resource value: 0x7f0a0087 public const int Base_Widget_AppCompat_Light_ActionBar_TabView = 2131361927; // aapt resource value: 0x7f0a0088 public const int Base_Widget_AppCompat_Light_PopupMenu = 2131361928; // aapt resource value: 0x7f0a0089 public const int Base_Widget_AppCompat_Light_PopupMenu_Overflow = 2131361929; // aapt resource value: 0x7f0a008a public const int Base_Widget_AppCompat_ListPopupWindow = 2131361930; // aapt resource value: 0x7f0a008b public const int Base_Widget_AppCompat_ListView = 2131361931; // aapt resource value: 0x7f0a008c public const int Base_Widget_AppCompat_ListView_DropDown = 2131361932; // aapt resource value: 0x7f0a008d public const int Base_Widget_AppCompat_ListView_Menu = 2131361933; // aapt resource value: 0x7f0a008e public const int Base_Widget_AppCompat_PopupMenu = 2131361934; // aapt resource value: 0x7f0a008f public const int Base_Widget_AppCompat_PopupMenu_Overflow = 2131361935; // aapt resource value: 0x7f0a00cd public const int Base_Widget_AppCompat_PopupWindow = 2131361997; // aapt resource value: 0x7f0a0030 public const int Base_Widget_AppCompat_ProgressBar = 2131361840; // aapt resource value: 0x7f0a0031 public const int Base_Widget_AppCompat_ProgressBar_Horizontal = 2131361841; // aapt resource value: 0x7f0a0090 public const int Base_Widget_AppCompat_RatingBar = 2131361936; // aapt resource value: 0x7f0a009f public const int Base_Widget_AppCompat_RatingBar_Indicator = 2131361951; // aapt resource value: 0x7f0a00a0 public const int Base_Widget_AppCompat_RatingBar_Small = 2131361952; // aapt resource value: 0x7f0a00ce public const int Base_Widget_AppCompat_SearchView = 2131361998; // aapt resource value: 0x7f0a00cf public const int Base_Widget_AppCompat_SearchView_ActionBar = 2131361999; // aapt resource value: 0x7f0a0091 public const int Base_Widget_AppCompat_SeekBar = 2131361937; // aapt resource value: 0x7f0a0092 public const int Base_Widget_AppCompat_Spinner = 2131361938; // aapt resource value: 0x7f0a001e public const int Base_Widget_AppCompat_Spinner_Underlined = 2131361822; // aapt resource value: 0x7f0a0093 public const int Base_Widget_AppCompat_TextView_SpinnerItem = 2131361939; // aapt resource value: 0x7f0a00d0 public const int Base_Widget_AppCompat_Toolbar = 2131362000; // aapt resource value: 0x7f0a0094 public const int Base_Widget_AppCompat_Toolbar_Button_Navigation = 2131361940; // aapt resource value: 0x7f0a015b public const int Base_Widget_Design_TabLayout = 2131362139; // aapt resource value: 0x7f0a0017 public const int CardView = 2131361815; // aapt resource value: 0x7f0a0019 public const int CardView_Dark = 2131361817; // aapt resource value: 0x7f0a001a public const int CardView_Light = 2131361818; // aapt resource value: 0x7f0a0172 public const int MyTheme = 2131362162; // aapt resource value: 0x7f0a0173 public const int MyTheme_Base = 2131362163; // aapt resource value: 0x7f0a0032 public const int Platform_AppCompat = 2131361842; // aapt resource value: 0x7f0a0033 public const int Platform_AppCompat_Light = 2131361843; // aapt resource value: 0x7f0a0095 public const int Platform_ThemeOverlay_AppCompat = 2131361941; // aapt resource value: 0x7f0a0096 public const int Platform_ThemeOverlay_AppCompat_Dark = 2131361942; // aapt resource value: 0x7f0a0097 public const int Platform_ThemeOverlay_AppCompat_Light = 2131361943; // aapt resource value: 0x7f0a0034 public const int Platform_V11_AppCompat = 2131361844; // aapt resource value: 0x7f0a0035 public const int Platform_V11_AppCompat_Light = 2131361845; // aapt resource value: 0x7f0a003c public const int Platform_V14_AppCompat = 2131361852; // aapt resource value: 0x7f0a003d public const int Platform_V14_AppCompat_Light = 2131361853; // aapt resource value: 0x7f0a0036 public const int Platform_Widget_AppCompat_Spinner = 2131361846; // aapt resource value: 0x7f0a0043 public const int RtlOverlay_DialogWindowTitle_AppCompat = 2131361859; // aapt resource value: 0x7f0a0044 public const int RtlOverlay_Widget_AppCompat_ActionBar_TitleItem = 2131361860; // aapt resource value: 0x7f0a0045 public const int RtlOverlay_Widget_AppCompat_DialogTitle_Icon = 2131361861; // aapt resource value: 0x7f0a0046 public const int RtlOverlay_Widget_AppCompat_PopupMenuItem = 2131361862; // aapt resource value: 0x7f0a0047 public const int RtlOverlay_Widget_AppCompat_PopupMenuItem_InternalGroup = 2131361863; // aapt resource value: 0x7f0a0048 public const int RtlOverlay_Widget_AppCompat_PopupMenuItem_Text = 2131361864; // aapt resource value: 0x7f0a0049 public const int RtlOverlay_Widget_AppCompat_Search_DropDown = 2131361865; // aapt resource value: 0x7f0a004a public const int RtlOverlay_Widget_AppCompat_Search_DropDown_Icon1 = 2131361866; // aapt resource value: 0x7f0a004b public const int RtlOverlay_Widget_AppCompat_Search_DropDown_Icon2 = 2131361867; // aapt resource value: 0x7f0a004c public const int RtlOverlay_Widget_AppCompat_Search_DropDown_Query = 2131361868; // aapt resource value: 0x7f0a004d public const int RtlOverlay_Widget_AppCompat_Search_DropDown_Text = 2131361869; // aapt resource value: 0x7f0a004e public const int RtlOverlay_Widget_AppCompat_SearchView_MagIcon = 2131361870; // aapt resource value: 0x7f0a004f public const int RtlUnderlay_Widget_AppCompat_ActionButton = 2131361871; // aapt resource value: 0x7f0a0050 public const int RtlUnderlay_Widget_AppCompat_ActionButton_Overflow = 2131361872; // aapt resource value: 0x7f0a00d1 public const int TextAppearance_AppCompat = 2131362001; // aapt resource value: 0x7f0a00d2 public const int TextAppearance_AppCompat_Body1 = 2131362002; // aapt resource value: 0x7f0a00d3 public const int TextAppearance_AppCompat_Body2 = 2131362003; // aapt resource value: 0x7f0a00d4 public const int TextAppearance_AppCompat_Button = 2131362004; // aapt resource value: 0x7f0a00d5 public const int TextAppearance_AppCompat_Caption = 2131362005; // aapt resource value: 0x7f0a00d6 public const int TextAppearance_AppCompat_Display1 = 2131362006; // aapt resource value: 0x7f0a00d7 public const int TextAppearance_AppCompat_Display2 = 2131362007; // aapt resource value: 0x7f0a00d8 public const int TextAppearance_AppCompat_Display3 = 2131362008; // aapt resource value: 0x7f0a00d9 public const int TextAppearance_AppCompat_Display4 = 2131362009; // aapt resource value: 0x7f0a00da public const int TextAppearance_AppCompat_Headline = 2131362010; // aapt resource value: 0x7f0a00db public const int TextAppearance_AppCompat_Inverse = 2131362011; // aapt resource value: 0x7f0a00dc public const int TextAppearance_AppCompat_Large = 2131362012; // aapt resource value: 0x7f0a00dd public const int TextAppearance_AppCompat_Large_Inverse = 2131362013; // aapt resource value: 0x7f0a00de public const int TextAppearance_AppCompat_Light_SearchResult_Subtitle = 2131362014; // aapt resource value: 0x7f0a00df public const int TextAppearance_AppCompat_Light_SearchResult_Title = 2131362015; // aapt resource value: 0x7f0a00e0 public const int TextAppearance_AppCompat_Light_Widget_PopupMenu_Large = 2131362016; // aapt resource value: 0x7f0a00e1 public const int TextAppearance_AppCompat_Light_Widget_PopupMenu_Small = 2131362017; // aapt resource value: 0x7f0a00e2 public const int TextAppearance_AppCompat_Medium = 2131362018; // aapt resource value: 0x7f0a00e3 public const int TextAppearance_AppCompat_Medium_Inverse = 2131362019; // aapt resource value: 0x7f0a00e4 public const int TextAppearance_AppCompat_Menu = 2131362020; // aapt resource value: 0x7f0a00e5 public const int TextAppearance_AppCompat_SearchResult_Subtitle = 2131362021; // aapt resource value: 0x7f0a00e6 public const int TextAppearance_AppCompat_SearchResult_Title = 2131362022; // aapt resource value: 0x7f0a00e7 public const int TextAppearance_AppCompat_Small = 2131362023; // aapt resource value: 0x7f0a00e8 public const int TextAppearance_AppCompat_Small_Inverse = 2131362024; // aapt resource value: 0x7f0a00e9 public const int TextAppearance_AppCompat_Subhead = 2131362025; // aapt resource value: 0x7f0a00ea public const int TextAppearance_AppCompat_Subhead_Inverse = 2131362026; // aapt resource value: 0x7f0a00eb public const int TextAppearance_AppCompat_Title = 2131362027; // aapt resource value: 0x7f0a00ec public const int TextAppearance_AppCompat_Title_Inverse = 2131362028; // aapt resource value: 0x7f0a00ed public const int TextAppearance_AppCompat_Widget_ActionBar_Menu = 2131362029; // aapt resource value: 0x7f0a00ee public const int TextAppearance_AppCompat_Widget_ActionBar_Subtitle = 2131362030; // aapt resource value: 0x7f0a00ef public const int TextAppearance_AppCompat_Widget_ActionBar_Subtitle_Inverse = 2131362031; // aapt resource value: 0x7f0a00f0 public const int TextAppearance_AppCompat_Widget_ActionBar_Title = 2131362032; // aapt resource value: 0x7f0a00f1 public const int TextAppearance_AppCompat_Widget_ActionBar_Title_Inverse = 2131362033; // aapt resource value: 0x7f0a00f2 public const int TextAppearance_AppCompat_Widget_ActionMode_Subtitle = 2131362034; // aapt resource value: 0x7f0a00f3 public const int TextAppearance_AppCompat_Widget_ActionMode_Subtitle_Inverse = 2131362035; // aapt resource value: 0x7f0a00f4 public const int TextAppearance_AppCompat_Widget_ActionMode_Title = 2131362036; // aapt resource value: 0x7f0a00f5 public const int TextAppearance_AppCompat_Widget_ActionMode_Title_Inverse = 2131362037; // aapt resource value: 0x7f0a00f6 public const int TextAppearance_AppCompat_Widget_Button = 2131362038; // aapt resource value: 0x7f0a00f7 public const int TextAppearance_AppCompat_Widget_Button_Inverse = 2131362039; // aapt resource value: 0x7f0a00f8 public const int TextAppearance_AppCompat_Widget_DropDownItem = 2131362040; // aapt resource value: 0x7f0a00f9 public const int TextAppearance_AppCompat_Widget_PopupMenu_Large = 2131362041; // aapt resource value: 0x7f0a00fa public const int TextAppearance_AppCompat_Widget_PopupMenu_Small = 2131362042; // aapt resource value: 0x7f0a00fb public const int TextAppearance_AppCompat_Widget_Switch = 2131362043; // aapt resource value: 0x7f0a00fc public const int TextAppearance_AppCompat_Widget_TextView_SpinnerItem = 2131362044; // aapt resource value: 0x7f0a015c public const int TextAppearance_Design_CollapsingToolbar_Expanded = 2131362140; // aapt resource value: 0x7f0a015d public const int TextAppearance_Design_Counter = 2131362141; // aapt resource value: 0x7f0a015e public const int TextAppearance_Design_Counter_Overflow = 2131362142; // aapt resource value: 0x7f0a015f public const int TextAppearance_Design_Error = 2131362143; // aapt resource value: 0x7f0a0160 public const int TextAppearance_Design_Hint = 2131362144; // aapt resource value: 0x7f0a0161 public const int TextAppearance_Design_Snackbar_Message = 2131362145; // aapt resource value: 0x7f0a0162 public const int TextAppearance_Design_Tab = 2131362146; // aapt resource value: 0x7f0a003e public const int TextAppearance_StatusBar_EventContent = 2131361854; // aapt resource value: 0x7f0a003f public const int TextAppearance_StatusBar_EventContent_Info = 2131361855; // aapt resource value: 0x7f0a0040 public const int TextAppearance_StatusBar_EventContent_Line2 = 2131361856; // aapt resource value: 0x7f0a0041 public const int TextAppearance_StatusBar_EventContent_Time = 2131361857; // aapt resource value: 0x7f0a0042 public const int TextAppearance_StatusBar_EventContent_Title = 2131361858; // aapt resource value: 0x7f0a00fd public const int TextAppearance_Widget_AppCompat_ExpandedMenu_Item = 2131362045; // aapt resource value: 0x7f0a00fe public const int TextAppearance_Widget_AppCompat_Toolbar_Subtitle = 2131362046; // aapt resource value: 0x7f0a00ff public const int TextAppearance_Widget_AppCompat_Toolbar_Title = 2131362047; // aapt resource value: 0x7f0a0100 public const int Theme_AppCompat = 2131362048; // aapt resource value: 0x7f0a0101 public const int Theme_AppCompat_CompactMenu = 2131362049; // aapt resource value: 0x7f0a001f public const int Theme_AppCompat_DayNight = 2131361823; // aapt resource value: 0x7f0a0020 public const int Theme_AppCompat_DayNight_DarkActionBar = 2131361824; // aapt resource value: 0x7f0a0021 public const int Theme_AppCompat_DayNight_Dialog = 2131361825; // aapt resource value: 0x7f0a0022 public const int Theme_AppCompat_DayNight_Dialog_Alert = 2131361826; // aapt resource value: 0x7f0a0023 public const int Theme_AppCompat_DayNight_Dialog_MinWidth = 2131361827; // aapt resource value: 0x7f0a0024 public const int Theme_AppCompat_DayNight_DialogWhenLarge = 2131361828; // aapt resource value: 0x7f0a0025 public const int Theme_AppCompat_DayNight_NoActionBar = 2131361829; // aapt resource value: 0x7f0a0102 public const int Theme_AppCompat_Dialog = 2131362050; // aapt resource value: 0x7f0a0103 public const int Theme_AppCompat_Dialog_Alert = 2131362051; // aapt resource value: 0x7f0a0104 public const int Theme_AppCompat_Dialog_MinWidth = 2131362052; // aapt resource value: 0x7f0a0105 public const int Theme_AppCompat_DialogWhenLarge = 2131362053; // aapt resource value: 0x7f0a0106 public const int Theme_AppCompat_Light = 2131362054; // aapt resource value: 0x7f0a0107 public const int Theme_AppCompat_Light_DarkActionBar = 2131362055; // aapt resource value: 0x7f0a0108 public const int Theme_AppCompat_Light_Dialog = 2131362056; // aapt resource value: 0x7f0a0109 public const int Theme_AppCompat_Light_Dialog_Alert = 2131362057; // aapt resource value: 0x7f0a010a public const int Theme_AppCompat_Light_Dialog_MinWidth = 2131362058; // aapt resource value: 0x7f0a010b public const int Theme_AppCompat_Light_DialogWhenLarge = 2131362059; // aapt resource value: 0x7f0a010c public const int Theme_AppCompat_Light_NoActionBar = 2131362060; // aapt resource value: 0x7f0a010d public const int Theme_AppCompat_NoActionBar = 2131362061; // aapt resource value: 0x7f0a0163 public const int Theme_Design = 2131362147; // aapt resource value: 0x7f0a0164 public const int Theme_Design_BottomSheetDialog = 2131362148; // aapt resource value: 0x7f0a0165 public const int Theme_Design_Light = 2131362149; // aapt resource value: 0x7f0a0166 public const int Theme_Design_Light_BottomSheetDialog = 2131362150; // aapt resource value: 0x7f0a0167 public const int Theme_Design_Light_NoActionBar = 2131362151; // aapt resource value: 0x7f0a0168 public const int Theme_Design_NoActionBar = 2131362152; // aapt resource value: 0x7f0a0000 public const int Theme_MediaRouter = 2131361792; // aapt resource value: 0x7f0a0001 public const int Theme_MediaRouter_Light = 2131361793; // aapt resource value: 0x7f0a0002 public const int Theme_MediaRouter_Light_DarkControlPanel = 2131361794; // aapt resource value: 0x7f0a0003 public const int Theme_MediaRouter_LightControlPanel = 2131361795; // aapt resource value: 0x7f0a010e public const int ThemeOverlay_AppCompat = 2131362062; // aapt resource value: 0x7f0a010f public const int ThemeOverlay_AppCompat_ActionBar = 2131362063; // aapt resource value: 0x7f0a0110 public const int ThemeOverlay_AppCompat_Dark = 2131362064; // aapt resource value: 0x7f0a0111 public const int ThemeOverlay_AppCompat_Dark_ActionBar = 2131362065; // aapt resource value: 0x7f0a0112 public const int ThemeOverlay_AppCompat_Light = 2131362066; // aapt resource value: 0x7f0a0113 public const int Widget_AppCompat_ActionBar = 2131362067; // aapt resource value: 0x7f0a0114 public const int Widget_AppCompat_ActionBar_Solid = 2131362068; // aapt resource value: 0x7f0a0115 public const int Widget_AppCompat_ActionBar_TabBar = 2131362069; // aapt resource value: 0x7f0a0116 public const int Widget_AppCompat_ActionBar_TabText = 2131362070; // aapt resource value: 0x7f0a0117 public const int Widget_AppCompat_ActionBar_TabView = 2131362071; // aapt resource value: 0x7f0a0118 public const int Widget_AppCompat_ActionButton = 2131362072; // aapt resource value: 0x7f0a0119 public const int Widget_AppCompat_ActionButton_CloseMode = 2131362073; // aapt resource value: 0x7f0a011a public const int Widget_AppCompat_ActionButton_Overflow = 2131362074; // aapt resource value: 0x7f0a011b public const int Widget_AppCompat_ActionMode = 2131362075; // aapt resource value: 0x7f0a011c public const int Widget_AppCompat_ActivityChooserView = 2131362076; // aapt resource value: 0x7f0a011d public const int Widget_AppCompat_AutoCompleteTextView = 2131362077; // aapt resource value: 0x7f0a011e public const int Widget_AppCompat_Button = 2131362078; // aapt resource value: 0x7f0a011f public const int Widget_AppCompat_Button_Borderless = 2131362079; // aapt resource value: 0x7f0a0120 public const int Widget_AppCompat_Button_Borderless_Colored = 2131362080; // aapt resource value: 0x7f0a0121 public const int Widget_AppCompat_Button_ButtonBar_AlertDialog = 2131362081; // aapt resource value: 0x7f0a0122 public const int Widget_AppCompat_Button_Colored = 2131362082; // aapt resource value: 0x7f0a0123 public const int Widget_AppCompat_Button_Small = 2131362083; // aapt resource value: 0x7f0a0124 public const int Widget_AppCompat_ButtonBar = 2131362084; // aapt resource value: 0x7f0a0125 public const int Widget_AppCompat_ButtonBar_AlertDialog = 2131362085; // aapt resource value: 0x7f0a0126 public const int Widget_AppCompat_CompoundButton_CheckBox = 2131362086; // aapt resource value: 0x7f0a0127 public const int Widget_AppCompat_CompoundButton_RadioButton = 2131362087; // aapt resource value: 0x7f0a0128 public const int Widget_AppCompat_CompoundButton_Switch = 2131362088; // aapt resource value: 0x7f0a0129 public const int Widget_AppCompat_DrawerArrowToggle = 2131362089; // aapt resource value: 0x7f0a012a public const int Widget_AppCompat_DropDownItem_Spinner = 2131362090; // aapt resource value: 0x7f0a012b public const int Widget_AppCompat_EditText = 2131362091; // aapt resource value: 0x7f0a012c public const int Widget_AppCompat_ImageButton = 2131362092; // aapt resource value: 0x7f0a012d public const int Widget_AppCompat_Light_ActionBar = 2131362093; // aapt resource value: 0x7f0a012e public const int Widget_AppCompat_Light_ActionBar_Solid = 2131362094; // aapt resource value: 0x7f0a012f public const int Widget_AppCompat_Light_ActionBar_Solid_Inverse = 2131362095; // aapt resource value: 0x7f0a0130 public const int Widget_AppCompat_Light_ActionBar_TabBar = 2131362096; // aapt resource value: 0x7f0a0131 public const int Widget_AppCompat_Light_ActionBar_TabBar_Inverse = 2131362097; // aapt resource value: 0x7f0a0132 public const int Widget_AppCompat_Light_ActionBar_TabText = 2131362098; // aapt resource value: 0x7f0a0133 public const int Widget_AppCompat_Light_ActionBar_TabText_Inverse = 2131362099; // aapt resource value: 0x7f0a0134 public const int Widget_AppCompat_Light_ActionBar_TabView = 2131362100; // aapt resource value: 0x7f0a0135 public const int Widget_AppCompat_Light_ActionBar_TabView_Inverse = 2131362101; // aapt resource value: 0x7f0a0136 public const int Widget_AppCompat_Light_ActionButton = 2131362102; // aapt resource value: 0x7f0a0137 public const int Widget_AppCompat_Light_ActionButton_CloseMode = 2131362103; // aapt resource value: 0x7f0a0138 public const int Widget_AppCompat_Light_ActionButton_Overflow = 2131362104; // aapt resource value: 0x7f0a0139 public const int Widget_AppCompat_Light_ActionMode_Inverse = 2131362105; // aapt resource value: 0x7f0a013a public const int Widget_AppCompat_Light_ActivityChooserView = 2131362106; // aapt resource value: 0x7f0a013b public const int Widget_AppCompat_Light_AutoCompleteTextView = 2131362107; // aapt resource value: 0x7f0a013c public const int Widget_AppCompat_Light_DropDownItem_Spinner = 2131362108; // aapt resource value: 0x7f0a013d public const int Widget_AppCompat_Light_ListPopupWindow = 2131362109; // aapt resource value: 0x7f0a013e public const int Widget_AppCompat_Light_ListView_DropDown = 2131362110; // aapt resource value: 0x7f0a013f public const int Widget_AppCompat_Light_PopupMenu = 2131362111; // aapt resource value: 0x7f0a0140 public const int Widget_AppCompat_Light_PopupMenu_Overflow = 2131362112; // aapt resource value: 0x7f0a0141 public const int Widget_AppCompat_Light_SearchView = 2131362113; // aapt resource value: 0x7f0a0142 public const int Widget_AppCompat_Light_Spinner_DropDown_ActionBar = 2131362114; // aapt resource value: 0x7f0a0143 public const int Widget_AppCompat_ListPopupWindow = 2131362115; // aapt resource value: 0x7f0a0144 public const int Widget_AppCompat_ListView = 2131362116; // aapt resource value: 0x7f0a0145 public const int Widget_AppCompat_ListView_DropDown = 2131362117; // aapt resource value: 0x7f0a0146 public const int Widget_AppCompat_ListView_Menu = 2131362118; // aapt resource value: 0x7f0a0147 public const int Widget_AppCompat_PopupMenu = 2131362119; // aapt resource value: 0x7f0a0148 public const int Widget_AppCompat_PopupMenu_Overflow = 2131362120; // aapt resource value: 0x7f0a0149 public const int Widget_AppCompat_PopupWindow = 2131362121; // aapt resource value: 0x7f0a014a public const int Widget_AppCompat_ProgressBar = 2131362122; // aapt resource value: 0x7f0a014b public const int Widget_AppCompat_ProgressBar_Horizontal = 2131362123; // aapt resource value: 0x7f0a014c public const int Widget_AppCompat_RatingBar = 2131362124; // aapt resource value: 0x7f0a014d public const int Widget_AppCompat_RatingBar_Indicator = 2131362125; // aapt resource value: 0x7f0a014e public const int Widget_AppCompat_RatingBar_Small = 2131362126; // aapt resource value: 0x7f0a014f public const int Widget_AppCompat_SearchView = 2131362127; // aapt resource value: 0x7f0a0150 public const int Widget_AppCompat_SearchView_ActionBar = 2131362128; // aapt resource value: 0x7f0a0151 public const int Widget_AppCompat_SeekBar = 2131362129; // aapt resource value: 0x7f0a0152 public const int Widget_AppCompat_Spinner = 2131362130; // aapt resource value: 0x7f0a0153 public const int Widget_AppCompat_Spinner_DropDown = 2131362131; // aapt resource value: 0x7f0a0154 public const int Widget_AppCompat_Spinner_DropDown_ActionBar = 2131362132; // aapt resource value: 0x7f0a0155 public const int Widget_AppCompat_Spinner_Underlined = 2131362133; // aapt resource value: 0x7f0a0156 public const int Widget_AppCompat_TextView_SpinnerItem = 2131362134; // aapt resource value: 0x7f0a0157 public const int Widget_AppCompat_Toolbar = 2131362135; // aapt resource value: 0x7f0a0158 public const int Widget_AppCompat_Toolbar_Button_Navigation = 2131362136; // aapt resource value: 0x7f0a0169 public const int Widget_Design_AppBarLayout = 2131362153; // aapt resource value: 0x7f0a016a public const int Widget_Design_BottomSheet_Modal = 2131362154; // aapt resource value: 0x7f0a016b public const int Widget_Design_CollapsingToolbar = 2131362155; // aapt resource value: 0x7f0a016c public const int Widget_Design_CoordinatorLayout = 2131362156; // aapt resource value: 0x7f0a016d public const int Widget_Design_FloatingActionButton = 2131362157; // aapt resource value: 0x7f0a016e public const int Widget_Design_NavigationView = 2131362158; // aapt resource value: 0x7f0a016f public const int Widget_Design_ScrimInsetsFrameLayout = 2131362159; // aapt resource value: 0x7f0a0170 public const int Widget_Design_Snackbar = 2131362160; // aapt resource value: 0x7f0a0159 public const int Widget_Design_TabLayout = 2131362137; // aapt resource value: 0x7f0a0171 public const int Widget_Design_TextInputLayout = 2131362161; // aapt resource value: 0x7f0a0004 public const int Widget_MediaRouter_ChooserText = 2131361796; // aapt resource value: 0x7f0a0005 public const int Widget_MediaRouter_ChooserText_Primary = 2131361797; // aapt resource value: 0x7f0a0006 public const int Widget_MediaRouter_ChooserText_Primary_Dark = 2131361798; // aapt resource value: 0x7f0a0007 public const int Widget_MediaRouter_ChooserText_Primary_Light = 2131361799; // aapt resource value: 0x7f0a0008 public const int Widget_MediaRouter_ChooserText_Secondary = 2131361800; // aapt resource value: 0x7f0a0009 public const int Widget_MediaRouter_ChooserText_Secondary_Dark = 2131361801; // aapt resource value: 0x7f0a000a public const int Widget_MediaRouter_ChooserText_Secondary_Light = 2131361802; // aapt resource value: 0x7f0a000b public const int Widget_MediaRouter_ControllerText = 2131361803; // aapt resource value: 0x7f0a000c public const int Widget_MediaRouter_ControllerText_Primary = 2131361804; // aapt resource value: 0x7f0a000d public const int Widget_MediaRouter_ControllerText_Primary_Dark = 2131361805; // aapt resource value: 0x7f0a000e public const int Widget_MediaRouter_ControllerText_Primary_Light = 2131361806; // aapt resource value: 0x7f0a000f public const int Widget_MediaRouter_ControllerText_Secondary = 2131361807; // aapt resource value: 0x7f0a0010 public const int Widget_MediaRouter_ControllerText_Secondary_Dark = 2131361808; // aapt resource value: 0x7f0a0011 public const int Widget_MediaRouter_ControllerText_Secondary_Light = 2131361809; // aapt resource value: 0x7f0a0012 public const int Widget_MediaRouter_ControllerText_Title = 2131361810; // aapt resource value: 0x7f0a0013 public const int Widget_MediaRouter_ControllerText_Title_Dark = 2131361811; // aapt resource value: 0x7f0a0014 public const int Widget_MediaRouter_ControllerText_Title_Light = 2131361812; // aapt resource value: 0x7f0a0015 public const int Widget_MediaRouter_Light_MediaRouteButton = 2131361813; // aapt resource value: 0x7f0a0016 public const int Widget_MediaRouter_MediaRouteButton = 2131361814; static Style() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); } private Style() { } } public partial class Styleable { public static int[] ActionBar = new int[] { 2130772007, 2130772009, 2130772010, 2130772011, 2130772012, 2130772013, 2130772014, 2130772015, 2130772016, 2130772017, 2130772018, 2130772019, 2130772020, 2130772021, 2130772022, 2130772023, 2130772024, 2130772025, 2130772026, 2130772027, 2130772028, 2130772029, 2130772030, 2130772031, 2130772032, 2130772033, 2130772090}; // aapt resource value: 10 public const int ActionBar_background = 10; // aapt resource value: 12 public const int ActionBar_backgroundSplit = 12; // aapt resource value: 11 public const int ActionBar_backgroundStacked = 11; // aapt resource value: 21 public const int ActionBar_contentInsetEnd = 21; // aapt resource value: 22 public const int ActionBar_contentInsetLeft = 22; // aapt resource value: 23 public const int ActionBar_contentInsetRight = 23; // aapt resource value: 20 public const int ActionBar_contentInsetStart = 20; // aapt resource value: 13 public const int ActionBar_customNavigationLayout = 13; // aapt resource value: 3 public const int ActionBar_displayOptions = 3; // aapt resource value: 9 public const int ActionBar_divider = 9; // aapt resource value: 24 public const int ActionBar_elevation = 24; // aapt resource value: 0 public const int ActionBar_height = 0; // aapt resource value: 19 public const int ActionBar_hideOnContentScroll = 19; // aapt resource value: 26 public const int ActionBar_homeAsUpIndicator = 26; // aapt resource value: 14 public const int ActionBar_homeLayout = 14; // aapt resource value: 7 public const int ActionBar_icon = 7; // aapt resource value: 16 public const int ActionBar_indeterminateProgressStyle = 16; // aapt resource value: 18 public const int ActionBar_itemPadding = 18; // aapt resource value: 8 public const int ActionBar_logo = 8; // aapt resource value: 2 public const int ActionBar_navigationMode = 2; // aapt resource value: 25 public const int ActionBar_popupTheme = 25; // aapt resource value: 17 public const int ActionBar_progressBarPadding = 17; // aapt resource value: 15 public const int ActionBar_progressBarStyle = 15; // aapt resource value: 4 public const int ActionBar_subtitle = 4; // aapt resource value: 6 public const int ActionBar_subtitleTextStyle = 6; // aapt resource value: 1 public const int ActionBar_title = 1; // aapt resource value: 5 public const int ActionBar_titleTextStyle = 5; public static int[] ActionBarLayout = new int[] { 16842931}; // aapt resource value: 0 public const int ActionBarLayout_android_layout_gravity = 0; public static int[] ActionMenuItemView = new int[] { 16843071}; // aapt resource value: 0 public const int ActionMenuItemView_android_minWidth = 0; public static int[] ActionMenuView; public static int[] ActionMode = new int[] { 2130772007, 2130772013, 2130772014, 2130772018, 2130772020, 2130772034}; // aapt resource value: 3 public const int ActionMode_background = 3; // aapt resource value: 4 public const int ActionMode_backgroundSplit = 4; // aapt resource value: 5 public const int ActionMode_closeItemLayout = 5; // aapt resource value: 0 public const int ActionMode_height = 0; // aapt resource value: 2 public const int ActionMode_subtitleTextStyle = 2; // aapt resource value: 1 public const int ActionMode_titleTextStyle = 1; public static int[] ActivityChooserView = new int[] { 2130772035, 2130772036}; // aapt resource value: 1 public const int ActivityChooserView_expandActivityOverflowButtonDrawable = 1; // aapt resource value: 0 public const int ActivityChooserView_initialActivityCount = 0; public static int[] AlertDialog = new int[] { 16842994, 2130772037, 2130772038, 2130772039, 2130772040, 2130772041}; // aapt resource value: 0 public const int AlertDialog_android_layout = 0; // aapt resource value: 1 public const int AlertDialog_buttonPanelSideLayout = 1; // aapt resource value: 5 public const int AlertDialog_listItemLayout = 5; // aapt resource value: 2 public const int AlertDialog_listLayout = 2; // aapt resource value: 3 public const int AlertDialog_multiChoiceItemLayout = 3; // aapt resource value: 4 public const int AlertDialog_singleChoiceItemLayout = 4; public static int[] AppBarLayout = new int[] { 16842964, 2130772032, 2130772215}; // aapt resource value: 0 public const int AppBarLayout_android_background = 0; // aapt resource value: 1 public const int AppBarLayout_elevation = 1; // aapt resource value: 2 public const int AppBarLayout_expanded = 2; public static int[] AppBarLayout_LayoutParams = new int[] { 2130772216, 2130772217}; // aapt resource value: 0 public const int AppBarLayout_LayoutParams_layout_scrollFlags = 0; // aapt resource value: 1 public const int AppBarLayout_LayoutParams_layout_scrollInterpolator = 1; public static int[] AppCompatImageView = new int[] { 16843033, 2130772042}; // aapt resource value: 0 public const int AppCompatImageView_android_src = 0; // aapt resource value: 1 public const int AppCompatImageView_srcCompat = 1; public static int[] AppCompatTextView = new int[] { 16842804, 2130772043}; // aapt resource value: 0 public const int AppCompatTextView_android_textAppearance = 0; // aapt resource value: 1 public const int AppCompatTextView_textAllCaps = 1; public static int[] AppCompatTheme = new int[] { 16842839, 16842926, 2130772044, 2130772045, 2130772046, 2130772047, 2130772048, 2130772049, 2130772050, 2130772051, 2130772052, 2130772053, 2130772054, 2130772055, 2130772056, 2130772057, 2130772058, 2130772059, 2130772060, 2130772061, 2130772062, 2130772063, 2130772064, 2130772065, 2130772066, 2130772067, 2130772068, 2130772069, 2130772070, 2130772071, 2130772072, 2130772073, 2130772074, 2130772075, 2130772076, 2130772077, 2130772078, 2130772079, 2130772080, 2130772081, 2130772082, 2130772083, 2130772084, 2130772085, 2130772086, 2130772087, 2130772088, 2130772089, 2130772090, 2130772091, 2130772092, 2130772093, 2130772094, 2130772095, 2130772096, 2130772097, 2130772098, 2130772099, 2130772100, 2130772101, 2130772102, 2130772103, 2130772104, 2130772105, 2130772106, 2130772107, 2130772108, 2130772109, 2130772110, 2130772111, 2130772112, 2130772113, 2130772114, 2130772115, 2130772116, 2130772117, 2130772118, 2130772119, 2130772120, 2130772121, 2130772122, 2130772123, 2130772124, 2130772125, 2130772126, 2130772127, 2130772128, 2130772129, 2130772130, 2130772131, 2130772132, 2130772133, 2130772134, 2130772135, 2130772136, 2130772137, 2130772138, 2130772139, 2130772140, 2130772141, 2130772142, 2130772143, 2130772144, 2130772145, 2130772146, 2130772147, 2130772148, 2130772149, 2130772150, 2130772151, 2130772152, 2130772153}; // aapt resource value: 23 public const int AppCompatTheme_actionBarDivider = 23; // aapt resource value: 24 public const int AppCompatTheme_actionBarItemBackground = 24; // aapt resource value: 17 public const int AppCompatTheme_actionBarPopupTheme = 17; // aapt resource value: 22 public const int AppCompatTheme_actionBarSize = 22; // aapt resource value: 19 public const int AppCompatTheme_actionBarSplitStyle = 19; // aapt resource value: 18 public const int AppCompatTheme_actionBarStyle = 18; // aapt resource value: 13 public const int AppCompatTheme_actionBarTabBarStyle = 13; // aapt resource value: 12 public const int AppCompatTheme_actionBarTabStyle = 12; // aapt resource value: 14 public const int AppCompatTheme_actionBarTabTextStyle = 14; // aapt resource value: 20 public const int AppCompatTheme_actionBarTheme = 20; // aapt resource value: 21 public const int AppCompatTheme_actionBarWidgetTheme = 21; // aapt resource value: 49 public const int AppCompatTheme_actionButtonStyle = 49; // aapt resource value: 45 public const int AppCompatTheme_actionDropDownStyle = 45; // aapt resource value: 25 public const int AppCompatTheme_actionMenuTextAppearance = 25; // aapt resource value: 26 public const int AppCompatTheme_actionMenuTextColor = 26; // aapt resource value: 29 public const int AppCompatTheme_actionModeBackground = 29; // aapt resource value: 28 public const int AppCompatTheme_actionModeCloseButtonStyle = 28; // aapt resource value: 31 public const int AppCompatTheme_actionModeCloseDrawable = 31; // aapt resource value: 33 public const int AppCompatTheme_actionModeCopyDrawable = 33; // aapt resource value: 32 public const int AppCompatTheme_actionModeCutDrawable = 32; // aapt resource value: 37 public const int AppCompatTheme_actionModeFindDrawable = 37; // aapt resource value: 34 public const int AppCompatTheme_actionModePasteDrawable = 34; // aapt resource value: 39 public const int AppCompatTheme_actionModePopupWindowStyle = 39; // aapt resource value: 35 public const int AppCompatTheme_actionModeSelectAllDrawable = 35; // aapt resource value: 36 public const int AppCompatTheme_actionModeShareDrawable = 36; // aapt resource value: 30 public const int AppCompatTheme_actionModeSplitBackground = 30; // aapt resource value: 27 public const int AppCompatTheme_actionModeStyle = 27; // aapt resource value: 38 public const int AppCompatTheme_actionModeWebSearchDrawable = 38; // aapt resource value: 15 public const int AppCompatTheme_actionOverflowButtonStyle = 15; // aapt resource value: 16 public const int AppCompatTheme_actionOverflowMenuStyle = 16; // aapt resource value: 57 public const int AppCompatTheme_activityChooserViewStyle = 57; // aapt resource value: 92 public const int AppCompatTheme_alertDialogButtonGroupStyle = 92; // aapt resource value: 93 public const int AppCompatTheme_alertDialogCenterButtons = 93; // aapt resource value: 91 public const int AppCompatTheme_alertDialogStyle = 91; // aapt resource value: 94 public const int AppCompatTheme_alertDialogTheme = 94; // aapt resource value: 1 public const int AppCompatTheme_android_windowAnimationStyle = 1; // aapt resource value: 0 public const int AppCompatTheme_android_windowIsFloating = 0; // aapt resource value: 99 public const int AppCompatTheme_autoCompleteTextViewStyle = 99; // aapt resource value: 54 public const int AppCompatTheme_borderlessButtonStyle = 54; // aapt resource value: 51 public const int AppCompatTheme_buttonBarButtonStyle = 51; // aapt resource value: 97 public const int AppCompatTheme_buttonBarNegativeButtonStyle = 97; // aapt resource value: 98 public const int AppCompatTheme_buttonBarNeutralButtonStyle = 98; // aapt resource value: 96 public const int AppCompatTheme_buttonBarPositiveButtonStyle = 96; // aapt resource value: 50 public const int AppCompatTheme_buttonBarStyle = 50; // aapt resource value: 100 public const int AppCompatTheme_buttonStyle = 100; // aapt resource value: 101 public const int AppCompatTheme_buttonStyleSmall = 101; // aapt resource value: 102 public const int AppCompatTheme_checkboxStyle = 102; // aapt resource value: 103 public const int AppCompatTheme_checkedTextViewStyle = 103; // aapt resource value: 84 public const int AppCompatTheme_colorAccent = 84; // aapt resource value: 88 public const int AppCompatTheme_colorButtonNormal = 88; // aapt resource value: 86 public const int AppCompatTheme_colorControlActivated = 86; // aapt resource value: 87 public const int AppCompatTheme_colorControlHighlight = 87; // aapt resource value: 85 public const int AppCompatTheme_colorControlNormal = 85; // aapt resource value: 82 public const int AppCompatTheme_colorPrimary = 82; // aapt resource value: 83 public const int AppCompatTheme_colorPrimaryDark = 83; // aapt resource value: 89 public const int AppCompatTheme_colorSwitchThumbNormal = 89; // aapt resource value: 90 public const int AppCompatTheme_controlBackground = 90; // aapt resource value: 43 public const int AppCompatTheme_dialogPreferredPadding = 43; // aapt resource value: 42 public const int AppCompatTheme_dialogTheme = 42; // aapt resource value: 56 public const int AppCompatTheme_dividerHorizontal = 56; // aapt resource value: 55 public const int AppCompatTheme_dividerVertical = 55; // aapt resource value: 74 public const int AppCompatTheme_dropDownListViewStyle = 74; // aapt resource value: 46 public const int AppCompatTheme_dropdownListPreferredItemHeight = 46; // aapt resource value: 63 public const int AppCompatTheme_editTextBackground = 63; // aapt resource value: 62 public const int AppCompatTheme_editTextColor = 62; // aapt resource value: 104 public const int AppCompatTheme_editTextStyle = 104; // aapt resource value: 48 public const int AppCompatTheme_homeAsUpIndicator = 48; // aapt resource value: 64 public const int AppCompatTheme_imageButtonStyle = 64; // aapt resource value: 81 public const int AppCompatTheme_listChoiceBackgroundIndicator = 81; // aapt resource value: 44 public const int AppCompatTheme_listDividerAlertDialog = 44; // aapt resource value: 75 public const int AppCompatTheme_listPopupWindowStyle = 75; // aapt resource value: 69 public const int AppCompatTheme_listPreferredItemHeight = 69; // aapt resource value: 71 public const int AppCompatTheme_listPreferredItemHeightLarge = 71; // aapt resource value: 70 public const int AppCompatTheme_listPreferredItemHeightSmall = 70; // aapt resource value: 72 public const int AppCompatTheme_listPreferredItemPaddingLeft = 72; // aapt resource value: 73 public const int AppCompatTheme_listPreferredItemPaddingRight = 73; // aapt resource value: 78 public const int AppCompatTheme_panelBackground = 78; // aapt resource value: 80 public const int AppCompatTheme_panelMenuListTheme = 80; // aapt resource value: 79 public const int AppCompatTheme_panelMenuListWidth = 79; // aapt resource value: 60 public const int AppCompatTheme_popupMenuStyle = 60; // aapt resource value: 61 public const int AppCompatTheme_popupWindowStyle = 61; // aapt resource value: 105 public const int AppCompatTheme_radioButtonStyle = 105; // aapt resource value: 106 public const int AppCompatTheme_ratingBarStyle = 106; // aapt resource value: 107 public const int AppCompatTheme_ratingBarStyleIndicator = 107; // aapt resource value: 108 public const int AppCompatTheme_ratingBarStyleSmall = 108; // aapt resource value: 68 public const int AppCompatTheme_searchViewStyle = 68; // aapt resource value: 109 public const int AppCompatTheme_seekBarStyle = 109; // aapt resource value: 52 public const int AppCompatTheme_selectableItemBackground = 52; // aapt resource value: 53 public const int AppCompatTheme_selectableItemBackgroundBorderless = 53; // aapt resource value: 47 public const int AppCompatTheme_spinnerDropDownItemStyle = 47; // aapt resource value: 110 public const int AppCompatTheme_spinnerStyle = 110; // aapt resource value: 111 public const int AppCompatTheme_switchStyle = 111; // aapt resource value: 40 public const int AppCompatTheme_textAppearanceLargePopupMenu = 40; // aapt resource value: 76 public const int AppCompatTheme_textAppearanceListItem = 76; // aapt resource value: 77 public const int AppCompatTheme_textAppearanceListItemSmall = 77; // aapt resource value: 66 public const int AppCompatTheme_textAppearanceSearchResultSubtitle = 66; // aapt resource value: 65 public const int AppCompatTheme_textAppearanceSearchResultTitle = 65; // aapt resource value: 41 public const int AppCompatTheme_textAppearanceSmallPopupMenu = 41; // aapt resource value: 95 public const int AppCompatTheme_textColorAlertDialogListItem = 95; // aapt resource value: 67 public const int AppCompatTheme_textColorSearchUrl = 67; // aapt resource value: 59 public const int AppCompatTheme_toolbarNavigationButtonStyle = 59; // aapt resource value: 58 public const int AppCompatTheme_toolbarStyle = 58; // aapt resource value: 2 public const int AppCompatTheme_windowActionBar = 2; // aapt resource value: 4 public const int AppCompatTheme_windowActionBarOverlay = 4; // aapt resource value: 5 public const int AppCompatTheme_windowActionModeOverlay = 5; // aapt resource value: 9 public const int AppCompatTheme_windowFixedHeightMajor = 9; // aapt resource value: 7 public const int AppCompatTheme_windowFixedHeightMinor = 7; // aapt resource value: 6 public const int AppCompatTheme_windowFixedWidthMajor = 6; // aapt resource value: 8 public const int AppCompatTheme_windowFixedWidthMinor = 8; // aapt resource value: 10 public const int AppCompatTheme_windowMinWidthMajor = 10; // aapt resource value: 11 public const int AppCompatTheme_windowMinWidthMinor = 11; // aapt resource value: 3 public const int AppCompatTheme_windowNoTitle = 3; public static int[] BottomSheetBehavior_Params = new int[] { 2130772218, 2130772219}; // aapt resource value: 1 public const int BottomSheetBehavior_Params_behavior_hideable = 1; // aapt resource value: 0 public const int BottomSheetBehavior_Params_behavior_peekHeight = 0; public static int[] ButtonBarLayout = new int[] { 2130772154}; // aapt resource value: 0 public const int ButtonBarLayout_allowStacking = 0; public static int[] CardView = new int[] { 16843071, 16843072, 2130771995, 2130771996, 2130771997, 2130771998, 2130771999, 2130772000, 2130772001, 2130772002, 2130772003, 2130772004, 2130772005}; // aapt resource value: 1 public const int CardView_android_minHeight = 1; // aapt resource value: 0 public const int CardView_android_minWidth = 0; // aapt resource value: 2 public const int CardView_cardBackgroundColor = 2; // aapt resource value: 3 public const int CardView_cardCornerRadius = 3; // aapt resource value: 4 public const int CardView_cardElevation = 4; // aapt resource value: 5 public const int CardView_cardMaxElevation = 5; // aapt resource value: 7 public const int CardView_cardPreventCornerOverlap = 7; // aapt resource value: 6 public const int CardView_cardUseCompatPadding = 6; // aapt resource value: 8 public const int CardView_contentPadding = 8; // aapt resource value: 12 public const int CardView_contentPaddingBottom = 12; // aapt resource value: 9 public const int CardView_contentPaddingLeft = 9; // aapt resource value: 10 public const int CardView_contentPaddingRight = 10; // aapt resource value: 11 public const int CardView_contentPaddingTop = 11; public static int[] CollapsingAppBarLayout_LayoutParams = new int[] { 2130772220, 2130772221}; // aapt resource value: 0 public const int CollapsingAppBarLayout_LayoutParams_layout_collapseMode = 0; // aapt resource value: 1 public const int CollapsingAppBarLayout_LayoutParams_layout_collapseParallaxMultiplier = 1; public static int[] CollapsingToolbarLayout = new int[] { 2130772009, 2130772222, 2130772223, 2130772224, 2130772225, 2130772226, 2130772227, 2130772228, 2130772229, 2130772230, 2130772231, 2130772232, 2130772233, 2130772234}; // aapt resource value: 11 public const int CollapsingToolbarLayout_collapsedTitleGravity = 11; // aapt resource value: 7 public const int CollapsingToolbarLayout_collapsedTitleTextAppearance = 7; // aapt resource value: 8 public const int CollapsingToolbarLayout_contentScrim = 8; // aapt resource value: 12 public const int CollapsingToolbarLayout_expandedTitleGravity = 12; // aapt resource value: 1 public const int CollapsingToolbarLayout_expandedTitleMargin = 1; // aapt resource value: 5 public const int CollapsingToolbarLayout_expandedTitleMarginBottom = 5; // aapt resource value: 4 public const int CollapsingToolbarLayout_expandedTitleMarginEnd = 4; // aapt resource value: 2 public const int CollapsingToolbarLayout_expandedTitleMarginStart = 2; // aapt resource value: 3 public const int CollapsingToolbarLayout_expandedTitleMarginTop = 3; // aapt resource value: 6 public const int CollapsingToolbarLayout_expandedTitleTextAppearance = 6; // aapt resource value: 9 public const int CollapsingToolbarLayout_statusBarScrim = 9; // aapt resource value: 0 public const int CollapsingToolbarLayout_title = 0; // aapt resource value: 13 public const int CollapsingToolbarLayout_titleEnabled = 13; // aapt resource value: 10 public const int CollapsingToolbarLayout_toolbarId = 10; public static int[] CompoundButton = new int[] { 16843015, 2130772155, 2130772156}; // aapt resource value: 0 public const int CompoundButton_android_button = 0; // aapt resource value: 1 public const int CompoundButton_buttonTint = 1; // aapt resource value: 2 public const int CompoundButton_buttonTintMode = 2; public static int[] CoordinatorLayout = new int[] { 2130772235, 2130772236}; // aapt resource value: 0 public const int CoordinatorLayout_keylines = 0; // aapt resource value: 1 public const int CoordinatorLayout_statusBarBackground = 1; public static int[] CoordinatorLayout_LayoutParams = new int[] { 16842931, 2130772237, 2130772238, 2130772239, 2130772240}; // aapt resource value: 0 public const int CoordinatorLayout_LayoutParams_android_layout_gravity = 0; // aapt resource value: 2 public const int CoordinatorLayout_LayoutParams_layout_anchor = 2; // aapt resource value: 4 public const int CoordinatorLayout_LayoutParams_layout_anchorGravity = 4; // aapt resource value: 1 public const int CoordinatorLayout_LayoutParams_layout_behavior = 1; // aapt resource value: 3 public const int CoordinatorLayout_LayoutParams_layout_keyline = 3; public static int[] DesignTheme = new int[] { 2130772241, 2130772242, 2130772243}; // aapt resource value: 0 public const int DesignTheme_bottomSheetDialogTheme = 0; // aapt resource value: 1 public const int DesignTheme_bottomSheetStyle = 1; // aapt resource value: 2 public const int DesignTheme_textColorError = 2; public static int[] DrawerArrowToggle = new int[] { 2130772157, 2130772158, 2130772159, 2130772160, 2130772161, 2130772162, 2130772163, 2130772164}; // aapt resource value: 4 public const int DrawerArrowToggle_arrowHeadLength = 4; // aapt resource value: 5 public const int DrawerArrowToggle_arrowShaftLength = 5; // aapt resource value: 6 public const int DrawerArrowToggle_barLength = 6; // aapt resource value: 0 public const int DrawerArrowToggle_color = 0; // aapt resource value: 2 public const int DrawerArrowToggle_drawableSize = 2; // aapt resource value: 3 public const int DrawerArrowToggle_gapBetweenBars = 3; // aapt resource value: 1 public const int DrawerArrowToggle_spinBars = 1; // aapt resource value: 7 public const int DrawerArrowToggle_thickness = 7; public static int[] FloatingActionButton = new int[] { 2130772032, 2130772213, 2130772214, 2130772244, 2130772245, 2130772246, 2130772247, 2130772248}; // aapt resource value: 1 public const int FloatingActionButton_backgroundTint = 1; // aapt resource value: 2 public const int FloatingActionButton_backgroundTintMode = 2; // aapt resource value: 6 public const int FloatingActionButton_borderWidth = 6; // aapt resource value: 0 public const int FloatingActionButton_elevation = 0; // aapt resource value: 4 public const int FloatingActionButton_fabSize = 4; // aapt resource value: 5 public const int FloatingActionButton_pressedTranslationZ = 5; // aapt resource value: 3 public const int FloatingActionButton_rippleColor = 3; // aapt resource value: 7 public const int FloatingActionButton_useCompatPadding = 7; public static int[] ForegroundLinearLayout = new int[] { 16843017, 16843264, 2130772249}; // aapt resource value: 0 public const int ForegroundLinearLayout_android_foreground = 0; // aapt resource value: 1 public const int ForegroundLinearLayout_android_foregroundGravity = 1; // aapt resource value: 2 public const int ForegroundLinearLayout_foregroundInsidePadding = 2; public static int[] LinearLayoutCompat = new int[] { 16842927, 16842948, 16843046, 16843047, 16843048, 2130772017, 2130772165, 2130772166, 2130772167}; // aapt resource value: 2 public const int LinearLayoutCompat_android_baselineAligned = 2; // aapt resource value: 3 public const int LinearLayoutCompat_android_baselineAlignedChildIndex = 3; // aapt resource value: 0 public const int LinearLayoutCompat_android_gravity = 0; // aapt resource value: 1 public const int LinearLayoutCompat_android_orientation = 1; // aapt resource value: 4 public const int LinearLayoutCompat_android_weightSum = 4; // aapt resource value: 5 public const int LinearLayoutCompat_divider = 5; // aapt resource value: 8 public const int LinearLayoutCompat_dividerPadding = 8; // aapt resource value: 6 public const int LinearLayoutCompat_measureWithLargestChild = 6; // aapt resource value: 7 public const int LinearLayoutCompat_showDividers = 7; public static int[] LinearLayoutCompat_Layout = new int[] { 16842931, 16842996, 16842997, 16843137}; // aapt resource value: 0 public const int LinearLayoutCompat_Layout_android_layout_gravity = 0; // aapt resource value: 2 public const int LinearLayoutCompat_Layout_android_layout_height = 2; // aapt resource value: 3 public const int LinearLayoutCompat_Layout_android_layout_weight = 3; // aapt resource value: 1 public const int LinearLayoutCompat_Layout_android_layout_width = 1; public static int[] ListPopupWindow = new int[] { 16843436, 16843437}; // aapt resource value: 0 public const int ListPopupWindow_android_dropDownHorizontalOffset = 0; // aapt resource value: 1 public const int ListPopupWindow_android_dropDownVerticalOffset = 1; public static int[] MediaRouteButton = new int[] { 16843071, 16843072, 2130771994}; // aapt resource value: 1 public const int MediaRouteButton_android_minHeight = 1; // aapt resource value: 0 public const int MediaRouteButton_android_minWidth = 0; // aapt resource value: 2 public const int MediaRouteButton_externalRouteEnabledDrawable = 2; public static int[] MenuGroup = new int[] { 16842766, 16842960, 16843156, 16843230, 16843231, 16843232}; // aapt resource value: 5 public const int MenuGroup_android_checkableBehavior = 5; // aapt resource value: 0 public const int MenuGroup_android_enabled = 0; // aapt resource value: 1 public const int MenuGroup_android_id = 1; // aapt resource value: 3 public const int MenuGroup_android_menuCategory = 3; // aapt resource value: 4 public const int MenuGroup_android_orderInCategory = 4; // aapt resource value: 2 public const int MenuGroup_android_visible = 2; public static int[] MenuItem = new int[] { 16842754, 16842766, 16842960, 16843014, 16843156, 16843230, 16843231, 16843233, 16843234, 16843235, 16843236, 16843237, 16843375, 2130772168, 2130772169, 2130772170, 2130772171}; // aapt resource value: 14 public const int MenuItem_actionLayout = 14; // aapt resource value: 16 public const int MenuItem_actionProviderClass = 16; // aapt resource value: 15 public const int MenuItem_actionViewClass = 15; // aapt resource value: 9 public const int MenuItem_android_alphabeticShortcut = 9; // aapt resource value: 11 public const int MenuItem_android_checkable = 11; // aapt resource value: 3 public const int MenuItem_android_checked = 3; // aapt resource value: 1 public const int MenuItem_android_enabled = 1; // aapt resource value: 0 public const int MenuItem_android_icon = 0; // aapt resource value: 2 public const int MenuItem_android_id = 2; // aapt resource value: 5 public const int MenuItem_android_menuCategory = 5; // aapt resource value: 10 public const int MenuItem_android_numericShortcut = 10; // aapt resource value: 12 public const int MenuItem_android_onClick = 12; // aapt resource value: 6 public const int MenuItem_android_orderInCategory = 6; // aapt resource value: 7 public const int MenuItem_android_title = 7; // aapt resource value: 8 public const int MenuItem_android_titleCondensed = 8; // aapt resource value: 4 public const int MenuItem_android_visible = 4; // aapt resource value: 13 public const int MenuItem_showAsAction = 13; public static int[] MenuView = new int[] { 16842926, 16843052, 16843053, 16843054, 16843055, 16843056, 16843057, 2130772172}; // aapt resource value: 4 public const int MenuView_android_headerBackground = 4; // aapt resource value: 2 public const int MenuView_android_horizontalDivider = 2; // aapt resource value: 5 public const int MenuView_android_itemBackground = 5; // aapt resource value: 6 public const int MenuView_android_itemIconDisabledAlpha = 6; // aapt resource value: 1 public const int MenuView_android_itemTextAppearance = 1; // aapt resource value: 3 public const int MenuView_android_verticalDivider = 3; // aapt resource value: 0 public const int MenuView_android_windowAnimationStyle = 0; // aapt resource value: 7 public const int MenuView_preserveIconSpacing = 7; public static int[] NavigationView = new int[] { 16842964, 16842973, 16843039, 2130772032, 2130772250, 2130772251, 2130772252, 2130772253, 2130772254, 2130772255}; // aapt resource value: 0 public const int NavigationView_android_background = 0; // aapt resource value: 1 public const int NavigationView_android_fitsSystemWindows = 1; // aapt resource value: 2 public const int NavigationView_android_maxWidth = 2; // aapt resource value: 3 public const int NavigationView_elevation = 3; // aapt resource value: 9 public const int NavigationView_headerLayout = 9; // aapt resource value: 7 public const int NavigationView_itemBackground = 7; // aapt resource value: 5 public const int NavigationView_itemIconTint = 5; // aapt resource value: 8 public const int NavigationView_itemTextAppearance = 8; // aapt resource value: 6 public const int NavigationView_itemTextColor = 6; // aapt resource value: 4 public const int NavigationView_menu = 4; public static int[] PopupWindow = new int[] { 16843126, 2130772173}; // aapt resource value: 0 public const int PopupWindow_android_popupBackground = 0; // aapt resource value: 1 public const int PopupWindow_overlapAnchor = 1; public static int[] PopupWindowBackgroundState = new int[] { 2130772174}; // aapt resource value: 0 public const int PopupWindowBackgroundState_state_above_anchor = 0; public static int[] RecyclerView = new int[] { 16842948, 2130771968, 2130771969, 2130771970, 2130771971}; // aapt resource value: 0 public const int RecyclerView_android_orientation = 0; // aapt resource value: 1 public const int RecyclerView_layoutManager = 1; // aapt resource value: 3 public const int RecyclerView_reverseLayout = 3; // aapt resource value: 2 public const int RecyclerView_spanCount = 2; // aapt resource value: 4 public const int RecyclerView_stackFromEnd = 4; public static int[] ScrimInsetsFrameLayout = new int[] { 2130772256}; // aapt resource value: 0 public const int ScrimInsetsFrameLayout_insetForeground = 0; public static int[] ScrollingViewBehavior_Params = new int[] { 2130772257}; // aapt resource value: 0 public const int ScrollingViewBehavior_Params_behavior_overlapTop = 0; public static int[] SearchView = new int[] { 16842970, 16843039, 16843296, 16843364, 2130772175, 2130772176, 2130772177, 2130772178, 2130772179, 2130772180, 2130772181, 2130772182, 2130772183, 2130772184, 2130772185, 2130772186, 2130772187}; // aapt resource value: 0 public const int SearchView_android_focusable = 0; // aapt resource value: 3 public const int SearchView_android_imeOptions = 3; // aapt resource value: 2 public const int SearchView_android_inputType = 2; // aapt resource value: 1 public const int SearchView_android_maxWidth = 1; // aapt resource value: 8 public const int SearchView_closeIcon = 8; // aapt resource value: 13 public const int SearchView_commitIcon = 13; // aapt resource value: 7 public const int SearchView_defaultQueryHint = 7; // aapt resource value: 9 public const int SearchView_goIcon = 9; // aapt resource value: 5 public const int SearchView_iconifiedByDefault = 5; // aapt resource value: 4 public const int SearchView_layout = 4; // aapt resource value: 15 public const int SearchView_queryBackground = 15; // aapt resource value: 6 public const int SearchView_queryHint = 6; // aapt resource value: 11 public const int SearchView_searchHintIcon = 11; // aapt resource value: 10 public const int SearchView_searchIcon = 10; // aapt resource value: 16 public const int SearchView_submitBackground = 16; // aapt resource value: 14 public const int SearchView_suggestionRowLayout = 14; // aapt resource value: 12 public const int SearchView_voiceIcon = 12; public static int[] SnackbarLayout = new int[] { 16843039, 2130772032, 2130772258}; // aapt resource value: 0 public const int SnackbarLayout_android_maxWidth = 0; // aapt resource value: 1 public const int SnackbarLayout_elevation = 1; // aapt resource value: 2 public const int SnackbarLayout_maxActionInlineWidth = 2; public static int[] Spinner = new int[] { 16842930, 16843126, 16843131, 16843362, 2130772033}; // aapt resource value: 3 public const int Spinner_android_dropDownWidth = 3; // aapt resource value: 0 public const int Spinner_android_entries = 0; // aapt resource value: 1 public const int Spinner_android_popupBackground = 1; // aapt resource value: 2 public const int Spinner_android_prompt = 2; // aapt resource value: 4 public const int Spinner_popupTheme = 4; public static int[] SwitchCompat = new int[] { 16843044, 16843045, 16843074, 2130772188, 2130772189, 2130772190, 2130772191, 2130772192, 2130772193, 2130772194}; // aapt resource value: 1 public const int SwitchCompat_android_textOff = 1; // aapt resource value: 0 public const int SwitchCompat_android_textOn = 0; // aapt resource value: 2 public const int SwitchCompat_android_thumb = 2; // aapt resource value: 9 public const int SwitchCompat_showText = 9; // aapt resource value: 8 public const int SwitchCompat_splitTrack = 8; // aapt resource value: 6 public const int SwitchCompat_switchMinWidth = 6; // aapt resource value: 7 public const int SwitchCompat_switchPadding = 7; // aapt resource value: 5 public const int SwitchCompat_switchTextAppearance = 5; // aapt resource value: 4 public const int SwitchCompat_thumbTextPadding = 4; // aapt resource value: 3 public const int SwitchCompat_track = 3; public static int[] TabItem = new int[] { 16842754, 16842994, 16843087}; // aapt resource value: 0 public const int TabItem_android_icon = 0; // aapt resource value: 1 public const int TabItem_android_layout = 1; // aapt resource value: 2 public const int TabItem_android_text = 2; public static int[] TabLayout = new int[] { 2130772259, 2130772260, 2130772261, 2130772262, 2130772263, 2130772264, 2130772265, 2130772266, 2130772267, 2130772268, 2130772269, 2130772270, 2130772271, 2130772272, 2130772273, 2130772274}; // aapt resource value: 3 public const int TabLayout_tabBackground = 3; // aapt resource value: 2 public const int TabLayout_tabContentStart = 2; // aapt resource value: 5 public const int TabLayout_tabGravity = 5; // aapt resource value: 0 public const int TabLayout_tabIndicatorColor = 0; // aapt resource value: 1 public const int TabLayout_tabIndicatorHeight = 1; // aapt resource value: 7 public const int TabLayout_tabMaxWidth = 7; // aapt resource value: 6 public const int TabLayout_tabMinWidth = 6; // aapt resource value: 4 public const int TabLayout_tabMode = 4; // aapt resource value: 15 public const int TabLayout_tabPadding = 15; // aapt resource value: 14 public const int TabLayout_tabPaddingBottom = 14; // aapt resource value: 13 public const int TabLayout_tabPaddingEnd = 13; // aapt resource value: 11 public const int TabLayout_tabPaddingStart = 11; // aapt resource value: 12 public const int TabLayout_tabPaddingTop = 12; // aapt resource value: 10 public const int TabLayout_tabSelectedTextColor = 10; // aapt resource value: 8 public const int TabLayout_tabTextAppearance = 8; // aapt resource value: 9 public const int TabLayout_tabTextColor = 9; public static int[] TextAppearance = new int[] { 16842901, 16842902, 16842903, 16842904, 16843105, 16843106, 16843107, 16843108, 2130772043}; // aapt resource value: 4 public const int TextAppearance_android_shadowColor = 4; // aapt resource value: 5 public const int TextAppearance_android_shadowDx = 5; // aapt resource value: 6 public const int TextAppearance_android_shadowDy = 6; // aapt resource value: 7 public const int TextAppearance_android_shadowRadius = 7; // aapt resource value: 3 public const int TextAppearance_android_textColor = 3; // aapt resource value: 0 public const int TextAppearance_android_textSize = 0; // aapt resource value: 2 public const int TextAppearance_android_textStyle = 2; // aapt resource value: 1 public const int TextAppearance_android_typeface = 1; // aapt resource value: 8 public const int TextAppearance_textAllCaps = 8; public static int[] TextInputLayout = new int[] { 16842906, 16843088, 2130772275, 2130772276, 2130772277, 2130772278, 2130772279, 2130772280, 2130772281, 2130772282, 2130772283}; // aapt resource value: 1 public const int TextInputLayout_android_hint = 1; // aapt resource value: 0 public const int TextInputLayout_android_textColorHint = 0; // aapt resource value: 6 public const int TextInputLayout_counterEnabled = 6; // aapt resource value: 7 public const int TextInputLayout_counterMaxLength = 7; // aapt resource value: 9 public const int TextInputLayout_counterOverflowTextAppearance = 9; // aapt resource value: 8 public const int TextInputLayout_counterTextAppearance = 8; // aapt resource value: 4 public const int TextInputLayout_errorEnabled = 4; // aapt resource value: 5 public const int TextInputLayout_errorTextAppearance = 5; // aapt resource value: 10 public const int TextInputLayout_hintAnimationEnabled = 10; // aapt resource value: 3 public const int TextInputLayout_hintEnabled = 3; // aapt resource value: 2 public const int TextInputLayout_hintTextAppearance = 2; public static int[] Toolbar = new int[] { 16842927, 16843072, 2130772009, 2130772012, 2130772016, 2130772028, 2130772029, 2130772030, 2130772031, 2130772033, 2130772195, 2130772196, 2130772197, 2130772198, 2130772199, 2130772200, 2130772201, 2130772202, 2130772203, 2130772204, 2130772205, 2130772206, 2130772207, 2130772208, 2130772209}; // aapt resource value: 0 public const int Toolbar_android_gravity = 0; // aapt resource value: 1 public const int Toolbar_android_minHeight = 1; // aapt resource value: 19 public const int Toolbar_collapseContentDescription = 19; // aapt resource value: 18 public const int Toolbar_collapseIcon = 18; // aapt resource value: 6 public const int Toolbar_contentInsetEnd = 6; // aapt resource value: 7 public const int Toolbar_contentInsetLeft = 7; // aapt resource value: 8 public const int Toolbar_contentInsetRight = 8; // aapt resource value: 5 public const int Toolbar_contentInsetStart = 5; // aapt resource value: 4 public const int Toolbar_logo = 4; // aapt resource value: 22 public const int Toolbar_logoDescription = 22; // aapt resource value: 17 public const int Toolbar_maxButtonHeight = 17; // aapt resource value: 21 public const int Toolbar_navigationContentDescription = 21; // aapt resource value: 20 public const int Toolbar_navigationIcon = 20; // aapt resource value: 9 public const int Toolbar_popupTheme = 9; // aapt resource value: 3 public const int Toolbar_subtitle = 3; // aapt resource value: 11 public const int Toolbar_subtitleTextAppearance = 11; // aapt resource value: 24 public const int Toolbar_subtitleTextColor = 24; // aapt resource value: 2 public const int Toolbar_title = 2; // aapt resource value: 16 public const int Toolbar_titleMarginBottom = 16; // aapt resource value: 14 public const int Toolbar_titleMarginEnd = 14; // aapt resource value: 13 public const int Toolbar_titleMarginStart = 13; // aapt resource value: 15 public const int Toolbar_titleMarginTop = 15; // aapt resource value: 12 public const int Toolbar_titleMargins = 12; // aapt resource value: 10 public const int Toolbar_titleTextAppearance = 10; // aapt resource value: 23 public const int Toolbar_titleTextColor = 23; public static int[] View = new int[] { 16842752, 16842970, 2130772210, 2130772211, 2130772212}; // aapt resource value: 1 public const int View_android_focusable = 1; // aapt resource value: 0 public const int View_android_theme = 0; // aapt resource value: 3 public const int View_paddingEnd = 3; // aapt resource value: 2 public const int View_paddingStart = 2; // aapt resource value: 4 public const int View_theme = 4; public static int[] ViewBackgroundHelper = new int[] { 16842964, 2130772213, 2130772214}; // aapt resource value: 0 public const int ViewBackgroundHelper_android_background = 0; // aapt resource value: 1 public const int ViewBackgroundHelper_backgroundTint = 1; // aapt resource value: 2 public const int ViewBackgroundHelper_backgroundTintMode = 2; public static int[] ViewStubCompat = new int[] { 16842960, 16842994, 16842995}; // aapt resource value: 0 public const int ViewStubCompat_android_id = 0; // aapt resource value: 2 public const int ViewStubCompat_android_inflatedId = 2; // aapt resource value: 1 public const int ViewStubCompat_android_layout = 1; static Styleable() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); } private Styleable() { } } } } #pragma warning restore 1591
31.643529
138
0.730825
[ "Apache-2.0" ]
humrs/MDHandbook
src/MDHandbookApp.Droid/Resources/Resource.Designer.cs
188,279
C#
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using MangoBlog.Model; namespace MangoBlog.Entity { public interface ICommentDao { Task AddCommentAsync(string articleId,CommentModel comment); Task DeleteCommentAsync(string id); Task<IList<CommentModel>> GetCommentsAsync(string articleId,int start,int count); Task<CommentModel> GetCommentAsync(string id); Task<IList<CommentModel>> LessThanSomeDate(string articleId, DateTime date, int count); } }
30.666667
95
0.744565
[ "Apache-2.0" ]
HahaMango/Mango-Blog-
MangoBlog/Entity/ICommentDao.cs
554
C#
// This file was automatically generated and may be regenerated at any // time. To ensure any changes are retained, modify the tool with any segment/component/group/field name // or type changes. namespace Machete.HL7Schema.V26 { using HL7; /// <summary> /// ORL_O34 (Message) - /// </summary> public interface ORL_O34 : HL7V26Layout { /// <summary> /// MSH /// </summary> Segment<MSH> MSH { get; } /// <summary> /// MSA /// </summary> Segment<MSA> MSA { get; } /// <summary> /// ERR /// </summary> SegmentList<ERR> ERR { get; } /// <summary> /// SFT /// </summary> SegmentList<SFT> SFT { get; } /// <summary> /// UAC /// </summary> Segment<UAC> UAC { get; } /// <summary> /// NTE /// </summary> SegmentList<NTE> NTE { get; } /// <summary> /// RESPONSE /// </summary> Layout<ORL_O34_RESPONSE> Response { get; } } }
22.081633
104
0.476895
[ "Apache-2.0" ]
ahives/Machete
src/Machete.HL7Schema/V26/Messages/ORL_O34.cs
1,082
C#
using Microsoft.EntityFrameworkCore; using Senparc.Ncf.Core.Models; using Senparc.Ncf.XncfBase; using Senparc.Ncf.XncfBase.Functions; using System; using Microsoft.Extensions.DependencyInjection; using Senparc.Ncf.Service; using System.Threading.Tasks; using System.ComponentModel.DataAnnotations; using System.ComponentModel; using Senparc.CO2NET.Trace; namespace Senparc.Xncf.DatabaseToolkit.Functions { public class SetConfig : FunctionBase { public class SetConfig_Parameters : FunctionParameterLoadDataBase, IFunctionParameter { [Required] [MaxLength(300)] [Description("自动备份周期(分钟)||0 则为不自动备份")] public int BackupCycleMinutes { get; set; } [Required] [MaxLength(300)] [Description("备份路径||本地物理路径,如:E:\\Senparc\\Ncf\\NCF.bak")] public string BackupPath { get; set; } public override async Task LoadData(IServiceProvider serviceProvider) { var configService = serviceProvider.GetService<ServiceBase<DbConfig>>(); var config = await configService.GetObjectAsync(z => true); if (config != null) { BackupCycleMinutes = config.BackupCycleMinutes; BackupPath = config.BackupPath; } } } //注意:Name 必须在单个 Xncf 模块中唯一! public override string Name => "设置参数"; public override string Description => "设置备份间隔时间、备份文件路径等参数"; public override Type FunctionParameterType => typeof(SetConfig_Parameters); public SetConfig(IServiceProvider serviceProvider) : base(serviceProvider) { } /// <summary> /// 运行 /// </summary> /// <param name="param"></param> /// <returns></returns> public override FunctionResult Run(IFunctionParameter param) { return FunctionHelper.RunFunction<SetConfig_Parameters>(param, (typeParam, sb, result) => { //RecordLog(sb, "开始获取 ISenparcEntities 对象"); //var senparcEntities = ServiceProvider.GetService(typeof(ISenparcEntities)) as SenparcEntitiesBase; //RecordLog(sb, "获取 ISenparcEntities 对象成功"); var configService = base.ServiceProvider.GetService<ServiceBase<DbConfig>>(); var config = configService.GetObject(z => true); if (config == null) { config = new DbConfig(typeParam.BackupCycleMinutes, typeParam.BackupPath); } else { configService.Mapper.Map(typeParam, config); } configService.SaveObject(config); result.Message = "设置已保存!"; }); } } }
35.481481
117
0.587335
[ "Apache-2.0" ]
NeuCharFramework/NcfPackageSources
src/Extensions/Senparc.Xncf.DatabaseToolkit/Senparc.Xncf.DatabaseToolkit/Functions/SetConfig.cs
3,048
C#
/* * Copyright (c) 2018 THL A29 Limited, a Tencent company. All Rights Reserved. * * Licensed 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. */ namespace TencentCloud.Yunjing.V20180228.Models { using Newtonsoft.Json; using System.Collections.Generic; using TencentCloud.Common; public class DeleteLoginWhiteListResponse : AbstractModel { /// <summary> /// The unique request ID, which is returned for each request. RequestId is required for locating a problem. /// </summary> [JsonProperty("RequestId")] public string RequestId{ get; set; } /// <summary> /// For internal usage only. DO NOT USE IT. /// </summary> public override void ToMap(Dictionary<string, string> map, string prefix) { this.SetParamSimple(map, prefix + "RequestId", this.RequestId); } } }
31.863636
116
0.671184
[ "Apache-2.0" ]
TencentCloud/tencentcloud-sdk-dotnet-intl-en
TencentCloud/Yunjing/V20180228/Models/DeleteLoginWhiteListResponse.cs
1,402
C#
using System; // Mark this assembly as "CLS compliant" or "not CLS compliant". // // You should always mark an assembly as "CLS compliant", if possible (this is also the default in "Project.Code.props"). // // The only reason to mark an assembly as "not CLS compliant" is if it's using "not CLS compliant" // dependencies that have "public" or "protected" visibility. ASP.NET Core is an example of such a dependency. // // To mark this assembly as "not CLS compliant", add the property "<ClsCompliant>false</ClsCompliant>" to // your project file. // // For details, see: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/CA1014 // // NOTE: This can't be done in a .csproj file at the moment: https://github.com/dotnet/msbuild/issues/2281 #if CLS_COMPLIANT [assembly: CLSCompliant(true)] #else [assembly: CLSCompliant(false)] #endif
42.190476
122
0.722348
[ "Apache-2.0" ]
skrysmanski/hdvp
_ProjectCommons/CommonAssemblyInfo.cs
888
C#
namespace VXDesign.Store.DevTools.Common.Core.Constants { public static class MemoryCacheKey { public const string GitHubUserRepositories = "GitHubUserRepositories"; public const string GitHubRepositoryLanguages = "GitHubRepositoryLanguages"; public const string CamundaVersion = "CamundaVersion"; } }
37.444444
84
0.750742
[ "MIT" ]
GUSAR1T0/VXDS-DEV-TOOLS
DevTools/Common/Core/Constants/MemoryCacheKey.cs
337
C#
using BuildingBlocks.Core.Exceptions; namespace OnlineStore.Modules.Identity.Domain.Aggregates.Users.DomainExceptions { public class InvalidEmailException : DomainException { public string Email { get; } public InvalidEmailException(string email) : base($"Invalid email: {email}.") { Email = email; } } }
27.769231
85
0.66759
[ "MIT" ]
mehdihadeli/Modular-Monolith-Template
src/Modules/Identity/src/OnlineStore.Modules.Identity.Domain/Aggregates/Users/DomainExceptions/InvalidEmailException.cs
361
C#
/* * RepoUploadOptions.cs * * Copyright (C) 2010-2015 by Microsoft Corporation * * This program is licensed to you under the terms of Version 2.0 of the * Apache License. This program is distributed WITHOUT * ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT, * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the * Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0) for more details. * */ using System; namespace DeployR { /// <summary> /// Options used when uploading files to the Repository /// </summary> /// <remarks></remarks> public class RepoUploadOptions { private String m_descr = ""; private String m_filename = ""; private Boolean m_newversion = false; private String m_newversionmsg = ""; private String m_inputs = ""; private String m_outputs = ""; private Boolean m_published = false; private Boolean m_sharedUser = false; private String m_restricted = ""; private String m_directory = ""; /// <summary> /// Repository file description /// </summary> /// <value>file description</value> /// <returns>file description</returns> /// <remarks></remarks> public String descr { get { return m_descr; } set { m_descr = value; } } /// <summary> /// Repository file name /// </summary> /// <value>file name</value> /// <returns>file name</returns> /// <remarks></remarks> public String filename { get { return m_filename; } set { m_filename = value; } } /// <summary> /// Repository file new version on upload /// </summary> /// <value>make new version flag</value> /// <returns>make new version flag</returns> /// <remarks></remarks> public Boolean newversion { get { return m_newversion; } set { m_newversion = value; } } /// <summary> /// Repository file new version message on upload. /// </summary> /// <value>message associated with file when a new version is created via upload</value> /// <returns>message associated with file when a new version is created via upload</returns> /// <remarks></remarks> public String newversionmsg { get { return m_newversionmsg; } set { m_newversionmsg = value; } } /// <summary> /// Repository file (script) inputs. /// </summary> /// <value>script inputs</value> /// <returns>script inputs</returns> /// <remarks></remarks> public String inputs { get { return m_inputs; } set { m_inputs = value; } } /// <summary> /// Repository file (script) outputs. /// </summary> /// <value>script outputs</value> /// <returns>script outputs</returns> /// <remarks></remarks> public String outputs { get { return m_outputs; } set { m_outputs = value; } } /// <summary> /// Repository file to be published on upload. /// </summary> /// <value>publish flag</value> /// <returns>publish flag</returns> /// <remarks></remarks> public Boolean published { get { return m_published; } set { m_published = value; } } /// <summary> /// Repository file to be shared on upload. /// </summary> /// <value>shared flag</value> /// <returns>shared flag</returns> /// <remarks></remarks> public Boolean sharedUser { get { return m_sharedUser; } set { m_sharedUser = value; } } /// <summary> /// Repository file to be restricted to comma-separated list of Roles on upload. /// </summary> /// <value>restricted list of users</value> /// <returns>restricted list of users</returns> /// <remarks></remarks> public String restricted { get { return m_restricted; } set { m_restricted = value; } } /// <summary> /// Repository directory name /// </summary> /// <value>directory name</value> /// <returns>directory name</returns> /// <remarks></remarks> public String directory { get { return m_directory; } set { m_directory = value; } } } }
25.398148
100
0.458075
[ "Apache-2.0" ]
jamesbascle/DeployR-dotnet-client-library
src/RepoUploadOptions.cs
5,486
C#
#region Copyright // <<<<<<< HEAD <<<<<<< HEAD ======= ======= >>>>>>> update form orginal repo // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation // // 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. #endregion <<<<<<< HEAD >>>>>>> Merges latest changes from release/9.4.x into development (#3178) ======= >>>>>>> update form orginal repo #region Usings using System; using System.ComponentModel; using System.Web.UI; using System.Web.UI.WebControls; #endregion namespace DotNetNuke.Web.UI.WebControls { [ParseChildren(true)] public class DnnRibbonBar : WebControl { public DnnRibbonBar() : base("div") { CssClass = "dnnRibbon"; Control control = this; Utilities.ApplySkin(control, "", "RibbonBar", "RibbonBar"); } [Category("Behavior"), PersistenceMode(PersistenceMode.InnerProperty), DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] public DnnRibbonBarGroupCollection Groups { get { return (DnnRibbonBarGroupCollection) Controls; } } protected override void AddParsedSubObject(object obj) { if (obj is DnnRibbonBarGroup) { base.AddParsedSubObject(obj); } else { throw new NotSupportedException("DnnRibbonBarGroupCollection must contain controls of type DnnRibbonBarGroup"); } } protected override ControlCollection CreateControlCollection() { return new DnnRibbonBarGroupCollection(this); } protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); if (Visible) { Utilities.ApplySkin(this, "", "RibbonBar", "RibbonBar"); } } protected override void Render(HtmlTextWriter writer) { if ((Groups.Count > 0)) { Groups[0].CssClass = Groups[0].CssClass + " " + Groups[0].CssClass.Trim() + "First"; Groups[Groups.Count - 1].CssClass = Groups[Groups.Count - 1].CssClass + " " + Groups[Groups.Count - 1].CssClass.Trim() + "Last"; } base.RenderBeginTag(writer); writer.AddAttribute("class", "barContent"); writer.RenderBeginTag("div"); writer.AddAttribute("cellpadding", "0"); writer.AddAttribute("cellspacing", "0"); writer.AddAttribute("border", "0"); writer.RenderBeginTag("table"); writer.RenderBeginTag("tr"); foreach (DnnRibbonBarGroup grp in Groups) { if ((grp.Visible)) { writer.RenderBeginTag("td"); grp.RenderControl(writer); writer.RenderEndTag(); } } //MyBase.RenderChildren(writer) writer.RenderEndTag(); //tr writer.RenderEndTag(); //table writer.RenderEndTag(); //div writer.AddAttribute("class", "barBottomLeft"); writer.RenderBeginTag("div"); writer.RenderEndTag(); writer.AddAttribute("class", "barBottomRight"); writer.RenderBeginTag("div"); writer.RenderEndTag(); base.RenderEndTag(writer); } } }
33.688889
152
0.598065
[ "MIT" ]
DnnSoftwarePersian/Dnn.Platform
DNN Platform/DotNetNuke.Web/UI/WebControls/DnnRibbonBar.cs
4,549
C#
// <copyright file="MeterProviderSdk.cs" company="OpenTelemetry Authors"> // Copyright The OpenTelemetry Authors // // Licensed 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. // </copyright> using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Diagnostics.Metrics; using System.Linq; using System.Threading; using OpenTelemetry.Resources; namespace OpenTelemetry.Metrics { public class MeterProviderSdk : MeterProvider { internal const int MaxMetrics = 1000; private readonly Metric[] metrics; private readonly List<object> instrumentations = new List<object>(); private readonly object collectLock = new object(); private readonly MeterListener listener; private readonly List<MetricReader> metricReaders = new List<MetricReader>(); private int metricIndex = -1; internal MeterProviderSdk( Resource resource, IEnumerable<string> meterSources, List<MeterProviderBuilderSdk.InstrumentationFactory> instrumentationFactories, MetricReader[] metricReaders) { this.Resource = resource; this.metrics = new Metric[MaxMetrics]; // TODO: Replace with single CompositeReader. this.metricReaders.AddRange(metricReaders); AggregationTemporality temporality = AggregationTemporality.Cumulative; // TODO: Actually support multiple readers. // Currently the last reader's temporality wins. foreach (var reader in this.metricReaders) { reader.SetParentProvider(this); temporality = reader.PreferredAggregationTemporality; } if (instrumentationFactories.Any()) { foreach (var instrumentationFactory in instrumentationFactories) { this.instrumentations.Add(instrumentationFactory.Factory()); } } // Setup Listener var meterSourcesToSubscribe = new Dictionary<string, bool>(StringComparer.OrdinalIgnoreCase); foreach (var name in meterSources) { meterSourcesToSubscribe[name] = true; } this.listener = new MeterListener() { InstrumentPublished = (instrument, listener) => { if (meterSourcesToSubscribe.ContainsKey(instrument.Meter.Name)) { var index = Interlocked.Increment(ref this.metricIndex); if (index >= MaxMetrics) { // Log that all measurements are dropped from this instrument. } else { var metric = new Metric(instrument, temporality); this.metrics[index] = metric; listener.EnableMeasurementEvents(instrument, metric); } } }, MeasurementsCompleted = (instrument, state) => this.MeasurementsCompleted(instrument, state), }; // Everything double this.listener.SetMeasurementEventCallback<double>((instrument, value, tags, state) => this.MeasurementRecordedDouble(instrument, value, tags, state)); this.listener.SetMeasurementEventCallback<float>((instrument, value, tags, state) => this.MeasurementRecordedDouble(instrument, value, tags, state)); // Everything long this.listener.SetMeasurementEventCallback<long>((instrument, value, tags, state) => this.MeasurementRecordedLong(instrument, value, tags, state)); this.listener.SetMeasurementEventCallback<int>((instrument, value, tags, state) => this.MeasurementRecordedLong(instrument, value, tags, state)); this.listener.SetMeasurementEventCallback<short>((instrument, value, tags, state) => this.MeasurementRecordedLong(instrument, value, tags, state)); this.listener.SetMeasurementEventCallback<byte>((instrument, value, tags, state) => this.MeasurementRecordedLong(instrument, value, tags, state)); this.listener.Start(); } internal Resource Resource { get; } internal void MeasurementsCompleted(Instrument instrument, object state) { Console.WriteLine($"Instrument {instrument.Meter.Name}:{instrument.Name} completed."); } internal void MeasurementRecordedDouble(Instrument instrument, double value, ReadOnlySpan<KeyValuePair<string, object>> tagsRos, object state) { // Get Instrument State var metric = state as Metric; if (instrument == null || metric == null) { // TODO: log return; } metric.UpdateDouble(value, tagsRos); } internal void MeasurementRecordedLong(Instrument instrument, long value, ReadOnlySpan<KeyValuePair<string, object>> tagsRos, object state) { // Get Instrument State var metric = state as Metric; if (instrument == null || metric == null) { // TODO: log return; } metric.UpdateLong(value, tagsRos); } internal Batch<Metric> Collect() { lock (this.collectLock) { try { // Record all observable instruments this.listener.RecordObservableInstruments(); var indexSnapShot = Math.Min(this.metricIndex, MaxMetrics - 1); for (int i = 0; i < indexSnapShot + 1; i++) { this.metrics[i].SnapShot(); } return new Batch<Metric>(this.metrics, indexSnapShot + 1); } catch (Exception) { // TODO: Log return default; } } } protected override void Dispose(bool disposing) { if (this.instrumentations != null) { foreach (var item in this.instrumentations) { (item as IDisposable)?.Dispose(); } this.instrumentations.Clear(); } foreach (var reader in this.metricReaders) { reader.Dispose(); } this.listener.Dispose(); } } }
38.296296
162
0.574192
[ "Apache-2.0" ]
joaopgrassi/opentelemetry-dotnet
src/OpenTelemetry/Metrics/MeterProviderSdk.cs
7,238
C#
using System.Text.Json.Serialization; namespace Essensoft.Paylink.Alipay.Domain { /// <summary> /// AlipayOfflineMarketingVoucherCreateModel Data Structure. /// </summary> public class AlipayOfflineMarketingVoucherCreateModel : AlipayObject { /// <summary> /// 预算信息 /// </summary> [JsonPropertyName("budget_info")] public BudgetInfo BudgetInfo { get; set; } /// <summary> /// 券码池编号。该值调用:alipay.offline.marketing.voucher.code.upload接口生成 /// </summary> [JsonPropertyName("code_inventory_id")] public string CodeInventoryId { get; set; } /// <summary> /// 扩展参数 /// </summary> [JsonPropertyName("ext_info")] public string ExtInfo { get; set; } /// <summary> /// 发放规则信息 /// </summary> [JsonPropertyName("get_rule")] public GetRuleInfo GetRule { get; set; } /// <summary> /// 外部流水号.需商家自己生成并保证每次请求的唯一性 /// </summary> [JsonPropertyName("out_biz_no")] public string OutBizNo { get; set; } /// <summary> /// 券模板信息 /// </summary> [JsonPropertyName("voucher_info")] public VoucherInfo VoucherInfo { get; set; } } }
27.106383
72
0.564364
[ "MIT" ]
Frunck8206/payment
src/Essensoft.Paylink.Alipay/Domain/AlipayOfflineMarketingVoucherCreateModel.cs
1,390
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Generic; using Internal.Text; using Internal.TypeSystem; namespace ILCompiler.DependencyAnalysis { /// <summary> /// Represents a frozen object that is statically preallocated within the data section /// of the executable instead of on the GC heap. /// </summary> public class FrozenObjectNode : EmbeddedObjectNode, ISymbolDefinitionNode { private readonly FieldDesc _field; private readonly TypePreinit.ISerializableReference _data; public FrozenObjectNode(FieldDesc field, TypePreinit.ISerializableReference data) { _field = field; _data = data; } public void AppendMangledName(NameMangler nameMangler, Utf8StringBuilder sb) { sb.Append(nameMangler.CompilationUnitPrefix).Append("__FrozenObj_") .Append(nameMangler.GetMangledFieldName(_field)); } public override bool StaticDependenciesAreComputed => true; int ISymbolNode.Offset => 0; int ISymbolDefinitionNode.Offset { get { // The frozen object symbol points at the MethodTable portion of the object, skipping over the sync block return OffsetFromBeginningOfArray + _field.Context.Target.PointerSize; } } public override void EncodeData(ref ObjectDataBuilder dataBuilder, NodeFactory factory, bool relocsOnly) { // Sync Block dataBuilder.EmitZeroPointer(); // byte contents _data.WriteContent(ref dataBuilder, this, factory); } protected override string GetName(NodeFactory factory) => this.GetMangledName(factory.NameMangler); public override IEnumerable<DependencyListEntry> GetStaticDependencies(NodeFactory factory) { ObjectDataBuilder builder = new ObjectDataBuilder(factory, true); EncodeData(ref builder, factory, true); Relocation[] relocs = builder.ToObjectData().Relocs; DependencyList dependencies = null; if (relocs != null) { dependencies = new DependencyList(); foreach (Relocation reloc in relocs) { dependencies.Add(reloc.Target, "reloc"); } } return dependencies; } protected override void OnMarked(NodeFactory factory) { factory.FrozenSegmentRegion.AddEmbeddedObject(this); } public override int ClassCode => 1789429316; public override int CompareToImpl(ISortableNode other, CompilerComparer comparer) { return comparer.Compare(((FrozenObjectNode)other)._field, _field); } } }
33.568182
121
0.634056
[ "MIT" ]
333fred/runtime
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/FrozenObjectNode.cs
2,954
C#
namespace StockManager.Src.Views.Forms { partial class ProductForm { /// <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() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ProductForm)); this.pnlBody = new System.Windows.Forms.Panel(); this.btnCancel = new System.Windows.Forms.Button(); this.pnlTopBar = new System.Windows.Forms.Panel(); this.lbTitle = new System.Windows.Forms.Label(); this.lbErrorName = new System.Windows.Forms.Label(); this.lbErrorReference = new System.Windows.Forms.Label(); this.btnSave = new System.Windows.Forms.Button(); this.tbName = new System.Windows.Forms.TextBox(); this.lbName = new System.Windows.Forms.Label(); this.tbReference = new System.Windows.Forms.TextBox(); this.lbReference = new System.Windows.Forms.Label(); this.pnlBody.SuspendLayout(); this.pnlTopBar.SuspendLayout(); this.SuspendLayout(); // // pnlBody // this.pnlBody.BackColor = System.Drawing.SystemColors.Control; this.pnlBody.Controls.Add(this.btnCancel); this.pnlBody.Controls.Add(this.pnlTopBar); this.pnlBody.Controls.Add(this.lbErrorName); this.pnlBody.Controls.Add(this.lbErrorReference); this.pnlBody.Controls.Add(this.btnSave); this.pnlBody.Controls.Add(this.tbName); this.pnlBody.Controls.Add(this.lbName); this.pnlBody.Controls.Add(this.tbReference); this.pnlBody.Controls.Add(this.lbReference); this.pnlBody.Dock = System.Windows.Forms.DockStyle.Fill; this.pnlBody.Location = new System.Drawing.Point(0, 0); this.pnlBody.Name = "pnlBody"; this.pnlBody.Size = new System.Drawing.Size(451, 299); this.pnlBody.TabIndex = 7; // // btnCancel // this.btnCancel.BackColor = System.Drawing.Color.FromArgb((( int )((( byte )(217)))), (( int )((( byte )(83)))), (( int )((( byte )(79))))); this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnCancel.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (( byte )(0))); this.btnCancel.ForeColor = System.Drawing.Color.White; this.btnCancel.Location = new System.Drawing.Point(103, 229); this.btnCancel.Name = "btnCancel"; this.btnCancel.Size = new System.Drawing.Size(120, 32); this.btnCancel.TabIndex = 4; this.btnCancel.Text = "Cancel"; this.btnCancel.UseVisualStyleBackColor = false; this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); // // pnlTopBar // this.pnlTopBar.BackColor = System.Drawing.Color.FromArgb((( int )((( byte )(26)))), (( int )((( byte )(29)))), (( int )((( byte )(33))))); this.pnlTopBar.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.pnlTopBar.Controls.Add(this.lbTitle); this.pnlTopBar.Dock = System.Windows.Forms.DockStyle.Top; this.pnlTopBar.Location = new System.Drawing.Point(0, 0); this.pnlTopBar.Name = "pnlTopBar"; this.pnlTopBar.Size = new System.Drawing.Size(451, 44); this.pnlTopBar.TabIndex = 16; // // lbTitle // this.lbTitle.AutoSize = true; this.lbTitle.BackColor = System.Drawing.Color.Transparent; this.lbTitle.Font = new System.Drawing.Font("Courier New", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (( byte )(0))); this.lbTitle.ForeColor = System.Drawing.Color.White; this.lbTitle.Location = new System.Drawing.Point(12, 11); this.lbTitle.Name = "lbTitle"; this.lbTitle.Size = new System.Drawing.Size(142, 22); this.lbTitle.TabIndex = 1; this.lbTitle.Text = "Product info"; // // lbErrorName // this.lbErrorName.AutoSize = true; this.lbErrorName.Font = new System.Drawing.Font("Courier New", 9F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, (( byte )(0))); this.lbErrorName.ForeColor = System.Drawing.Color.Red; this.lbErrorName.Location = new System.Drawing.Point(106, 174); this.lbErrorName.Name = "lbErrorName"; this.lbErrorName.Size = new System.Drawing.Size(85, 16); this.lbErrorName.TabIndex = 15; this.lbErrorName.Text = "Name errors"; // // lbErrorReference // this.lbErrorReference.AutoSize = true; this.lbErrorReference.Font = new System.Drawing.Font("Courier New", 9F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, (( byte )(0))); this.lbErrorReference.ForeColor = System.Drawing.Color.Red; this.lbErrorReference.Location = new System.Drawing.Point(106, 108); this.lbErrorReference.Name = "lbErrorReference"; this.lbErrorReference.Size = new System.Drawing.Size(120, 16); this.lbErrorReference.TabIndex = 14; this.lbErrorReference.Text = "Reference errors"; // // btnSave // this.btnSave.BackColor = System.Drawing.Color.FromArgb((( int )((( byte )(92)))), (( int )((( byte )(184)))), (( int )((( byte )(92))))); this.btnSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnSave.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (( byte )(0))); this.btnSave.ForeColor = System.Drawing.Color.White; this.btnSave.Location = new System.Drawing.Point(235, 229); this.btnSave.Name = "btnSave"; this.btnSave.Size = new System.Drawing.Size(120, 32); this.btnSave.TabIndex = 3; this.btnSave.Text = "Save"; this.btnSave.UseVisualStyleBackColor = false; this.btnSave.Click += new System.EventHandler(this.btnSave_Click); // // tbName // this.tbName.BackColor = System.Drawing.Color.White; this.tbName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.tbName.ForeColor = System.Drawing.Color.Black; this.tbName.Location = new System.Drawing.Point(103, 149); this.tbName.Name = "tbName"; this.tbName.Size = new System.Drawing.Size(252, 22); this.tbName.TabIndex = 2; this.tbName.KeyDown += new System.Windows.Forms.KeyEventHandler(this.OnKeyDown); // // lbName // this.lbName.AutoSize = true; this.lbName.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (( byte )(0))); this.lbName.ForeColor = System.Drawing.Color.FromArgb((( int )((( byte )(5)))), (( int )((( byte )(118)))), (( int )((( byte )(185))))); this.lbName.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; this.lbName.Location = new System.Drawing.Point(100, 130); this.lbName.Name = "lbName"; this.lbName.Size = new System.Drawing.Size(40, 16); this.lbName.TabIndex = 9; this.lbName.Text = "Name"; // // tbReference // this.tbReference.BackColor = System.Drawing.Color.White; this.tbReference.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.tbReference.ForeColor = System.Drawing.Color.Black; this.tbReference.Location = new System.Drawing.Point(103, 83); this.tbReference.Name = "tbReference"; this.tbReference.Size = new System.Drawing.Size(252, 22); this.tbReference.TabIndex = 1; this.tbReference.KeyDown += new System.Windows.Forms.KeyEventHandler(this.OnKeyDown); // // lbReference // this.lbReference.AutoSize = true; this.lbReference.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (( byte )(0))); this.lbReference.ForeColor = System.Drawing.Color.FromArgb((( int )((( byte )(5)))), (( int )((( byte )(118)))), (( int )((( byte )(185))))); this.lbReference.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; this.lbReference.Location = new System.Drawing.Point(100, 64); this.lbReference.Name = "lbReference"; this.lbReference.Size = new System.Drawing.Size(80, 16); this.lbReference.TabIndex = 2; this.lbReference.Text = "Reference"; // // ProductForm // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.BackColor = System.Drawing.SystemColors.Control; this.ClientSize = new System.Drawing.Size(451, 299); this.Controls.Add(this.pnlBody); this.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (( byte )(0))); this.ForeColor = System.Drawing.Color.White; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.Icon = (( System.Drawing.Icon )(resources.GetObject("$this.Icon"))); this.Margin = new System.Windows.Forms.Padding(4); this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "ProductForm"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Stock Manager | Create new product"; this.pnlBody.ResumeLayout(false); this.pnlBody.PerformLayout(); this.pnlTopBar.ResumeLayout(false); this.pnlTopBar.PerformLayout(); this.ResumeLayout(false); } #endregion private System.Windows.Forms.Panel pnlBody; private System.Windows.Forms.TextBox tbName; private System.Windows.Forms.Label lbName; private System.Windows.Forms.TextBox tbReference; private System.Windows.Forms.Label lbReference; private System.Windows.Forms.Button btnSave; private System.Windows.Forms.Label lbErrorName; private System.Windows.Forms.Label lbErrorReference; private System.Windows.Forms.Panel pnlTopBar; private System.Windows.Forms.Label lbTitle; private System.Windows.Forms.Button btnCancel; } }
54.490991
168
0.590642
[ "MIT" ]
ricardotx/StockManager
StockManager/Src/Views/Forms/ProductForm.Designer.cs
12,099
C#
using System; namespace GateMQ.Db.Drivers.Sqlite { public static class SqliteGateDbTypeMapper { public static Type MapToNetType(string dbType, bool notNull) { if (dbType == "BOOLEAN" && notNull) { return typeof(bool); } if (dbType == "BOOLEAN" && !notNull) { return typeof(bool?); } if (dbType == "DOUBLE" && notNull) { return typeof(double); } if (dbType == "DOUBLE" && !notNull) { return typeof(double?); } if (dbType == "FLOAT" && notNull) { return typeof(float); } if (dbType == "FLOAT" && !notNull) { return typeof(float?); } if (dbType == "TINYINT" && notNull) { return typeof(byte); } if (dbType == "TINYINT" && !notNull) { return typeof(byte?); } if (dbType == "SMALLINT" && notNull) { return typeof(short); } if (dbType == "SMALLINT" && !notNull) { return typeof(short?); } if (dbType == "INTEGER" && notNull) { return typeof(int); } if (dbType == "INTEGER" && !notNull) { return typeof(int?); } if (dbType == "BIGINT" && notNull) { return typeof(long); } if (dbType == "BIGINT" && !notNull) { return typeof(long?); } if (dbType == "GUID" && !notNull) { return typeof(Guid?); } if (dbType == "GUID" && notNull) { return typeof(Guid); } if (dbType == "DATETIME" && notNull) { return typeof(DateTime); } if (dbType == "DATETIME" && !notNull) { return typeof(DateTime?); } if (dbType == "DECIMAL(18,4)" && notNull) { return typeof(decimal); } if (dbType == "DECIMAL(18,4)" && !notNull) { return typeof(decimal?); } if (dbType == "BLOB") { return typeof(byte[]); } if (dbType == "VARCHAR") { return typeof(string); } throw new NotSupportedException($"Unsupported DB type [{dbType},{notNull}]"); } public static string MapToDbType(Type columnType) { if (columnType == typeof(bool)) { return "BOOLEAN NOT NULL"; } if (columnType == typeof(bool?)) { return "BOOLEAN NULL"; } if (columnType == typeof(decimal)) { return "DECIMAL(18,4) NOT NULL"; } if (columnType == typeof(decimal?)) { return "DECIMAL(18,4) NULL"; } if (columnType == typeof(double)) { return "DOUBLE NOT NULL"; } if (columnType == typeof(double?)) { return "DOUBLE NULL"; } if (columnType == typeof(float)) { return "FLOAT NOT NULL"; } if (columnType == typeof(float?)) { return "FLOAT NULL"; } if (columnType == typeof(byte)) { return "TINYINT NOT NULL"; } if (columnType == typeof(byte?)) { return "TINYINT NULL"; } if (columnType == typeof(short)) { return "SMALLINT NOT NULL"; } if (columnType == typeof(short?)) { return "SMALLINT NULL"; } if (columnType == typeof(int)) { return "INTEGER NOT NULL"; } if (columnType == typeof(int?)) { return "INTEGER NULL"; } if (columnType == typeof(long)) { return "BIGINT NOT NULL"; } if (columnType == typeof(long?)) { return "BIGINT NULL"; } if (columnType == typeof(Guid)) { return "GUID NOT NULL"; } if (columnType == typeof(Guid?)) { return "GUID NULL"; } if (columnType == typeof(DateTime)) { return "DATETIME NOT NULL"; } if (columnType == typeof(DateTime?)) { return "DATETIME NULL"; } if (columnType == typeof(string)) { return "VARCHAR NULL"; } if (columnType == typeof(byte[])) { return "BLOB NULL"; } throw new NotSupportedException($"Unsupported .NET type [{columnType.Name}]"); } } }
25.558036
90
0.355284
[ "Apache-2.0" ]
gighen76/gatemq
src/GateMQ.Db/Drivers/Sqlite/SqliteGateDbTypeMapper.cs
5,725
C#
using System; using System.Configuration; using System.Globalization; public static class Settings { public static TimeSpan WarmupDuration = TimeSpan.Parse(ConfigurationManager.AppSettings["WarmupDuration"]); public static TimeSpan RunDuration = TimeSpan.Parse(ConfigurationManager.AppSettings["RunDuration"]); public static TimeSpan SeedDuration = TimeSpan.FromSeconds((RunDuration + WarmupDuration).TotalSeconds * Convert.ToDouble(ConfigurationManager.AppSettings["SeedDurationFactor"], CultureInfo.InvariantCulture)); public const int DefaultConnectionLimit = 150; }
46.230769
214
0.798669
[ "Apache-2.0" ]
Particular/EndToEnd
src/PerformanceTests/Utils/Settings.cs
591
C#
using System; using System.Collections.Generic; using System.Text; namespace AzureB2C.PolicyAnalyzer.Core.Models { public class Reference<T> where T : BaseItem { public Reference(BaseItem item, string id, ObjectIndex references) { Id = id; _references = references; _item = item; } public string Id { get; } private ObjectIndex _references; private BaseItem _item; public T GetInstance() { if (_item is Policy) return _references.GetPolicyReference(Id) as T; else return _references.GetReference(typeof(T), Id, ((PolicyItem)_item).Policy) as T; } public override string ToString() { return $"{Id}"; } } }
23.514286
96
0.561361
[ "MIT" ]
roberchi/AzureB2C-PolicyAnalyzer
src/AzureB2C.PolicyAnalyzer.Core/Models/Reference.cs
825
C#
using MpcCore.Contracts; using MpcCore.Contracts.Mpd; using MpcCore.Response; using System.Collections.Generic; namespace MpcCore.Commands.Outputs { /// <summary> /// Returns a list of all outputdevices available /// <seealso cref="https://www.musicpd.org/doc/html/protocol.html#audio-output-devices"/> /// </summary> public class GetOutputDeviceList : IMpcCoreCommand<IEnumerable<IOutputDevice>> { /// <summary> /// The internal command string /// </summary> public string Command { get; internal set; } = "outputs"; public IEnumerable<IOutputDevice> HandleResponse(IMpdResponse response) { var parser = new ResponseParser(response); return parser.GetListedOutputDevices(); } } }
26.407407
90
0.73352
[ "MIT" ]
LEdoian/mpcCore
src/MpcCore/Commands/Outputs/GetOutputList.cs
715
C#
using System.Collections; using DistantWorlds2.ModLoader; using Json.Schema; using Json.Schema.Generation; using Json.Schema.Generation.Intents; namespace ModDevToolsMod; public class Dw2ContentDefinitionSchemaRefiner : ISchemaRefiner { private static readonly RefIntent ExprLangRefIntent = new(Mod.ExprLangRefUri); public Dw2ContentDefinitionSchemaRefiner(Type rootType) => RootType = rootType; public Type RootType { get; } private bool _rootTypeInit = false; public Dictionary<string, SchemaGeneratorContext> Definitions = new(); public bool ShouldRun(SchemaGeneratorContext context) => !context.Type.IsPrimitive && context.Type != typeof(string) && context.Type.GetInterfaces().All(f => f != typeof(IEnumerable)); public void Run(SchemaGeneratorContext context) { var type = context.Type; if (type.IsEnum) { context.Intents.Add(new TitleIntent(Mod.GetFriendlyName(type))); context.Intents.Add(new DescriptionIntent(Mod.GetFriendlyDescription(type))); return; } if (type == typeof(ExplicitExpression)) { context.Intents.Clear(); context.Intents.Add(ExprLangRefIntent); return; } if (type == typeof(NumberExpression)) { context.Intents.Clear(); context.Intents.Add(new OneOfIntent( new ISchemaKeywordIntent[] { ExprLangRefIntent }, new ISchemaKeywordIntent[] { new TypeIntent(SchemaValueType.Number) } )); context.Intents.Add(new TitleIntent(Mod.GetFriendlyName(type))); context.Intents.Add(new DescriptionIntent(Mod.GetFriendlyDescription(type))); return; } if (type == typeof(IntegerExpression)) { context.Intents.Clear(); context.Intents.Add(new OneOfIntent( new ISchemaKeywordIntent[] { ExprLangRefIntent }, new ISchemaKeywordIntent[] { new TypeIntent(SchemaValueType.Integer) } )); context.Intents.Add(new DescriptionIntent(Mod.GetFriendlyDescription(type))); return; } if (type.IsGenericType) { if (type.GetGenericTypeDefinition() == typeof(AddToList<>)) { context.Intents.Clear(); return; } if (type.GetGenericTypeDefinition() == typeof(Def<>)) { context.Intents.Clear(); return; } if (type.GetGenericTypeDefinition() == typeof(ItemOrDelete<>)) { context.Intents.Clear(); return; } } if (!_rootTypeInit) SchemaGenerationContextCache.Get(RootType, new(0), context.Configuration); var props = context.Intents.OfType<PropertiesIntent>().FirstOrDefault(); if (props is null) return; var isDefType = Mod.DefTypes.Contains(context.Type); if (isDefType) if (context.Type != RootType) { context.Intents.Clear(); context.Intents.Add(new RefIntent(new($"./def-{context.Type.Name}.json#", UriKind.Relative))); return; } var propsCopy = new Dictionary<string, SchemaGeneratorContext>(props.Properties); #if DEBUG var minProps = props.Properties.Count; #endif props.Properties.Clear(); var sgcExplicitExpression = SchemaGenerationContextCache.Get(typeof(ExplicitExpression), new(0), context.Configuration); var sgcIntegerExpression = SchemaGenerationContextCache.Get(typeof(IntegerExpression), new(0), context.Configuration); var sgcNumberExpression = SchemaGenerationContextCache.Get(typeof(NumberExpression), new(0), context.Configuration); foreach (var kv in propsCopy) { var name = kv.Key; var propCtx = kv.Value; if (propCtx.Intents.Count >= 1 && !propCtx.Intents.OfType<TitleIntent>().Any()) { context.Intents.Add(new DescriptionIntent(Mod.GetFriendlyDescription(propCtx.Type))); } if (propCtx.Type == typeof(string)) { props.Properties.Add(name, propCtx); props.Properties.Add($"${name}", sgcExplicitExpression); continue; } var typeIntent = propCtx.Intents.OfType<TypeIntent>() .FirstOrDefault(ti => ti.Type is SchemaValueType.Integer or SchemaValueType.Number); if (typeIntent is null) { props.Properties.Add(name, propCtx); continue; } var exprNum = typeIntent.Type == SchemaValueType.Integer ? sgcIntegerExpression : sgcNumberExpression; props.Properties.Add(name, exprNum); } context.Intents.Add(new UnevaluatedPropertiesIntent(false)); context.Intents.Add(new AdditionalPropertiesIntent(false)); if (isDefType) { if (Mod.DefIdFields.TryGetValue(context.Type.Name, out var idFieldName)) { var exprIdFieldName = $"${idFieldName}"; if (!props.Properties.ContainsKey(exprIdFieldName)) props.Properties.Add(exprIdFieldName, sgcExplicitExpression); } context.Intents.Insert(0, new SchemaIntent(Mod.JsonSchemaDraft7)); context.Intents.Insert(1, new IdIntent($"https://dw2mc.github.io/DW2ModLoader/def-{type.Name}.json")); context.Intents.Add(new TitleIntent($"{type.FullName}, a content definition type")); context.Intents.Add(new DescriptionIntent($"See https://github.com/DW2MC/DW2ModLoader/wiki/{type.FullName}")); var defs = context.Intents.OfType<DefinitionsIntent>().FirstOrDefault(); if (defs is not null) { // move to end foreach (var (k, v) in Definitions) defs.Definitions.Add(k, v); var oldDefs = Definitions; Definitions = defs.Definitions; oldDefs.Clear(); } else context.Intents.Add(new DefinitionsIntent(Definitions)); props.Properties.Add("$where", sgcExplicitExpression); // for parser compatibility sake _rootTypeInit = true; } else { context.Intents.Add(new TitleIntent(Mod.GetFriendlyName(type))); context.Intents.Add(new DescriptionIntent(Mod.GetFriendlyDescription(type))); } #if DEBUG if (props.Properties.Count < minProps) throw new NotImplementedException("Woops!"); #endif } }
34.97076
124
0.68194
[ "MIT" ]
DW2MC/DW2ModLoader
ModDevToolsMod/Dw2ContentDefinitionSchemaRefiner.cs
5,980
C#
namespace Libgpgme { public class InvalidPtrException : GpgmeException { public InvalidPtrException(string message) : base(message) { } } }
20.777778
54
0.588235
[ "MIT" ]
Daniel15/gpgme-sharp
gpgme-sharp/Exceptions/InvalidPtrException.cs
187
C#
// *** WARNING: this file was generated by the Pulumi SDK Generator. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Threading.Tasks; using Pulumi.Serialization; namespace Pulumi.AzureNative.DataBoxEdge.V20190701 { /// <summary> /// Trigger details. /// </summary> [Obsolete(@"Please use one of the variants: FileEventTrigger, PeriodicTimerEventTrigger.")] [AzureNativeResourceType("azure-native:databoxedge/v20190701:Trigger")] public partial class Trigger : Pulumi.CustomResource { /// <summary> /// Trigger Kind. /// </summary> [Output("kind")] public Output<string> Kind { get; private set; } = null!; /// <summary> /// The object name. /// </summary> [Output("name")] public Output<string> Name { get; private set; } = null!; /// <summary> /// The hierarchical type of the object. /// </summary> [Output("type")] public Output<string> Type { get; private set; } = null!; /// <summary> /// Create a Trigger resource with the given unique name, arguments, and options. /// </summary> /// /// <param name="name">The unique name of the resource</param> /// <param name="args">The arguments used to populate this resource's properties</param> /// <param name="options">A bag of options that control this resource's behavior</param> public Trigger(string name, TriggerArgs args, CustomResourceOptions? options = null) : base("azure-native:databoxedge/v20190701:Trigger", name, args ?? new TriggerArgs(), MakeResourceOptions(options, "")) { } private Trigger(string name, Input<string> id, CustomResourceOptions? options = null) : base("azure-native:databoxedge/v20190701:Trigger", name, null, MakeResourceOptions(options, id)) { } private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id) { var defaultOptions = new CustomResourceOptions { Version = Utilities.Version, Aliases = { new Pulumi.Alias { Type = "azure-nextgen:databoxedge/v20190701:Trigger"}, new Pulumi.Alias { Type = "azure-native:databoxedge:Trigger"}, new Pulumi.Alias { Type = "azure-nextgen:databoxedge:Trigger"}, new Pulumi.Alias { Type = "azure-native:databoxedge/v20190301:Trigger"}, new Pulumi.Alias { Type = "azure-nextgen:databoxedge/v20190301:Trigger"}, new Pulumi.Alias { Type = "azure-native:databoxedge/v20190801:Trigger"}, new Pulumi.Alias { Type = "azure-nextgen:databoxedge/v20190801:Trigger"}, new Pulumi.Alias { Type = "azure-native:databoxedge/v20200501preview:Trigger"}, new Pulumi.Alias { Type = "azure-nextgen:databoxedge/v20200501preview:Trigger"}, new Pulumi.Alias { Type = "azure-native:databoxedge/v20200901:Trigger"}, new Pulumi.Alias { Type = "azure-nextgen:databoxedge/v20200901:Trigger"}, new Pulumi.Alias { Type = "azure-native:databoxedge/v20200901preview:Trigger"}, new Pulumi.Alias { Type = "azure-nextgen:databoxedge/v20200901preview:Trigger"}, new Pulumi.Alias { Type = "azure-native:databoxedge/v20201201:Trigger"}, new Pulumi.Alias { Type = "azure-nextgen:databoxedge/v20201201:Trigger"}, new Pulumi.Alias { Type = "azure-native:databoxedge/v20210201:Trigger"}, new Pulumi.Alias { Type = "azure-nextgen:databoxedge/v20210201:Trigger"}, new Pulumi.Alias { Type = "azure-native:databoxedge/v20210201preview:Trigger"}, new Pulumi.Alias { Type = "azure-nextgen:databoxedge/v20210201preview:Trigger"}, }, }; var merged = CustomResourceOptions.Merge(defaultOptions, options); // Override the ID if one was specified for consistency with other language SDKs. merged.Id = id ?? merged.Id; return merged; } /// <summary> /// Get an existing Trigger resource's state with the given name, ID, and optional extra /// properties used to qualify the lookup. /// </summary> /// /// <param name="name">The unique name of the resulting resource.</param> /// <param name="id">The unique provider ID of the resource to lookup.</param> /// <param name="options">A bag of options that control this resource's behavior</param> public static Trigger Get(string name, Input<string> id, CustomResourceOptions? options = null) { return new Trigger(name, id, options); } } public sealed class TriggerArgs : Pulumi.ResourceArgs { /// <summary> /// Creates or updates a trigger /// </summary> [Input("deviceName", required: true)] public Input<string> DeviceName { get; set; } = null!; /// <summary> /// Trigger Kind. /// </summary> [Input("kind", required: true)] public InputUnion<string, Pulumi.AzureNative.DataBoxEdge.V20190701.TriggerEventType> Kind { get; set; } = null!; /// <summary> /// The trigger name. /// </summary> [Input("name")] public Input<string>? Name { get; set; } /// <summary> /// The resource group name. /// </summary> [Input("resourceGroupName", required: true)] public Input<string> ResourceGroupName { get; set; } = null!; public TriggerArgs() { } } }
44.954887
131
0.596755
[ "Apache-2.0" ]
polivbr/pulumi-azure-native
sdk/dotnet/DataBoxEdge/V20190701/Trigger.cs
5,979
C#
namespace GraphShape.Algorithms.Layout { /// <summary> /// Enumeration of possible layout modes. /// </summary> public enum LayoutMode { /// <summary> /// Simple layout mode without compound vertices. /// </summary> Simple, /// <summary> /// Compound vertices, compound graph. /// </summary> Compound } }
21.888889
57
0.535533
[ "MIT" ]
GerHobbelt/GraphShape
src/GraphShape/Algorithms/Layout/LayoutMode.cs
396
C#
//----------------------------------------------------------------------- // <copyright company="Metamorphic"> // Copyright (c) Metamorphic. All rights reserved. // Licensed under the Apache License, Version 2.0 license. See LICENCE.md file in the project root for full license information. // </copyright> //----------------------------------------------------------------------- using System; using System.Diagnostics.CodeAnalysis; using NUnit.Framework; namespace Metamorphic.Core.Actions { [TestFixture] public sealed class ActionParameterDefinitionTest { [Test] public void Create() { var name = "a"; var definition = new ActionParameterDefinition(name); Assert.AreSame(name, definition.Name); } [Test] [SuppressMessage( "Microsoft.Usage", "CA1806:DoNotIgnoreMethodResults", MessageId = "Metamorphic.Core.Actions.ActionParameterDefinition", Justification = "Testing that the constructor throws an exception.")] public void CreateWithEmptyName() { Assert.Throws<ArgumentException>(() => new ActionParameterDefinition(string.Empty)); } [Test] [SuppressMessage( "Microsoft.Usage", "CA1806:DoNotIgnoreMethodResults", MessageId = "Metamorphic.Core.Actions.ActionParameterDefinition", Justification = "Testing that the constructor throws an exception.")] public void CreateWithNullName() { Assert.Throws<ArgumentNullException>(() => new ActionParameterDefinition(null)); } } }
34
128
0.582233
[ "Apache-2.0" ]
metamorpher/Metamorphic
src/Test.Unit.Core/Actions/ActionParameterDefinitionTest.cs
1,668
C#
using System.Collections.Generic; /// <summary> /// Class for a graph with generic data type /// </summary> /// <typeparam name="T">any</typeparam> public class Graph<T> { private List<GraphNode<T>> nodes; private Dictionary<T, GraphNode<T>> map; public Graph() { nodes = new List<GraphNode<T>>(); map = new Dictionary<T, GraphNode<T>>(); } /// <summary> /// Get all nodes of the graph /// </summary> /// <returns></returns> public List<GraphNode<T>> GetNodes() { return nodes; } /// <summary> /// Build a tree using breadth-first search /// </summary> /// <returns>a graph that is actually a tree</returns> public Graph<T> BuildTree() { Graph<T> graph = new Graph<T>(); BFS(graph); return graph; } /// <summary> /// Add an directed edge betweet item t1 and t2 /// </summary> /// <param name="t1">element</param> /// <param name="t2">element</param> public void Connect(T t1, T t2) { GraphNode<T> node1 = Get(t1); GraphNode<T> node2 = Get(t2); node1.AddOut(node2); } /// <summary> /// Get the graph node that holds the element t /// </summary> /// <param name="t">element</param> /// <returns>the graph node</returns> public GraphNode<T> Get(T t) { if (!map.ContainsKey(t)) { int id = nodes.Count; GraphNode<T> node = new GraphNode<T>(id, t); nodes.Add(node); map.Add(t, node); } return map[t]; } /// <summary> /// Performs a topological sort on the graph and /// returns the elements in a linear list. /// </summary> /// <returns>linear list of the elements</returns> public List<T> TopSort() { List<T> list = new List<T>(); List<GraphNode<T>> tmpNodes = new List<GraphNode<T>>(); Dictionary<GraphNode<T>, int> count = new Dictionary<GraphNode<T>, int>(); foreach (GraphNode<T> node in nodes) { tmpNodes.Add(node); count.Add(node, node.InDeg); } while (tmpNodes.Count > 0) { if (tmpNodes.Count > 1) { tmpNodes.Sort(delegate (GraphNode<T> node1, GraphNode<T> node2) { return count[node1] < count[node2] ? -1 : 1; }); } GraphNode<T> node = tmpNodes[0]; if (count[node] == 0) { list.Add(node.GetT()); count.Remove(node); tmpNodes.RemoveAt(0); foreach (GraphNode<T> node2 in node.GetNeighbors()) { if (count.ContainsKey(node2)) count[node2]--; } } } return list; } /// <summary> /// Perform the breadth-first search on the graph /// </summary> /// <param name="graph">the graph</param> private void BFS(Graph<T> graph) { List<GraphNode<T>> visited = new List<GraphNode<T>>(); Queue<GraphNode<T>> queue = new Queue<GraphNode<T>>(); queue.Enqueue(nodes[0]); while (queue.Count > 0) { GraphNode<T> node = queue.Dequeue(); T t1 = node.GetT(); if (!visited.Contains(node)) { visited.Add(node); foreach (GraphNode<T> neighbor in node.GetNeighbors()) { if (!visited.Contains(neighbor)) { T t2 = neighbor.GetT(); graph.Connect(t1, t2); queue.Enqueue(neighbor); } } } } } public override string ToString() { string s = "Graph: " + nodes.Count + " Nodes\n"; foreach (GraphNode<T> node in nodes) { s += node.ToString() + "\n"; } return s; } }
25.949045
82
0.480118
[ "MIT" ]
polylith/PlumploriGame
Assets/Scripts/Helper/Graph.cs
4,076
C#
using System; using System.Collections.Generic; using System.Linq; using Bugsnag.Payload; using Xunit; namespace Bugsnag.Tests.Payload { public class EventTests { [Fact] public void HasExpectedPayloadVersion() { var app = new App("version", "releaseStage", "type"); var device = new Device("hostname"); var exception = new System.DllNotFoundException(); var severity = Bugsnag.Payload.HandledState.ForUnhandledException(); var breadcrumbs = Enumerable.Empty<Breadcrumb>(); var session = new Session(); var payloadVersion = "4"; var @event = new Event(payloadVersion, app, device, exception, severity, breadcrumbs, session); Assert.Equal(payloadVersion, @event["payloadVersion"]); } [Fact] public void SeverityKeysAreAddedCorrectly() { var app = new App("version", "releaseStage", "type"); var device = new Device("hostname"); var exception = new System.DllNotFoundException(); var severity = Bugsnag.Payload.HandledState.ForUnhandledException(); var breadcrumbs = Enumerable.Empty<Breadcrumb>(); var session = new Session(); var @event = new Event("1", app, device, exception, severity, breadcrumbs, session); foreach (var key in severity.Keys) { Assert.Contains(key, @event.Keys); } } [Theory] [InlineData(Severity.Error)] [InlineData(Severity.Warning)] [InlineData(Severity.Info)] public void SeverityCanBeRetrieved(Severity severity) { var app = new App("version", "releaseStage", "type"); var device = new Device("hostname"); var exception = new System.DllNotFoundException(); var breadcrumbs = Enumerable.Empty<Breadcrumb>(); var session = new Session(); var handledState = HandledState.ForUserSpecifiedSeverity(severity); var @event = new Event("1", app, device, exception, handledState, breadcrumbs, session); Assert.Equal(severity, @event.Severity); } [Theory] [InlineData(Severity.Error, Severity.Info)] [InlineData(Severity.Warning, Severity.Error)] [InlineData(Severity.Info, Severity.Warning)] public void SeverityCanBeUpdated(Severity originalSeverity, Severity updatedSeverity) { var app = new App("version", "releaseStage", "type"); var device = new Device("hostname"); var exception = new System.DllNotFoundException(); var breadcrumbs = Enumerable.Empty<Breadcrumb>(); var session = new Session(); var handledState = HandledState.ForUserSpecifiedSeverity(originalSeverity); var @event = new Event("1", app, device, exception, handledState, breadcrumbs, session); @event.Severity = updatedSeverity; Assert.Equal(updatedSeverity, @event.Severity); Assert.Contains("severityReason", @event.Keys); } } }
33.197674
101
0.677408
[ "MIT" ]
tremlab/bugsnag-dotnet
tests/Bugsnag.Tests/Payload/EventTests.cs
2,855
C#
// *** WARNING: this file was generated by the Pulumi SDK Generator. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** using System; using System.ComponentModel; using Pulumi; namespace Pulumi.AzureNextGen.DocumentDB.V20200901 { /// <summary> /// Describes the mode of backups. /// </summary> [EnumType] public readonly struct BackupPolicyType : IEquatable<BackupPolicyType> { private readonly string _value; private BackupPolicyType(string value) { _value = value ?? throw new ArgumentNullException(nameof(value)); } public static BackupPolicyType Periodic { get; } = new BackupPolicyType("Periodic"); public static BackupPolicyType Continuous { get; } = new BackupPolicyType("Continuous"); public static bool operator ==(BackupPolicyType left, BackupPolicyType right) => left.Equals(right); public static bool operator !=(BackupPolicyType left, BackupPolicyType right) => !left.Equals(right); public static explicit operator string(BackupPolicyType value) => value._value; [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object? obj) => obj is BackupPolicyType other && Equals(other); public bool Equals(BackupPolicyType other) => string.Equals(_value, other._value, StringComparison.Ordinal); [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value?.GetHashCode() ?? 0; public override string ToString() => _value; } /// <summary> /// Sort order for composite paths. /// </summary> [EnumType] public readonly struct CompositePathSortOrder : IEquatable<CompositePathSortOrder> { private readonly string _value; private CompositePathSortOrder(string value) { _value = value ?? throw new ArgumentNullException(nameof(value)); } public static CompositePathSortOrder Ascending { get; } = new CompositePathSortOrder("Ascending"); public static CompositePathSortOrder Descending { get; } = new CompositePathSortOrder("Descending"); public static bool operator ==(CompositePathSortOrder left, CompositePathSortOrder right) => left.Equals(right); public static bool operator !=(CompositePathSortOrder left, CompositePathSortOrder right) => !left.Equals(right); public static explicit operator string(CompositePathSortOrder value) => value._value; [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object? obj) => obj is CompositePathSortOrder other && Equals(other); public bool Equals(CompositePathSortOrder other) => string.Equals(_value, other._value, StringComparison.Ordinal); [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value?.GetHashCode() ?? 0; public override string ToString() => _value; } /// <summary> /// Indicates the conflict resolution mode. /// </summary> [EnumType] public readonly struct ConflictResolutionMode : IEquatable<ConflictResolutionMode> { private readonly string _value; private ConflictResolutionMode(string value) { _value = value ?? throw new ArgumentNullException(nameof(value)); } public static ConflictResolutionMode LastWriterWins { get; } = new ConflictResolutionMode("LastWriterWins"); public static ConflictResolutionMode Custom { get; } = new ConflictResolutionMode("Custom"); public static bool operator ==(ConflictResolutionMode left, ConflictResolutionMode right) => left.Equals(right); public static bool operator !=(ConflictResolutionMode left, ConflictResolutionMode right) => !left.Equals(right); public static explicit operator string(ConflictResolutionMode value) => value._value; [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object? obj) => obj is ConflictResolutionMode other && Equals(other); public bool Equals(ConflictResolutionMode other) => string.Equals(_value, other._value, StringComparison.Ordinal); [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value?.GetHashCode() ?? 0; public override string ToString() => _value; } /// <summary> /// The cassandra connector offer type for the Cosmos DB database C* account. /// </summary> [EnumType] public readonly struct ConnectorOffer : IEquatable<ConnectorOffer> { private readonly string _value; private ConnectorOffer(string value) { _value = value ?? throw new ArgumentNullException(nameof(value)); } public static ConnectorOffer Small { get; } = new ConnectorOffer("Small"); public static bool operator ==(ConnectorOffer left, ConnectorOffer right) => left.Equals(right); public static bool operator !=(ConnectorOffer left, ConnectorOffer right) => !left.Equals(right); public static explicit operator string(ConnectorOffer value) => value._value; [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object? obj) => obj is ConnectorOffer other && Equals(other); public bool Equals(ConnectorOffer other) => string.Equals(_value, other._value, StringComparison.Ordinal); [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value?.GetHashCode() ?? 0; public override string ToString() => _value; } /// <summary> /// The datatype for which the indexing behavior is applied to. /// </summary> [EnumType] public readonly struct DataType : IEquatable<DataType> { private readonly string _value; private DataType(string value) { _value = value ?? throw new ArgumentNullException(nameof(value)); } public static DataType String { get; } = new DataType("String"); public static DataType Number { get; } = new DataType("Number"); public static DataType Point { get; } = new DataType("Point"); public static DataType Polygon { get; } = new DataType("Polygon"); public static DataType LineString { get; } = new DataType("LineString"); public static DataType MultiPolygon { get; } = new DataType("MultiPolygon"); public static bool operator ==(DataType left, DataType right) => left.Equals(right); public static bool operator !=(DataType left, DataType right) => !left.Equals(right); public static explicit operator string(DataType value) => value._value; [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object? obj) => obj is DataType other && Equals(other); public bool Equals(DataType other) => string.Equals(_value, other._value, StringComparison.Ordinal); [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value?.GetHashCode() ?? 0; public override string ToString() => _value; } /// <summary> /// Indicates the type of database account. This can only be set at database account creation. /// </summary> [EnumType] public readonly struct DatabaseAccountKind : IEquatable<DatabaseAccountKind> { private readonly string _value; private DatabaseAccountKind(string value) { _value = value ?? throw new ArgumentNullException(nameof(value)); } public static DatabaseAccountKind GlobalDocumentDB { get; } = new DatabaseAccountKind("GlobalDocumentDB"); public static DatabaseAccountKind MongoDB { get; } = new DatabaseAccountKind("MongoDB"); public static DatabaseAccountKind Parse { get; } = new DatabaseAccountKind("Parse"); public static bool operator ==(DatabaseAccountKind left, DatabaseAccountKind right) => left.Equals(right); public static bool operator !=(DatabaseAccountKind left, DatabaseAccountKind right) => !left.Equals(right); public static explicit operator string(DatabaseAccountKind value) => value._value; [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object? obj) => obj is DatabaseAccountKind other && Equals(other); public bool Equals(DatabaseAccountKind other) => string.Equals(_value, other._value, StringComparison.Ordinal); [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value?.GetHashCode() ?? 0; public override string ToString() => _value; } /// <summary> /// The offer type for the database /// </summary> [EnumType] public readonly struct DatabaseAccountOfferType : IEquatable<DatabaseAccountOfferType> { private readonly string _value; private DatabaseAccountOfferType(string value) { _value = value ?? throw new ArgumentNullException(nameof(value)); } public static DatabaseAccountOfferType Standard { get; } = new DatabaseAccountOfferType("Standard"); public static bool operator ==(DatabaseAccountOfferType left, DatabaseAccountOfferType right) => left.Equals(right); public static bool operator !=(DatabaseAccountOfferType left, DatabaseAccountOfferType right) => !left.Equals(right); public static explicit operator string(DatabaseAccountOfferType value) => value._value; [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object? obj) => obj is DatabaseAccountOfferType other && Equals(other); public bool Equals(DatabaseAccountOfferType other) => string.Equals(_value, other._value, StringComparison.Ordinal); [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value?.GetHashCode() ?? 0; public override string ToString() => _value; } /// <summary> /// The default consistency level and configuration settings of the Cosmos DB account. /// </summary> [EnumType] public readonly struct DefaultConsistencyLevel : IEquatable<DefaultConsistencyLevel> { private readonly string _value; private DefaultConsistencyLevel(string value) { _value = value ?? throw new ArgumentNullException(nameof(value)); } public static DefaultConsistencyLevel Eventual { get; } = new DefaultConsistencyLevel("Eventual"); public static DefaultConsistencyLevel Session { get; } = new DefaultConsistencyLevel("Session"); public static DefaultConsistencyLevel BoundedStaleness { get; } = new DefaultConsistencyLevel("BoundedStaleness"); public static DefaultConsistencyLevel Strong { get; } = new DefaultConsistencyLevel("Strong"); public static DefaultConsistencyLevel ConsistentPrefix { get; } = new DefaultConsistencyLevel("ConsistentPrefix"); public static bool operator ==(DefaultConsistencyLevel left, DefaultConsistencyLevel right) => left.Equals(right); public static bool operator !=(DefaultConsistencyLevel left, DefaultConsistencyLevel right) => !left.Equals(right); public static explicit operator string(DefaultConsistencyLevel value) => value._value; [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object? obj) => obj is DefaultConsistencyLevel other && Equals(other); public bool Equals(DefaultConsistencyLevel other) => string.Equals(_value, other._value, StringComparison.Ordinal); [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value?.GetHashCode() ?? 0; public override string ToString() => _value; } /// <summary> /// Indicates the type of index. /// </summary> [EnumType] public readonly struct IndexKind : IEquatable<IndexKind> { private readonly string _value; private IndexKind(string value) { _value = value ?? throw new ArgumentNullException(nameof(value)); } public static IndexKind Hash { get; } = new IndexKind("Hash"); public static IndexKind Range { get; } = new IndexKind("Range"); public static IndexKind Spatial { get; } = new IndexKind("Spatial"); public static bool operator ==(IndexKind left, IndexKind right) => left.Equals(right); public static bool operator !=(IndexKind left, IndexKind right) => !left.Equals(right); public static explicit operator string(IndexKind value) => value._value; [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object? obj) => obj is IndexKind other && Equals(other); public bool Equals(IndexKind other) => string.Equals(_value, other._value, StringComparison.Ordinal); [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value?.GetHashCode() ?? 0; public override string ToString() => _value; } /// <summary> /// Indicates the indexing mode. /// </summary> [EnumType] public readonly struct IndexingMode : IEquatable<IndexingMode> { private readonly string _value; private IndexingMode(string value) { _value = value ?? throw new ArgumentNullException(nameof(value)); } public static IndexingMode Consistent { get; } = new IndexingMode("Consistent"); public static IndexingMode Lazy { get; } = new IndexingMode("Lazy"); public static IndexingMode None { get; } = new IndexingMode("None"); public static bool operator ==(IndexingMode left, IndexingMode right) => left.Equals(right); public static bool operator !=(IndexingMode left, IndexingMode right) => !left.Equals(right); public static explicit operator string(IndexingMode value) => value._value; [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object? obj) => obj is IndexingMode other && Equals(other); public bool Equals(IndexingMode other) => string.Equals(_value, other._value, StringComparison.Ordinal); [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value?.GetHashCode() ?? 0; public override string ToString() => _value; } /// <summary> /// Indicates the kind of algorithm used for partitioning /// </summary> [EnumType] public readonly struct PartitionKind : IEquatable<PartitionKind> { private readonly string _value; private PartitionKind(string value) { _value = value ?? throw new ArgumentNullException(nameof(value)); } public static PartitionKind Hash { get; } = new PartitionKind("Hash"); public static PartitionKind Range { get; } = new PartitionKind("Range"); public static bool operator ==(PartitionKind left, PartitionKind right) => left.Equals(right); public static bool operator !=(PartitionKind left, PartitionKind right) => !left.Equals(right); public static explicit operator string(PartitionKind value) => value._value; [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object? obj) => obj is PartitionKind other && Equals(other); public bool Equals(PartitionKind other) => string.Equals(_value, other._value, StringComparison.Ordinal); [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value?.GetHashCode() ?? 0; public override string ToString() => _value; } /// <summary> /// Describes the ServerVersion of an a MongoDB account. /// </summary> [EnumType] public readonly struct ServerVersion : IEquatable<ServerVersion> { private readonly string _value; private ServerVersion(string value) { _value = value ?? throw new ArgumentNullException(nameof(value)); } public static ServerVersion ServerVersion_3_2 { get; } = new ServerVersion("3.2"); public static ServerVersion ServerVersion_3_6 { get; } = new ServerVersion("3.6"); public static bool operator ==(ServerVersion left, ServerVersion right) => left.Equals(right); public static bool operator !=(ServerVersion left, ServerVersion right) => !left.Equals(right); public static explicit operator string(ServerVersion value) => value._value; [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object? obj) => obj is ServerVersion other && Equals(other); public bool Equals(ServerVersion other) => string.Equals(_value, other._value, StringComparison.Ordinal); [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value?.GetHashCode() ?? 0; public override string ToString() => _value; } /// <summary> /// Indicates the spatial type of index. /// </summary> [EnumType] public readonly struct SpatialType : IEquatable<SpatialType> { private readonly string _value; private SpatialType(string value) { _value = value ?? throw new ArgumentNullException(nameof(value)); } public static SpatialType Point { get; } = new SpatialType("Point"); public static SpatialType LineString { get; } = new SpatialType("LineString"); public static SpatialType Polygon { get; } = new SpatialType("Polygon"); public static SpatialType MultiPolygon { get; } = new SpatialType("MultiPolygon"); public static bool operator ==(SpatialType left, SpatialType right) => left.Equals(right); public static bool operator !=(SpatialType left, SpatialType right) => !left.Equals(right); public static explicit operator string(SpatialType value) => value._value; [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object? obj) => obj is SpatialType other && Equals(other); public bool Equals(SpatialType other) => string.Equals(_value, other._value, StringComparison.Ordinal); [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value?.GetHashCode() ?? 0; public override string ToString() => _value; } /// <summary> /// The operation the trigger is associated with /// </summary> [EnumType] public readonly struct TriggerOperation : IEquatable<TriggerOperation> { private readonly string _value; private TriggerOperation(string value) { _value = value ?? throw new ArgumentNullException(nameof(value)); } public static TriggerOperation All { get; } = new TriggerOperation("All"); public static TriggerOperation Create { get; } = new TriggerOperation("Create"); public static TriggerOperation Update { get; } = new TriggerOperation("Update"); public static TriggerOperation Delete { get; } = new TriggerOperation("Delete"); public static TriggerOperation Replace { get; } = new TriggerOperation("Replace"); public static bool operator ==(TriggerOperation left, TriggerOperation right) => left.Equals(right); public static bool operator !=(TriggerOperation left, TriggerOperation right) => !left.Equals(right); public static explicit operator string(TriggerOperation value) => value._value; [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object? obj) => obj is TriggerOperation other && Equals(other); public bool Equals(TriggerOperation other) => string.Equals(_value, other._value, StringComparison.Ordinal); [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value?.GetHashCode() ?? 0; public override string ToString() => _value; } /// <summary> /// Type of the Trigger /// </summary> [EnumType] public readonly struct TriggerType : IEquatable<TriggerType> { private readonly string _value; private TriggerType(string value) { _value = value ?? throw new ArgumentNullException(nameof(value)); } public static TriggerType Pre { get; } = new TriggerType("Pre"); public static TriggerType Post { get; } = new TriggerType("Post"); public static bool operator ==(TriggerType left, TriggerType right) => left.Equals(right); public static bool operator !=(TriggerType left, TriggerType right) => !left.Equals(right); public static explicit operator string(TriggerType value) => value._value; [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object? obj) => obj is TriggerType other && Equals(other); public bool Equals(TriggerType other) => string.Equals(_value, other._value, StringComparison.Ordinal); [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value?.GetHashCode() ?? 0; public override string ToString() => _value; } }
43.543033
125
0.684079
[ "Apache-2.0" ]
pulumi/pulumi-azure-nextgen
sdk/dotnet/DocumentDB/V20200901/Enums.cs
21,249
C#
// // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. // // Microsoft Bot Framework: http://botframework.com // // Bot Builder SDK Github: // https://github.com/Microsoft/BotBuilder // // Copyright (c) Microsoft Corporation // All rights reserved. // // MIT License: // 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. // using Microsoft.Bot.Builder.Internals.Fibers; using Microsoft.Bot.Builder.Scorables.Internals; using System; using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; using System.Text.RegularExpressions; using Microsoft.Bot.Builder.Luis; using Microsoft.Bot.Builder.Dialogs; using Microsoft.Bot.Builder.Luis.Models; namespace Microsoft.Bot.Builder.Scorables { public static partial class Scorable { /// <summary> /// Invoke the scorable calling protocol against a single scorable. /// </summary> public static async Task<bool> TryPostAsync<Item, Score>(this IScorable<Item, Score> scorable, Item item, CancellationToken token) { var state = await scorable.PrepareAsync(item, token); try { if (scorable.HasScore(item, state)) { var score = scorable.GetScore(item, state); await scorable.PostAsync(item, state, token); return true; } return false; } finally { await scorable.DoneAsync(item, state, token); } } public static IScorable<Item, Score> WhereScore<Item, Score>(this IScorable<Item, Score> scorable, Func<Item, Score, bool> predicate) { return new WhereScoreScorable<Item, Score>(scorable, predicate); } /// <summary> /// Project the score of a scorable using a lambda expression. /// </summary> public static IScorable<Item, TargetScore> SelectScore<Item, SourceScore, TargetScore>(this IScorable<Item, SourceScore> scorable, Func<Item, SourceScore, TargetScore> selector) { return new SelectScoreScorable<Item, SourceScore, TargetScore>(scorable, selector); } /// <summary> /// Project the item of a scorable using a lambda expression. /// </summary> public static IScorable<SourceItem, Score> SelectItem<SourceItem, TargetItem, Score>(this IScorable<TargetItem, Score> scorable, Func<SourceItem, TargetItem> selector) { return new SelectItemScorable<SourceItem, TargetItem, Score>(scorable, selector); } /// <summary> /// True if the scorable is non-null, false otherwise. /// </summary> public static bool Keep<Item, Score>(IScorable<Item, Score> scorable) { // complicated because IScorable<Item, Score> is variant on generic parameter, // so generic type arguments of NullScorable<,> may not match generic type // arguments of IScorable<,> var type = scorable.GetType(); if (type.IsGenericType) { var definition = type.GetGenericTypeDefinition(); if (typeof(NullScorable<,>).IsAssignableFrom(definition)) { return false; } } return true; } /// <summary> /// Try to simplify a list of scorables. /// </summary> /// <param name="scorables">The simplified list of scorables.</param> /// <param name="scorable">The single scorable representing the list, if possible.</param> /// <returns>True if it were possible to reduce the list of scorables to a single scorable, false otherwise.</returns> public static bool TryReduce<Item, Score>(ref IEnumerable<IScorable<Item, Score>> scorables, out IScorable<Item, Score> scorable) { // only if this is a fixed list of scorables, but never a lazy enumerable var list = scorables as IReadOnlyList<IScorable<Item, Score>>; if (list != null) { var itemCount = list.Count; int keepCount = 0; for (int index = 0; index < itemCount; ++index) { var item = list[index]; if (Keep(item)) { ++keepCount; } } // empty non-null list is null scorable if (keepCount == 0) { scorable = NullScorable<Item, Score>.Instance; return true; } // single item non-null list is just that scorable else if (keepCount == 1) { for (int index = 0; index < itemCount; ++index) { var item = list[index]; if (Keep(item)) { scorable = item; return true; } } } // non-null subset of that list is just those scorables else if (keepCount < itemCount) { var keep = new IScorable<Item, Score>[keepCount]; int keepIndex = 0; for (int index = 0; index < itemCount; ++index) { var item = list[index]; if (Keep(item)) { keep[keepIndex] = item; ++keepIndex; } } scorables = keep; } } scorable = null; return false; } /// <summary> /// Select the first scorable that produces a score. /// </summary> public static IScorable<Item, Score> First<Item, Score>(this IEnumerable<IScorable<Item, Score>> scorables) { IScorable<Item, Score> scorable; if (TryReduce(ref scorables, out scorable)) { return scorable; } return new FirstScorable<Item, Score>(scorables); } /// <summary> /// Fold an enumeration of scorables using a score comparer. /// </summary> public static IScorable<Item, Score> Fold<Item, Score>(this IEnumerable<IScorable<Item, Score>> scorables, IComparer<Score> comparer = null, FoldScorable<Item, Score>.OnStageDelegate onStage = null) { comparer = comparer ?? Comparer<Score>.Default; IScorable<Item, Score> scorable; if (TryReduce(ref scorables, out scorable)) { return scorable; } return new DelegatingFoldScorable<Item, Score>(onStage, comparer, scorables); } } } namespace Microsoft.Bot.Builder.Scorables.Internals { [Serializable] public sealed class NullScorable<Item, Score> : IScorable<Item, Score> { public static readonly IScorable<Item, Score> Instance = new NullScorable<Item, Score>(); private NullScorable() { } Task<object> IScorable<Item, Score>.PrepareAsync(Item item, CancellationToken token) { return Tasks<object>.Null; } bool IScorable<Item, Score>.HasScore(Item item, object state) { return false; } Score IScorable<Item, Score>.GetScore(Item item, object state) { throw new NotImplementedException(); } Task IScorable<Item, Score>.PostAsync(Item item, object state, CancellationToken token) { return Task.FromException(new NotImplementedException()); } Task IScorable<Item, Score>.DoneAsync(Item item, object state, CancellationToken token) { return Task.CompletedTask; } } [Serializable] public sealed class WhereScoreScorable<Item, Score> : DelegatingScorable<Item, Score> { private readonly Func<Item, Score, bool> predicate; public WhereScoreScorable(IScorable<Item, Score> scorable, Func<Item, Score, bool> predicate) : base(scorable) { SetField.NotNull(out this.predicate, nameof(predicate), predicate); } public override bool HasScore(Item item, object state) { if (base.HasScore(item, state)) { var score = base.GetScore(item, state); if (this.predicate(item, score)) { return true; } } return false; } } [Serializable] public sealed class SelectItemScorable<OuterItem, InnerItem, Score> : ScorableAggregator<OuterItem, Token<InnerItem, Score>, Score, InnerItem, object, Score> { private readonly IScorable<InnerItem, Score> scorable; private readonly Func<OuterItem, InnerItem> selector; public SelectItemScorable(IScorable<InnerItem, Score> scorable, Func<OuterItem, InnerItem> selector) { SetField.NotNull(out this.scorable, nameof(scorable), scorable); SetField.NotNull(out this.selector, nameof(selector), selector); } protected override async Task<Token<InnerItem, Score>> PrepareAsync(OuterItem sourceItem, CancellationToken token) { var targetItem = this.selector(sourceItem); var state = new Token<InnerItem, Score>() { Item = targetItem, Scorable = this.scorable, State = await this.scorable.PrepareAsync(targetItem, token) }; return state; } protected override Score GetScore(OuterItem item, Token<InnerItem, Score> state) { return state.Scorable.GetScore(state.Item, state.State); } } [Serializable] public sealed class SelectScoreScorable<Item, SourceScore, TargetScore> : DelegatingScorable<Item, SourceScore>, IScorable<Item, TargetScore> { private readonly Func<Item, SourceScore, TargetScore> selector; public SelectScoreScorable(IScorable<Item, SourceScore> scorable, Func<Item, SourceScore, TargetScore> selector) : base(scorable) { SetField.NotNull(out this.selector, nameof(selector), selector); } TargetScore IScorable<Item, TargetScore>.GetScore(Item item, object state) { IScorable<Item, SourceScore> source = this.inner; var sourceScore = source.GetScore(item, state); var targetScore = this.selector(item, sourceScore); return targetScore; } } public sealed class FirstScorable<Item, Score> : DelegatingFoldScorable<Item, Score> { public FirstScorable(IEnumerable<IScorable<Item, Score>> scorables) : base(null, Comparer<Score>.Default, scorables) { } public override bool OnStageHandler(FoldStage stage, IScorable<Item, Score> scorable, Item item, object state, Score score) { switch (stage) { case FoldStage.AfterFold: return false; case FoldStage.StartPost: return true; case FoldStage.AfterPost: return false; default: throw new NotImplementedException(); } } } public sealed class TraitsScorable<Item, Score> : DelegatingFoldScorable<Item, Score> { private readonly ITraits<Score> traits; public TraitsScorable(ITraits<Score> traits, IComparer<Score> comparer, IEnumerable<IScorable<Item, Score>> scorables) : base(null, comparer, scorables) { SetField.NotNull(out this.traits, nameof(traits), traits); } public override bool OnStageHandler(FoldStage stage, IScorable<Item, Score> scorable, Item item, object state, Score score) { switch (stage) { case FoldStage.AfterFold: return OnFold(scorable, item, state, score); case FoldStage.StartPost: return true; case FoldStage.AfterPost: return false; default: throw new NotImplementedException(); } } private bool OnFold(IScorable<Item, Score> scorable, Item item, object state, Score score) { if (this.comparer.Compare(score, this.traits.Minimum) < 0) { throw new ArgumentOutOfRangeException(nameof(score)); } var maximum = this.comparer.Compare(score, this.traits.Maximum); if (maximum > 0) { throw new ArgumentOutOfRangeException(nameof(score)); } else if (maximum == 0) { return false; } return true; } } }
36.937662
206
0.5783
[ "MIT" ]
dewadaru/botbuilder
CSharp/Library/Microsoft.Bot.Builder/Scorables/Scorables.cs
14,223
C#
// *********************************************************************** // Copyright (c) 2008-2018 Charlie Poole, Rob Prouse // // 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. // *********************************************************************** using System; using System.Collections; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Reflection; using NUnit.Compatibility; using NUnit.Framework.Interfaces; using NUnit.Framework.Internal; namespace NUnit.Framework { /// <summary> /// RandomAttribute is used to supply a set of random values /// to a single parameter of a parameterized test. /// </summary> [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)] public class RandomAttribute : NUnitAttribute, IParameterDataSource { private RandomDataSource _source; private readonly int _count; /// <summary> /// If true, no value will be repeated. /// </summary> public bool Distinct { get; set; } #region Constructors /// <summary> /// Construct a random set of values appropriate for the Type of the /// parameter on which the attribute appears, specifying only the count. /// </summary> /// <param name="count"></param> public RandomAttribute(int count) { _count = count; } /// <summary> /// Construct a set of ints within a specified range /// </summary> public RandomAttribute(int min, int max, int count) { _source = new IntDataSource(min, max, count); } /// <summary> /// Construct a set of unsigned ints within a specified range /// </summary> [CLSCompliant(false)] public RandomAttribute(uint min, uint max, int count) { _source = new UIntDataSource(min, max, count); } /// <summary> /// Construct a set of longs within a specified range /// </summary> public RandomAttribute(long min, long max, int count) { _source = new LongDataSource(min, max, count); } /// <summary> /// Construct a set of unsigned longs within a specified range /// </summary> [CLSCompliant(false)] public RandomAttribute(ulong min, ulong max, int count) { _source = new ULongDataSource(min, max, count); } /// <summary> /// Construct a set of shorts within a specified range /// </summary> public RandomAttribute(short min, short max, int count) { _source = new ShortDataSource(min, max, count); } /// <summary> /// Construct a set of unsigned shorts within a specified range /// </summary> [CLSCompliant(false)] public RandomAttribute(ushort min, ushort max, int count) { _source = new UShortDataSource(min, max, count); } /// <summary> /// Construct a set of doubles within a specified range /// </summary> public RandomAttribute(double min, double max, int count) { _source = new DoubleDataSource(min, max, count); } /// <summary> /// Construct a set of floats within a specified range /// </summary> public RandomAttribute(float min, float max, int count) { _source = new FloatDataSource(min, max, count); } /// <summary> /// Construct a set of bytes within a specified range /// </summary> public RandomAttribute(byte min, byte max, int count) { _source = new ByteDataSource(min, max, count); } /// <summary> /// Construct a set of sbytes within a specified range /// </summary> [CLSCompliant(false)] public RandomAttribute(sbyte min, sbyte max, int count) { _source = new SByteDataSource(min, max, count); } #endregion #region IParameterDataSource Interface /// <summary> /// Retrieves a list of arguments which can be passed to the specified parameter. /// </summary> /// <param name="fixtureType">The point of context in the fixture’s inheritance hierarchy.</param> /// <param name="parameter">The parameter of a parameterized test.</param> public IEnumerable GetData(Type fixtureType, ParameterInfo parameter) { // Since a separate Randomizer is used for each parameter, // we can't fill in the data in the constructor of the // attribute. Only now, when GetData is called, do we have // sufficient information to create the values in a // repeatable manner. Type parmType = parameter.ParameterType; if (_source == null) { if (parmType == typeof(int)) _source = new IntDataSource(_count); else if (parmType == typeof(uint)) _source = new UIntDataSource(_count); else if (parmType == typeof(long)) _source = new LongDataSource(_count); else if (parmType == typeof(ulong)) _source = new ULongDataSource(_count); else if (parmType == typeof(short)) _source = new ShortDataSource(_count); else if (parmType == typeof(ushort)) _source = new UShortDataSource(_count); else if (parmType == typeof(double)) _source = new DoubleDataSource(_count); else if (parmType == typeof(float)) _source = new FloatDataSource(_count); else if (parmType == typeof(byte)) _source = new ByteDataSource(_count); else if (parmType == typeof(sbyte)) _source = new SByteDataSource(_count); else if (parmType == typeof(decimal)) _source = new DecimalDataSource(_count); else if (parmType.GetTypeInfo().IsEnum) _source = new EnumDataSource(_count); else // Default _source = new IntDataSource(_count); } else if (_source.DataType != parmType && WeConvert(_source.DataType, parmType)) { _source.Distinct = Distinct; _source = new RandomDataConverter(_source); } _source.Distinct = Distinct; return _source.GetData(fixtureType, parameter); } private bool WeConvert(Type sourceType, Type targetType) { if (targetType == typeof(short) || targetType == typeof(ushort) || targetType == typeof(byte) || targetType == typeof(sbyte)) return sourceType == typeof(int); if (targetType == typeof(decimal)) return sourceType == typeof(int) || sourceType == typeof(double); return false; } #endregion #region Nested DataSource Classes #region RandomDataSource abstract class RandomDataSource : IParameterDataSource { public Type DataType { get; protected set; } public bool Distinct { get; set; } public abstract IEnumerable GetData(Type fixtureType, ParameterInfo parameter); } abstract class RandomDataSource<T> : RandomDataSource { private readonly T _min; private readonly T _max; private readonly int _count; private readonly bool _inRange; private readonly List<T> previousValues = new List<T>(); protected Randomizer _randomizer; protected RandomDataSource(int count) { _count = count; _inRange = false; DataType = typeof(T); } protected RandomDataSource(T min, T max, int count) { _min = min; _max = max; _count = count; _inRange = true; DataType = typeof(T); } public override IEnumerable GetData(Type fixtureType, ParameterInfo parameter) { //Guard.ArgumentValid(parameter.ParameterType == typeof(T), "Parameter type must be " + typeof(T).Name, "parameter"); _randomizer = Randomizer.GetRandomizer(parameter); Guard.OperationValid(!(Distinct && _inRange && !CanBeDistinct(_min, _max, _count)), $"The range of values is [{_min}, {_max}[ and the random value count is {_count} so the values cannot be distinct."); for (int i = 0; i < _count; i++) { if (Distinct) { T next; do { next = _inRange ? GetNext(_min, _max) : GetNext(); } while (previousValues.Contains(next)); previousValues.Add(next); yield return next; } else yield return _inRange ? GetNext(_min, _max) : GetNext(); } } protected abstract T GetNext(); protected abstract T GetNext(T min, T max); protected abstract bool CanBeDistinct(T min, T max, int count); } #endregion #region RandomDataConverter class RandomDataConverter : RandomDataSource { readonly IParameterDataSource _source; public RandomDataConverter(IParameterDataSource source) { _source = source; } public override IEnumerable GetData(Type fixtureType, ParameterInfo parameter) { Type parmType = parameter.ParameterType; foreach (object obj in _source.GetData(fixtureType, parameter)) { if (obj is int) { int ival = (int)obj; // unbox first if (parmType == typeof(short)) yield return (short)ival; else if (parmType == typeof(ushort)) yield return (ushort)ival; else if (parmType == typeof(byte)) yield return (byte)ival; else if (parmType == typeof(sbyte)) yield return (sbyte)ival; else if (parmType == typeof(decimal)) yield return (decimal)ival; } else if (obj is double) { double d = (double)obj; // unbox first if (parmType == typeof(decimal)) yield return (decimal)d; } } } } #endregion #region IntDataSource class IntDataSource : RandomDataSource<int> { public IntDataSource(int count) : base(count) { } public IntDataSource(int min, int max, int count) : base(min, max, count) { } protected override int GetNext() { return _randomizer.Next(); } protected override int GetNext(int min, int max) { return _randomizer.Next(min, max); } protected override bool CanBeDistinct(int min, int max, int count) { return count <= max - min; } } #endregion #region UIntDataSource class UIntDataSource : RandomDataSource<uint> { public UIntDataSource(int count) : base(count) { } public UIntDataSource(uint min, uint max, int count) : base(min, max, count) { } protected override uint GetNext() { return _randomizer.NextUInt(); } protected override uint GetNext(uint min, uint max) { return _randomizer.NextUInt(min, max); } protected override bool CanBeDistinct(uint min, uint max, int count) { return count <= max - min; } } #endregion #region LongDataSource class LongDataSource : RandomDataSource<long> { public LongDataSource(int count) : base(count) { } public LongDataSource(long min, long max, int count) : base(min, max, count) { } protected override long GetNext() { return _randomizer.NextLong(); } protected override long GetNext(long min, long max) { return _randomizer.NextLong(min, max); } protected override bool CanBeDistinct(long min, long max, int count) { return count <= max - min; } } #endregion #region ULongDataSource class ULongDataSource : RandomDataSource<ulong> { public ULongDataSource(int count) : base(count) { } public ULongDataSource(ulong min, ulong max, int count) : base(min, max, count) { } protected override ulong GetNext() { return _randomizer.NextULong(); } protected override ulong GetNext(ulong min, ulong max) { return _randomizer.NextULong(min, max); } protected override bool CanBeDistinct(ulong min, ulong max, int count) { return (uint)count <= max - min; } } #endregion #region ShortDataSource class ShortDataSource : RandomDataSource<short> { public ShortDataSource(int count) : base(count) { } public ShortDataSource(short min, short max, int count) : base(min, max, count) { } protected override short GetNext() { return _randomizer.NextShort(); } protected override short GetNext(short min, short max) { return _randomizer.NextShort(min, max); } protected override bool CanBeDistinct(short min, short max, int count) { return count <= max - min; } } #endregion #region UShortDataSource class UShortDataSource : RandomDataSource<ushort> { public UShortDataSource(int count) : base(count) { } public UShortDataSource(ushort min, ushort max, int count) : base(min, max, count) { } protected override ushort GetNext() { return _randomizer.NextUShort(); } protected override ushort GetNext(ushort min, ushort max) { return _randomizer.NextUShort(min, max); } protected override bool CanBeDistinct(ushort min, ushort max, int count) { return count <= max - min; } } #endregion #region DoubleDataSource class DoubleDataSource : RandomDataSource<double> { public DoubleDataSource(int count) : base(count) { } public DoubleDataSource(double min, double max, int count) : base(min, max, count) { } protected override double GetNext() { return _randomizer.NextDouble(); } protected override double GetNext(double min, double max) { return _randomizer.NextDouble(min, max); } protected override bool CanBeDistinct(double min, double max, int count) { return true; } } #endregion #region FloatDataSource class FloatDataSource : RandomDataSource<float> { public FloatDataSource(int count) : base(count) { } public FloatDataSource(float min, float max, int count) : base(min, max, count) { } protected override float GetNext() { return _randomizer.NextFloat(); } protected override float GetNext(float min, float max) { return _randomizer.NextFloat(min, max); } protected override bool CanBeDistinct(float min, float max, int count) { return true; } } #endregion #region ByteDataSource class ByteDataSource : RandomDataSource<byte> { public ByteDataSource(int count) : base(count) { } public ByteDataSource(byte min, byte max, int count) : base(min, max, count) { } protected override byte GetNext() { return _randomizer.NextByte(); } protected override byte GetNext(byte min, byte max) { return _randomizer.NextByte(min, max); } protected override bool CanBeDistinct(byte min, byte max, int count) { return count <= max - min; } } #endregion #region SByteDataSource class SByteDataSource : RandomDataSource<sbyte> { public SByteDataSource(int count) : base(count) { } public SByteDataSource(sbyte min, sbyte max, int count) : base(min, max, count) { } protected override sbyte GetNext() { return _randomizer.NextSByte(); } protected override sbyte GetNext(sbyte min, sbyte max) { return _randomizer.NextSByte(min, max); } protected override bool CanBeDistinct(sbyte min, sbyte max, int count) { return count <= max - min; } } #endregion #region EnumDataSource class EnumDataSource : RandomDataSource { private readonly int _count; private readonly List<object> previousValues = new List<object>(); public EnumDataSource(int count) { _count = count; DataType = typeof(Enum); } public override IEnumerable GetData(Type fixtureType, ParameterInfo parameter) { Guard.ArgumentValid(parameter.ParameterType.GetTypeInfo().IsEnum, "EnumDataSource requires an enum parameter", nameof(parameter)); Randomizer randomizer = Randomizer.GetRandomizer(parameter); DataType = parameter.ParameterType; int valueCount = Enum.GetValues(DataType).Cast<int>().Distinct().Count(); Guard.OperationValid(!(Distinct && _count > valueCount), $"The enum \"{DataType.Name}\" has {valueCount} values and the random value count is {_count} so the values cannot be distinct."); for (int i = 0; i < _count; i++) { if (Distinct) { object next; do { next = randomizer.NextEnum(parameter.ParameterType); } while (previousValues.Contains(next)); previousValues.Add(next); yield return next; } else yield return randomizer.NextEnum(parameter.ParameterType); } } } #endregion #region DecimalDataSource // Currently, Randomizer doesn't implement methods for decimal // so we use random Ulongs and convert them. This doesn't cover // the full range of decimal, so it's temporary. class DecimalDataSource : RandomDataSource<decimal> { public DecimalDataSource(int count) : base(count) { } public DecimalDataSource(decimal min, decimal max, int count) : base(min, max, count) { } protected override decimal GetNext() { return _randomizer.NextDecimal(); } protected override decimal GetNext(decimal min, decimal max) { return _randomizer.NextDecimal(min, max); } protected override bool CanBeDistinct(decimal min, decimal max, int count) { return true; } } #endregion #endregion } }
32.58858
217
0.529293
[ "MIT" ]
BrianDiggs/nunit
src/NUnitFramework/framework/Attributes/RandomAttribute.cs
22,260
C#
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file 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. */ /* * Do not modify this file. This file is generated from the snowball-2016-06-30.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.Snowball.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Snowball.Model.Internal.MarshallTransformations { /// <summary> /// Notification Marshaller /// </summary> public class NotificationMarshaller : IRequestMarshaller<Notification, JsonMarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="requestObject"></param> /// <param name="context"></param> /// <returns></returns> public void Marshall(Notification requestObject, JsonMarshallerContext context) { if(requestObject.IsSetJobStatesToNotify()) { context.Writer.WritePropertyName("JobStatesToNotify"); context.Writer.WriteArrayStart(); foreach(var requestObjectJobStatesToNotifyListValue in requestObject.JobStatesToNotify) { context.Writer.Write(requestObjectJobStatesToNotifyListValue); } context.Writer.WriteArrayEnd(); } if(requestObject.IsSetNotifyAll()) { context.Writer.WritePropertyName("NotifyAll"); context.Writer.Write(requestObject.NotifyAll); } if(requestObject.IsSetSnsTopicARN()) { context.Writer.WritePropertyName("SnsTopicARN"); context.Writer.Write(requestObject.SnsTopicARN); } } /// <summary> /// Singleton Marshaller. /// </summary> public readonly static NotificationMarshaller Instance = new NotificationMarshaller(); } }
34.291139
106
0.653008
[ "Apache-2.0" ]
ChristopherButtars/aws-sdk-net
sdk/src/Services/Snowball/Generated/Model/Internal/MarshallTransformations/NotificationMarshaller.cs
2,709
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; namespace Roslyn.Utilities { internal static class FileUtilities { /// <summary> /// Resolves relative path and returns absolute path. /// The method depends only on values of its parameters and their implementation (for fileExists). /// It doesn't itself depend on the state of the current process (namely on the current drive directories) or /// the state of file system. /// </summary> /// <param name="path"> /// Path to resolve. /// </param> /// <param name="basePath"> /// Base file path to resolve CWD-relative paths against. Null if not available. /// </param> /// <param name="baseDirectory"> /// Base directory to resolve CWD-relative paths against if <paramref name="basePath"/> isn't specified. /// Must be absolute path. /// Null if not available. /// </param> /// <param name="searchPaths"> /// Sequence of paths used to search for unqualified relative paths. /// </param> /// <param name="fileExists"> /// Method that tests existence of a file. /// </param> /// <returns> /// The resolved path or null if the path can't be resolved or does not exist. /// </returns> internal static string? ResolveRelativePath( string path, string? basePath, string? baseDirectory, IEnumerable<string> searchPaths, Func<string, bool> fileExists ) { Debug.Assert( baseDirectory == null || searchPaths != null || PathUtilities.IsAbsolute(baseDirectory) ); RoslynDebug.Assert(searchPaths != null); RoslynDebug.Assert(fileExists != null); string? combinedPath; var kind = PathUtilities.GetPathKind(path); if (kind == PathKind.Relative) { // first, look in the base directory: baseDirectory = GetBaseDirectory(basePath, baseDirectory); if (baseDirectory != null) { combinedPath = PathUtilities.CombinePathsUnchecked(baseDirectory, path); Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); if (fileExists(combinedPath)) { return combinedPath; } } // try search paths: foreach (var searchPath in searchPaths) { combinedPath = PathUtilities.CombinePathsUnchecked(searchPath, path); Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); if (fileExists(combinedPath)) { return combinedPath; } } return null; } combinedPath = ResolveRelativePath(kind, path, basePath, baseDirectory); if (combinedPath != null) { Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); if (fileExists(combinedPath)) { return combinedPath; } } return null; } internal static string? ResolveRelativePath(string? path, string? baseDirectory) { return ResolveRelativePath(path, null, baseDirectory); } internal static string? ResolveRelativePath( string? path, string? basePath, string? baseDirectory ) { Debug.Assert(baseDirectory == null || PathUtilities.IsAbsolute(baseDirectory)); return ResolveRelativePath( PathUtilities.GetPathKind(path), path, basePath, baseDirectory ); } private static string? ResolveRelativePath( PathKind kind, string? path, string? basePath, string? baseDirectory ) { Debug.Assert(PathUtilities.GetPathKind(path) == kind); switch (kind) { case PathKind.Empty: return null; case PathKind.Relative: baseDirectory = GetBaseDirectory(basePath, baseDirectory); if (baseDirectory == null) { return null; } // with no search paths relative paths are relative to the base directory: return PathUtilities.CombinePathsUnchecked(baseDirectory, path); case PathKind.RelativeToCurrentDirectory: baseDirectory = GetBaseDirectory(basePath, baseDirectory); if (baseDirectory == null) { return null; } if (path!.Length == 1) { // "." return baseDirectory; } else { // ".\path" return PathUtilities.CombinePathsUnchecked(baseDirectory, path); } case PathKind.RelativeToCurrentParent: baseDirectory = GetBaseDirectory(basePath, baseDirectory); if (baseDirectory == null) { return null; } // ".." return PathUtilities.CombinePathsUnchecked(baseDirectory, path); case PathKind.RelativeToCurrentRoot: string? baseRoot; if (basePath != null) { baseRoot = PathUtilities.GetPathRoot(basePath); } else if (baseDirectory != null) { baseRoot = PathUtilities.GetPathRoot(baseDirectory); } else { return null; } if (RoslynString.IsNullOrEmpty(baseRoot)) { return null; } Debug.Assert(PathUtilities.IsDirectorySeparator(path![0])); Debug.Assert(path.Length == 1 || !PathUtilities.IsDirectorySeparator(path[1])); return PathUtilities.CombinePathsUnchecked(baseRoot, path.Substring(1)); case PathKind.RelativeToDriveDirectory: // drive relative paths not supported, can't resolve: return null; case PathKind.Absolute: return path; default: throw ExceptionUtilities.UnexpectedValue(kind); } } private static string? GetBaseDirectory(string? basePath, string? baseDirectory) { // relative base paths are relative to the base directory: string? resolvedBasePath = ResolveRelativePath(basePath, baseDirectory); if (resolvedBasePath == null) { return baseDirectory; } // Note: Path.GetDirectoryName doesn't normalize the path and so it doesn't depend on the process state. Debug.Assert(PathUtilities.IsAbsolute(resolvedBasePath)); try { return Path.GetDirectoryName(resolvedBasePath); } catch (Exception) { return null; } } private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); internal static string? NormalizeRelativePath( string path, string? basePath, string? baseDirectory ) { // Does this look like a URI at all or does it have any invalid path characters? If so, just use it as is. if ( path.IndexOf("://", StringComparison.Ordinal) >= 0 || path.IndexOfAny(s_invalidPathChars) >= 0 ) { return null; } string? resolvedPath = ResolveRelativePath(path, basePath, baseDirectory); if (resolvedPath == null) { return null; } string? normalizedPath = TryNormalizeAbsolutePath(resolvedPath); if (normalizedPath == null) { return null; } return normalizedPath; } /// <summary> /// Normalizes an absolute path. /// </summary> /// <param name="path">Path to normalize.</param> /// <exception cref="IOException"/> /// <returns>Normalized path.</returns> internal static string NormalizeAbsolutePath(string path) { // we can only call GetFullPath on an absolute path to avoid dependency on process state (current directory): Debug.Assert(PathUtilities.IsAbsolute(path)); try { return Path.GetFullPath(path); } catch (ArgumentException e) { throw new IOException(e.Message, e); } catch (System.Security.SecurityException e) { throw new IOException(e.Message, e); } catch (NotSupportedException e) { throw new IOException(e.Message, e); } } internal static string NormalizeDirectoryPath(string path) { return NormalizeAbsolutePath(path) .TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); } internal static string? TryNormalizeAbsolutePath(string path) { Debug.Assert(PathUtilities.IsAbsolute(path)); try { return Path.GetFullPath(path); } catch { return null; } } internal static Stream OpenRead(string fullPath) { Debug.Assert(PathUtilities.IsAbsolute(fullPath)); try { return new FileStream(fullPath, FileMode.Open, FileAccess.Read, FileShare.Read); } catch (IOException) { throw; } catch (Exception e) { throw new IOException(e.Message, e); } } internal static Stream OpenAsyncRead(string fullPath) { Debug.Assert(PathUtilities.IsAbsolute(fullPath)); return RethrowExceptionsAsIOException( () => new FileStream( fullPath, FileMode.Open, FileAccess.Read, FileShare.Read, 4096, FileOptions.Asynchronous ) ); } internal static T RethrowExceptionsAsIOException<T>(Func<T> operation) { try { return operation(); } catch (IOException) { throw; } catch (Exception e) { throw new IOException(e.Message, e); } } /// <summary> /// Used to create a file given a path specified by the user. /// paramName - Provided by the Public surface APIs to have a clearer message. Internal API just rethrow the exception /// </summary> internal static Stream CreateFileStreamChecked( Func<string, Stream> factory, string path, string? paramName = null ) { try { return factory(path); } catch (ArgumentNullException) { if (paramName == null) { throw; } else { throw new ArgumentNullException(paramName); } } catch (ArgumentException e) { if (paramName == null) { throw; } else { throw new ArgumentException(e.Message, paramName); } } catch (IOException) { throw; } catch (Exception e) { throw new IOException(e.Message, e); } } /// <exception cref="IOException"/> internal static DateTime GetFileTimeStamp(string fullPath) { Debug.Assert(PathUtilities.IsAbsolute(fullPath)); try { return File.GetLastWriteTimeUtc(fullPath); } catch (IOException) { throw; } catch (Exception e) { throw new IOException(e.Message, e); } } /// <exception cref="IOException"/> internal static long GetFileLength(string fullPath) { Debug.Assert(PathUtilities.IsAbsolute(fullPath)); try { var info = new FileInfo(fullPath); return info.Length; } catch (IOException) { throw; } catch (Exception e) { throw new IOException(e.Message, e); } } } }
32.80778
126
0.47897
[ "MIT" ]
belav/roslyn
src/Compilers/Core/Portable/FileSystem/FileUtilities.cs
14,339
C#
using ee.iLawyer.Db.Entities; using FluentNHibernate.Mapping; namespace ee.iLawyer.Db.Mappings { public class ProjectTodoListMap : ClassMap<ProjectTodoItem> { public ProjectTodoListMap() { Table("ProjectTodoList"); LazyLoad(); Id(x => x.Id) .GeneratedBy.Assigned(); Map(x => x.Name); Map(x => x.Priority); Map(x => x.IsSetRemind); Map(x => x.RemindTime); Map(x => x.ExpiredTime); Map(x => x.Content); Map(x => x.Status); Map(x => x.CompletedTime); Map(x => x.CreateTime); References(x => x.InProject).Column("ProjectId").NotFound.Ignore(); } } }
26.892857
79
0.50996
[ "Apache-2.0" ]
Egoily/iLawyer
02.Domain/ee.iLawyer.Db/Mappings/ProjectTodoListMap.cs
755
C#
using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Ocuda.Ops.Models.Entities; using Ocuda.Ops.Service.Filters; using Ocuda.Ops.Service.Models; namespace Ocuda.Ops.Service.Interfaces.Ops.Services { public interface IFileService { Task<int> GetFileCountAsync(); Task<ICollection<File>> GetFilesAsync(); Task<File> GetByIdAsync(int id); Task<File> GetLatestByLibraryIdAsync(int id); Task<DataWithCount<ICollection<File>>> GetPaginatedListAsync(BlogFilter filter); Task<File> CreatePrivateFileAsync(int currentUserId, File file, IFormFile fileData, ICollection<IFormFile> thumbnailFiles); Task<File> EditPrivateFileAsync(int currentUserId, File file, IFormFile fileData, ICollection<IFormFile> thumbnailFiles, int[] thumbnailIdsToKeep); Task<File> CreatePublicFileAsync(int currentUserId, File file, IFormFile fileData); string GetPublicFilePath(File file); string GetPrivateFilePath(File file); Task DeletePrivateFileAsync(int id); Task<byte[]> ReadPrivateFileAsync(File file); Task DeletePublicFileAsync(int id); Task<FileLibrary> GetLibraryByIdAsync(int id); Task<DataWithCount<ICollection<FileLibrary>>> GetPaginatedLibraryListAsync( BlogFilter filter); Task<FileLibrary> CreateLibraryAsync(int currentUserId, FileLibrary library, ICollection<int> fileTypeIds); Task<FileLibrary> EditLibraryAsync(FileLibrary library, ICollection<int> fileTypeIds); Task DeleteLibraryAsync(int id); Task<ICollection<int>> GetLibraryFileTypeIdsAsync(int libraryId); Task<ICollection<int>> GetFileTypeIdsInUseByLibraryAsync(int libraryId); } }
40.133333
94
0.728128
[ "MIT" ]
iafb/ocuda
src/Ops.Service/Interfaces/Ops/Services/IFileService.cs
1,808
C#
#pragma warning disable CS0649 namespace Dissonance.Framework.Graphics { partial class GL { [MethodImport("glClearBufferData")] private static ClearBufferDataDelegate glClearBufferData; [MethodImport("glClearBufferSubData")] private static ClearBufferSubDataDelegate glClearBufferSubData; [MethodImport("glDispatchCompute")] private static DispatchComputeDelegate glDispatchCompute; [MethodImport("glDispatchComputeIndirect")] private static DispatchComputeIndirectDelegate glDispatchComputeIndirect; [MethodImport("glCopyImageSubData")] private static CopyImageSubDataDelegate glCopyImageSubData; [MethodImport("glFramebufferParameteri")] private static FramebufferParameteriDelegate glFramebufferParameteri; [MethodImport("glGetFramebufferParameteriv")] private static GetFramebufferParameterivDelegate glGetFramebufferParameteriv; [MethodImport("glGetInternalformati64v")] private static GetInternalformati64vDelegate glGetInternalformati64v; [MethodImport("glInvalidateTexSubImage")] private static InvalidateTexSubImageDelegate glInvalidateTexSubImage; [MethodImport("glInvalidateTexImage")] private static InvalidateTexImageDelegate glInvalidateTexImage; [MethodImport("glInvalidateBufferSubData")] private static InvalidateBufferSubDataDelegate glInvalidateBufferSubData; [MethodImport("glInvalidateBufferData")] private static InvalidateBufferDataDelegate glInvalidateBufferData; [MethodImport("glInvalidateFramebuffer")] private static InvalidateFramebufferDelegate glInvalidateFramebuffer; [MethodImport("glInvalidateSubFramebuffer")] private static InvalidateSubFramebufferDelegate glInvalidateSubFramebuffer; [MethodImport("glMultiDrawArraysIndirect")] private static MultiDrawArraysIndirectDelegate glMultiDrawArraysIndirect; [MethodImport("glMultiDrawElementsIndirect")] private static MultiDrawElementsIndirectDelegate glMultiDrawElementsIndirect; [MethodImport("glGetProgramInterfaceiv")] private static GetProgramInterfaceivDelegate glGetProgramInterfaceiv; [MethodImport("glGetProgramResourceIndex")] private static GetProgramResourceIndexDelegate glGetProgramResourceIndex; [MethodImport("glGetProgramResourceName")] private static GetProgramResourceNameDelegate glGetProgramResourceName; [MethodImport("glGetProgramResourceiv")] private static GetProgramResourceivDelegate glGetProgramResourceiv; [MethodImport("glGetProgramResourceLocation")] private static GetProgramResourceLocationDelegate glGetProgramResourceLocation; [MethodImport("glGetProgramResourceLocationIndex")] private static GetProgramResourceLocationIndexDelegate glGetProgramResourceLocationIndex; [MethodImport("glShaderStorageBlockBinding")] private static ShaderStorageBlockBindingDelegate glShaderStorageBlockBinding; [MethodImport("glTexBufferRange")] private static TexBufferRangeDelegate glTexBufferRange; [MethodImport("glTexStorage2DMultisample")] private static TexStorage2DMultisampleDelegate glTexStorage2DMultisample; [MethodImport("glTexStorage3DMultisample")] private static TexStorage3DMultisampleDelegate glTexStorage3DMultisample; [MethodImport("glTextureView")] private static TextureViewDelegate glTextureView; [MethodImport("glBindVertexBuffer")] private static BindVertexBufferDelegate glBindVertexBuffer; [MethodImport("glVertexAttribFormat")] private static VertexAttribFormatDelegate glVertexAttribFormat; [MethodImport("glVertexAttribIFormat")] private static VertexAttribIFormatDelegate glVertexAttribIFormat; [MethodImport("glVertexAttribLFormat")] private static VertexAttribLFormatDelegate glVertexAttribLFormat; [MethodImport("glVertexAttribBinding")] private static VertexAttribBindingDelegate glVertexAttribBinding; [MethodImport("glVertexBindingDivisor")] private static VertexBindingDivisorDelegate glVertexBindingDivisor; [MethodImport("glDebugMessageControl")] private static DebugMessageControlDelegate glDebugMessageControl; [MethodImport("glDebugMessageInsert")] private static DebugMessageInsertDelegate glDebugMessageInsert; [MethodImport("glDebugMessageCallback")] private static DebugMessageCallbackDelegate glDebugMessageCallback; [MethodImport("glGetDebugMessageLog")] private static GetDebugMessageLogDelegate glGetDebugMessageLog; [MethodImport("glPushDebugGroup")] private static PushDebugGroupDelegate glPushDebugGroup; [MethodImport("glPopDebugGroup")] private static PopDebugGroupDelegate glPopDebugGroup; [MethodImport("glObjectLabel")] private static ObjectLabelDelegate glObjectLabel; [MethodImport("glGetObjectLabel")] private static GetObjectLabelDelegate glGetObjectLabel; [MethodImport("glObjectPtrLabel")] private static ObjectPtrLabelDelegate glObjectPtrLabel; [MethodImport("glGetObjectPtrLabel")] private static GetObjectPtrLabelDelegate glGetObjectPtrLabel; } }
36
91
0.847121
[ "Unlicense" ]
Mirsario/DissonanceFramework
Src/Graphics/Implementation/Generated/GL.43.Fields.cs
4,932
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using ModestTree.Util; using Zenject; using NUnit.Framework; using ModestTree; using Assert=ModestTree.Assert; namespace Zenject { // Inherit from this and mark you class with [TestFixture] attribute to do some unit tests // For anything more complicated than this, such as tests involving interaction between // several classes, or if you want to use interfaces such as IInitializable or IDisposable, // then I recommend using ZenjectIntegrationTestFixture instead // See documentation for details public abstract class ZenjectUnitTestFixture { DiContainer _container; protected DiContainer Container { get { return _container; } } [SetUp] public virtual void Setup() { _container = new DiContainer(StaticContext.Container); } [TearDown] public virtual void Teardown() { StaticContext.Clear(); } } }
27.375
96
0.647489
[ "MIT" ]
codemaster/LD42
Assets/Plugins/Zenject/OptionalExtras/TestFramework/Editor/ZenjectUnitTestFixture.cs
1,097
C#
namespace FoodControl.DataAccessLayer { using System; using FoodControl.Model; /// <summary> /// The DALContext ensures that only one instance of the database connection will be used in all repositories. /// The class holds a generic property ![CDATA[ Repository<T> ]]> for each model class. /// </summary> public class DALContext : IDALContext, IDisposable { /// <summary> /// The _context property represents the context to the current Database. /// </summary> private DatabaseContext _context; /// <summary> /// Each model class is represented by a property through a generic class ![CDATA[ Repository<T> ]]>. /// </summary> private Repository<ActivityLog> _activityLogRepository; private Repository<Activity> _activityRepository; private Repository<FoodCategory> _foodCategoryRepository; private Repository<Food> _foodRepository; private Repository<NutritionLog> _nutritionLogRepository; private Repository<Portion> _portionRepository; private Repository<Profile> _profileRepository; private Repository<User> _userRepository; private Repository<VitalData> _vitalDataRepository; /// <summary> /// In this constructor the single instance of the DataBaseContext gets instantiated. /// </summary> public DALContext() { _context = new DatabaseContext(); } #region Getter /// <summary> /// Get the generic base class instantiated with the ActivityLog type. /// </summary> public IRepository<ActivityLog> ActivityLog { get { return this._activityLogRepository ?? (_activityLogRepository = new Repository<ActivityLog>(_context)); } } /// <summary> /// Get the generic base class instantiated with the Activity type. /// </summary> public IRepository<Activity> Activity { get { return this._activityRepository ?? (_activityRepository = new Repository<Activity>(_context)); } } /// <summary> /// Get the generic base class instantiated with the FoodCategory type. /// </summary> public IRepository<FoodCategory> FoodCategory { get { return this._foodCategoryRepository ?? (_foodCategoryRepository = new Repository<FoodCategory>(_context)); } } /// <summary> /// Get the generic base class instantiated with the Food type. /// </summary> public IRepository<Food> Food { get { return this._foodRepository ?? (_foodRepository = new Repository<Food>(_context)); } } /// <summary> /// Get the generic base class instantiated with the NutritionLog type. /// </summary> public IRepository<NutritionLog> NutritionLog { get { return this._nutritionLogRepository ?? (_nutritionLogRepository = new Repository<NutritionLog>(_context)); } } /// <summary> /// Get the generic base class instantiated with the Portion type. /// </summary> public IRepository<Portion> Portion { get { return this._portionRepository ?? (_portionRepository = new Repository<Portion>(_context)); } } /// <summary> /// Get the generic base class instantiated with the Profile type. /// </summary> public IRepository<Profile> Profile { get { return this._profileRepository ?? (_profileRepository = new Repository<Profile>(_context)); } } /// <summary> /// Get the generic base class instantiated with the User type. /// </summary> public IRepository<User> User { get { return this._userRepository ?? (_userRepository = new Repository<User>(_context)); } } /// <summary> /// Get the generic base class instantiated with the VitalData type. /// </summary> public IRepository<VitalData> VitalData { get { return this._vitalDataRepository ?? (_vitalDataRepository = new Repository<VitalData>(_context)); } } #endregion /// <summary> /// Implementation of IUnitOfWork. IDALContext inherits from IUnitOfWork. /// </summary> public void SaveChanges() { _context.SaveChanges(); } private bool disposed = false; /// <summary> /// Implementation of IDisposable. IDALContext inherits from IUnitOfWork, which inherits from IDisposable. /// </summary> protected virtual void Dispose(bool disposing) { if (!this.disposed) { if (disposing) { _context.Dispose(); } } this.disposed = true; } /// <summary> /// Implementation of IDisposable. IDALContext inherits from IUnitOfWork, which inherits from IDisposable. /// </summary> public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } } }
35.194631
126
0.598017
[ "MIT" ]
MatthiasHoldorf/FoodControl
FoodControl/DataAccessLayer/DALContext.cs
5,246
C#
// // System.Web.UI.IResourceUrlGenerator.cs // // Authors: // Sanjay Gupta (gsanjay@novell.com) // // (C) 2004-2010 Novell, Inc (http://www.novell.com) // // // 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. // using System; namespace System.Web.UI { public interface IResourceUrlGenerator { string GetResourceUrl (Type type, string resource); } }
34.725
73
0.74658
[ "Apache-2.0" ]
121468615/mono
mcs/class/System.Web/System.Web.UI/IResourceUrlGenerator.cs
1,389
C#
using AnnoSavegameViewer.Serialization.Core; using System.Collections.Generic; namespace AnnoSavegameViewer.Structures.Savegame.Generated { public class CityLayoutBlockType { [BinaryContent(Name = "value", NodeType = BinaryContentTypes.Node)] public CityLayoutBlockTypeValue Value { get; set; } } }
26.166667
71
0.783439
[ "MIT" ]
brumiros/AnnoSavegameViewer
AnnoSavegameViewer/Structures/Savegame/Generated/NoContent/CityLayoutBlockType.cs
314
C#
using Assets.Scripts.GameLogic.Animation; namespace Assets.Scripts.GameLogic.ActionLoop.ActionEffects { public class KnockOutEffect : IActionEffect { public KnockOutEffect(ActorData actorData) { ActorData = actorData; } public ActorData ActorData { get; private set; } public virtual void Process() { IGameEntity entity = ActorData.Entity; IEntityAnimator entityAnimator = entity.EntityAnimator; bool actorIsVisible = entity.IsVisible; if (actorIsVisible) entityAnimator.KnockOut(); } } }
22.041667
59
0.750473
[ "MIT" ]
azsdaja/7drl-2018
Assets/Scripts/GameLogic/ActionLoop/ActionEffects/KnockOutEffect.cs
531
C#
using UnityEngine; using System.Collections; public class InputKeyboard : IInput { float inputReturn = 0; public float InputReturn { get { return inputReturn; } } public InputKeyboard (float iReturn) { inputReturn = iReturn; } }
16.388889
41
0.59661
[ "MIT" ]
oneseedfruit/LD33_MYCUPOFFURY
Assets/My Assets/Scripts/Input Classes/InputKeyboard.cs
297
C#
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. namespace NuGet.Common { internal static class CommandLineConstants { internal static string ReferencePage = "https://github.com/NuGet/NuGetOperations"; } }
34.5
111
0.736232
[ "Apache-2.0" ]
DevlinSchoonraad/NuGetGallery
src/NuGetGallery.Operations/Common/CommandLineConstants.cs
347
C#
// <copyright file="CommandLine.cs" company="Google Inc."> // Copyright (C) 2016 Google Inc. All Rights Reserved. // // Licensed 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. // </copyright> namespace GooglePlayServices { using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Text.RegularExpressions; using System.Threading; using System; #if UNITY_EDITOR using UnityEditor; #endif // UNITY_EDITOR public static class CommandLine { /// <summary> /// Result from Run(). /// </summary> public class Result { /// String containing the standard output stream of the tool. public string stdout; /// String containing the standard error stream of the tool. public string stderr; /// Exit code returned by the tool when execution is complete. public int exitCode; }; /// <summary> /// Called when a RunAsync() completes. /// </summary> public delegate void CompletionHandler(Result result); /// <summary> /// Text and byte representations of an array of data. /// </summary> public class StreamData { /// <summary> /// Handle to the stream this was read from. /// e.g 0 for stdout, 1 for stderr. /// </summary> public int handle = 0; /// <summary> /// Text representation of "data". /// </summary> public string text = ""; /// <summary> /// Array of bytes or "null" if no data is present. /// </summary> public byte[] data = null; /// <summary> /// Whether this marks the end of the stream. /// </summary> public bool end; /// <summary> /// Initialize this instance. /// </summary> /// <param name="handle">Stream identifier.</param> /// <param name="text">String</param> /// <param name="data">Bytes</param> /// <param name="end">Whether this is the end of the stream.</param> public StreamData(int handle, string text, byte[] data, bool end) { this.handle = handle; this.text = text; this.data = data; this.end = end; } /// <summary> /// Get an empty StreamData instance. /// </summary> public static StreamData Empty { get { return new StreamData(0, "", null, false); } } } /// <summary> /// Called when data is received from either the standard output or standard error /// streams with a reference to the current standard input stream to enable simulated /// interactive input. /// </summary> /// <param name="process">Executing process.</param> /// <param name="stdin">Standard input stream.</param> /// <param name="stream">Data read from the standard output or error streams.</param> public delegate void IOHandler(Process process, StreamWriter stdin, StreamData streamData); /// <summary> /// Asynchronously execute a command line tool, calling the specified delegate on /// completion. /// </summary> /// <param name="toolPath">Tool to execute.</param> /// <param name="arguments">String to pass to the tools' command line.</param> /// <param name="completionDelegate">Called when the tool completes.</param> /// <param name="workingDirectory">Directory to execute the tool from.</param> /// <param name="envVars">Additional environment variables to set for the command.</param> /// <param name="ioHandler">Allows a caller to provide interactive input and also handle /// both output and error streams from a single delegate.</param> public static void RunAsync( string toolPath, string arguments, CompletionHandler completionDelegate, string workingDirectory = null, Dictionary<string, string> envVars = null, IOHandler ioHandler = null) { Thread thread = new Thread(new ThreadStart(() => { Result result = Run(toolPath, arguments, workingDirectory, envVars: envVars, ioHandler: ioHandler); completionDelegate(result); })); thread.Start(); } /// <summary> /// Asynchronously reads binary data from a stream using a configurable buffer. /// </summary> private class AsyncStreamReader { /// <summary> /// Delegate called when data is read from the stream. /// <param name="streamData">Data read from the stream.</param> /// </summary> public delegate void Handler(StreamData streamData); /// <summary> /// Event which is signalled when data is received. /// </summary> public event Handler DataReceived; // Signalled when a read completes. private AutoResetEvent readEvent = null; // Handle to the stream. private int handle; // Stream to read. private Stream stream; // Buffer used to read data from the stream. private byte[] buffer; // Whether reading is complete. volatile bool complete = false; /// <summary> /// Initialize the reader. /// </summary> /// <param name="stream">Stream to read.</param> /// <param name="bufferSize">Size of the buffer to read.</param> public AsyncStreamReader(int handle, Stream stream, int bufferSize) { readEvent = new AutoResetEvent(false); this.handle = handle; this.stream = stream; buffer = new byte[bufferSize]; } /// <summary> /// Get the handle of the stream associated with this reader. /// </summary> public int Handle { get { return handle; } } /// <summary> /// Start reading. /// </summary> public void Start() { if (!complete) (new Thread(new ThreadStart(Read))).Start(); } /// <summary> /// Read from the stream until the end is reached. /// </summary> private void Read() { while (!complete) { stream.BeginRead( buffer, 0, buffer.Length, (asyncResult) => { int bytesRead = stream.EndRead(asyncResult); if (!complete) { complete = bytesRead == 0; if (DataReceived != null) { byte[] copy = new byte[bytesRead]; Array.Copy(buffer, copy, copy.Length); DataReceived(new StreamData( handle, System.Text.Encoding.UTF8.GetString(copy), copy, complete)); } } readEvent.Set(); }, null); readEvent.WaitOne(); } } /// <summary> /// Create a set of readers to read the specified streams, handles are assigned /// based upon the index of each stream in the provided array. /// </summary> /// <param name="streams">Streams to read.</param> /// <param name="bufferSize">Size of the buffer to use to read each stream.</param> public static AsyncStreamReader[] CreateFromStreams(Stream[] streams, int bufferSize) { AsyncStreamReader[] readers = new AsyncStreamReader[streams.Length]; for (int i = 0; i < streams.Length; i++) { readers[i] = new AsyncStreamReader(i, streams[i], bufferSize); } return readers; } } /// <summary> /// Multiplexes data read from multiple AsyncStreamReaders onto a single thread. /// </summary> private class AsyncStreamReaderMultiplexer { /// Used to wait on items in the queue. private AutoResetEvent queuedItem = null; /// Queue of Data read from the readers. private System.Collections.Queue queue = null; /// Active stream handles. private HashSet<int> activeStreams; /// <summary> /// Called when all streams reach the end or the reader is shut down. /// </summary> public delegate void CompletionHandler(); /// <summary> /// Called when all streams reach the end or the reader is shut down. /// </summary> public event CompletionHandler Complete; /// <summary> /// Handler called from the multiplexer's thread. /// </summary> public event AsyncStreamReader.Handler DataReceived; /// <summary> /// Create the multiplexer and attach it to the specified handler. /// </summary> /// <param name="readers">Readers to read.</param> /// <param name="handler">Called for queued data item.</param> /// <param name="complete">Called when all readers complete.</param> public AsyncStreamReaderMultiplexer(AsyncStreamReader[] readers, AsyncStreamReader.Handler handler, CompletionHandler complete = null) { queuedItem = new AutoResetEvent(false); queue = System.Collections.Queue.Synchronized(new System.Collections.Queue()); activeStreams = new HashSet<int>(); foreach (AsyncStreamReader reader in readers) { reader.DataReceived += HandleRead; activeStreams.Add(reader.Handle); } DataReceived += handler; if (complete != null) Complete += complete; (new Thread(new ThreadStart(PollQueue))).Start(); } /// <summary> /// Shutdown the multiplexer. /// </summary> public void Shutdown() { lock (activeStreams) { activeStreams.Clear(); } queuedItem.Set(); } // Handle stream read notification. private void HandleRead(StreamData streamData) { queue.Enqueue(streamData); queuedItem.Set(); } // Poll the queue. private void PollQueue() { while (activeStreams.Count > 0) { queuedItem.WaitOne(); while (queue.Count > 0) { StreamData data = (StreamData)queue.Dequeue(); if (data.end) { lock(activeStreams) { activeStreams.Remove(data.handle); } } if (DataReceived != null) DataReceived(data); } } if (Complete != null) Complete(); } } /// <summary> /// Aggregates lines read by AsyncStreamReader. /// </summary> public class LineReader { // List of data keyed by stream handle. private Dictionary<int, List<StreamData>> streamDataByHandle = new Dictionary<int, List<StreamData>>(); /// <summary> /// Event called with a new line of data. /// </summary> public event IOHandler LineHandler; /// <summary> /// Event called for each piece of data received. /// </summary> public event IOHandler DataHandler; /// <summary> /// Initialize the instance. /// </summary> /// <param name="handler">Called for each line read.</param> public LineReader(IOHandler handler = null) { if (handler != null) LineHandler += handler; } /// <summary> /// Retrieve the currently buffered set of data. /// This allows the user to retrieve data before the end of a stream when /// a newline isn't present. /// </summary> /// <param name="handle">Handle of the stream to query.</param> /// <returns>List of data for the requested stream.</return> public List<StreamData> GetBufferedData(int handle) { List<StreamData> handleData; return streamDataByHandle.TryGetValue(handle, out handleData) ? new List<StreamData>(handleData) : new List<StreamData>(); } /// <summary> /// Flush the internal buffer. /// </summary> public void Flush() { foreach (List<StreamData> handleData in streamDataByHandle.Values) { handleData.Clear(); } } /// <summary> /// Aggregate the specified list of StringBytes into a single structure. /// </summary> /// <param name="handle">Stream handle.</param> /// <param name="dataStream">Data to aggregate.</param> public static StreamData Aggregate(List<StreamData> dataStream) { // Build a list of strings up to the newline. List<string> stringList = new List<string>(); int byteArraySize = 0; int handle = 0; bool end = false; foreach (StreamData sd in dataStream) { stringList.Add(sd.text); byteArraySize += sd.data.Length; handle = sd.handle; end |= sd.end; } string concatenatedString = String.Join("", stringList.ToArray()); // Concatenate the list of bytes up to the StringBytes before the // newline. byte[] byteArray = new byte[byteArraySize]; int byteArrayOffset = 0; foreach (StreamData sd in dataStream) { Array.Copy(sd.data, 0, byteArray, byteArrayOffset, sd.data.Length); byteArrayOffset += sd.data.Length; } return new StreamData(handle, concatenatedString, byteArray, end); } /// <summary> /// Delegate method which can be attached to AsyncStreamReader.DataReceived to /// aggregate data until a new line is found before calling LineHandler. /// </summary> public void AggregateLine(Process process, StreamWriter stdin, StreamData data) { if (DataHandler != null) DataHandler(process, stdin, data); bool linesProcessed = false; if (data.data != null) { // Simplify line tracking by converting linefeeds to newlines. data.text = data.text.Replace("\r\n", "\n").Replace("\r", "\n"); List<StreamData> aggregateList = GetBufferedData(data.handle); aggregateList.Add(data); bool complete = false; while (!complete) { List<StreamData> newAggregateList = new List<StreamData>(); int textDataIndex = 0; int aggregateListSize = aggregateList.Count; complete = true; foreach (StreamData textData in aggregateList) { bool end = data.end && (++textDataIndex == aggregateListSize); newAggregateList.Add(textData); int newlineOffset = textData.text.Length; if (!end) { newlineOffset = textData.text.IndexOf("\n"); if (newlineOffset < 0) continue; newAggregateList.Remove(textData); } StreamData concatenated = Aggregate(newAggregateList); // Flush the aggregation list and store the overflow. newAggregateList.Clear(); if (!end) { // Add the remaining line to the concatenated data. concatenated.text += textData.text.Substring(0, newlineOffset + 1); // Save the line after the newline in the buffer. newAggregateList.Add(new StreamData( data.handle, textData.text.Substring(newlineOffset + 1), textData.data, false)); complete = false; } // Report the data. if (LineHandler != null) LineHandler(process, stdin, concatenated); linesProcessed = true; } aggregateList = newAggregateList; } streamDataByHandle[data.handle] = aggregateList; } // If no lines were processed call the handle to allow it to look ahead. if (!linesProcessed && LineHandler != null) { LineHandler(process, stdin, StreamData.Empty); } } } /// <summary> /// Execute a command line tool. /// </summary> /// <param name="toolPath">Tool to execute.</param> /// <param name="arguments">String to pass to the tools' command line.</param> /// <param name="workingDirectory">Directory to execute the tool from.</param> /// <param name="envVars">Additional environment variables to set for the command.</param> /// <param name="ioHandler">Allows a caller to provide interactive input and also handle /// both output and error streams from a single delegate.</param> /// <returns>CommandLineTool result if successful, raises an exception if it's not /// possible to execute the tool.</returns> public static Result Run(string toolPath, string arguments, string workingDirectory = null, Dictionary<string, string> envVars = null, IOHandler ioHandler = null) { System.Text.Encoding inputEncoding = Console.InputEncoding; System.Text.Encoding outputEncoding = Console.OutputEncoding; Console.InputEncoding = System.Text.Encoding.UTF8; Console.OutputEncoding = System.Text.Encoding.UTF8; Process process = new Process(); process.StartInfo.UseShellExecute = false; process.StartInfo.Arguments = arguments; process.StartInfo.CreateNoWindow = true; process.StartInfo.RedirectStandardOutput = true; process.StartInfo.RedirectStandardError = true; if (envVars != null) { foreach (var env in envVars) { process.StartInfo.EnvironmentVariables[env.Key] = env.Value; } } process.StartInfo.RedirectStandardInput = (ioHandler != null); process.StartInfo.FileName = toolPath; process.StartInfo.WorkingDirectory = workingDirectory ?? Environment.CurrentDirectory; process.Start(); // If an I/O handler was specified, call it with no data to provide a process and stdin // handle before output data is sent to it. if (ioHandler != null) ioHandler(process, process.StandardInput, StreamData.Empty); AutoResetEvent complete = new AutoResetEvent(false); List<string>[] stdouterr = new List<string>[] { new List<string>(), new List<string>() }; // Read raw output from the process. AsyncStreamReader[] readers = AsyncStreamReader.CreateFromStreams( new Stream[] { process.StandardOutput.BaseStream, process.StandardError.BaseStream }, 1); new AsyncStreamReaderMultiplexer( readers, (StreamData data) => { stdouterr[data.handle].Add(data.text); if (ioHandler != null) ioHandler(process, process.StandardInput, data); }, complete: () => { complete.Set(); }); foreach (AsyncStreamReader reader in readers) reader.Start(); process.WaitForExit(); // Wait for the reading threads to complete. complete.WaitOne(); Result result = new Result(); result.stdout = String.Join("", stdouterr[0].ToArray()); result.stderr = String.Join("", stdouterr[1].ToArray()); result.exitCode = process.ExitCode; Console.InputEncoding = inputEncoding; Console.OutputEncoding = outputEncoding; return result; } /// <summary> /// Split a string into lines using newline, carriage return or a combination of both. /// </summary> /// <param name="multilineString">String to split into lines</param> public static string[] SplitLines(string multilineString) { return Regex.Split(multilineString, "\r\n|\r|\n"); } #if UNITY_EDITOR /// <summary> /// Get an executable extension. /// </summary> /// <returns>Platform specific extension for executables.</returns> public static string GetExecutableExtension() { return (UnityEngine.RuntimePlatform.WindowsEditor == UnityEngine.Application.platform) ? ".exe" : ""; } /// <summary> /// Locate an executable in the system path. /// </summary> /// <param name="exeName">Executable name without a platform specific extension like /// .exe</param> /// <returns>A string to the executable path if it's found, null otherwise.</returns> public static string FindExecutable(string executable) { string which = (UnityEngine.RuntimePlatform.WindowsEditor == UnityEngine.Application.platform) ? "where" : "which"; try { Result result = Run(which, executable, Environment.CurrentDirectory); if (result.exitCode == 0) { return SplitLines(result.stdout)[0]; } } catch (Exception e) { UnityEngine.Debug.Log("'" + which + "' command is not on path. " + "Unable to find executable '" + executable + "' (" + e.ToString() + ")"); } return null; } #endif // UNITY_EDITOR } }
41.757475
99
0.505888
[ "Unlicense" ]
Motts182/xilophon
Assets/PlayServicesResolver/Editor/CommandLine.cs
25,138
C#
using UnityEngine; using System.Collections.Generic; using System.IO; using System; using System.Linq; using UnityEditor; #if UNITY_EDITOR using UnityEditor.Callbacks; #endif namespace Utils { public static class Configuration { private static IDictionary<string, string> _config; private static FileInfo _fileInfo = #if UNITY_EDITOR new FileInfo(Path.Combine(Path.Combine(Application.dataPath, "BIOPACInterface/BuildData"), "config.txt")); #elif !UNITY_EDITOR new FileInfo(Path.Combine(Path.Combine(Directory.GetParent(Application.dataPath).FullName, "BuildData"), "config.txt")); #endif static Configuration() { try { _config = new Dictionary<string, string>(); Load(_fileInfo); } catch (Exception e) { #if UNITY_WSA Debug.Log(e); #else Debug.LogException(e); #endif } } public static T GetEnum<T>(string path, T deflt = default(T)) { if (_config.ContainsKey(path)) return (T)Enum.Parse(typeof(T), _config[path], true); else { Debug.LogWarningFormat("Using default value for property \"{0}\" ({1})", path, deflt); return deflt; } } public static string GetString(string path) { return GetString(path, string.Empty); } public static string GetString(string path, string deflt) { if (_config.ContainsKey(path)) return _config[path]; else { Debug.LogWarningFormat("Using default value for property \"{0}\" ({1})", path, deflt); return deflt; } } public static int GetInt(string path, int deflt = 0) { if (_config.ContainsKey(path)) return int.Parse(_config[path], System.Globalization.NumberStyles.Integer, System.Globalization.CultureInfo.InvariantCulture.NumberFormat); else { Debug.LogWarningFormat("Using default value for property \"{0}\" ({1})", path, deflt); return deflt; } } public static float GetFloat(string path, float deflt = 0f) { if (_config.ContainsKey(path)) return float.Parse(_config[path], System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture.NumberFormat); else { Debug.LogWarningFormat("Using default value for property \"{0}\" ({1})", path, deflt); return deflt; } } public static bool GetBool(string path, bool deflt = false) { if (_config.ContainsKey(path)) return bool.Parse(_config[path]); else { Debug.LogWarningFormat("Using default value for property \"{0}\" ({1})", path, deflt); return deflt; } } public static void Put(string path, object value) { _config[path] = value.ToString(); } public static bool Exists(string path) { return _config.ContainsKey(path); } public static IEnumerable<string> Keys { get { return _config.Keys; } } public static void Load(FileInfo file) { using (var f = new StreamReader(file.OpenRead())) { string line; while ((line = f.ReadLine()) != null) { if (line.Length > 0 && !line.StartsWith("#")) { var split = line.Split('='); _config[split[0].Trim()] = split[1].Trim(); } } } } #if UNITY_EDITOR [PostProcessBuild(1)] public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject) { string folderToCopy = Path.GetFileName(_fileInfo.DirectoryName); string destFolder = Path.Combine(Path.GetDirectoryName(pathToBuiltProject), folderToCopy); Debug.Log($"Copying the editor config file @{_fileInfo.DirectoryName} into the build data @{destFolder}"); DirectoryCopy(_fileInfo.DirectoryName, destFolder, true, new []{".meta"}); } #endif public static void DirectoryCopy(string sourceDirName, string destDirName, bool copySubDirs, params string[] excludingExtensions) { // Get the subdirectories for the specified directory. DirectoryInfo dir = new DirectoryInfo(sourceDirName); if (!dir.Exists) { throw new DirectoryNotFoundException( "Source directory does not exist or could not be found: " + sourceDirName); } DirectoryInfo[] dirs = dir.GetDirectories(); // If the destination directory doesn't exist, create it. Directory.CreateDirectory(destDirName); // Get the files in the directory and copy them to the new location. FileInfo[] files = dir.GetFiles().Where(file => !excludingExtensions.Any(x => file.Name.EndsWith(x, StringComparison.OrdinalIgnoreCase))).ToArray(); foreach (FileInfo file in files) { string tempPath = Path.Combine(destDirName, file.Name); if (File.Exists(tempPath)) File.Delete(tempPath); file.CopyTo(tempPath, false); } // If copying subdirectories, copy them and their contents to new location. if (copySubDirs) { foreach (DirectoryInfo subdir in dirs) { string tempPath = Path.Combine(destDirName, subdir.Name); DirectoryCopy(subdir.FullName, tempPath, copySubDirs); } } } } }
34.016484
160
0.541916
[ "MIT" ]
CGVG-Poli/BIOPACInterface
Assets/BIOPACInterface/Runtime/Utils/Configuration.cs
6,193
C#
// ---------------------------------------------------------------------------------- // // Copyright Microsoft Corporation // Licensed 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.Collections.Generic; using System.Linq; using System.Management.Automation; using Microsoft.Azure.Management.RecoveryServices.SiteRecovery.Models; namespace Microsoft.Azure.Commands.RecoveryServices.SiteRecovery { /// <summary> /// Gets Azure Site Recovery Notification / Alert Settings. /// </summary> [Cmdlet( VerbsCommon.Get, "AzureRmRecoveryServicesAsrAlertSetting")] [Alias( "Get-ASRNotificationSetting", "Get-AzureRmRecoveryServicesAsrNotificationSetting", "Get-ASRAlertSetting")] [OutputType(typeof(IEnumerable<ASRAlertSetting>))] public class GetAzureRmRecoveryServicesAsrAlertSetting : SiteRecoveryCmdletBase { /// <summary> /// ProcessRecord of the command. /// </summary> public override void ExecuteSiteRecoveryCmdlet() { base.ExecuteSiteRecoveryCmdlet(); var alertSetting = this.RecoveryServicesClient.GetAzureSiteRecoveryAlertSetting(); this.WriteObject(alertSetting.Select(p => new ASRAlertSetting(p)), true); } } }
41.891304
87
0.629476
[ "MIT" ]
AzureDataBox/azure-powershell
src/ResourceManager/RecoveryServices.SiteRecovery/Commands.RecoveryServices.SiteRecovery/AlertSetting/GetAzureRmRecoveryServicesAsrAlertSetting.cs
1,884
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using lm.Comol.Core.DomainModel; namespace lm.Comol.Modules.EduPath.Domain { public class dtoCertificateStat { public Int64 PathId { get; set; } public Int64 ActivityId { get; set; } public Int64 SubActivityId { get; set; } public Int32 CommunityId { get; set; } public dtoSubActivity dtoSubActivity { get; set; } public Int64 CertificateId { get; set; } public Int64 CertificateVersion { get; set; } public String CertificateName { get; set; } public Int32 Obtained { get; set; } public Int32 Total { get; set; } public IList<dtoCertificateUsersStat> Users { get; set; } public dtoCertificateStat() { Users = new List<dtoCertificateUsersStat>(); } } public class dtoCertificateUsersStat { public dtoCertificateStat Parent { get; set; } public Int32 PersonId { get; set; } public litePerson Person { get; set; } public DateTime Date { get; set; } } }
25.818182
73
0.621479
[ "MIT" ]
EdutechSRL/Adevico
3-Business/3-Modules/lm.Comol.Modules.EduPath/Domain/DTO/Certifications/dtoCertificateStat.cs
1,138
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using ILLink.Shared; using Mono.Cecil; using Mono.Cecil.Cil; namespace Mono.Linker.Dataflow { class FlowAnnotations { readonly LinkContext _context; readonly Dictionary<TypeDefinition, TypeAnnotations> _annotations = new Dictionary<TypeDefinition, TypeAnnotations> (); readonly TypeHierarchyCache _hierarchyInfo; public FlowAnnotations (LinkContext context) { _context = context; _hierarchyInfo = new TypeHierarchyCache (context); } public bool RequiresDataFlowAnalysis (MethodDefinition method) => GetAnnotations (method.DeclaringType).TryGetAnnotation (method, out _); public bool RequiresDataFlowAnalysis (FieldDefinition field) => GetAnnotations (field.DeclaringType).TryGetAnnotation (field, out _); public bool RequiresDataFlowAnalysis (GenericParameter genericParameter) => GetGenericParameterAnnotation (genericParameter) != DynamicallyAccessedMemberTypes.None; /// <summary> /// Retrieves the annotations for the given parameter. /// </summary> /// <param name="parameterIndex">Parameter index in the IL sense. Parameter 0 on instance methods is `this`.</param> /// <returns></returns> public DynamicallyAccessedMemberTypes GetParameterAnnotation (MethodDefinition method, int parameterIndex) { if (GetAnnotations (method.DeclaringType).TryGetAnnotation (method, out var annotation) && annotation.ParameterAnnotations != null) return annotation.ParameterAnnotations[parameterIndex]; return DynamicallyAccessedMemberTypes.None; } public DynamicallyAccessedMemberTypes GetReturnParameterAnnotation (MethodDefinition method) { if (GetAnnotations (method.DeclaringType).TryGetAnnotation (method, out var annotation)) return annotation.ReturnParameterAnnotation; return DynamicallyAccessedMemberTypes.None; } public DynamicallyAccessedMemberTypes GetFieldAnnotation (FieldDefinition field) { if (GetAnnotations (field.DeclaringType).TryGetAnnotation (field, out var annotation)) return annotation.Annotation; return DynamicallyAccessedMemberTypes.None; } public DynamicallyAccessedMemberTypes GetTypeAnnotation (TypeDefinition type) => GetAnnotations (type).TypeAnnotation; public bool ShouldWarnWhenAccessedForReflection (IMemberDefinition provider) => provider switch { MethodDefinition method => ShouldWarnWhenAccessedForReflection (method), FieldDefinition field => ShouldWarnWhenAccessedForReflection (field), _ => false }; public DynamicallyAccessedMemberTypes GetGenericParameterAnnotation (GenericParameter genericParameter) { TypeDefinition? declaringType = _context.Resolve (genericParameter.DeclaringType); if (declaringType != null) { if (GetAnnotations (declaringType).TryGetAnnotation (genericParameter, out var annotation)) return annotation; return DynamicallyAccessedMemberTypes.None; } MethodDefinition? declaringMethod = _context.Resolve (genericParameter.DeclaringMethod); if (declaringMethod != null && GetAnnotations (declaringMethod.DeclaringType).TryGetAnnotation (declaringMethod, out var methodTypeAnnotations) && methodTypeAnnotations.TryGetAnnotation (genericParameter, out var methodAnnotation)) return methodAnnotation; return DynamicallyAccessedMemberTypes.None; } public bool ShouldWarnWhenAccessedForReflection (MethodDefinition method) { if (!GetAnnotations (method.DeclaringType).TryGetAnnotation (method, out var annotation)) return false; if (annotation.ParameterAnnotations == null && annotation.ReturnParameterAnnotation == DynamicallyAccessedMemberTypes.None) return false; // If the method only has annotation on the return value and it's not virtual avoid warning. // Return value annotations are "consumed" by the caller of a method, and as such there is nothing // wrong calling these dynamically. The only problem can happen if something overrides a virtual // method with annotated return value at runtime - in this case the trimmer can't validate // that the method will return only types which fulfill the annotation's requirements. // For example: // class BaseWithAnnotation // { // [return: DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields)] // public abstract Type GetTypeWithFields(); // } // // class UsingTheBase // { // public void PrintFields(Base base) // { // // No warning here - GetTypeWithFields is correctly annotated to allow GetFields on the return value. // Console.WriteLine(string.Join(" ", base.GetTypeWithFields().GetFields().Select(f => f.Name))); // } // } // // If at runtime (through ref emit) something generates code like this: // class DerivedAtRuntimeFromBase // { // // No point in adding annotation on the return value - nothing will look at it anyway // // Linker will not see this code, so there are no checks // public override Type GetTypeWithFields() { return typeof(TestType); } // } // // If TestType from above is trimmed, it may note have all its fields, and there would be no warnings generated. // But there has to be code like this somewhere in the app, in order to generate the override: // class RuntimeTypeGenerator // { // public MethodInfo GetBaseMethod() // { // // This must warn - that the GetTypeWithFields has annotation on the return value // return typeof(BaseWithAnnotation).GetMethod("GetTypeWithFields"); // } // } return method.IsVirtual || annotation.ParameterAnnotations != null; } public bool ShouldWarnWhenAccessedForReflection (FieldDefinition field) => GetAnnotations (field.DeclaringType).TryGetAnnotation (field, out _); TypeAnnotations GetAnnotations (TypeDefinition type) { if (!_annotations.TryGetValue (type, out TypeAnnotations value)) { value = BuildTypeAnnotations (type); _annotations.Add (type, value); } return value; } static bool IsDynamicallyAccessedMembersAttribute (CustomAttribute attribute) { var attributeType = attribute.AttributeType; return attributeType.Name == "DynamicallyAccessedMembersAttribute" && attributeType.Namespace == "System.Diagnostics.CodeAnalysis"; } DynamicallyAccessedMemberTypes GetMemberTypesForDynamicallyAccessedMembersAttribute (IMemberDefinition member, ICustomAttributeProvider? providerIfNotMember = null) { ICustomAttributeProvider provider = providerIfNotMember ?? member; if (!_context.CustomAttributes.HasAny (provider)) return DynamicallyAccessedMemberTypes.None; foreach (var attribute in _context.CustomAttributes.GetCustomAttributes (provider)) { if (!IsDynamicallyAccessedMembersAttribute (attribute)) continue; if (attribute.ConstructorArguments.Count == 1) return (DynamicallyAccessedMemberTypes) (int) attribute.ConstructorArguments[0].Value; else _context.LogWarning (member, DiagnosticId.AttributeDoesntHaveTheRequiredNumberOfParameters, "System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute"); } return DynamicallyAccessedMemberTypes.None; } TypeAnnotations BuildTypeAnnotations (TypeDefinition type) { // class, interface, struct can have annotations DynamicallyAccessedMemberTypes typeAnnotation = GetMemberTypesForDynamicallyAccessedMembersAttribute (type); var annotatedFields = new ArrayBuilder<FieldAnnotation> (); // First go over all fields with an explicit annotation if (type.HasFields) { foreach (FieldDefinition field in type.Fields) { DynamicallyAccessedMemberTypes annotation = GetMemberTypesForDynamicallyAccessedMembersAttribute (field); if (annotation == DynamicallyAccessedMemberTypes.None) { continue; } if (!IsTypeInterestingForDataflow (field.FieldType)) { // Already know that there's a non-empty annotation on a field which is not System.Type/String and we're about to ignore it _context.LogWarning (field, DiagnosticId.DynamicallyAccessedMembersOnFieldCanOnlyApplyToTypesOrStrings, field.GetDisplayName ()); continue; } annotatedFields.Add (new FieldAnnotation (field, annotation)); } } var annotatedMethods = new ArrayBuilder<MethodAnnotations> (); // Next go over all methods with an explicit annotation if (type.HasMethods) { foreach (MethodDefinition method in type.Methods) { DynamicallyAccessedMemberTypes[]? paramAnnotations = null; // We convert indices from metadata space to IL space here. // IL space assigns index 0 to the `this` parameter on instance methods. DynamicallyAccessedMemberTypes methodMemberTypes = GetMemberTypesForDynamicallyAccessedMembersAttribute (method); int offset; if (method.HasImplicitThis ()) { offset = 1; if (IsTypeInterestingForDataflow (method.DeclaringType)) { // If there's an annotation on the method itself and it's one of the special types (System.Type for example) // treat that annotation as annotating the "this" parameter. if (methodMemberTypes != DynamicallyAccessedMemberTypes.None) { paramAnnotations = new DynamicallyAccessedMemberTypes[method.Parameters.Count + offset]; paramAnnotations[0] = methodMemberTypes; } } else if (methodMemberTypes != DynamicallyAccessedMemberTypes.None) { _context.LogWarning (method, DiagnosticId.DynamicallyAccessedMembersIsNotAllowedOnMethods); } } else { offset = 0; if (methodMemberTypes != DynamicallyAccessedMemberTypes.None) { _context.LogWarning (method, DiagnosticId.DynamicallyAccessedMembersIsNotAllowedOnMethods); } } for (int i = 0; i < method.Parameters.Count; i++) { var methodParameter = method.Parameters[i]; DynamicallyAccessedMemberTypes pa = GetMemberTypesForDynamicallyAccessedMembersAttribute (method, providerIfNotMember: methodParameter); if (pa == DynamicallyAccessedMemberTypes.None) continue; if (!IsTypeInterestingForDataflow (methodParameter.ParameterType)) { _context.LogWarning (method, DiagnosticId.DynamicallyAccessedMembersOnMethodParameterCanOnlyApplyToTypesOrStrings, DiagnosticUtilities.GetParameterNameForErrorMessage (methodParameter), DiagnosticUtilities.GetMethodSignatureDisplayName (methodParameter.Method)); continue; } if (paramAnnotations == null) { paramAnnotations = new DynamicallyAccessedMemberTypes[method.Parameters.Count + offset]; } paramAnnotations[i + offset] = pa; } DynamicallyAccessedMemberTypes returnAnnotation = GetMemberTypesForDynamicallyAccessedMembersAttribute (method, providerIfNotMember: method.MethodReturnType); if (returnAnnotation != DynamicallyAccessedMemberTypes.None && !IsTypeInterestingForDataflow (method.ReturnType)) { _context.LogWarning (method, DiagnosticId.DynamicallyAccessedMembersOnMethodReturnValueCanOnlyApplyToTypesOrStrings, method.GetDisplayName ()); } DynamicallyAccessedMemberTypes[]? genericParameterAnnotations = null; if (method.HasGenericParameters) { for (int genericParameterIndex = 0; genericParameterIndex < method.GenericParameters.Count; genericParameterIndex++) { var genericParameter = method.GenericParameters[genericParameterIndex]; var annotation = GetMemberTypesForDynamicallyAccessedMembersAttribute (method, providerIfNotMember: genericParameter); if (annotation != DynamicallyAccessedMemberTypes.None) { if (genericParameterAnnotations == null) genericParameterAnnotations = new DynamicallyAccessedMemberTypes[method.GenericParameters.Count]; genericParameterAnnotations[genericParameterIndex] = annotation; } } } if (returnAnnotation != DynamicallyAccessedMemberTypes.None || paramAnnotations != null || genericParameterAnnotations != null) { annotatedMethods.Add (new MethodAnnotations (method, paramAnnotations, returnAnnotation, genericParameterAnnotations)); } } } // Next up are properties. Annotations on properties are kind of meta because we need to // map them to annotations on methods/fields. They're syntactic sugar - what they do is expressible // by placing attribute on the accessor/backing field. For complex properties, that's what people // will need to do anyway. Like so: // // [field: Attribute] // Type MyProperty { // [return: Attribute] // get; // [value: Attribute] // set; // } // if (type.HasProperties) { foreach (PropertyDefinition property in type.Properties) { DynamicallyAccessedMemberTypes annotation = GetMemberTypesForDynamicallyAccessedMembersAttribute (property); if (annotation == DynamicallyAccessedMemberTypes.None) continue; if (!IsTypeInterestingForDataflow (property.PropertyType)) { _context.LogWarning (property, DiagnosticId.DynamicallyAccessedMembersOnPropertyCanOnlyApplyToTypesOrStrings, property.GetDisplayName ()); continue; } FieldDefinition? backingFieldFromSetter = null; // Propagate the annotation to the setter method MethodDefinition setMethod = property.SetMethod; if (setMethod != null) { // Abstract property backing field propagation doesn't make sense, and any derived property will be validated // to have the exact same annotations on getter/setter, and thus if it has a detectable backing field that will be validated as well. if (setMethod.HasBody) { // Look for the compiler generated backing field. If it doesn't work out simply move on. In such case we would still // propagate the annotation to the setter/getter and later on when analyzing the setter/getter we will warn // that the field (which ever it is) must be annotated as well. ScanMethodBodyForFieldAccess (setMethod.Body, write: true, out backingFieldFromSetter); } if (annotatedMethods.Any (a => a.Method == setMethod)) { _context.LogWarning (setMethod, DiagnosticId.DynamicallyAccessedMembersConflictsBetweenPropertyAndAccessor, property.GetDisplayName (), setMethod.GetDisplayName ()); } else { int offset = setMethod.HasImplicitThis () ? 1 : 0; if (setMethod.Parameters.Count > 0) { DynamicallyAccessedMemberTypes[] paramAnnotations = new DynamicallyAccessedMemberTypes[setMethod.Parameters.Count + offset]; paramAnnotations[paramAnnotations.Length - 1] = annotation; annotatedMethods.Add (new MethodAnnotations (setMethod, paramAnnotations, DynamicallyAccessedMemberTypes.None, null)); } } } FieldDefinition? backingFieldFromGetter = null; // Propagate the annotation to the getter method MethodDefinition getMethod = property.GetMethod; if (getMethod != null) { // Abstract property backing field propagation doesn't make sense, and any derived property will be validated // to have the exact same annotations on getter/setter, and thus if it has a detectable backing field that will be validated as well. if (getMethod.HasBody) { // Look for the compiler generated backing field. If it doesn't work out simply move on. In such case we would still // propagate the annotation to the setter/getter and later on when analyzing the setter/getter we will warn // that the field (which ever it is) must be annotated as well. ScanMethodBodyForFieldAccess (getMethod.Body, write: false, out backingFieldFromGetter); } if (annotatedMethods.Any (a => a.Method == getMethod)) { _context.LogWarning (getMethod, DiagnosticId.DynamicallyAccessedMembersConflictsBetweenPropertyAndAccessor, property.GetDisplayName (), getMethod.GetDisplayName ()); } else { annotatedMethods.Add (new MethodAnnotations (getMethod, null, annotation, null)); } } FieldDefinition? backingField; if (backingFieldFromGetter != null && backingFieldFromSetter != null && backingFieldFromGetter != backingFieldFromSetter) { _context.LogWarning (property, DiagnosticId.DynamicallyAccessedMembersCouldNotFindBackingField, property.GetDisplayName ()); backingField = null; } else { backingField = backingFieldFromGetter ?? backingFieldFromSetter; } if (backingField != null) { if (annotatedFields.Any (a => a.Field == backingField)) { _context.LogWarning (backingField, DiagnosticId.DynamicallyAccessedMembersOnPropertyConflictsWithBackingField, property.GetDisplayName (), backingField.GetDisplayName ()); } else { annotatedFields.Add (new FieldAnnotation (backingField, annotation)); } } } } DynamicallyAccessedMemberTypes[]? typeGenericParameterAnnotations = null; if (type.HasGenericParameters) { for (int genericParameterIndex = 0; genericParameterIndex < type.GenericParameters.Count; genericParameterIndex++) { var genericParameter = type.GenericParameters[genericParameterIndex]; var annotation = GetMemberTypesForDynamicallyAccessedMembersAttribute (type, providerIfNotMember: genericParameter); if (annotation != DynamicallyAccessedMemberTypes.None) { if (typeGenericParameterAnnotations == null) typeGenericParameterAnnotations = new DynamicallyAccessedMemberTypes[type.GenericParameters.Count]; typeGenericParameterAnnotations[genericParameterIndex] = annotation; } } } return new TypeAnnotations (type, typeAnnotation, annotatedMethods.ToArray (), annotatedFields.ToArray (), typeGenericParameterAnnotations); } bool ScanMethodBodyForFieldAccess (MethodBody body, bool write, out FieldDefinition? found) { // Tries to find the backing field for a property getter/setter. // Returns true if this is a method body that we can unambiguously analyze. // The found field could still be null if there's no backing store. FieldReference? foundReference = null; foreach (Instruction instruction in body.Instructions) { switch (instruction.OpCode.Code) { case Code.Ldsfld when !write: case Code.Ldfld when !write: case Code.Stsfld when write: case Code.Stfld when write: if (foundReference != null) { // This writes/reads multiple fields - can't guess which one is the backing store. // Return failure. found = null; return false; } foundReference = (FieldReference) instruction.Operand; break; } } if (foundReference == null) { // Doesn't access any fields. Could be e.g. "Type Foo => typeof(Bar);" // Return success. found = null; return true; } found = _context.Resolve (foundReference); if (found == null) { // If the field doesn't resolve, it can't be a field on the current type // anyway. Return failure. return false; } if (found.DeclaringType != body.Method.DeclaringType || found.IsStatic != body.Method.IsStatic || !found.IsCompilerGenerated ()) { // A couple heuristics to make sure we got the right field. // Return failure. found = null; return false; } return true; } bool IsTypeInterestingForDataflow (TypeReference typeReference) { if (typeReference.MetadataType == MetadataType.String) return true; TypeDefinition? type = _context.TryResolve (typeReference); return type != null && ( _hierarchyInfo.IsSystemType (type) || _hierarchyInfo.IsSystemReflectionIReflect (type)); } internal void ValidateMethodAnnotationsAreSame (MethodDefinition method, MethodDefinition baseMethod) { GetAnnotations (method.DeclaringType).TryGetAnnotation (method, out var methodAnnotations); GetAnnotations (baseMethod.DeclaringType).TryGetAnnotation (baseMethod, out var baseMethodAnnotations); if (methodAnnotations.ReturnParameterAnnotation != baseMethodAnnotations.ReturnParameterAnnotation) LogValidationWarning (method.MethodReturnType, baseMethod.MethodReturnType, method); if (methodAnnotations.ParameterAnnotations != null || baseMethodAnnotations.ParameterAnnotations != null) { if (methodAnnotations.ParameterAnnotations == null) ValidateMethodParametersHaveNoAnnotations (baseMethodAnnotations.ParameterAnnotations!, method, baseMethod, method); else if (baseMethodAnnotations.ParameterAnnotations == null) ValidateMethodParametersHaveNoAnnotations (methodAnnotations.ParameterAnnotations, method, baseMethod, method); else { if (methodAnnotations.ParameterAnnotations.Length != baseMethodAnnotations.ParameterAnnotations.Length) return; for (int parameterIndex = 0; parameterIndex < methodAnnotations.ParameterAnnotations.Length; parameterIndex++) { if (methodAnnotations.ParameterAnnotations[parameterIndex] != baseMethodAnnotations.ParameterAnnotations[parameterIndex]) LogValidationWarning ( DiagnosticUtilities.GetMethodParameterFromIndex (method, parameterIndex), DiagnosticUtilities.GetMethodParameterFromIndex (baseMethod, parameterIndex), method); } } } if (methodAnnotations.GenericParameterAnnotations != null || baseMethodAnnotations.GenericParameterAnnotations != null) { if (methodAnnotations.GenericParameterAnnotations == null) ValidateMethodGenericParametersHaveNoAnnotations (baseMethodAnnotations.GenericParameterAnnotations!, method, baseMethod, method); else if (baseMethodAnnotations.GenericParameterAnnotations == null) ValidateMethodGenericParametersHaveNoAnnotations (methodAnnotations.GenericParameterAnnotations, method, baseMethod, method); else { if (methodAnnotations.GenericParameterAnnotations.Length != baseMethodAnnotations.GenericParameterAnnotations.Length) return; for (int genericParameterIndex = 0; genericParameterIndex < methodAnnotations.GenericParameterAnnotations.Length; genericParameterIndex++) { if (methodAnnotations.GenericParameterAnnotations[genericParameterIndex] != baseMethodAnnotations.GenericParameterAnnotations[genericParameterIndex]) { LogValidationWarning ( method.GenericParameters[genericParameterIndex], baseMethod.GenericParameters[genericParameterIndex], method); } } } } } void ValidateMethodParametersHaveNoAnnotations (DynamicallyAccessedMemberTypes[] parameterAnnotations, MethodDefinition method, MethodDefinition baseMethod, IMemberDefinition origin) { for (int parameterIndex = 0; parameterIndex < parameterAnnotations.Length; parameterIndex++) { var annotation = parameterAnnotations[parameterIndex]; if (annotation != DynamicallyAccessedMemberTypes.None) LogValidationWarning ( DiagnosticUtilities.GetMethodParameterFromIndex (method, parameterIndex), DiagnosticUtilities.GetMethodParameterFromIndex (baseMethod, parameterIndex), origin); } } void ValidateMethodGenericParametersHaveNoAnnotations (DynamicallyAccessedMemberTypes[] genericParameterAnnotations, MethodDefinition method, MethodDefinition baseMethod, IMemberDefinition origin) { for (int genericParameterIndex = 0; genericParameterIndex < genericParameterAnnotations.Length; genericParameterIndex++) { if (genericParameterAnnotations[genericParameterIndex] != DynamicallyAccessedMemberTypes.None) { LogValidationWarning ( method.GenericParameters[genericParameterIndex], baseMethod.GenericParameters[genericParameterIndex], origin); } } } void LogValidationWarning (IMetadataTokenProvider provider, IMetadataTokenProvider baseProvider, IMemberDefinition origin) { Debug.Assert (provider.GetType () == baseProvider.GetType ()); Debug.Assert (!(provider is GenericParameter genericParameter) || genericParameter.DeclaringMethod != null); switch (provider) { case ParameterDefinition parameterDefinition: var baseParameterDefinition = (ParameterDefinition) baseProvider; _context.LogWarning (origin, DiagnosticId.DynamicallyAccessedMembersMismatchOnMethodParameterBetweenOverrides, DiagnosticUtilities.GetParameterNameForErrorMessage (parameterDefinition), DiagnosticUtilities.GetMethodSignatureDisplayName (parameterDefinition.Method), DiagnosticUtilities.GetParameterNameForErrorMessage (baseParameterDefinition), DiagnosticUtilities.GetMethodSignatureDisplayName (baseParameterDefinition.Method)); break; case MethodReturnType methodReturnType: _context.LogWarning (origin, DiagnosticId.DynamicallyAccessedMembersMismatchOnMethodReturnValueBetweenOverrides, DiagnosticUtilities.GetMethodSignatureDisplayName (methodReturnType.Method), DiagnosticUtilities.GetMethodSignatureDisplayName (((MethodReturnType) baseProvider).Method)); break; // No fields - it's not possible to have a virtual field and override it case MethodDefinition methodDefinition: _context.LogWarning (origin, DiagnosticId.DynamicallyAccessedMembersMismatchOnImplicitThisBetweenOverrides, DiagnosticUtilities.GetMethodSignatureDisplayName (methodDefinition), DiagnosticUtilities.GetMethodSignatureDisplayName ((MethodDefinition) baseProvider)); break; case GenericParameter genericParameterOverride: var genericParameterBase = (GenericParameter) baseProvider; _context.LogWarning (origin, DiagnosticId.DynamicallyAccessedMembersMismatchOnGenericParameterBetweenOverrides, genericParameterOverride.Name, DiagnosticUtilities.GetGenericParameterDeclaringMemberDisplayName (genericParameterOverride), genericParameterBase.Name, DiagnosticUtilities.GetGenericParameterDeclaringMemberDisplayName (genericParameterBase)); break; default: throw new NotImplementedException ($"Unsupported provider type '{provider.GetType ()}'."); } } readonly struct TypeAnnotations { readonly TypeDefinition _type; readonly DynamicallyAccessedMemberTypes _typeAnnotation; readonly MethodAnnotations[]? _annotatedMethods; readonly FieldAnnotation[]? _annotatedFields; readonly DynamicallyAccessedMemberTypes[]? _genericParameterAnnotations; public TypeAnnotations ( TypeDefinition type, DynamicallyAccessedMemberTypes typeAnnotation, MethodAnnotations[]? annotatedMethods, FieldAnnotation[]? annotatedFields, DynamicallyAccessedMemberTypes[]? genericParameterAnnotations) => (_type, _typeAnnotation, _annotatedMethods, _annotatedFields, _genericParameterAnnotations) = (type, typeAnnotation, annotatedMethods, annotatedFields, genericParameterAnnotations); public DynamicallyAccessedMemberTypes TypeAnnotation { get => _typeAnnotation; } public bool TryGetAnnotation (MethodDefinition method, out MethodAnnotations annotations) { annotations = default; if (_annotatedMethods == null) { return false; } foreach (var m in _annotatedMethods) { if (m.Method == method) { annotations = m; return true; } } return false; } public bool TryGetAnnotation (FieldDefinition field, out FieldAnnotation annotation) { annotation = default; if (_annotatedFields == null) { return false; } foreach (var f in _annotatedFields) { if (f.Field == field) { annotation = f; return true; } } return false; } public bool TryGetAnnotation (GenericParameter genericParameter, out DynamicallyAccessedMemberTypes annotation) { annotation = default; if (_genericParameterAnnotations == null) return false; for (int genericParameterIndex = 0; genericParameterIndex < _genericParameterAnnotations.Length; genericParameterIndex++) { if (_type.GenericParameters[genericParameterIndex] == genericParameter) { annotation = _genericParameterAnnotations[genericParameterIndex]; return true; } } return false; } } readonly struct MethodAnnotations { public readonly MethodDefinition Method; public readonly DynamicallyAccessedMemberTypes[]? ParameterAnnotations; public readonly DynamicallyAccessedMemberTypes ReturnParameterAnnotation; public readonly DynamicallyAccessedMemberTypes[]? GenericParameterAnnotations; public MethodAnnotations ( MethodDefinition method, DynamicallyAccessedMemberTypes[]? paramAnnotations, DynamicallyAccessedMemberTypes returnParamAnnotations, DynamicallyAccessedMemberTypes[]? genericParameterAnnotations) => (Method, ParameterAnnotations, ReturnParameterAnnotation, GenericParameterAnnotations) = (method, paramAnnotations, returnParamAnnotations, genericParameterAnnotations); public bool TryGetAnnotation (GenericParameter genericParameter, out DynamicallyAccessedMemberTypes annotation) { annotation = default; if (GenericParameterAnnotations == null) return false; for (int genericParameterIndex = 0; genericParameterIndex < GenericParameterAnnotations.Length; genericParameterIndex++) { if (Method.GenericParameters[genericParameterIndex] == genericParameter) { annotation = GenericParameterAnnotations[genericParameterIndex]; return true; } } return false; } } readonly struct FieldAnnotation { public readonly FieldDefinition Field; public readonly DynamicallyAccessedMemberTypes Annotation; public FieldAnnotation (FieldDefinition field, DynamicallyAccessedMemberTypes annotation) => (Field, Annotation) = (field, annotation); } } }
44.363636
198
0.755812
[ "MIT" ]
Mu-L/linker
src/linker/Linker.Dataflow/FlowAnnotations.cs
29,768
C#
using System.Windows.Controls; using ACT.UltraScouter.resources; using FFXIV.Framework.Globalization; namespace ACT.UltraScouter.Config.UI.Views { /// <summary> /// GeneralView.xaml の相互作用ロジック /// </summary> public partial class EnmityConfigView : Page, ILocalizable { public EnmityConfigView() { this.InitializeComponent(); this.SetLocale(Settings.Instance.UILocale); } public void SetLocale(Locales locale) => this.ReloadLocaleDictionary(locale); } }
26.380952
86
0.646209
[ "BSD-3-Clause" ]
Noisyfox/ACT.Hojoring
source/ACT.UltraScouter/ACT.UltraScouter.Core/Config/UI/Views/EnmityConfigView.xaml.cs
572
C#
using System.Collections.Generic; namespace PeopleCompetences.Api.DataStore { /// <summary> /// Dummy data store containing a few competences - image that this is coming from an external service call :-) /// </summary> public class CompetencesStore { public IEnumerable<Competence> Competences { get; private set; } = new List<Competence>() { new Competence() { Id = 1, PersonId = 1, Name = "Reading" }, new Competence() { Id = 2, PersonId = 1, Name = "Cooking" }, new Competence() { Id = 3, PersonId = 2, Name = "Drinking wine" }, new Competence() { Id = 4, PersonId = 2, Name = "Watching movies" }, new Competence() { Id = 5, PersonId = 3, Name = "Playing soccer" }, new Competence() { Id = 6, PersonId = 3, Name = "Watching soccer" }, new Competence() { Id = 7, PersonId = 4, Name = "Travelling" }, new Competence() { Id = 8, PersonId = 4, Name = "Putting up tents at festivals" }, }; } }
45.75
115
0.541894
[ "MIT" ]
KevinDockx/CleanCodeResultFilterSample
src/PeopleCompetences.Api/DataStore/CompetencesStore.cs
1,100
C#
using System; using System.Collections.Generic; using System.Linq; using System.Web; using Mvc.Mailer; using System.Net.Mail; namespace SocialGoal.Web.Mailers { public class UserMailer : MailerBase, IUserMailer { public UserMailer() : base() { MasterName = "_Layout"; } public virtual MvcMailMessage Welcome() { var mailMessage = new MvcMailMessage { Subject = "Welcome" }; PopulateBody(mailMessage, viewName: "Welcome"); return mailMessage; } public virtual MvcMailMessage Invite(string email, Guid groupIdToken) { var mailMessage = new MvcMailMessage { Subject = "Invite" }; mailMessage.To.Add(email); ViewBag.group = "gr:" + groupIdToken; PopulateBody(mailMessage, viewName: "Invite"); return mailMessage; } public virtual MvcMailMessage Support(string email, Guid goalIdToken) { var mailMessage = new MvcMailMessage { Subject = "Support My Goal" }; mailMessage.To.Add(email); ViewBag.goal = "go:" + goalIdToken; PopulateBody(mailMessage, viewName: "SupportGoal"); return mailMessage; } public virtual MvcMailMessage ResetPassword(string email, Guid passwordResetToken) { var mailMessage = new MvcMailMessage { Subject = "Reset Password" }; mailMessage.To.Add(email); ViewBag.token = "pwreset:" + passwordResetToken; PopulateBody(mailMessage,viewName:"PasswordReset"); return mailMessage; } public virtual MvcMailMessage InviteNewUser(string email,Guid registrationToken) { var mailMessage = new MvcMailMessage { Subject = "Invitation to SocialGoal" }; mailMessage.To.Add(email); ViewBag.token = "reg:" + registrationToken; PopulateBody(mailMessage, viewName: "InviteNewUser"); return mailMessage; } } }
33.467742
90
0.603373
[ "MIT" ]
26596/Home
source/SocialGoal/Mailers/UserMailer.cs
2,075
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System; using System.Collections.Generic; using System.Composition; using System.Linq; using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.Host; using Microsoft.CodeAnalysis.Host.Mef; using Microsoft.CodeAnalysis.Operations; using Microsoft.CodeAnalysis.Options; using Microsoft.CodeAnalysis.SolutionCrawler; using Microsoft.CodeAnalysis.Telemetry; using Microsoft.VisualStudio.Telemetry; namespace Microsoft.CodeAnalysis.Remote.Telemetry { /// <summary> /// Creates an <see cref="IIncrementalAnalyzer"/> that collects Api usage information from metadata references /// in current solution. /// </summary> [ExportIncrementalAnalyzerProvider(nameof(ApiUsageIncrementalAnalyzerProvider), new[] { WorkspaceKind.RemoteWorkspace }), Shared] internal sealed class ApiUsageIncrementalAnalyzerProvider : IIncrementalAnalyzerProvider { [ImportingConstructor] [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] public ApiUsageIncrementalAnalyzerProvider() { } public IIncrementalAnalyzer CreateIncrementalAnalyzer(Workspace workspace) { #if DEBUG return new Analyzer(workspace.Services); #else return null; #endif } private sealed class Analyzer : IIncrementalAnalyzer { private readonly HostWorkspaceServices _services; // maximum number of symbols to report per project. private const int Max = 2000; private readonly HashSet<ProjectId> _reported = new HashSet<ProjectId>(); public Analyzer(HostWorkspaceServices services) { _services = services; } public Task RemoveProjectAsync(ProjectId projectId, CancellationToken cancellationToken) { lock (_reported) { _reported.Remove(projectId); } return Task.CompletedTask; } public async Task AnalyzeProjectAsync(Project project, bool semanticsChanged, InvocationReasons reasons, CancellationToken cancellationToken) { var telemetryService = _services.GetRequiredService<IWorkspaceTelemetryService>(); if (!telemetryService.HasActiveSession) { return; } lock (_reported) { // to make sure that we don't report while solution load, we do this heuristic. // if the reason we are called is due to "document being added" to project, we wait for next analyze call. // also, we only report usage information per project once. // this telemetry will only let us know which API ever used, this doesn't care how often/many times an API // used. and this data is approximation not precise information. and we don't care much on how many times // APIs used in the same solution. we are rather more interested in number of solutions or users APIs are used. if (reasons.Contains(PredefinedInvocationReasons.DocumentAdded) || !_reported.Add(project.Id)) { return; } } // if this project has cross language p2p references, then pass in solution, otherwise, don't give in // solution since checking whether symbol is cross language symbol or not is expansive and // we know that population of solution with both C# and VB are very tiny. // so no reason to pay the cost for common cases. var crossLanguageSolutionOpt = project.ProjectReferences.Any(p => project.Solution.GetProject(p.ProjectId)?.Language != project.Language) ? project.Solution : null; var metadataSymbolUsed = new HashSet<ISymbol>(SymbolEqualityComparer.Default); foreach (var document in project.Documents) { var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); var model = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false); foreach (var operation in GetOperations(model, cancellationToken)) { cancellationToken.ThrowIfCancellationRequested(); if (metadataSymbolUsed.Count > Max) { // collect data up to max per project break; } // this only gather reference and method call symbols but not type being used. // if we want all types from metadata used, we need to add more cases // which will make things more expansive. CollectApisUsed(operation, crossLanguageSolutionOpt, metadataSymbolUsed, cancellationToken); } } var solutionSessionId = project.Solution.State.SolutionAttributes.TelemetryId; var projectGuid = project.State.ProjectInfo.Attributes.TelemetryId; telemetryService.ReportApiUsage(metadataSymbolUsed, solutionSessionId, projectGuid); return; // local functions static void CollectApisUsed( IOperation operation, Solution solutionOpt, HashSet<ISymbol> metadataSymbolUsed, CancellationToken cancellationToken) { switch (operation) { case IMemberReferenceOperation memberOperation: AddIfMetadataSymbol(solutionOpt, memberOperation.Member, metadataSymbolUsed, cancellationToken); break; case IInvocationOperation invocationOperation: AddIfMetadataSymbol(solutionOpt, invocationOperation.TargetMethod, metadataSymbolUsed, cancellationToken); break; case IObjectCreationOperation objectCreation: AddIfMetadataSymbol(solutionOpt, objectCreation.Constructor, metadataSymbolUsed, cancellationToken); break; } } static void AddIfMetadataSymbol( Solution solutionOpt, ISymbol symbol, HashSet<ISymbol> metadataSymbolUsed, CancellationToken cancellationToken) { // get symbol as it is defined in metadata symbol = symbol.OriginalDefinition; if (metadataSymbolUsed.Contains(symbol)) { return; } if (symbol.Locations.All(l => l.Kind == LocationKind.MetadataFile) && solutionOpt?.GetProject(symbol.ContainingAssembly, cancellationToken) == null) { metadataSymbolUsed.Add(symbol); } } static IEnumerable<IOperation> GetOperations(SemanticModel model, CancellationToken cancellationToken) { // root is already there var root = model.SyntaxTree.GetRoot(cancellationToken); // go through all nodes until we find first node that has IOperation foreach (var rootOperation in root.DescendantNodes(n => model.GetOperation(n, cancellationToken) == null) .Select(n => model.GetOperation(n, cancellationToken)) .Where(o => o != null)) { foreach (var operation in rootOperation.DescendantsAndSelf()) { yield return operation; } } } } public Task AnalyzeSyntaxAsync(Document document, InvocationReasons reasons, CancellationToken cancellationToken) => Task.CompletedTask; public Task DocumentOpenAsync(Document document, CancellationToken cancellationToken) => Task.CompletedTask; public Task DocumentCloseAsync(Document document, CancellationToken cancellationToken) => Task.CompletedTask; public Task DocumentResetAsync(Document document, CancellationToken cancellationToken) => Task.CompletedTask; public Task AnalyzeDocumentAsync(Document document, SyntaxNode bodyOpt, InvocationReasons reasons, CancellationToken cancellationToken) => Task.CompletedTask; public bool NeedsReanalysisOnOptionChanged(object sender, OptionChangedEventArgs e) => false; public Task NewSolutionSnapshotAsync(Solution solution, CancellationToken cancellationToken) => Task.CompletedTask; public Task RemoveDocumentAsync(DocumentId documentId, CancellationToken cancellationToken) => Task.CompletedTask; } } }
46.210526
153
0.594844
[ "MIT" ]
333fred/roslyn
src/Workspaces/Remote/ServiceHub/Services/ProjectTelemetry/ApiUsageIncrementalAnalyzerProvider.cs
9,660
C#
#pragma warning disable CS0672,CS0809,CS1591 namespace AlibabaCloud.SDK.ROS.CDK.Privatelink { /// <remarks> /// <h2>Aliyun ROS PRIVATELINK Construct Library</h2> /// /// This module is part of the AliCloud ROS Cloud Development Kit (ROS CDK) project. /// /// <code><![CDATA[ /// import * as PRIVATELINK from '@alicloud/ros-cdk-privatelink'; /// ]]></code> /// </remarks> [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public class NamespaceDoc { } }
28.736842
93
0.661172
[ "Apache-2.0" ]
piotr-kalanski/Resource-Orchestration-Service-Cloud-Development-Kit
multiple-languages/dotnet/AlibabaCloud.SDK.ROS.CDK.Privatelink/AlibabaCloud/SDK/ROS/CDK/Privatelink/NamespaceDoc.cs
546
C#
using System; using System.Diagnostics; using System.Globalization; using System.Linq; using System.Net; using System.Reflection; using System.Web.Http; using System.Web.Http.Cors; using System.Web.Http.Description; using EventFeedback.Common; using EventFeedback.Domain; using EventFeedback.Web.Api.Models; namespace EventFeedback.Web.Api.Controllers { [Authorize(Roles = "Administrator")] [RoutePrefix("api/v1/events/{eventId}/report")] [EnableCors(origins: "*", headers: "*", methods: "*")] [ExceptionHandling] public class EventReportsController : ApiController { private readonly TraceSource _traceSource = new TraceSource(Assembly.GetExecutingAssembly().GetName().Name); private readonly DataContext _context; public EventReportsController(DataContext context) { Guard.Against<ArgumentNullException>(context == null, "context cannot be null"); _context = context; } [HttpGet] [Route("")] [ResponseType(typeof(EventReportModel))] public IHttpActionResult Get(int eventId, [FromUri] string filter = "") { //Thread.Sleep(1500); Guard.Against<ArgumentException>(eventId == 0, "eventId cannot be empty or zero"); var ev = _context.Events .Include("FeedbackDefinition") .Include("Sessions").Include("Sessions.FeedbackDefinition") //.Where(d => !(d.Active != null && !(bool) d.Active)) .Where(e => !(e.Deleted != null && (bool) e.Deleted)) .FirstOrDefault(e => e.Id == eventId); if (ev == null) return StatusCode(HttpStatusCode.NotFound); var sIds = ev.Sessions.Select(s => s.Id); var eventFeedbacks = _context.Feedbacks.Where(f => f.EventId == eventId) //.Where(d => !(d.Active != null && !(bool) d.Active)) .Where(f => !(f.Deleted != null && (bool) f.Deleted)).ToList(); var sessionFeedbacks = _context.Feedbacks.Where(f => sIds.Contains(f.SessionId.Value)) //.Where(d => !(d.Active != null && !(bool) d.Active)) .Where(f => !(f.Deleted != null && (bool) f.Deleted)).ToList(); var result = new EventReportModel { Id = ev.Id, Title = ev.Title, StartDate = ev.StartDate, EndDate = ev.EndDate, Location = ev.Location, AverageRate = Math.Round(eventFeedbacks .Where(f => f.UpdateAverageRate().IsDouble()) .Select(f => f.UpdateAverageRate().ToDouble()).DefaultIfEmpty() .Average(), 2).ToString(CultureInfo.InvariantCulture), QuesstionTitle0 = ev.FeedbackDefinition.Title0, QuesstionTitle1 = ev.FeedbackDefinition.Title1, QuesstionTitle2 = ev.FeedbackDefinition.Title2, QuesstionTitle3 = ev.FeedbackDefinition.Title3, QuesstionTitle4 = ev.FeedbackDefinition.Title4, QuesstionTitle5 = ev.FeedbackDefinition.Title5, QuesstionTitle6 = ev.FeedbackDefinition.Title6, QuesstionTitle7 = ev.FeedbackDefinition.Title7, QuesstionTitle8 = ev.FeedbackDefinition.Title8, QuesstionTitle9 = ev.FeedbackDefinition.Title9, Feedbacks = eventFeedbacks.Select(f => new FeedbackReportModel { Id = f.Id, AverageRate = f.UpdateAverageRate(), CreateDate = f.CreateDate, Answer0 = f.Answer0, Answer1 = f.Answer1, Answer2 = f.Answer2, Answer3 = f.Answer3, Answer4 = f.Answer4, Answer5 = f.Answer5, Answer6 = f.Answer6, Answer7 = f.Answer7, Answer8 = f.Answer8, Answer9 = f.Answer9, MaxRateQuestion0 = MaxRate(ev.FeedbackDefinition.QuestionType0).ToString(CultureInfo.InvariantCulture), MaxRateQuestion1 = MaxRate(ev.FeedbackDefinition.QuestionType1).ToString(CultureInfo.InvariantCulture), MaxRateQuestion2 = MaxRate(ev.FeedbackDefinition.QuestionType2).ToString(CultureInfo.InvariantCulture), MaxRateQuestion3 = MaxRate(ev.FeedbackDefinition.QuestionType3).ToString(CultureInfo.InvariantCulture), MaxRateQuestion4 = MaxRate(ev.FeedbackDefinition.QuestionType4).ToString(CultureInfo.InvariantCulture), MaxRateQuestion5 = MaxRate(ev.FeedbackDefinition.QuestionType5).ToString(CultureInfo.InvariantCulture), MaxRateQuestion6 = MaxRate(ev.FeedbackDefinition.QuestionType6).ToString(CultureInfo.InvariantCulture), MaxRateQuestion7 = MaxRate(ev.FeedbackDefinition.QuestionType7).ToString(CultureInfo.InvariantCulture), MaxRateQuestion8 = MaxRate(ev.FeedbackDefinition.QuestionType8).ToString(CultureInfo.InvariantCulture), MaxRateQuestion9 = MaxRate(ev.FeedbackDefinition.QuestionType9).ToString(CultureInfo.InvariantCulture), }), Sessions = ev.Sessions .Where(s => !(s.Deleted != null && (bool)s.Deleted)) .Select(s => new SessionReportModel { Id = s.Id, Title = s.Title, SpeakerList = s.SpeakerList, StartDate = s.StartDate, EndDate = s.EndDate, Location = s.Location, FeedbackAllowed = !(s.FeedbackAllowed != null && !(bool)s.FeedbackAllowed), AverageRate = Math.Round(sessionFeedbacks.NullToEmpty().Where(f => f.SessionId == s.Id) .Where(f => f.UpdateAverageRate().IsDouble()) .Select(f => f.UpdateAverageRate().ToDouble()).DefaultIfEmpty() .Average(), 2).ToString(CultureInfo.InvariantCulture), AverageRateAnswer0 = Math.Round(sessionFeedbacks.NullToEmpty().Where(f => f.SessionId == s.Id) .Where(f => f.Answer0.IsDouble()) .Select(f => f.Answer0.ToDouble()).DefaultIfEmpty() .Average(), 2).ToString(CultureInfo.InvariantCulture), MaxRateQuestion0 = s.FeedbackDefinition == null ? "" : MaxRate(s.FeedbackDefinition.QuestionType0).ToString(CultureInfo.InvariantCulture), AverageRateAnswer1 = Math.Round(sessionFeedbacks.NullToEmpty().Where(f => f.SessionId == s.Id) .Where(f => f.Answer1.IsDouble()) .Select(f => f.Answer1.ToDouble()).DefaultIfEmpty() .Average(), 2).ToString(CultureInfo.InvariantCulture), MaxRateQuestion1 = s.FeedbackDefinition == null ? "" : MaxRate(s.FeedbackDefinition.QuestionType1).ToString(CultureInfo.InvariantCulture), AverageRateAnswer2 = Math.Round(sessionFeedbacks.NullToEmpty().Where(f => f.SessionId == s.Id) .Where(f => f.Answer2.IsDouble()) .Select(f => f.Answer2.ToDouble()).DefaultIfEmpty() .Average(), 2).ToString(CultureInfo.InvariantCulture), MaxRateQuestion2 = s.FeedbackDefinition == null ? "" : MaxRate(s.FeedbackDefinition.QuestionType2).ToString(CultureInfo.InvariantCulture), AverageRateAnswer3 = Math.Round(sessionFeedbacks.NullToEmpty().Where(f => f.SessionId == s.Id) .Where(f => f.Answer3.IsDouble()) .Select(f => f.Answer3.ToDouble()).DefaultIfEmpty() .Average(), 2).ToString(CultureInfo.InvariantCulture), MaxRateQuestion3 = s.FeedbackDefinition == null ? "" : MaxRate(s.FeedbackDefinition.QuestionType3).ToString(CultureInfo.InvariantCulture), AverageRateAnswer4 = Math.Round(sessionFeedbacks.NullToEmpty().Where(f => f.SessionId == s.Id) .Where(f => f.Answer4.IsDouble()) .Select(f => f.Answer4.ToDouble()).DefaultIfEmpty() .Average(), 2).ToString(CultureInfo.InvariantCulture), MaxRateQuestion4 = s.FeedbackDefinition == null ? "" : MaxRate(s.FeedbackDefinition.QuestionType4).ToString(CultureInfo.InvariantCulture), AverageRateAnswer5 = Math.Round(sessionFeedbacks.NullToEmpty().Where(f => f.SessionId == s.Id) .Where(f => f.Answer5.IsDouble()) .Select(f => f.Answer6.ToDouble()).DefaultIfEmpty() .Average(), 2).ToString(CultureInfo.InvariantCulture), MaxRateQuestion5 = s.FeedbackDefinition == null ? "" : MaxRate(s.FeedbackDefinition.QuestionType5).ToString(CultureInfo.InvariantCulture), AverageRateAnswer6 = Math.Round(sessionFeedbacks.NullToEmpty().Where(f => f.SessionId == s.Id) .Where(f => f.Answer6.IsDouble()) .Select(f => f.Answer6.ToDouble()).DefaultIfEmpty() .Average(), 2).ToString(CultureInfo.InvariantCulture), MaxRateQuestion6 = s.FeedbackDefinition == null ? "" : MaxRate(s.FeedbackDefinition.QuestionType6).ToString(CultureInfo.InvariantCulture), AverageRateAnswer7 = Math.Round(sessionFeedbacks.NullToEmpty().Where(f => f.SessionId == s.Id) .Where(f => f.Answer7.IsDouble()) .Select(f => f.Answer7.ToDouble()).DefaultIfEmpty() .Average(), 2).ToString(CultureInfo.InvariantCulture), MaxRateQuestion7 = s.FeedbackDefinition == null ? "" : MaxRate(s.FeedbackDefinition.QuestionType7).ToString(CultureInfo.InvariantCulture), AverageRateAnswer8 = Math.Round(sessionFeedbacks.NullToEmpty().Where(f => f.SessionId == s.Id) .Where(f => f.Answer8.IsDouble()) .Select(f => f.Answer8.ToDouble()).DefaultIfEmpty() .Average(), 2).ToString(CultureInfo.InvariantCulture), MaxRateQuestion8 = s.FeedbackDefinition == null ? "" : MaxRate(s.FeedbackDefinition.QuestionType8).ToString(CultureInfo.InvariantCulture), AverageRateAnswer9 = Math.Round(sessionFeedbacks.NullToEmpty().Where(f => f.SessionId == s.Id) .Where(f => f.Answer9.IsDouble()) .Select(f => f.Answer9.ToDouble()).DefaultIfEmpty() .Average(), 2).ToString(CultureInfo.InvariantCulture), MaxRateQuestion9 = s.FeedbackDefinition == null ? "" : MaxRate(s.FeedbackDefinition.QuestionType9).ToString(CultureInfo.InvariantCulture), QuesstionTitle0 = s.FeedbackDefinition == null ? "" : s.FeedbackDefinition.Title0, QuesstionTitle1 = s.FeedbackDefinition == null ? "" : s.FeedbackDefinition.Title1, QuesstionTitle2 = s.FeedbackDefinition == null ? "" : s.FeedbackDefinition.Title2, QuesstionTitle3 = s.FeedbackDefinition == null ? "" : s.FeedbackDefinition.Title3, QuesstionTitle4 = s.FeedbackDefinition == null ? "" : s.FeedbackDefinition.Title4, QuesstionTitle5 = s.FeedbackDefinition == null ? "" : s.FeedbackDefinition.Title5, QuesstionTitle6 = s.FeedbackDefinition == null ? "" : s.FeedbackDefinition.Title6, QuesstionTitle7 = s.FeedbackDefinition == null ? "" : s.FeedbackDefinition.Title7, QuesstionTitle8 = s.FeedbackDefinition == null ? "" : s.FeedbackDefinition.Title8, QuesstionTitle9 = s.FeedbackDefinition == null ? "" : s.FeedbackDefinition.Title9, Feedbacks = sessionFeedbacks.NullToEmpty() .Where(f=> f.SessionId == s.Id) .Select(f => new FeedbackReportModel { Id = f.Id, AverageRate = f.UpdateAverageRate(), CreateDate = f.CreateDate, Answer0 = f.Answer0, Answer1 = f.Answer1, Answer2 = f.Answer2, Answer3 = f.Answer3, Answer4 = f.Answer4, Answer5 = f.Answer5, Answer6 = f.Answer6, Answer7 = f.Answer7, Answer8 = f.Answer8, Answer9 = f.Answer9, MaxRateQuestion0 = MaxRate(s.FeedbackDefinition == null ? FeedbackQuestionType.Freetext : s.FeedbackDefinition.QuestionType0).ToString(CultureInfo.InvariantCulture), MaxRateQuestion1 = MaxRate(s.FeedbackDefinition == null ? FeedbackQuestionType.Freetext : s.FeedbackDefinition.QuestionType1).ToString(CultureInfo.InvariantCulture), MaxRateQuestion2 = MaxRate(s.FeedbackDefinition == null ? FeedbackQuestionType.Freetext : s.FeedbackDefinition.QuestionType2).ToString(CultureInfo.InvariantCulture), MaxRateQuestion3 = MaxRate(s.FeedbackDefinition == null ? FeedbackQuestionType.Freetext : s.FeedbackDefinition.QuestionType3).ToString(CultureInfo.InvariantCulture), MaxRateQuestion4 = MaxRate(s.FeedbackDefinition == null ? FeedbackQuestionType.Freetext : s.FeedbackDefinition.QuestionType4).ToString(CultureInfo.InvariantCulture), MaxRateQuestion5 = MaxRate(s.FeedbackDefinition == null ? FeedbackQuestionType.Freetext : s.FeedbackDefinition.QuestionType5).ToString(CultureInfo.InvariantCulture), MaxRateQuestion6 = MaxRate(s.FeedbackDefinition == null ? FeedbackQuestionType.Freetext : s.FeedbackDefinition.QuestionType6).ToString(CultureInfo.InvariantCulture), MaxRateQuestion7 = MaxRate(s.FeedbackDefinition == null ? FeedbackQuestionType.Freetext : s.FeedbackDefinition.QuestionType7).ToString(CultureInfo.InvariantCulture), MaxRateQuestion8 = MaxRate(s.FeedbackDefinition == null ? FeedbackQuestionType.Freetext : s.FeedbackDefinition.QuestionType8).ToString(CultureInfo.InvariantCulture), MaxRateQuestion9 = MaxRate(s.FeedbackDefinition == null ? FeedbackQuestionType.Freetext : s.FeedbackDefinition.QuestionType9).ToString(CultureInfo.InvariantCulture), }) }).OrderBy(s=>s.StartDate) }; return Ok(result); } private int MaxRate(FeedbackQuestionType? type) { return type == FeedbackQuestionType.ThreeStarRate ? 3 : type == FeedbackQuestionType.FiveStarRate ? 5 : type == FeedbackQuestionType.TenStarRate ? 10 : 0; } } }
74.472637
193
0.602579
[ "MIT" ]
vip32/eventfeedback
Web.Api/Controllers/EventReportsController.cs
14,971
C#
#region License /* * Copyright 2002-2012 the original author or authors. * * Licensed 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. */ #endregion using System; using System.IO; using System.Collections.Generic; using Spring.Util; namespace Spring.Http.Client.Interceptor { /// <summary> /// Wrapper for an <see cref="IClientHttpRequest"/> that has support /// for <see cref="IClientHttpRequestInterceptor"/>s. /// </summary> /// <author>Arjen Poutsma</author> /// <author>Bruno Baia</author> public class InterceptingClientHttpRequest : IClientHttpRequest { private IClientHttpRequest targetRequest; private IEnumerable<IClientHttpRequestInterceptor> interceptors; private Action<Stream> body; /// <summary> /// Gets the intercepted request. /// </summary> public IClientHttpRequest TargetRequest { get { return this.targetRequest; } } /// <summary> /// Creates a new instance of the <see cref="InterceptingClientHttpRequest"/> with the given parameters. /// </summary> /// <param name="request">The request to wrap.</param> /// <param name="interceptors">The interceptors that are to be applied. Can be <c>null</c>.</param> public InterceptingClientHttpRequest( IClientHttpRequest request, IEnumerable<IClientHttpRequestInterceptor> interceptors) { ArgumentUtils.AssertNotNull(request, "request"); this.targetRequest = request; this.interceptors = interceptors != null ? interceptors : new IClientHttpRequestInterceptor[0]; } #region IClientHttpRequest Members /// <summary> /// Gets the HTTP method of the request. /// </summary> public HttpMethod Method { get { return this.targetRequest.Method; } } /// <summary> /// Gets the URI of the request. /// </summary> public Uri Uri { get { return this.targetRequest.Uri; } } /// <summary> /// Gets the message headers. /// </summary> public HttpHeaders Headers { get { return this.targetRequest.Headers; } } /// <summary> /// Gets or sets the delegate that writes the body message as a stream. /// </summary> public Action<Stream> Body { get { return this.body; } set { this.body = value; this.targetRequest.Body = value; } } /// <summary> /// Execute this request, resulting in a <see cref="IClientHttpResponse" /> that can be read. /// </summary> /// <returns>The response result of the execution</returns> public IClientHttpResponse Execute() { RequestSyncExecution requestSyncExecution = new RequestSyncExecution(this.targetRequest, this.body, this.interceptors); return requestSyncExecution.Execute(); } /// <summary> /// Execute this request asynchronously. /// </summary> /// <param name="state"> /// An optional user-defined object that is passed to the method invoked /// when the asynchronous operation completes. /// </param> /// <param name="executeCompleted"> /// The <see cref="Action{ClientHttpRequestCompletedEventArgs}"/> to perform when the asynchronous execution completes. /// </param> public void ExecuteAsync(object state, Action<ClientHttpRequestCompletedEventArgs> executeCompleted) { RequestAsyncExecution requestAsyncExecution = new RequestAsyncExecution(this.targetRequest, this.body, this.interceptors, state, executeCompleted); requestAsyncExecution.ExecuteAsync(); } /// <summary> /// Cancels a pending asynchronous operation. /// </summary> public void CancelAsync() { this.targetRequest.CancelAsync(); } #endregion #region Inner class definitions private abstract class AbstractRequestContext : IClientHttpRequestContext { protected IClientHttpRequest delegateRequest; protected Action<Stream> body; protected IEnumerator<IClientHttpRequestInterceptor> enumerator; protected AbstractRequestContext( IClientHttpRequest delegateRequest, Action<Stream> body, IEnumerable<IClientHttpRequestInterceptor> interceptors) { this.delegateRequest = delegateRequest; this.body = body; this.enumerator = interceptors.GetEnumerator(); } public HttpMethod Method { get { return this.delegateRequest.Method; } } public Uri Uri { get { return this.delegateRequest.Uri; } } public HttpHeaders Headers { get { return this.delegateRequest.Headers; } } public Action<Stream> Body { get { return this.body; } set { this.delegateRequest.Body = value; } } } private sealed class RequestSyncExecution : AbstractRequestContext, IClientHttpRequestSyncExecution { public RequestSyncExecution( IClientHttpRequest delegateRequest, Action<Stream> body, IEnumerable<IClientHttpRequestInterceptor> interceptors) : base(delegateRequest, body, interceptors) { } public IClientHttpResponse Execute() { if (enumerator.MoveNext()) { if (enumerator.Current is IClientHttpRequestSyncInterceptor) { return ((IClientHttpRequestSyncInterceptor)enumerator.Current).Execute(this); } if (enumerator.Current is IClientHttpRequestBeforeInterceptor) { ((IClientHttpRequestBeforeInterceptor)enumerator.Current).BeforeExecute(this); } return this.Execute(); } else { return this.delegateRequest.Execute(); } } } private sealed class RequestAsyncExecution : AbstractRequestContext, IClientHttpRequestAsyncExecution { private object asyncState; private Action<ClientHttpRequestCompletedEventArgs> interceptedExecuteCompleted; private IList<Action<IClientHttpResponseAsyncContext>> executeCompletedDelegates; public RequestAsyncExecution( IClientHttpRequest delegateRequest, Action<Stream> body, IEnumerable<IClientHttpRequestInterceptor> interceptors, object asyncState, Action<ClientHttpRequestCompletedEventArgs> executeCompleted) : base(delegateRequest, body, interceptors) { this.asyncState = asyncState; this.interceptedExecuteCompleted = executeCompleted; this.executeCompletedDelegates = new List<Action<IClientHttpResponseAsyncContext>>(); } public object AsyncState { get { return this.asyncState; } set { this.asyncState = value; } } public void ExecuteAsync() { this.ExecuteAsync(null); } public void ExecuteAsync(Action<IClientHttpResponseAsyncContext> executeCompleted) { if (executeCompleted != null) { this.executeCompletedDelegates.Insert(0, executeCompleted); } if (enumerator.MoveNext()) { if (enumerator.Current is IClientHttpRequestAsyncInterceptor) { ((IClientHttpRequestAsyncInterceptor)enumerator.Current).ExecuteAsync(this); } else { if (enumerator.Current is IClientHttpRequestBeforeInterceptor) { ((IClientHttpRequestBeforeInterceptor)enumerator.Current).BeforeExecute(this); } this.ExecuteAsync(null); } } else { this.delegateRequest.ExecuteAsync(this.asyncState, delegate(ClientHttpRequestCompletedEventArgs args) { ResponseAsyncContext responseAsyncContext = new ResponseAsyncContext(args); foreach (Action<IClientHttpResponseAsyncContext> action in this.executeCompletedDelegates) { action(responseAsyncContext); } if (this.interceptedExecuteCompleted != null) { interceptedExecuteCompleted(responseAsyncContext.GetCompletedEventArgs()); } }); } } } private sealed class ResponseAsyncContext : IClientHttpResponseAsyncContext { private bool hasChanged; private bool cancelled; private Exception error; private IClientHttpResponse response; private object userState; private ClientHttpRequestCompletedEventArgs completedEventArgs; public bool Cancelled { get { return this.cancelled; } set { this.hasChanged = true; this.cancelled = value; } } public Exception Error { get { return this.error; } set { this.hasChanged = true; this.error = value; } } public IClientHttpResponse Response { get { return this.response; } set { this.hasChanged = true; this.response = value; } } public object UserState { get { return this.userState; } set { this.hasChanged = true; this.userState = value; } } public ResponseAsyncContext(ClientHttpRequestCompletedEventArgs completedEventArgs) { this.cancelled = completedEventArgs.Cancelled; this.error = completedEventArgs.Error; if (this.error == null) { this.response = completedEventArgs.Response; } this.userState = completedEventArgs.UserState; this.completedEventArgs = completedEventArgs; } public ClientHttpRequestCompletedEventArgs GetCompletedEventArgs() { if (!this.hasChanged) { return this.completedEventArgs; } else { return new ClientHttpRequestCompletedEventArgs(this.response, this.error, this.cancelled, this.userState); } } } #endregion } }
34.794444
159
0.540077
[ "Apache-2.0" ]
kamiff/spring-net-rest
netstandard/Spring.Rest/Http/Client/Interceptor/InterceptingClientHttpRequest.cs
12,528
C#
using System; using System.CodeDom; using System.Collections.Generic; using Fhi.Controls.Indicators.EcosystemVitality; using Fhi.Controls.Indicators.EcosystemVitality.DamWizard; using FhiModel.Common; using FhiModel.EcosystemVitality.DendreticConnectivity; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Tests { [TestClass] public class ConnectivityIndicatorTests { private static readonly List<DciTestSet> _testSets = new List<DciTestSet> { new DciTestSet { Outflow = new Location { Longitude = 603021.8638, Latitude = 1497007.872 }, Rivers = @"..\..\..\TestData\river2.csv", Dams = @"..\..\..\TestData\dams2_update.csv", Network = @"..\..\..\TestData\river_result2.csv", Segments = @"..\..\..\TestData\pd2.csv", DciP = .2061348, DciD = .3614238, Wkid = 32648 }, new DciTestSet { Outflow = new Location { Longitude = 603021.8638, Latitude = 1497007.872 }, Rivers = @"..\..\..\TestData\river1.csv", Dams = @"..\..\..\TestData\dams1.csv", Network = @"..\..\..\TestData\river_result1.csv", Segments = @"..\..\..\TestData\pd1.csv", DciP = .5458785, DciD = .6558908, Wkid = 32648 } }; [TestMethod] public void PotadromousIndicatorTest() { foreach (var test in _testSets) { var indicator = new ConnectivityIndicator {Reaches = GetReaches(test)}; using (new Measure("DciP")) Assert.AreEqual(indicator.DciP, (Int32) Math.Round(test.DciP * 100, 0)); } } [TestMethod] public void DiadromousIndicatorTest() { foreach (var test in _testSets) { var indicator = new ConnectivityIndicator { Reaches = GetReaches(test)}; using (new Measure("DciD")) Assert.AreEqual(indicator.DciD, (Int32) Math.Round(test.DciD * 100, 0)); } } private List<Reach> GetReaches(DciTestSet set) { var ir = new ImportReachesViewModel { Wkid = set.Wkid }; using (new Measure("River Import")) { ir.RiverCsvImport(set.Rivers); foreach (var reach in ir.Reaches) { foreach (var node in reach.Nodes) { if (!node.Location.Match(set.Outflow)) continue; reach.Outlet = true; break; } if (reach.Outlet) break; } ir.Process(); } using (new Measure("Dam Import")) { var dams = new Step1ViewModel(ir.Reaches, set.Wkid, null); dams.ImportCsv(set.Dams); } return ir.Reaches; } } }
31.122642
92
0.470446
[ "MIT" ]
sustainable-software/FHI-Toolbox
Desktop/Tests/ConnectivityIndicatorTests.cs
3,299
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Panosen.CodeDom.Tag.Vue.Element { /// <summary> /// el-pagination /// </summary> public class ElPaginationComponent : ElementComponent { /// <summary> /// el-pagination /// </summary> public override string Name { get; set; } = "el-pagination"; } /// <summary> /// ElPaginationLayout /// </summary> [Flags] public enum ElPaginationLayout { /// <summary> /// 无 /// </summary> None = 0, /// <summary> /// total /// </summary> Total = 1, /// <summary> /// sizes /// </summary> Sizes = 2, /// <summary> /// prev /// </summary> Prev = 4, /// <summary> /// next /// </summary> Next = 8, /// <summary> /// pager /// </summary> Pager = 16, /// <summary> /// 跳转到...页 /// </summary> Jumper = 32 } /// <summary> /// ElPaginationComponentExtension /// </summary> public static class ElPaginationComponentExtension { /// <summary> /// background /// </summary> public static TElPaginationComponent Background<TElPaginationComponent>(this TElPaginationComponent elPaginationComponent) where TElPaginationComponent : ElPaginationComponent { elPaginationComponent.AddAttribute("background"); return elPaginationComponent; } /// <summary> /// @size-change /// </summary> public static TElPaginationComponent OnSizeChange<TElPaginationComponent>(this TElPaginationComponent elPaginationComponent, string sizeChange) where TElPaginationComponent : ElPaginationComponent { elPaginationComponent.AddProperty("@size-change", sizeChange); return elPaginationComponent; } /// <summary> /// @current-change /// </summary> public static TElPaginationComponent OnCurrentChange<TElPaginationComponent>(this TElPaginationComponent elPaginationComponent, string currentChange) where TElPaginationComponent : ElPaginationComponent { elPaginationComponent.AddProperty("@current-change", currentChange); return elPaginationComponent; } /// <summary> /// :current-page /// </summary> public static TElPaginationComponent _CurrentPage<TElPaginationComponent>(this TElPaginationComponent elPaginationComponent, string currentPage) where TElPaginationComponent : ElPaginationComponent { elPaginationComponent.AddProperty(":current-page", currentPage); return elPaginationComponent; } /// <summary> /// :page-sizes /// </summary> public static TElPaginationComponent _PageSizes<TElPaginationComponent>(this TElPaginationComponent elPaginationComponent, params int[] pageSizes) where TElPaginationComponent : ElPaginationComponent { if (pageSizes == null || pageSizes.Length == 0) { return elPaginationComponent; } elPaginationComponent.AddProperty(":page-sizes", $"[{string.Join(", ", pageSizes)}]"); return elPaginationComponent; } /// <summary> /// :page-size /// </summary> public static TElPaginationComponent _PageSize<TElPaginationComponent>(this TElPaginationComponent elPaginationComponent, string pageSize) where TElPaginationComponent : ElPaginationComponent { elPaginationComponent.AddProperty(":page-size", pageSize); return elPaginationComponent; } /// <summary> /// layout /// </summary> public static TElPaginationComponent Layout<TElPaginationComponent>(this TElPaginationComponent elPaginationComponent, ElPaginationLayout elPaginationLayout) where TElPaginationComponent : ElPaginationComponent { if (elPaginationLayout == ElPaginationLayout.None) { return elPaginationComponent; } elPaginationComponent.AddProperty("layout", elPaginationLayout.ToString().ToLower()); return elPaginationComponent; } /// <summary> /// :total /// </summary> public static TElPaginationComponent _Total<TElPaginationComponent>(this TElPaginationComponent elPaginationComponent, string total) where TElPaginationComponent : ElPaginationComponent { elPaginationComponent.AddProperty(":total", total); return elPaginationComponent; } /// <summary> /// :hide-on-single-page /// </summary> public static TElPaginationComponent _HideOnSinglePage<TElPaginationComponent>(this TElPaginationComponent elPaginationComponent, BooleanValue hideOnSinglePage) where TElPaginationComponent : ElPaginationComponent { elPaginationComponent.AddProperty(":hide-on-single-page", hideOnSinglePage.Value); return elPaginationComponent; } } }
30.666667
168
0.606669
[ "MIT" ]
panosen/panosen-codedom-tag-vue
Panosen.CodeDom.Tag.Vue.Element/ElPaginationComponent.cs
5,440
C#
using System.Collections; using System.Collections.Generic; using UnityEngine.UI; using UnityEngine; // Needed namespace using GameSpark; public class SparkSoundDemo : GameSparkDemoSceneTemplate { // Maneger Instance SoundManeger soundManeger; UIManager ui; [SerializeField] Slider musicSlider, soundSlider, noiseSlider; [SerializeField] GameObject sceneRoot; private void Start() { // Get Maneger Instance soundManeger = SoundManeger.GetInstance(); ui = UIManager.GetInstance(); } public override void StartDemo() { ui.OpenUI("SoundDemo"); sceneRoot.SetActive(true); } public override void EndDemo() { ui.CloseUI("SoundDemo"); soundManeger.StopMusic(); soundManeger.StopSound(); sceneRoot.SetActive(false); } // Play public void PlayMusic(string musicName) { soundManeger.PlayMusic("Main Music", musicName); } public void PlayNoise(string musicName) { soundManeger.PlayMusic("Noise", musicName); } public void PlaySound(string soundName) { soundManeger.PlaySound("Sound FX 1", soundName); } // Stop public void StopMusic() { soundManeger.StopSource("Main Music"); } public void StopNoise() { soundManeger.StopSource("Noise"); } public void StopSound() { soundManeger.StopSource("Sound FX 1"); } // On/off public void MusicOn() { soundManeger.MusicOn(); } public void MusicOff() { soundManeger.MusicOff(); } public void SoundOn() { soundManeger.SoundOn(); } public void SoundOff() { soundManeger.SoundOff(); } // Set Volume public void SetMusicVolume(float value) { soundManeger.SetMusicVolume(value); } public void SetMusicVolume() { soundManeger.SetMusicVolume(musicSlider.value); } public void SetSoundVolume() { soundManeger.SetSoundValume(soundSlider.value); } public void SetNoiseVolume() { soundManeger.SetSourceVolume("Noise", noiseSlider.value); } }
19.226087
66
0.616915
[ "CC0-1.0" ]
yusufkaraaslan/GameSpark
Assets/yUSyUS/Game Spark/Demo/Scrips/Sound Demo/SparkSoundDemo.cs
2,211
C#
namespace org.secc.Equip.Migrations { using Rock.Plugin; [MigrationNumber( 3, "1.8.0" )] public partial class CourseImage : Migration { public override void Up() { AddColumn( "dbo._org_secc_Equip_Course", "ImageId", c => c.Int( nullable: true ) ); } public override void Down() { DropColumn( "dbo._org_secc_Equip_Course", "ImageId" ); } } }
22.947368
95
0.561927
[ "ECL-2.0" ]
secc/RockPlugins
Plugins/org.secc.Equip/Migrations/003_CourseImage.cs
438
C#
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("01. Charity Marathon")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("01. Charity Marathon")] [assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("d6660a75-006b-454f-a8d2-5cb14fdd778e")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
38.189189
84
0.743808
[ "MIT" ]
viktor4o4o/Homework
Exam Preparation II -Taking a Sample Exam/01. Charity Marathon/Properties/AssemblyInfo.cs
1,416
C#
// // Copyright 2015 Blu Age Corporation - Plano, Texas // // Licensed 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 Microsoft.VisualStudio.TestTools.UnitTesting; using Summer.Batch.Extra.Utils; using System; using System.Linq; using Assert = Microsoft.VisualStudio.TestTools.UnitTesting.Assert; namespace Summer.Batch.CoreTests.Util { [TestClass] public class StringUtilsTest { #region Test concat. private static readonly string concat1 = StringUtils.Concat("bonjour ", "ça va ?"); private static readonly string concat2 = StringUtils.Concat("bonjour ", null); private static readonly string concat3 = StringUtils.Concat(null, "ça va ?"); [TestMethod] public void StringUtils_ConcatTest() { Assert.IsTrue(concat1.Equals("bonjour ça va ?")); Assert.IsTrue(concat2.Equals("bonjour ")); Assert.IsTrue(concat3.Equals("ça va ?")); } #endregion #region Test IsValidEmailAddress. private static readonly bool email1 = StringUtils.IsValidEmailAddress("test@netfective.com"); private static readonly bool email2 = StringUtils.IsValidEmailAddress("te.st@netfective.com"); private static readonly bool email3 = StringUtils.IsValidEmailAddress("te_st@netfective.com"); private static readonly bool email4 = StringUtils.IsValidEmailAddress("test-netfective.com"); private static readonly bool email5 = StringUtils.IsValidEmailAddress("test.netfective.com"); private static readonly bool email6 = StringUtils.IsValidEmailAddress(".com"); [TestMethod] public void StringUtils_IsValidEmailAddressTest() { Assert.IsTrue(email1); Assert.IsTrue(email2); Assert.IsTrue(email3); Assert.IsFalse(email4); Assert.IsFalse(email5); Assert.IsFalse(email6); } #endregion #region Test IsDate. private static readonly bool date1 = StringUtils.IsDate("010189"); private static readonly bool date2 = StringUtils.IsDate("010119"); private static readonly bool date3 = StringUtils.IsDate("01/01/1989"); private static readonly bool date4 = StringUtils.IsDate("31/02/2012"); private static readonly bool date5 = StringUtils.IsDate("01011989"); private static readonly bool date6 = StringUtils.IsDate("01/01/19"); private static readonly bool date7 = StringUtils.IsDate("01/01/89"); [TestMethod] public void StringUtils_IsDateTest() { Assert.IsFalse(date1); Assert.IsFalse(date2); Assert.IsTrue(date3); Assert.IsFalse(date4); Assert.IsFalse(date5); Assert.IsFalse(date6); Assert.IsFalse(date7); } #endregion #region Tests isDouble, isInteger. private static readonly bool isdouble1 = StringUtils.IsDouble("0"); private static readonly bool isdouble2 = StringUtils.IsDouble("0,0"); private static readonly bool isdouble3 = StringUtils.IsDouble("1"); private static readonly bool isdouble4 = StringUtils.IsDouble("1,0"); private static readonly bool isdouble5 = StringUtils.IsDouble("-1"); private static readonly bool isdouble6 = StringUtils.IsDouble("-1,0"); private static readonly bool isdouble7 = StringUtils.IsDouble("544867,454218"); private static readonly bool isdouble8 = StringUtils.IsDouble("-604867,54"); private static readonly bool isdouble9 = StringUtils.IsDouble("-2147483648"); private static readonly bool isdouble10 = StringUtils.IsDouble("2147483648"); private static readonly bool isdouble11 = StringUtils.IsDouble("1,79769313486232E+308"); private static readonly bool isdouble12 = StringUtils.IsDouble("segdrg"); private static readonly bool isdouble13 = StringUtils.IsDouble(""); private static readonly bool isdouble14 = StringUtils.IsDouble(" "); private static readonly bool isdouble15 = StringUtils.IsDouble(null); private static readonly bool isinteger1 = StringUtils.IsInteger("0"); private static readonly bool isinteger2 = StringUtils.IsInteger("0,0"); private static readonly bool isinteger3 = StringUtils.IsInteger("1"); private static readonly bool isinteger4 = StringUtils.IsInteger("1,0"); private static readonly bool isinteger5 = StringUtils.IsInteger("-1"); private static readonly bool isinteger6 = StringUtils.IsInteger("-1,0"); private static readonly bool isinteger7 = StringUtils.IsInteger("544867,454218"); private static readonly bool isinteger8 = StringUtils.IsInteger("-604867,54"); private static readonly bool isinteger9 = StringUtils.IsInteger("-2147483648"); private static readonly bool isinteger10 = StringUtils.IsInteger("2147483648"); private static readonly bool isinteger11 = StringUtils.IsInteger("1,79769313486232E+308"); private static readonly bool isinteger12 = StringUtils.IsInteger("segdrg"); private static readonly bool isinteger13 = StringUtils.IsInteger(""); private static readonly bool isinteger14 = StringUtils.IsInteger(" "); private static readonly bool isinteger15 = StringUtils.IsInteger(null); [TestMethod] public void StringUtils_IsNumberTest() { Assert.IsTrue(isdouble1); Assert.IsTrue(isdouble2); Assert.IsTrue(isdouble3); Assert.IsTrue(isdouble4); Assert.IsTrue(isdouble5); Assert.IsTrue(isdouble6); Assert.IsTrue(isdouble7); Assert.IsTrue(isdouble8); Assert.IsTrue(isdouble9); Assert.IsTrue(isdouble10); Assert.IsFalse(isdouble11); Assert.IsFalse(isdouble12); Assert.IsFalse(isdouble13); Assert.IsFalse(isdouble14); Assert.IsFalse(isdouble15); Assert.IsTrue(isinteger1); Assert.IsFalse(isinteger2); Assert.IsTrue(isinteger3); Assert.IsFalse(isinteger4); Assert.IsTrue(isinteger5); Assert.IsFalse(isinteger6); Assert.IsFalse(isinteger7); Assert.IsFalse(isinteger8); Assert.IsTrue(isinteger9); Assert.IsFalse(isinteger10); Assert.IsFalse(isinteger11); Assert.IsFalse(isinteger12); Assert.IsFalse(isinteger13); Assert.IsFalse(isinteger14); Assert.IsFalse(isinteger15); } #endregion #region Test CharAt. private static readonly string charatstring1 = "hello"; private static readonly char charat0 = StringUtils.CharAt(charatstring1, 0); private static readonly char charat1 = StringUtils.CharAt(charatstring1, 1); private static readonly char charat2 = StringUtils.CharAt(charatstring1, 2); private static readonly char charat3 = StringUtils.CharAt(charatstring1, 3); private static readonly char charat4 = StringUtils.CharAt(charatstring1, 4); [TestMethod] public void StringUtils_CharAtTest() { Assert.AreEqual('h', charat0); Assert.AreEqual('e', charat1); Assert.AreEqual('l', charat2); Assert.AreEqual('l', charat3); Assert.AreEqual('o', charat4); } #endregion #region Test CompareTo, CompareToIgnoreCase. private static readonly string toCompare1 = "abcdef"; private static readonly string toCompare2 = "AbCdEf"; private static readonly string toCompare3 = "zyxwvu"; private static readonly int compare1 = StringUtils.CompareTo(toCompare1, toCompare1); private static readonly int compare2 = StringUtils.CompareTo(toCompare1, toCompare2); private static readonly int compare3 = StringUtils.CompareTo(toCompare1, toCompare3); private static readonly int compare4 = StringUtils.CompareTo(toCompare3, toCompare1); private static readonly int compareIgnoreCase1 = StringUtils.CompareToIgnoreCase(toCompare1, toCompare1); private static readonly int compareIgnoreCase2 = StringUtils.CompareToIgnoreCase(toCompare1, toCompare2); private static readonly int compareIgnoreCase3 = StringUtils.CompareToIgnoreCase(toCompare1, toCompare3); private static readonly int compareIgnoreCase4 = StringUtils.CompareToIgnoreCase(toCompare3, toCompare1); [TestMethod] public void StringUtils_CompareToTest() { Assert.IsTrue(0 == compare1); Assert.IsTrue(0 != compare2); Assert.IsTrue(0 > compare3); Assert.IsTrue(-1 < compare4); Assert.IsTrue(0 == compareIgnoreCase1); Assert.IsTrue(0 == compareIgnoreCase2); Assert.IsTrue(0 > compareIgnoreCase3); Assert.IsTrue(-1 < compareIgnoreCase4); } #endregion #region Test GetBytes. private static readonly string getbytestest = "bonjour"; private static readonly byte[] bytes1 = StringUtils.GetBytes(getbytestest); [TestMethod] public void StringUtils_GetBytesTest() { byte[] result = { 98, 111, 110, 106, 111, 117, 114 }; Assert.IsTrue(result.SequenceEqual(bytes1)); } #endregion #region Test Lenght. private static readonly bool lenght1 = StringUtils.Length("bonjour") == 7; private static readonly bool lenght2 = StringUtils.Length("Comment ça va ?") == 15; private static readonly bool lenght3 = StringUtils.Length("Nom: \nPrenom: ") == 14; private static readonly bool lenght4 = StringUtils.Length("") == 0; [TestMethod] public void StringUtils_LengthTest() { Assert.IsTrue(lenght1); Assert.IsTrue(lenght2); Assert.IsTrue(lenght3); Assert.IsTrue(lenght4); } #endregion #region Test Matches. private static readonly string matchesregex1 = "Mr\\.?"; private static readonly bool matches1 = StringUtils.Matches("Mr Raymond Bar", matchesregex1); private static readonly bool matches2 = StringUtils.Matches("Mr. Raymond Bar", matchesregex1); private static readonly bool matches3 = StringUtils.Matches("Raymond Bar", matchesregex1); private static readonly string matchesregex2 = "[0-9]{1,3}"; private static readonly bool matches4 = StringUtils.Matches("015", matchesregex2); private static readonly bool matches5 = StringUtils.Matches("0684", matchesregex2); private static readonly bool matches6 = StringUtils.Matches("aaa", matchesregex2); [TestMethod] public void StringUtils_MatchesTest() { Assert.IsTrue(matches1); Assert.IsTrue(matches2); Assert.IsFalse(matches3); Assert.IsTrue(matches4); Assert.IsTrue(matches5); Assert.IsFalse(matches6); } #endregion #region Test Replace(char,string,string), Replace(string,string,string), ReplaceAll, ReplaceFirst, Split. private static readonly string replacetest1 = "héhéhé, hehehe, ahahaah !"; private static readonly bool replacchar1 = StringUtils.Replace(replacetest1, 'e', 'a').Equals("héhéhé, hahaha, ahahaah !"); private static readonly bool replacchar2 = StringUtils.Replace(replacetest1, ',', '!').Equals("héhéhé! hehehe! ahahaah !"); private static readonly bool replacchar3 = StringUtils.Replace(replacetest1, 'h', 'l').Equals("lélélé, lelele, alalaal !"); private static readonly bool replace1 = StringUtils.Replace(replacetest1, "hehehe", "hahaha").Equals("héhéhé, hahaha, ahahaah !"); private static readonly bool replace2 = StringUtils.Replace(replacetest1, ", ", "!!").Equals("héhéhé!!hehehe!!ahahaah !"); private static readonly string replacetest2 = "516dqzdgrd876sefefs1546sefsef878"; private static readonly string replaceregex1 = "[0-9]{3}"; private static readonly bool replaceall1 = StringUtils.ReplaceAll(replacetest2, replaceregex1, "AAA").Equals("AAAdqzdgrdAAAsefefsAAA6sefsefAAA"); private static readonly bool replacefirst1 = StringUtils.ReplaceFirst(replacetest2, replaceregex1, "AAA").Equals("AAAdqzdgrd876sefefs1546sefsef878"); private static readonly string[] split1 = StringUtils.Split(replacetest2, replaceregex1); [TestMethod] public void StringUtils_ReplaceTest() { Assert.IsTrue(replacchar1); Assert.IsTrue(replacchar2); Assert.IsTrue(replacchar3); Assert.IsTrue(replace1); Assert.IsTrue(replace2); Assert.IsTrue(replaceall1); Assert.IsTrue(replacefirst1); Assert.IsTrue(split1[0].Equals("")); Assert.IsTrue(split1[1].Equals("dqzdgrd")); Assert.IsTrue(split1[2].Equals("sefefs")); Assert.IsTrue(split1[3].Equals("6sefsef")); Assert.IsTrue(split1[4].Equals("")); } #endregion #region Test ToCharArray. private static readonly char[] result2 = StringUtils.ToCharArray("salut !"); [TestMethod] public void StringUtils_ToCharArrayTest() { char[] result1 = { 's', 'a', 'l', 'u', 't', ' ', '!' }; Assert.IsTrue(result1.Length == result2.Length); for (int i = 0; i < result1.Length; i++) { Assert.IsTrue(result1[i] == result2[i]); } } #endregion #region Test ConvertIntegerToString(int), ConvertIntegerToString(int,int). private static readonly bool convertint1 = StringUtils.ConvertIntegerTostring(204).Equals("204"); private static readonly bool convertint2 = StringUtils.ConvertIntegerTostring(null).Equals(""); private static readonly bool convertintpad1 = StringUtils.ConvertIntegerTostring(204, 6).Equals("000204"); private static readonly bool convertintpad2 = StringUtils.ConvertIntegerTostring(null, 6).Equals(""); private static readonly bool convertintpad3 = StringUtils.ConvertIntegerTostring(204, null).Equals("204"); [TestMethod] public void StringUtils_ConvertIntegerTostringTest() { Assert.IsTrue(convertint1); Assert.IsTrue(convertint2); Assert.IsTrue(convertintpad1); Assert.IsTrue(convertintpad2); Assert.IsTrue(convertintpad3); } #endregion #region Test IsEmpty, IsNotEmpty, IsBlank, IsNotBlank. private static readonly string emptyblank1 = "bonjour"; private static readonly string emptyblank2 = " "; private static readonly string emptyblank3 = ""; private static readonly string emptyblank4 = null; private static readonly bool isempty1 = StringUtils.IsEmpty(emptyblank1); private static readonly bool isempty2 = StringUtils.IsEmpty(emptyblank2); private static readonly bool isempty3 = StringUtils.IsEmpty(emptyblank3); private static readonly bool isempty4 = StringUtils.IsEmpty(emptyblank4); private static readonly bool isnotempty1 = StringUtils.IsNotEmpty(emptyblank1); private static readonly bool isnotempty2 = StringUtils.IsNotEmpty(emptyblank2); private static readonly bool isnotempty3 = StringUtils.IsNotEmpty(emptyblank3); private static readonly bool isnotempty4 = StringUtils.IsNotEmpty(emptyblank4); private static readonly bool isblank1 = StringUtils.IsBlank(emptyblank1); private static readonly bool isblank2 = StringUtils.IsBlank(emptyblank2); private static readonly bool isblank3 = StringUtils.IsBlank(emptyblank3); private static readonly bool isblank4 = StringUtils.IsBlank(emptyblank4); private static readonly bool isnotblank1 = StringUtils.IsNotBlank(emptyblank1); private static readonly bool isnotblank2 = StringUtils.IsNotBlank(emptyblank2); private static readonly bool isnotblank3 = StringUtils.IsNotBlank(emptyblank3); private static readonly bool isnotblank4 = StringUtils.IsNotBlank(emptyblank4); [TestMethod] public void StringUtils_EmptyBlankTest() { Assert.IsFalse(isempty1); Assert.IsFalse(isempty2); Assert.IsTrue(isempty3); Assert.IsTrue(isempty4); Assert.IsTrue(isnotempty1); Assert.IsTrue(isnotempty2); Assert.IsFalse(isnotempty3); Assert.IsFalse(isnotempty4); Assert.IsFalse(isblank1); Assert.IsTrue(isblank2); Assert.IsTrue(isblank3); Assert.IsTrue(isblank4); Assert.IsTrue(isnotblank1); Assert.IsFalse(isnotblank2); Assert.IsFalse(isnotblank3); Assert.IsFalse(isnotblank4); } #endregion #region Test Trim. private static readonly bool trim1 = StringUtils.Trim(null) == null; private static readonly bool trim2 = StringUtils.Trim("").Equals(""); private static readonly bool trim3 = StringUtils.Trim(" ").Equals(""); private static readonly bool trim4 = StringUtils.Trim("abc").Equals("abc"); private static readonly bool trim5 = StringUtils.Trim(" abc ").Equals("abc"); private static readonly bool trim6 = StringUtils.Trim(" abc abc ").Equals("abc abc"); [TestMethod] public void StringUtils_TrimTest() { Assert.IsTrue(trim1); Assert.IsTrue(trim2); Assert.IsTrue(trim3); Assert.IsTrue(trim4); Assert.IsTrue(trim5); Assert.IsTrue(trim6); } #endregion #region Test AreEquals, EqualsIgnoreCase. private static readonly bool areequals1 = StringUtils.AreEqual(null, null); private static readonly bool areequals2 = StringUtils.AreEqual(null, "abc"); private static readonly bool areequals3 = StringUtils.AreEqual("abc", null); private static readonly bool areequals4 = StringUtils.AreEqual("abc", "abc"); private static readonly bool areequals5 = StringUtils.AreEqual("abc", "ABC"); private static readonly bool areequalsignorecase1 = StringUtils.EqualsIgnoreCase(null, null); private static readonly bool areequalsignorecase2 = StringUtils.EqualsIgnoreCase(null, "abc"); private static readonly bool areequalsignorecase3 = StringUtils.EqualsIgnoreCase("abc", null); private static readonly bool areequalsignorecase4 = StringUtils.EqualsIgnoreCase("abc", "abc"); private static readonly bool areequalsignorecase5 = StringUtils.EqualsIgnoreCase("abc", "ABC"); [TestMethod] public void StringUtils_AreEqualsTest() { Assert.IsTrue(areequals1); Assert.IsFalse(areequals2); Assert.IsFalse(areequals3); Assert.IsTrue(areequals4); Assert.IsFalse(areequals5); Assert.IsTrue(areequalsignorecase1); Assert.IsFalse(areequalsignorecase2); Assert.IsFalse(areequalsignorecase3); Assert.IsTrue(areequalsignorecase4); Assert.IsTrue(areequalsignorecase5); } #endregion #region Test IndexOfTest, LastIndexOfTest. private static readonly bool indexof1 = StringUtils.IndexOf(null, '*') == -1; private static readonly bool indexof2 = StringUtils.IndexOf("", '*') == -1; private static readonly bool indexof3 = StringUtils.IndexOf("aabaabaa", 'a') == 0; private static readonly bool indexof4 = StringUtils.IndexOf("aabaabaa", 'b') == 2; private static readonly bool lastindexof1 = StringUtils.LastIndexOf(null, '*') == -1; private static readonly bool lastindexof2 = StringUtils.LastIndexOf("", '*') == -1; private static readonly bool lastindexof3 = StringUtils.LastIndexOf("aabaabaa", 'a') == 7; private static readonly bool lastindexof4 = StringUtils.LastIndexOf("aabaabaa", 'b') == 5; [TestMethod] public void StringUtils_IndexOfTest() { Assert.IsTrue(indexof1); Assert.IsTrue(indexof2); Assert.IsTrue(indexof3); Assert.IsTrue(indexof4); Assert.IsTrue(lastindexof1); Assert.IsTrue(lastindexof2); Assert.IsTrue(lastindexof3); Assert.IsTrue(lastindexof4); } #endregion #region Test Contains. private static readonly bool contains1 = StringUtils.Contains(null, '*'); private static readonly bool contains2 = StringUtils.Contains("", '*'); private static readonly bool contains3 = StringUtils.Contains("abc", 'a'); private static readonly bool contains4 = StringUtils.Contains("abc", 'z'); [TestMethod] public void StringUtils_ContainsTest() { Assert.IsFalse(contains1); Assert.IsFalse(contains2); Assert.IsTrue(contains3); Assert.IsFalse(contains4); } #endregion #region Test Substring, SubstringBefore, SubstringAfter. private static readonly bool substring1 = StringUtils.Substring(null, '*') == null; private static readonly bool substring2 = StringUtils.Substring("", '*').Equals(""); private static readonly bool substring3 = StringUtils.Substring("abc", 0).Equals("abc"); private static readonly bool substring4 = StringUtils.Substring("abc", 2).Equals("c"); private static readonly bool substring5 = StringUtils.Substring("abc", 4).Equals(""); private static readonly bool substring6 = StringUtils.Substring("abc", -2).Equals("bc"); private static readonly bool substring7 = StringUtils.Substring("abc", -4).Equals("abc"); private static readonly bool substringbefore1 = StringUtils.SubstringBefore(null, "*") == null; private static readonly bool substringbefore2 = StringUtils.SubstringBefore("", "*").Equals(""); private static readonly bool substringbefore3 = StringUtils.SubstringBefore("abc", "a").Equals(""); private static readonly bool substringbefore4 = StringUtils.SubstringBefore("abcba", "b").Equals("a"); private static readonly bool substringbefore5 = StringUtils.SubstringBefore("abc", "c").Equals("ab"); private static readonly bool substringbefore6 = StringUtils.SubstringBefore("abc", "d").Equals("abc"); private static readonly bool substringbefore7 = StringUtils.SubstringBefore("abc", "").Equals(""); private static readonly bool substringbefore8 = StringUtils.SubstringBefore("abc", null).Equals("abc"); private static readonly bool substringafter1 = StringUtils.SubstringAfter(null, "*") == null; private static readonly bool substringafter2 = StringUtils.SubstringAfter("", "*").Equals(""); private static readonly bool substringafter3 = StringUtils.SubstringAfter("*", null).Equals(""); private static readonly bool substringafter4 = StringUtils.SubstringAfter("abc", "a").Equals("bc"); private static readonly bool substringafter5 = StringUtils.SubstringAfter("abcba", "b").Equals("cba"); private static readonly bool substringafter6 = StringUtils.SubstringAfter("abc", "c").Equals(""); private static readonly bool substringafter7 = StringUtils.SubstringAfter("abc", "d").Equals(""); private static readonly bool substringafter8 = StringUtils.SubstringAfter("abc", "").Equals("abc"); private static readonly bool substring11 = StringUtils.Substring("abcd", 1, 2).Equals("bc"); [TestMethod] public void StringUtils_SubstringTest() { Assert.IsTrue(substring1); Assert.IsTrue(substring2); Assert.IsTrue(substring3); Assert.IsTrue(substring4); Assert.IsTrue(substring5); Assert.IsTrue(substring6); Assert.IsTrue(substring7); Assert.IsTrue(substringbefore1); Assert.IsTrue(substringbefore2); Assert.IsTrue(substringbefore3); Assert.IsTrue(substringbefore4); Assert.IsTrue(substringbefore5); Assert.IsTrue(substringbefore6); Assert.IsTrue(substringbefore7); Assert.IsTrue(substringbefore8); Assert.IsTrue(substringafter1); Assert.IsTrue(substringafter2); Assert.IsTrue(substringafter3); Assert.IsTrue(substringafter4); Assert.IsTrue(substringafter5); Assert.IsTrue(substringafter6); Assert.IsTrue(substringafter7); Assert.IsTrue(substringafter8); Assert.IsTrue(substring11); } #endregion #region Test Chomp, Chop, StripEnd. private static readonly bool chomp1 = StringUtils.Chomp(null) == null; private static readonly bool chomp2 = StringUtils.Chomp("").Equals(""); private static readonly bool chomp3 = StringUtils.Chomp("abc \r").Equals("abc "); private static readonly bool chomp4 = StringUtils.Chomp("abc\n").Equals("abc"); private static readonly bool chomp5 = StringUtils.Chomp("abc\r\n").Equals("abc"); private static readonly bool chomp6 = StringUtils.Chomp("abc\r\n\r\n").Equals("abc\r\n"); private static readonly bool chomp7 = StringUtils.Chomp("abc\n\r").Equals("abc\n"); private static readonly bool chomp8 = StringUtils.Chomp("abc\n\rabc").Equals("abc\n\rabc"); private static readonly bool chomp9 = StringUtils.Chomp("\r").Equals(""); private static readonly bool chomp10 = StringUtils.Chomp("\n").Equals(""); private static readonly bool chomp11 = StringUtils.Chomp("\r\n").Equals(""); private static readonly bool chop1 = StringUtils.Chop(null) == null; private static readonly bool chop2 = StringUtils.Chop("").Equals(""); private static readonly bool chop3 = StringUtils.Chop("abc \r").Equals("abc "); private static readonly bool chop4 = StringUtils.Chop("abc\n").Equals("abc"); private static readonly bool chop5 = StringUtils.Chop("abc\r\n").Equals("abc"); private static readonly bool chop6 = StringUtils.Chop("abc").Equals("ab"); private static readonly bool chop7 = StringUtils.Chop("abc\nabc").Equals("abc\nab"); private static readonly bool chop8 = StringUtils.Chop("a").Equals(""); private static readonly bool chop9 = StringUtils.Chop("\r").Equals(""); private static readonly bool chop10 = StringUtils.Chop("\n").Equals(""); private static readonly bool chop11 = StringUtils.Chop("\r\n").Equals(""); private static readonly bool stripend1 = StringUtils.StripEnd(null, "*") == null; private static readonly bool stripend2 = StringUtils.StripEnd("", "*").Equals(""); private static readonly bool stripend3 = StringUtils.StripEnd("abc", "").Equals("abc"); private static readonly bool stripend4 = StringUtils.StripEnd("abc", null).Equals("abc"); private static readonly bool stripend5 = StringUtils.StripEnd(" abc", null).Equals(" abc"); private static readonly bool stripend6 = StringUtils.StripEnd("abc ", null).Equals("abc"); private static readonly bool stripend7 = StringUtils.StripEnd(" abc ", null).Equals(" abc"); private static readonly bool stripend8 = StringUtils.StripEnd(" abcyx", "xyz").Equals(" abc"); private static readonly bool stripend9 = StringUtils.StripEnd("120.00", ".0").Equals("12"); [TestMethod] public void StringUtils_ChompChopStripEndTest() { Assert.IsTrue(chomp1); Assert.IsTrue(chomp2); Assert.IsTrue(chomp3); Assert.IsTrue(chomp4); Assert.IsTrue(chomp5); Assert.IsTrue(chomp6); Assert.IsTrue(chomp7); Assert.IsTrue(chomp8); Assert.IsTrue(chomp9); Assert.IsTrue(chomp10); Assert.IsTrue(chomp11); Assert.IsTrue(chop1); Assert.IsTrue(chop2); Assert.IsTrue(chop3); Assert.IsTrue(chop4); Assert.IsTrue(chop5); Assert.IsTrue(chop6); Assert.IsTrue(chop7); Assert.IsTrue(chop8); Assert.IsTrue(chop9); Assert.IsTrue(chop10); Assert.IsTrue(chop11); Assert.IsTrue(stripend1); Assert.IsTrue(stripend2); Assert.IsTrue(stripend3); Assert.IsTrue(stripend4); Assert.IsTrue(stripend5); Assert.IsTrue(stripend6); Assert.IsTrue(stripend7); Assert.IsTrue(stripend8); Assert.IsTrue(stripend9); } #endregion #region Test Repeat. private static readonly bool repeat1 = StringUtils.Repeat(null, 2) == null; private static readonly bool repeat2 = StringUtils.Repeat("", 0).Equals(""); private static readonly bool repeat3 = StringUtils.Repeat("", 2).Equals(""); private static readonly bool repeat4 = StringUtils.Repeat("a", 3).Equals("aaa"); private static readonly bool repeat5 = StringUtils.Repeat("ab", 2).Equals("abab"); private static readonly bool repeat6 = StringUtils.Repeat("a", -2).Equals(""); [TestMethod] public void StringUtils_RepeatTest() { Assert.IsTrue(repeat1); Assert.IsTrue(repeat2); Assert.IsTrue(repeat3); Assert.IsTrue(repeat4); Assert.IsTrue(repeat5); Assert.IsTrue(repeat6); } #endregion #region Test UpperCase, LowerCase. private static readonly bool lower1 = StringUtils.LowerCase(null) == null; private static readonly bool lower2 = StringUtils.LowerCase("").Equals(""); private static readonly bool lower3 = StringUtils.LowerCase("aBc").Equals("abc"); private static readonly bool upper1 = StringUtils.UpperCase(null) == null; private static readonly bool upper2 = StringUtils.UpperCase("").Equals(""); private static readonly bool upper3 = StringUtils.UpperCase("aBc").Equals("ABC"); [TestMethod] public void StringUtils_CaseTest() { Assert.IsTrue(lower1); Assert.IsTrue(lower2); Assert.IsTrue(lower3); Assert.IsTrue(upper1); Assert.IsTrue(upper2); Assert.IsTrue(upper3); } #endregion #region Test IsAlpha, IsAlphaSpace, IsNumeric, IsNumericSpace, IsAlphaNumeric, IsAlphaNumericSpace, IsWhiteSpace. private static readonly bool alpha1 = StringUtils.IsAlpha(null).Equals(false); private static readonly bool alpha2 = StringUtils.IsAlpha("").Equals(false); private static readonly bool alpha3 = StringUtils.IsAlpha(" ").Equals(false); private static readonly bool alpha4 = StringUtils.IsAlpha("abc").Equals(true); private static readonly bool alpha5 = StringUtils.IsAlpha("ab2c").Equals(false); private static readonly bool alpha6 = StringUtils.IsAlpha("ab-c").Equals(false); private static readonly bool alphaspace1 = StringUtils.IsAlphaSpace(null).Equals(false); private static readonly bool alphaspace2 = StringUtils.IsAlphaSpace("").Equals(true); private static readonly bool alphaspace3 = StringUtils.IsAlphaSpace(" ").Equals(true); private static readonly bool alphaspace4 = StringUtils.IsAlphaSpace("abc").Equals(true); private static readonly bool alphaspace5 = StringUtils.IsAlphaSpace("ab c").Equals(true); private static readonly bool alphaspace6 = StringUtils.IsAlphaSpace("ab2c").Equals(false); private static readonly bool alphaspace7 = StringUtils.IsAlphaSpace("ab-c").Equals(false); private static readonly bool alphanumeric1 = StringUtils.IsAlphanumeric(null).Equals(false); private static readonly bool alphanumeric2 = StringUtils.IsAlphanumeric("").Equals(false); private static readonly bool alphanumeric3 = StringUtils.IsAlphanumeric(" ").Equals(false); private static readonly bool alphanumeric4 = StringUtils.IsAlphanumeric("abc").Equals(true); private static readonly bool alphanumeric5 = StringUtils.IsAlphanumeric("ab c").Equals(false); private static readonly bool alphanumeric6 = StringUtils.IsAlphanumeric("ab2c").Equals(true); private static readonly bool alphanumeric7 = StringUtils.IsAlphanumeric("ab-c").Equals(false); private static readonly bool alphanumericspace1 = StringUtils.IsAlphanumericSpace(null).Equals(false); private static readonly bool alphanumericspace2 = StringUtils.IsAlphanumericSpace("").Equals(true); private static readonly bool alphanumericspace3 = StringUtils.IsAlphanumericSpace(" ").Equals(true); private static readonly bool alphanumericspace4 = StringUtils.IsAlphanumericSpace("abc").Equals(true); private static readonly bool alphanumericspace5 = StringUtils.IsAlphanumericSpace("ab c").Equals(true); private static readonly bool alphanumericspace6 = StringUtils.IsAlphanumericSpace("ab2c").Equals(true); private static readonly bool alphanumericspace7 = StringUtils.IsAlphanumericSpace("ab-c").Equals(false); private static readonly bool numeric1 = StringUtils.IsNumeric(null).Equals(false); private static readonly bool numeric2 = StringUtils.IsNumeric("").Equals(false); private static readonly bool numeric3 = StringUtils.IsNumeric(" ").Equals(false); private static readonly bool numeric4 = StringUtils.IsNumeric("123").Equals(true); private static readonly bool numeric5 = StringUtils.IsNumeric("12 3").Equals(false); private static readonly bool numeric6 = StringUtils.IsNumeric("ab2c").Equals(false); private static readonly bool numeric7 = StringUtils.IsNumeric("12-3").Equals(false); private static readonly bool numeric8 = StringUtils.IsNumeric("12.3").Equals(false); private static readonly bool numeric9 = StringUtils.IsNumeric("-123").Equals(false); private static readonly bool numeric10 = StringUtils.IsNumeric("+123").Equals(false); private static readonly bool numericspace1 = StringUtils.IsNumericSpace(null).Equals(false); private static readonly bool numericspace2 = StringUtils.IsNumericSpace("").Equals(true); private static readonly bool numericspace3 = StringUtils.IsNumericSpace(" ").Equals(true); private static readonly bool numericspace4 = StringUtils.IsNumericSpace("123").Equals(true); private static readonly bool numericspace5 = StringUtils.IsNumericSpace("12 3").Equals(true); private static readonly bool numericspace6 = StringUtils.IsNumericSpace("ab2c").Equals(false); private static readonly bool numericspace7 = StringUtils.IsNumericSpace("12-3").Equals(false); private static readonly bool numericspace8 = StringUtils.IsNumericSpace("12.3").Equals(false); private static readonly bool whitespace1 = StringUtils.IsWhitespace(null).Equals(false); private static readonly bool whitespace2 = StringUtils.IsWhitespace("").Equals(true); private static readonly bool whitespace3 = StringUtils.IsWhitespace(" ").Equals(true); private static readonly bool whitespace4 = StringUtils.IsWhitespace("abc").Equals(false); private static readonly bool whitespace5 = StringUtils.IsWhitespace("ab2c").Equals(false); private static readonly bool whitespace6 = StringUtils.IsWhitespace("ab-c").Equals(false); [TestMethod] public void StringUtils_AlphaNumericTest() { Assert.IsTrue(alpha1); Assert.IsTrue(alpha2); Assert.IsTrue(alpha3); Assert.IsTrue(alpha4); Assert.IsTrue(alpha5); Assert.IsTrue(alpha6); Assert.IsTrue(alphaspace1); Assert.IsTrue(alphaspace2); Assert.IsTrue(alphaspace3); Assert.IsTrue(alphaspace4); Assert.IsTrue(alphaspace5); Assert.IsTrue(alphaspace6); Assert.IsTrue(alphaspace7); Assert.IsTrue(alphanumeric1); Assert.IsTrue(alphanumeric2); Assert.IsTrue(alphanumeric3); Assert.IsTrue(alphanumeric4); Assert.IsTrue(alphanumeric5); Assert.IsTrue(alphanumeric6); Assert.IsTrue(alphanumeric7); Assert.IsTrue(alphanumericspace1); Assert.IsTrue(alphanumericspace2); Assert.IsTrue(alphanumericspace3); Assert.IsTrue(alphanumericspace4); Assert.IsTrue(alphanumericspace5); Assert.IsTrue(alphanumericspace6); Assert.IsTrue(alphanumericspace7); Assert.IsTrue(numeric1); Assert.IsTrue(numeric2); Assert.IsTrue(numeric3); Assert.IsTrue(numeric4); Assert.IsTrue(numeric5); Assert.IsTrue(numeric6); Assert.IsTrue(numeric7); Assert.IsTrue(numeric8); Assert.IsTrue(numeric9); Assert.IsTrue(numeric10); Assert.IsTrue(numericspace1); Assert.IsTrue(numericspace2); Assert.IsTrue(numericspace3); Assert.IsTrue(numericspace4); Assert.IsTrue(numericspace5); Assert.IsTrue(numericspace6); Assert.IsTrue(numericspace7); Assert.IsTrue(numericspace8); Assert.IsTrue(whitespace1); Assert.IsTrue(whitespace2); Assert.IsTrue(whitespace3); Assert.IsTrue(whitespace4); Assert.IsTrue(whitespace5); Assert.IsTrue(whitespace6); } #endregion #region Test Reverse. public static readonly bool reverse1 = StringUtils.Reverse(null) == null; public static readonly bool reverse2 = StringUtils.Reverse("").Equals(""); public static readonly bool reverse3 = StringUtils.Reverse("bat").Equals("tab"); [TestMethod] public void StringUtils_ReverseTest() { Assert.IsTrue(reverse1); Assert.IsTrue(reverse2); Assert.IsTrue(reverse3); } #endregion } }
49.651365
158
0.645843
[ "Apache-2.0" ]
Andrey-Ostapenko/SummerBatch
Summer.Batch.CoreTests/Util/StringUtilsTest.cs
40,044
C#
// <auto-generated> // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. // </auto-generated> namespace Microsoft.Azure.Management.ContainerService.Models { /// <summary> /// Defines values for Code. /// </summary> public static class Code { /// <summary> /// The cluster is running. /// </summary> public const string Running = "Running"; /// <summary> /// The cluster is stopped. /// </summary> public const string Stopped = "Stopped"; } }
27.241379
74
0.632911
[ "MIT" ]
93mishra/azure-sdk-for-net
sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/Code.cs
790
C#
using HarmonyLib; using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using static SolastaCommunityExpansion.Models.Level20Context; namespace SolastaCommunityExpansion.Patches.Level20 { // replaces the hard coded experience [HarmonyPatch(typeof(RulesetCharacterHero), "RegisterAttributes")] [SuppressMessage("Minor Code Smell", "S101:Types should be named in PascalCase", Justification = "Patch")] internal static class RulesetCharacterHero_RegisterAttributes { internal static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) { var code = new List<CodeInstruction>(instructions); if (Main.Settings.EnableLevel20) { code.Find(x => x.opcode.Name == "ldc.i4.s" && Convert.ToInt32(x.operand) == GAME_MAX_LEVEL).operand = MOD_MAX_LEVEL; } return code; } } }
35.222222
132
0.700315
[ "MIT" ]
BackupForksForReference/SolastaCommunityExpansion
SolastaCommunityExpansion/Patches/Level20/RulesetCharacterHeroPatcher.cs
953
C#