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; using System.Linq; using FluentAssertions; using Nest; using Tests.Core.Extensions; using Tests.Core.ManagedElasticsearch.Clusters; using Tests.Domain; using Tests.Framework.Integration; namespace Tests.Aggregations.Bucket.SignificantText { /** * An aggregation that returns interesting or unusual occurrences of free-text * terms in a set. It is like the significant terms aggregation but differs in that: * * * It is specifically designed for use on type `text` fields * * It does not require field data or doc-values * * It re-analyzes text content on-the-fly meaning it can also filter duplicate sections of noisy text that otherwise tend to skew statistics. * * [WARNING] * -- * Re-analyzing large result sets will require a lot of time and memory. * It is recommended that the significant_text aggregation is used * as a child of either the sampler or diversified sampler aggregation to * limit the analysis to a small selection of top-matching documents * e.g. 200. This will typically improve speed, memory use and quality * of results. * -- * * See the Elasticsearch documentation on {ref_current}/search-aggregations-bucket-significanttext-aggregation.html[significant text aggregation] for more detail. */ public class SignificantTextAggregationUsageTests : AggregationUsageTestBase { private readonly string _firstTenDescriptions = string.Join(" ", Project.First.Description.Split(' ').Distinct().Take(1024)); public SignificantTextAggregationUsageTests(ReadOnlyCluster i, EndpointUsage usage) : base(i, usage) { } protected override object AggregationJson => new { significant_descriptions = new { significant_text = new { field = "description", filter_duplicate_text = true } } }; protected override Func<AggregationContainerDescriptor<Project>, IAggregationContainer> FluentAggs => a => a .SignificantText("significant_descriptions", st => st .Field(p => p.Description) .FilterDuplicateText() ); protected override AggregationDictionary InitializerAggs => new SignificantTextAggregation("significant_descriptions") { Field = Infer.Field<Project>(p => p.Description), FilterDuplicateText = true }; protected override QueryContainer QueryScope => new MatchQuery { Field = Infer.Field<Project>(p => p.Description), Query = _firstTenDescriptions }; protected override object QueryScopeJson => new { match = new { description = new { query = _firstTenDescriptions } } }; protected override void ExpectResponse(ISearchResponse<Project> response) { response.ShouldBeValid(); var sigNames = response.Aggregations.SignificantText("significant_descriptions"); sigNames.Should().NotBeNull(); sigNames.DocCount.Should().BeGreaterThan(0); foreach (var bucket in sigNames.Buckets) { bucket.Key.Should().NotBeNullOrEmpty(); bucket.BgCount.Should().BeGreaterThan(0); bucket.DocCount.Should().BeGreaterThan(0); bucket.Score.Should().BeGreaterThan(0); } } } }
31.835052
163
0.73478
[ "Apache-2.0" ]
Henr1k80/elasticsearch-net
src/Tests/Tests/Aggregations/Bucket/SignificantText/SignificantTextAggregationUsageTests.cs
3,090
C#
using System.Windows; namespace SpotifyHotkeys.Views { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } } }
17.625
45
0.574468
[ "MIT" ]
joakimskoog/SpotifyHotkeys
SpotifyHotkeys/Views/MainWindow.xaml.cs
284
C#
// Copyright (c) MOSA Project. Licensed under the New BSD License. // This code was generated by an automated template. using Mosa.Compiler.Framework; namespace Mosa.Platform.x64.Instructions { /// <summary> /// BochsDebug /// </summary> /// <seealso cref="Mosa.Platform.x64.X64Instruction" /> public sealed class BochsDebug : X64Instruction { public override int ID { get { return 618; } } internal BochsDebug() : base(0, 0) { } public override bool HasUnspecifiedSideEffect { get { return true; } } public override void Emit(InstructionNode node, BaseCodeEmitter emitter) { System.Diagnostics.Debug.Assert(node.ResultCount == 0); System.Diagnostics.Debug.Assert(node.OperandCount == 0); emitter.OpcodeEncoder.AppendByte(0x66); emitter.OpcodeEncoder.AppendByte(0x87); emitter.OpcodeEncoder.AppendByte(0xdb); } } }
24.657143
74
0.720742
[ "BSD-3-Clause" ]
kthompson/MOSA-Project
Source/Mosa.Platform.x64/Instructions/BochsDebug.cs
863
C#
//Problem 6. Four-Digit Number //Write a program that takes as input a four-digit number in format abcd(e.g. 2011) and performs the following: //Calculates the sum of the digits(in our example 2 + 0 + 1 + 1 = 4). //Prints on the console the number in reversed order: dcba(in our example 1102). //Puts the last digit in the first position: dabc(in our example 1201). //Exchanges the second and the third digits: acbd(in our example 2101). //The number has always exactly 4 digits and cannot start with 0. using System; class DigitsSwitch { static void Main() { short number = short.Parse(Console.ReadLine()); short a, b, c, d; a = (short)(number / 1000); b = (short)((number / 100) % 10); c = (short)((number / 10) % 10); d = (short)(number % 10); Console.WriteLine(a + b + c + d); Console.WriteLine("{0:0000}", d * 1000 + c * 100 + b * 10 + a); Console.WriteLine("{0:0000}", d * 1000 + a * 100 + b * 10 + c); Console.WriteLine("{0:0000}", a * 1000 + c * 100 + b * 10 + d); } }
40.666667
112
0.589253
[ "MIT" ]
SevdalinZhelyazkov/TelerikAcademy
CSharp-Part-1/OperatorsAndExpressions/FourDigitNumber/DigitsSwitch.cs
1,100
C#
// ------------------------------------------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. // ------------------------------------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Threading.Tasks; using EnsureThat; using Microsoft.Azure.Documents; using Microsoft.Extensions.Logging; using Microsoft.Health.CosmosDb.Configs; using Microsoft.Health.Extensions.DependencyInjection; using Microsoft.Health.Fhir.Core; namespace Microsoft.Health.CosmosDb.Features.Storage { /// <summary> /// Provides an <see cref="IDocumentClient"/> instance that is opened and whose collection has been properly initialized for use. /// Initialization starts asynchronously during application startup and is guaranteed to complete before any web request is handled by a controller. /// </summary> public class DocumentClientProvider : IStartable, IRequireInitializationOnFirstRequest, IDisposable { private IDocumentClient _documentClient; private readonly RetryableInitializationOperation _initializationOperation; public DocumentClientProvider( CosmosDataStoreConfiguration cosmosDataStoreConfiguration, IDocumentClientInitializer documentClientInitializer, ILogger<DocumentClientProvider> logger, IEnumerable<ICollectionInitializer> collectionInitializers) { EnsureArg.IsNotNull(cosmosDataStoreConfiguration, nameof(cosmosDataStoreConfiguration)); EnsureArg.IsNotNull(documentClientInitializer, nameof(documentClientInitializer)); EnsureArg.IsNotNull(logger, nameof(logger)); EnsureArg.IsNotNull(collectionInitializers, nameof(collectionInitializers)); _documentClient = documentClientInitializer.CreateDocumentClient(cosmosDataStoreConfiguration); _initializationOperation = new RetryableInitializationOperation( () => documentClientInitializer.InitializeDataStore(_documentClient, cosmosDataStoreConfiguration, collectionInitializers)); } public IDocumentClient DocumentClient { get { if (!_initializationOperation.IsInitialized) { throw new InvalidOperationException($"{nameof(DocumentClientProvider)} has not been initialized."); } return _documentClient; } } /// <summary> /// Starts the initialization of the document client and cosmos data store. /// </summary> public void Start() { #pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed // The result is ignored and will be awaited in EnsureInitialized(). Exceptions are logged within DocumentClientInitializer. _initializationOperation.EnsureInitialized(); #pragma warning restore CS4014 } /// <summary> /// Returns a task representing the initialization operation. Once completed, /// this method will always return a completed task. If the task fails, the method /// can be called again to retry the operation. /// </summary> /// <returns>A task representing the initialization operation.</returns> public async Task EnsureInitialized() => await _initializationOperation.EnsureInitialized(); /// <inheritdoc /> public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } protected virtual void Dispose(bool disposing) { if (disposing) { _documentClient?.Dispose(); _documentClient = null; } } public IScoped<IDocumentClient> CreateDocumentClientScope() { if (!_initializationOperation.IsInitialized) { _initializationOperation.EnsureInitialized().GetAwaiter().GetResult(); } return new NonDisposingScope(DocumentClient); } } }
42.029126
152
0.647032
[ "MIT" ]
BoyaWu10/fhir-server
src/Microsoft.Health.CosmosDb/Features/Storage/DocumentClientProvider.cs
4,331
C#
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Numerics; using Filter.Algorithms; using Filter.Algorithms.FFTWSharp; using Filter.Extensions; namespace Filter_Win { public class FftwProvider : IFftProvider { /// <summary> /// Performs necessary initializations. /// </summary> public FftwProvider() { var fi = new FileInfo(this.WisdomPath); fi.Directory?.Create(); try { fftw.import_wisdom_from_filename(this.WisdomPath); } catch (Exception) { // no wisdom exists (yet) } AppDomain.CurrentDomain.ProcessExit += this.ExportWisdom; } private string WisdomPath { get; } = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\fftw\\fftw_real.wsd"; private Dictionary<int, ForwardFftPlan> ForwardPlans { get; } = new Dictionary<int, ForwardFftPlan>(); private Dictionary<int, InverseFftPlan> InversePlans { get; } = new Dictionary<int, InverseFftPlan>(); /// <summary> /// Computes the FFT over real-valued input data. Only the positive half of the hermitian symmetric fourier spectrum is /// returned. /// </summary> /// <param name="input">The real-valued input data.</param> /// <param name="n">The desired fft length. If set, the <paramref name="input" /> is zero-padded to <paramref name="n" />.</param> /// <returns>The positive half of the hermitian-symmetric spectrum, including DC and Nyquist/2.</returns> public IReadOnlyList<Complex> RealFft(IReadOnlyList<double> input, int n = -1) { if (n < 0) { n = input.Count; } if (!this.ForwardPlans.ContainsKey(n)) { this.ForwardPlans.Add(n, new ForwardFftPlan(n)); } var plan = this.ForwardPlans[n]; plan.Input = input.ZeroPad(n); return plan.Output.ToReadOnlyList(); } /// <summary> /// Computes the iFFT over the positive half of a hermitian-symmetric spectrum. /// </summary> /// <param name="input">The positive half of a hermitian-symmetric spectrum.</param> /// <returns>The computed time-domain values. Always has an even length.</returns> public IReadOnlyList<double> RealIfft(IReadOnlyList<Complex> input) { var n = (input.Count - 1) << 1; if (!this.InversePlans.ContainsKey(n)) { this.InversePlans.Add(n, new InverseFftPlan(n)); } var plan = this.InversePlans[n]; plan.Input = input; return plan.Output.Multiply(1.0 / n).ToReadOnlyList(); } /// <summary> /// Exports the accumulated wisdom to a file for later use. /// </summary> /// <param name="sender">Sender variable for event handler.</param> /// <param name="e">Event handler arguments.</param> private void ExportWisdom(object sender, EventArgs e) { fftw.export_wisdom_to_filename(this.WisdomPath); } } /// <summary> /// Handles the creating of an fftw plan and the associated memory blocks. /// </summary> public abstract class FftPlan { /// <summary> /// Initializes a new instance of the base class <see cref="FftPlan" />. /// </summary> /// <param name="fftLength">The FFT lenght the plan is used for.</param> protected FftPlan(int fftLength) { this.N = fftLength; this.FftwR = new fftw_realarray(this.N); this.FftwC = new fftw_complexarray((this.N >> 1) + 1); } /// <summary> /// The FFT length the plan is used for. /// </summary> public int N { get; } /// <summary> /// The FFTW plan. /// </summary> protected fftw_plan FftwP { get; set; } /// <summary> /// The unmanaged data array for the real values. /// </summary> protected fftw_realarray FftwR { get; set; } /// <summary> /// The unmanaged data array for the complex values. /// </summary> protected fftw_complexarray FftwC { get; set; } } /// <summary> /// Plan for a real-valued forward FFT. /// </summary> public class ForwardFftPlan : FftPlan { private IEnumerable<double> _Input; private IReadOnlyList<Complex> _Output; /// <summary> /// Initializes a new instance of the <see cref="ForwardFftPlan" /> class. /// </summary> /// <param name="fftLength">The FFT length the plan is used for.</param> public ForwardFftPlan(int fftLength) : base(fftLength) { this.FftwP = fftw_plan.dft_r2c_1d(this.N, this.FftwR, this.FftwC, fftw_flags.Measure); } /// <summary> /// The real-valued input data, i.e. the time samples. /// </summary> public IEnumerable<double> Input { get { return this._Input; } set { this._Input = value; this._Output = null; } } /// <summary> /// The complex-valued result, i.e. the positive half of the hermitian-symmatric fourier spectrum of the previously /// provided input data. /// </summary> public IReadOnlyList<Complex> Output { get { if (this._Output == null) { this.FftwR.SetData(this.Input.ToArray()); this.FftwP.Execute(); this._Output = this.FftwC.GetData().ToReadOnlyList(); } return this._Output; } } } /// <summary> /// Plan for a real-valued iFFT. /// </summary> public class InverseFftPlan : FftPlan { private IEnumerable<Complex> _Input; private IReadOnlyList<double> _Output; /// <summary> /// Initializes a new instance of the <see cref="InverseFftPlan" /> class. /// </summary> /// <param name="fftLength">The FFT length the plan is used for.</param> public InverseFftPlan(int fftLength) : base(fftLength) { this.FftwP = fftw_plan.dft_c2r_1d(this.N, this.FftwC, this.FftwR, fftw_flags.Measure); } /// <summary> /// The complex valued input data, i.e. the positive half of a hermitian symmatric fourier spectrum. /// </summary> public IEnumerable<Complex> Input { get { return this._Input; } set { this._Input = value; this._Output = null; } } /// <summary> /// The real-valued result, i.e. the time samples. /// </summary> public IReadOnlyList<double> Output { get { if (this._Output == null) { this.FftwC.SetData(this.Input); this.FftwP.Execute(); this._Output = this.FftwR.GetData().ToReadOnlyList(); } return this._Output; } protected set { this._Output = value; } } } }
33.862832
138
0.532863
[ "MIT" ]
Jonarw/filter
Filter_Win/FftwProvider.cs
7,655
C#
using System; namespace AnotherBlog.Domain.Core.Bus.Messages { public abstract class Message { public Guid AggregateId { get; protected set; } public string MessageType { get; protected set; } public DateTime Timestamp { get; private set; } protected Message() { MessageType = GetType().Name; Timestamp = DateTime.Now; } } }
20.7
57
0.594203
[ "MIT" ]
yrz1994/AnotherBlog
AnotherBlog.Domain.Core/Bus/Messages/Message.cs
416
C#
using System; using Apache.Geode.NetCore; using Xunit; public class NetCoreCollectionFixture : IDisposable { public NetCoreCollectionFixture() { client_ = new Client(); } public void Dispose() { client_.Dispose(); } Client client_; } [CollectionDefinition("Geode .net Core Collection")] public class NetCoreCollection : ICollectionFixture<NetCoreCollectionFixture> { }
18.130435
77
0.70024
[ "Apache-2.0" ]
apache/geode-dotnet-core-client
NetCore.Test/NetCoreCollectionFixture.cs
419
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace M6_UnitTesting { public class Student : Person { public int IQ { get; } public Student(string name, int age, int iq) : base(name, age) { this.IQ = iq; Skill = new List<string> { "Drive car", "Play the piano" }; } public override double Salary() { return 0; } public bool Learning(string skillName, int needIq) { if (needIq < IQ) { Skill.Add(skillName); return true; } else { return false; } } } }
20.897436
72
0.458896
[ "Apache-2.0" ]
anodeychuk/M6_UnitTest
M6_UnitTesting/Student.cs
817
C#
using System.Collections.Generic; namespace AsmResolver.Collections { /// <summary> /// Represents a one-to-many relation, where an object is mapped to a collection of other objects. /// </summary> /// <typeparam name="TKey">The type of objects to map.</typeparam> /// <typeparam name="TValue">The type of objects to map to.</typeparam> public class OneToManyRelation<TKey, TValue> { private readonly IDictionary<TKey, ICollection<TValue>> _memberLists = new Dictionary<TKey, ICollection<TValue>>(); private readonly IDictionary<TValue, TKey> _memberOwners = new Dictionary<TValue, TKey>(); /// <summary> /// Registers a relation between two objects. /// </summary> /// <param name="key">The first object.</param> /// <param name="value">The second object to map to.</param> /// <returns><c>true</c> if the key value pair was successfully registered. <c>false</c> if there already exists /// a key that maps to the provided value.</returns> public bool Add(TKey key, TValue value) { if (!_memberOwners.ContainsKey(value)) { GetValues(key).Add(value); _memberOwners.Add(value, key); return true; } return false; } /// <summary> /// Gets a collection of values the provided key maps to. /// </summary> /// <param name="key">The key.</param> /// <returns>The values.</returns> public ICollection<TValue> GetValues(TKey key) { if (!_memberLists.TryGetValue(key, out var items)) { items = new List<TValue>(); _memberLists.Add(key, items); } return items; } /// <summary> /// Gets the key that maps to the provided value. /// </summary> /// <param name="value">The value.</param> /// <returns>The key.</returns> public TKey GetKey(TValue value) { return _memberOwners.TryGetValue(value, out var key) ? key : default; } } }
35.806452
123
0.553604
[ "MIT" ]
Anonym0ose/AsmResolver
src/AsmResolver/Collections/OneToManyRelation.cs
2,220
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 System.Threading; using System.Threading.Tasks; using Microsoft.Win32.SafeHandles; namespace System.Diagnostics.Tracing { #if FEATURE_PERFTRACING internal sealed class EventPipeEventDispatcher { internal sealed class EventListenerSubscription { internal EventKeywords MatchAnyKeywords { get; private set; } internal EventLevel Level { get; private set; } internal EventListenerSubscription(EventKeywords matchAnyKeywords, EventLevel level) { MatchAnyKeywords = matchAnyKeywords; Level = level; } } internal static readonly EventPipeEventDispatcher Instance = new EventPipeEventDispatcher(); private readonly IntPtr m_RuntimeProviderID; private ulong m_sessionID; private DateTime m_syncTimeUtc; private long m_syncTimeQPC; private long m_timeQPCFrequency; private bool m_stopDispatchTask; private readonly EventPipeWaitHandle m_dispatchTaskWaitHandle = new EventPipeWaitHandle(); private Task? m_dispatchTask; private readonly object m_dispatchControlLock = new object(); private readonly Dictionary<EventListener, EventListenerSubscription> m_subscriptions = new Dictionary<EventListener, EventListenerSubscription>(); private const uint DefaultEventListenerCircularMBSize = 10; private EventPipeEventDispatcher() { // Get the ID of the runtime provider so that it can be used as a filter when processing events. m_RuntimeProviderID = EventPipeInternal.GetProvider(NativeRuntimeEventSource.EventSourceName); m_dispatchTaskWaitHandle.SafeWaitHandle = new SafeWaitHandle(IntPtr.Zero, false); } internal void SendCommand(EventListener eventListener, EventCommand command, bool enable, EventLevel level, EventKeywords matchAnyKeywords) { if (command == EventCommand.Update && enable) { lock (m_dispatchControlLock) { // Add the new subscription. This will overwrite an existing subscription for the listener if one exists. m_subscriptions[eventListener] = new EventListenerSubscription(matchAnyKeywords, level); // Commit the configuration change. CommitDispatchConfiguration(); } } else if (command == EventCommand.Update && !enable) { RemoveEventListener(eventListener); } } internal void RemoveEventListener(EventListener listener) { lock (m_dispatchControlLock) { // Remove the event listener from the list of subscribers. if (m_subscriptions.ContainsKey(listener)) { m_subscriptions.Remove(listener); } // Commit the configuration change. CommitDispatchConfiguration(); } } private void CommitDispatchConfiguration() { Debug.Assert(Monitor.IsEntered(m_dispatchControlLock)); // Ensure that the dispatch task is stopped. // This is a no-op if the task is already stopped. StopDispatchTask(); // Stop tracing. // This is a no-op if it's already disabled. EventPipeInternal.Disable(m_sessionID); // Check to see if tracing should be enabled. if (m_subscriptions.Count <= 0) { return; } // Determine the keywords and level that should be used based on the set of enabled EventListeners. EventKeywords aggregatedKeywords = EventKeywords.None; EventLevel highestLevel = EventLevel.LogAlways; foreach (EventListenerSubscription subscription in m_subscriptions.Values) { aggregatedKeywords |= subscription.MatchAnyKeywords; highestLevel = (subscription.Level > highestLevel) ? subscription.Level : highestLevel; } // Enable the EventPipe session. EventPipeProviderConfiguration[] providerConfiguration = new EventPipeProviderConfiguration[] { new EventPipeProviderConfiguration(NativeRuntimeEventSource.EventSourceName, (ulong)aggregatedKeywords, (uint)highestLevel, null) }; m_sessionID = EventPipeInternal.Enable(null, EventPipeSerializationFormat.NetTrace, DefaultEventListenerCircularMBSize, providerConfiguration); Debug.Assert(m_sessionID != 0); // Get the session information that is required to properly dispatch events. EventPipeSessionInfo sessionInfo; unsafe { if (!EventPipeInternal.GetSessionInfo(m_sessionID, &sessionInfo)) { Debug.Fail("GetSessionInfo returned false."); } } m_syncTimeUtc = DateTime.FromFileTimeUtc(sessionInfo.StartTimeAsUTCFileTime); m_syncTimeQPC = sessionInfo.StartTimeStamp; m_timeQPCFrequency = sessionInfo.TimeStampFrequency; // Start the dispatch task. StartDispatchTask(); } private void StartDispatchTask() { Debug.Assert(Monitor.IsEntered(m_dispatchControlLock)); if (m_dispatchTask == null) { m_stopDispatchTask = false; // Create a SafeWaitHandle that won't release the handle when done m_dispatchTaskWaitHandle.SafeWaitHandle = new SafeWaitHandle(EventPipeInternal.GetWaitHandle(m_sessionID), false); m_dispatchTask = Task.Factory.StartNew(DispatchEventsToEventListeners, CancellationToken.None, TaskCreationOptions.LongRunning, TaskScheduler.Default); } } private void StopDispatchTask() { Debug.Assert(Monitor.IsEntered(m_dispatchControlLock)); if (m_dispatchTask != null) { m_stopDispatchTask = true; Debug.Assert(!m_dispatchTaskWaitHandle.SafeWaitHandle.IsInvalid); EventWaitHandle.Set(m_dispatchTaskWaitHandle.SafeWaitHandle); m_dispatchTask.Wait(); m_dispatchTask = null; } } private unsafe void DispatchEventsToEventListeners() { // Struct to fill with the call to GetNextEvent. EventPipeEventInstanceData instanceData; while (!m_stopDispatchTask) { bool eventsReceived = false; // Get the next event. while (!m_stopDispatchTask && EventPipeInternal.GetNextEvent(m_sessionID, &instanceData)) { eventsReceived = true; // Filter based on provider. if (instanceData.ProviderID == m_RuntimeProviderID) { // Dispatch the event. ReadOnlySpan<byte> payload = new ReadOnlySpan<byte>((void*)instanceData.Payload, (int)instanceData.PayloadLength); DateTime dateTimeStamp = TimeStampToDateTime(instanceData.TimeStamp); NativeRuntimeEventSource.Log.ProcessEvent(instanceData.EventID, instanceData.ThreadID, dateTimeStamp, instanceData.ActivityId, instanceData.ChildActivityId, payload); } } // Wait for more events. if (!m_stopDispatchTask) { if (!eventsReceived) { // Future TODO: this would make more sense to handle in EventPipeSession/EventPipe native code. Debug.Assert(!m_dispatchTaskWaitHandle.SafeWaitHandle.IsInvalid); m_dispatchTaskWaitHandle.WaitOne(); } Thread.Sleep(10); } } } /// <summary> /// Converts a QueryPerformanceCounter (QPC) timestamp to a UTC DateTime. /// </summary> private DateTime TimeStampToDateTime(long timeStamp) { if (timeStamp == long.MaxValue) { return DateTime.MaxValue; } Debug.Assert((m_syncTimeUtc.Ticks != 0) && (m_syncTimeQPC != 0) && (m_timeQPCFrequency != 0)); long inTicks = (long)((timeStamp - m_syncTimeQPC) * 10000000.0 / m_timeQPCFrequency) + m_syncTimeUtc.Ticks; if ((inTicks < 0) || (DateTime.MaxTicks < inTicks)) { inTicks = DateTime.MaxTicks; } return new DateTime(inTicks, DateTimeKind.Utc); } } #endif // FEATURE_PERFTRACING }
40.420354
190
0.605145
[ "MIT" ]
2m0nd/runtime
src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventPipeEventDispatcher.cs
9,135
C#
using System.Reflection; using System.Runtime.InteropServices; using System.Windows; // 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("MailClient")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("MailClient")] [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)] //In order to begin building localizable applications, set //<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file //inside a <PropertyGroup>. For example, if you are using US english //in your source files, set the <UICulture> to en-US. Then uncomment //the NeutralResourceLanguage attribute below. Update the "en-US" in //the line below to match the UICulture setting in the project file. //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] [assembly: ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located //(used if a resource is not found in the page, // or application resource dictionaries) ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located //(used if a resource is not found in the page, // app, or any theme specific resource dictionaries) )] // 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")]
42.833333
98
0.702551
[ "MIT" ]
kipic96/mail-client
MailClient/MailClient/Properties/AssemblyInfo.cs
2,316
C#
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated from a template. // // Manual changes to this file may cause unexpected behavior in your application. // Manual changes to this file will be overwritten if the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace SMSPortalDBDataLibrary { using System; using System.Collections.Generic; public partial class SendBox_Phone { public System.Guid TFId { get; set; } public System.Guid TFSendBox_Id { get; set; } public System.Guid TFPhone_Id { get; set; } public System.Guid TFSim_Id { get; set; } public System.DateTime TFDateTimeSend { get; set; } public string TFDateTimeSendFA { get; set; } public Nullable<int> TFGSM_Id { get; set; } public bool TFIsDelivered { get; set; } public Nullable<System.DateTime> TFDateTimeSendGSM { get; set; } public string TFDateTimeSendGSMFA { get; set; } public Nullable<System.DateTime> TFDateTimeDelivery { get; set; } public string TFDateTimeDeliveryFA { get; set; } public virtual Phone Phone { get; set; } public virtual SendBox SendBox { get; set; } public virtual SIM SIM { get; set; } } }
40
85
0.578571
[ "MIT" ]
eabasir/sms-portal
SMSPortalDBDataLibrary/SendBox_Phone.cs
1,400
C#
using NUnit.Framework; using ReactUnity.StyleEngine; namespace ReactUnity.Editor.Tests { [TestFixture(TestOf = typeof(MediaQueryList))] public class MediaQueryTests { [Test] public void AllQueryWorks() { var provider = new DefaultMediaProvider("runtime"); var query = "all"; var mq = MediaQueryList.Create(provider, query); Assert.AreEqual(query, mq.media); Assert.True(mq.matches); } [Test] public void NotCondition() { var provider = new DefaultMediaProvider("runtime"); var query = "not (min-width: 600px)"; var mq = MediaQueryList.Create(provider, query); provider.SetNumber("width", 601); Assert.False(mq.matches); provider.SetNumber("width", 600); Assert.False(mq.matches); provider.SetNumber("width", 599); Assert.True(mq.matches); } [Test] public void AndCondition() { var provider = new DefaultMediaProvider("runtime"); var query = "runtime and (min-width: 600px)"; var mq = MediaQueryList.Create(provider, query); provider.SetNumber("width", 601); Assert.True(mq.matches); provider.SetNumber("width", 600); Assert.True(mq.matches); provider.SetNumber("width", 599); Assert.False(mq.matches); query = "editor and (min-width: 600px)"; mq = MediaQueryList.Create(provider, query); provider.SetNumber("width", 601); Assert.False(mq.matches); provider.SetNumber("width", 600); Assert.False(mq.matches); provider.SetNumber("width", 599); Assert.False(mq.matches); } [Test] public void OrCondition() { var provider = new DefaultMediaProvider("runtime"); var query = "runtime, (min-width: 600px)"; var mq = MediaQueryList.Create(provider, query); provider.SetNumber("width", 601); Assert.True(mq.matches); provider.SetNumber("width", 600); Assert.True(mq.matches); provider.SetNumber("width", 599); Assert.True(mq.matches); query = "runtime or (min-width: 600px)"; mq = MediaQueryList.Create(provider, query); provider.SetNumber("width", 601); Assert.True(mq.matches); provider.SetNumber("width", 600); Assert.True(mq.matches); provider.SetNumber("width", 599); Assert.True(mq.matches); query = "editor or (min-width: 600px)"; mq = MediaQueryList.Create(provider, query); provider.SetNumber("width", 601); Assert.True(mq.matches); provider.SetNumber("width", 600); Assert.True(mq.matches); provider.SetNumber("width", 599); Assert.False(mq.matches); query = "editor, (min-width: 600px)"; mq = MediaQueryList.Create(provider, query); provider.SetNumber("width", 601); Assert.True(mq.matches); provider.SetNumber("width", 600); Assert.True(mq.matches); provider.SetNumber("width", 599); Assert.False(mq.matches); } [Test] public void MinMaxQuery() { var provider = new DefaultMediaProvider("runtime"); var query = "(min-width: 600px)"; var mq = MediaQueryList.Create(provider, query); provider.SetNumber("width", 601); Assert.True(mq.matches); provider.SetNumber("width", 600); Assert.True(mq.matches); provider.SetNumber("width", 599); Assert.False(mq.matches); query = "(max-width: 600px)"; mq = MediaQueryList.Create(provider, query); provider.SetNumber("width", 601); Assert.False(mq.matches); provider.SetNumber("width", 600); Assert.True(mq.matches); provider.SetNumber("width", 599); Assert.True(mq.matches); // Invalid Query query = "max-width: 600px"; mq = MediaQueryList.Create(provider, query); provider.SetNumber("width", 601); Assert.False(mq.matches); provider.SetNumber("width", 600); Assert.False(mq.matches); provider.SetNumber("width", 599); Assert.False(mq.matches); } [Test] public void SingleRangeQuery_RegularOrder() { var provider = new DefaultMediaProvider("runtime"); var query = "(width >= 600px)"; var mq = MediaQueryList.Create(provider, query); provider.SetNumber("width", 601); Assert.True(mq.matches); provider.SetNumber("width", 600); Assert.True(mq.matches); provider.SetNumber("width", 599); Assert.False(mq.matches); query = "(width > 600px)"; mq = MediaQueryList.Create(provider, query); provider.SetNumber("width", 601); Assert.True(mq.matches); provider.SetNumber("width", 600); Assert.False(mq.matches); provider.SetNumber("width", 599); Assert.False(mq.matches); query = "(width <= 300px)"; mq = MediaQueryList.Create(provider, query); provider.SetNumber("width", 299); Assert.True(mq.matches); provider.SetNumber("width", 300); Assert.True(mq.matches); provider.SetNumber("width", 301); Assert.False(mq.matches); query = "(width < 300px)"; mq = MediaQueryList.Create(provider, query); provider.SetNumber("width", 299); Assert.True(mq.matches); provider.SetNumber("width", 300); Assert.False(mq.matches); provider.SetNumber("width", 301); Assert.False(mq.matches); query = "(width = 600px)"; mq = MediaQueryList.Create(provider, query); provider.SetNumber("width", 601); Assert.False(mq.matches); provider.SetNumber("width", 600); Assert.True(mq.matches); provider.SetNumber("width", 599); Assert.False(mq.matches); } [Test] public void SingleRangeQuery_ReversedOrder() { var provider = new DefaultMediaProvider("runtime"); var query = "(600px <= width)"; var mq = MediaQueryList.Create(provider, query); provider.SetNumber("width", 601); Assert.True(mq.matches); provider.SetNumber("width", 600); Assert.True(mq.matches); provider.SetNumber("width", 599); Assert.False(mq.matches); query = "(600px < width)"; mq = MediaQueryList.Create(provider, query); provider.SetNumber("width", 601); Assert.True(mq.matches); provider.SetNumber("width", 600); Assert.False(mq.matches); provider.SetNumber("width", 599); Assert.False(mq.matches); query = "(300px >= width)"; mq = MediaQueryList.Create(provider, query); provider.SetNumber("width", 299); Assert.True(mq.matches); provider.SetNumber("width", 300); Assert.True(mq.matches); provider.SetNumber("width", 301); Assert.False(mq.matches); query = "(300px > width)"; mq = MediaQueryList.Create(provider, query); provider.SetNumber("width", 299); Assert.True(mq.matches); provider.SetNumber("width", 300); Assert.False(mq.matches); provider.SetNumber("width", 301); Assert.False(mq.matches); query = "(600px = width)"; mq = MediaQueryList.Create(provider, query); provider.SetNumber("width", 601); Assert.False(mq.matches); provider.SetNumber("width", 600); Assert.True(mq.matches); provider.SetNumber("width", 599); Assert.False(mq.matches); } [Test] public void MultiRangeQuery() { var provider = new DefaultMediaProvider("runtime"); var query = "(600px <= width <= 800px)"; var mq = MediaQueryList.Create(provider, query); provider.SetNumber("width", 801); Assert.False(mq.matches); provider.SetNumber("width", 800); Assert.True(mq.matches); provider.SetNumber("width", 601); Assert.True(mq.matches); provider.SetNumber("width", 600); Assert.True(mq.matches); provider.SetNumber("width", 599); Assert.False(mq.matches); } [Test] public void DetectsFeatureOrMediaType() { var provider = new DefaultMediaProvider("runtime"); var query = "(runtime and a)"; var mq = MediaQueryList.Create(provider, query); Assert.False(mq.matches); provider.SetValue("a", null); Assert.False(mq.matches); provider.SetValue("a", "hello"); Assert.True(mq.matches); query = "(runtime and (a: bye))"; mq = MediaQueryList.Create(provider, query); Assert.False(mq.matches); provider.SetValue("a", "hello"); Assert.False(mq.matches); provider.SetValue("a", "bye"); Assert.True(mq.matches); } [Test] public void AndOrComposedQuery() { var provider = new DefaultMediaProvider("runtime"); var query = "(a and b and c or d and e)"; var mq = MediaQueryList.Create(provider, query); provider.SetValue("a", "true"); provider.SetValue("b", "true"); provider.SetValue("c", "true"); provider.SetValue("d", "true"); provider.SetValue("e", null); Assert.False(mq.matches); provider.SetValue("a", null); provider.SetValue("b", "true"); provider.SetValue("c", "true"); provider.SetValue("d", "true"); provider.SetValue("e", "true"); Assert.True(mq.matches); provider.SetValue("a", null); provider.SetValue("b", "true"); provider.SetValue("c", "true"); provider.SetValue("d", null); provider.SetValue("e", "true"); Assert.False(mq.matches); } } }
27.873171
64
0.50665
[ "MIT" ]
NickBurrell/core
Tests/Editor/Styling/MediaQueryTests.cs
11,428
C#
using MiniRpcFactory.CommandFactory.Contracts; using MiniRpcFactory.Logging; using MiniRpcFactory.RpcService.Contracts; using MiniRpcLib; using MiniRpcLib.Action; using MiniRpcLib.Func; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.CompilerServices; using Logger = MiniRpcFactory.Logging.Logger; namespace MiniRpcFactory.RpcService { public sealed class RpcService { private static Lazy<RpcService> _rpcService { get; set; } private static RpcService _instance { get { return _rpcService.Value; } } private static MiniRpcInstance _miniRpcInstance { get; set; } private CommandFactoryInstance _commandFactory = new CommandFactoryInstance(); private Dictionary<string, IRpcFunc<object, object>> _miniRpcFunctionCommands = new Dictionary<string, IRpcFunc<object, object>>(); private Dictionary<string, IRpcAction<object>> _miniRpcActionCommands = new Dictionary<string, IRpcAction<object>>(); private RpcService() { _miniRpcInstance = MiniRpc.CreateInstance(new Guid().ToString()); } private RpcService(string modGuid) { _miniRpcInstance = MiniRpc.CreateInstance(modGuid); } internal static RpcService CreateInstance() { if (!_rpcService.IsValueCreated) { _rpcService = new Lazy<RpcService>(() => new RpcService()); } return _instance; } internal static RpcService CreateInstance(string modGuid) { if (!_rpcService.IsValueCreated) { _rpcService = new Lazy<RpcService>(() => new RpcService(modGuid)); } return _instance; } public void RegisterCommand<RequestType, ResponseType>(string commandName, Type commandType, params object[] parameters) { if (_miniRpcFunctionCommands.ContainsKey(commandName)) { return; } var commandConstructor = _commandFactory.Instance.GenerateCommand<RequestType, ResponseType>(commandType, parameters.Select(p => p.GetType()).ToArray()); var command = commandConstructor(parameters); var commandFunction = command.GetCommandFunction(); var commandTarget = command.GetTarget(); var miniRpcCommand = _miniRpcInstance.RegisterFunc(commandTarget, commandFunction); _miniRpcFunctionCommands.Add(commandName, (IRpcFunc<object, object>)miniRpcCommand); command.MarkAsRegistered(); } public void RegisterCommand<RequestType>(string commandName, Type commandType, params object[] parameters) { if (_miniRpcActionCommands.ContainsKey(commandName)) { return; } var commandConstructor = _commandFactory.Instance.GenerateCommand<RequestType>(commandType, parameters.Select(p => p.GetType()).ToArray()); var command = commandConstructor(parameters); var commandAction = command.GetCommandAction(); var commandTarget = command.GetTarget(); var miniRpcCommand = _miniRpcInstance.RegisterAction(commandTarget, commandAction); _miniRpcActionCommands.Add(commandName, (IRpcAction<object>)miniRpcCommand); command.MarkAsRegistered(); } public void InvokeRpcCommand(string commandName, object requestParameter, Action<object> handleResponseAction) { var command = _miniRpcFunctionCommands[commandName]; command.Invoke(requestParameter, handleResponseAction); } public void InvokeRpcCommand(string commandName, object requestParameter) { var command = _miniRpcActionCommands[commandName]; command.Invoke(requestParameter); } public void HandleRpcResult(RpcResult result) { if (result.Success) { HandleSuccessRpcResult(result); } else { HandleFailedRpcResult(result); } } public void HandleSuccessRpcResult(RpcResult result) { switch (result.Severity) { case LogSeverity.Info: LogInfoMessage(result.Message); break; default: break; } } public void HandleFailedRpcResult(RpcResult result) { switch (result.Severity) { case LogSeverity.Info: LogInfoMessage(result.Message); break; case LogSeverity.Warning: LogWarningMessage(result.Message); break; case LogSeverity.Error: LogErrorMessage(result.Message); break; default: break; } } private void LogInfoMessage(string message) { Logger.LogInfo(message); } private void LogWarningMessage(string message = "Debug", [CallerLineNumber] int lineNumber = 0) { string warning = $"Line {lineNumber}: {message}"; Logger.LogWarning(warning); } private void LogErrorMessage(string message = "Error", [CallerLineNumber] int lineNumber = 0) { string warning = $"Line {lineNumber}: {message}"; Logger.LogError(warning); } } }
34.950311
165
0.603163
[ "MIT" ]
wooffet/RoR2-MiniRpcFactory
RpcService/RpcService.cs
5,629
C#
//------------------------------------------------------------------------------ // <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> //------------------------------------------------------------------------------ namespace SimpleSubtitleRenamer.Languages { using System; /// <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", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Language_en { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Language_en() { } /// <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 (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SimpleSubtitleRenamer.Languages.Language_en", typeof(Language_en).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; } } /// <summary> /// Looks up a localized string similar to Append:. /// </summary> internal static string Append_ { get { return ResourceManager.GetString("Append:", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Clear. /// </summary> internal static string Clear { get { return ResourceManager.GetString("Clear", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Delete. /// </summary> internal static string Delete { get { return ResourceManager.GetString("Delete", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Error. /// </summary> internal static string Error { get { return ResourceManager.GetString("Error", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Language. /// </summary> internal static string Language { get { return ResourceManager.GetString("Language", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Prepend:. /// </summary> internal static string Prepend_ { get { return ResourceManager.GetString("Prepend:", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Preview. /// </summary> internal static string Preview { get { return ResourceManager.GetString("Preview", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Rename. /// </summary> internal static string Rename { get { return ResourceManager.GetString("Rename", resourceCulture); } } } }
36.882353
190
0.558014
[ "MIT" ]
maboroshinokiseki/Simple-Subtitle-Renamer
Languages/Language_en.Designer.cs
5,018
C#
using System; using System.Collections; using System.Collections.Generic; using System.Data; using System.Text; using System.Reflection; using System.Linq; using Luval.Data.Attributes; namespace Luval.Data { public class ListDataReader : IDataReader { private IDataRecord _current; public ListDataReader(Type entityType) { EntityType = entityType; Records = new List<IDataRecord>(); } public ListDataReader(Type entityType, IEnumerable<IDataRecord> records) : this(entityType) { Records = new List<IDataRecord>(records); } public object this[int i] => _current[i]; public object this[string name] => _current[name]; public int Depth { get; internal set; } public bool IsClosed { get; internal set; } public int RecordsAffected => Records.Count; public int FieldCount => _current.FieldCount; public List<IDataRecord> Records { get; } public Type EntityType { get; } public void Close() { IsClosed = true; } public void Dispose() { Records.Clear(); _current = null; } public bool GetBoolean(int i) { return _current.GetBoolean(i); } public byte GetByte(int i) { return _current.GetByte(i); } public long GetBytes(int i, long fieldOffset, byte[] buffer, int bufferoffset, int length) { return _current.GetBytes(i, fieldOffset, buffer, bufferoffset, length); } public char GetChar(int i) { return _current.GetChar(i); } public long GetChars(int i, long fieldoffset, char[] buffer, int bufferoffset, int length) { return _current.GetChars(i, fieldoffset, buffer, bufferoffset, length); } public IDataReader GetData(int i) { return _current.GetData(i); } public string GetDataTypeName(int i) { return _current.GetDataTypeName(i); } public DateTime GetDateTime(int i) { return _current.GetDateTime(i); } public decimal GetDecimal(int i) { return _current.GetDecimal(i); } public double GetDouble(int i) { return _current.GetDouble(i); } public Type GetFieldType(int i) { return _current.GetFieldType(i); } public float GetFloat(int i) { return _current.GetFloat(i); } public Guid GetGuid(int i) { return _current.GetGuid(i); } public short GetInt16(int i) { return _current.GetInt16(i); } public int GetInt32(int i) { return _current.GetInt32(i); } public long GetInt64(int i) { return _current.GetInt64(i); } public string GetName(int i) { return _current.GetName(i); } public int GetOrdinal(string name) { return _current.GetOrdinal(name); } public DataTable GetSchemaTable() { var dt = new DataTable(); dt.Columns.AddRange(new[] { new DataColumn("AllowDBNull", typeof(bool)), new DataColumn("ColumnName", typeof(string)), new DataColumn("IsAutoIncrement", typeof(bool)), new DataColumn("IsIdentity", typeof(bool)), new DataColumn("IsKey", typeof(bool)), new DataColumn("BaseTableName", typeof(string)), }); foreach (var prop in EntityType.GetProperties()) { if (prop.GetCustomAttribute<NotMappedAttribute>() != null) continue; var dr = dt.NewRow(); var colAtt = prop.GetCustomAttribute<ColumnNameAttribute>(); var tabAtt = EntityType.GetCustomAttribute<TableNameAttribute>(); dr["ColumnName"] = colAtt != null ? colAtt.Name : prop.Name; dr["IsAutoIncrement"] = prop.GetCustomAttribute<IdentityColumnAttribute>() != null; dr["IsIdentity"] = dr["IsAutoIncrement"]; dr["IsKey"] = prop.GetCustomAttribute<PrimaryKeyAttribute>() != null; dr["AllowDBNull"] = Nullable.GetUnderlyingType(prop.PropertyType) != null; dr["BaseTableName"] = tabAtt != null ? tabAtt.TableName.GetFullTableName() : EntityType.Name; } return dt; } public string GetString(int i) { return _current.GetString(i); } public object GetValue(int i) { return _current.GetValue(i); } public int GetValues(object[] values) { return _current.GetValues(values); } public bool IsDBNull(int i) { return _current.IsDBNull(i); } public bool NextResult() { return !((Records.IndexOf(_current) + 1) > (Records.Count - 1)); } public bool Read() { if (_current == null) { _current = Records.FirstOrDefault(); return true; } var res = NextResult(); if (res) _current = Records[Records.IndexOf(_current) + 1]; return res; } } }
26.712919
109
0.53448
[ "MIT" ]
marinoscar/luval-data
code/Luval.Data/DictionaryListDataReader.cs
5,585
C#
using System; using System.Runtime.InteropServices; using Microsoft.VisualStudio.Shell; using Xamarin.SampleVsix.Properties; [assembly: ProvideCodeBase] namespace Xamarin.SampleVsix { [Guid("BC1550C5-64C9-4B9A-A4F6-7D477C9178F1")] [InstalledProductRegistration("Sample", "Sample", "1.0 (asdf)")] [PackageRegistration(RegisterUsing = RegistrationMethod.CodeBase, UseManagedResourcesOnly = true)] [ProvideBindingPath] public class SamplePackage : Package { //public override string ToString() //{ // return Strings.Foo; //} } }
26.909091
102
0.702703
[ "MIT" ]
Acidburn0zzz/Xamarin.VSSDK
test/Xamarin.SampleVsix/SamplePackage.cs
594
C#
using System.Net.Http; using System.Threading.Tasks; using Newtonsoft.Json; using Newtonsoft.Json.Linq; namespace Gov.Lclb.Cllb.OrgbookService { public class OrgBookClient { private readonly HttpClient Client; public readonly string ORGBOOK_BASE_URL; public readonly string ORGBOOK_API_REGISTRATION_ENDPOINT = "/api/v2/topic/ident/registration/"; public readonly string ORGBOOK_API_SCHEMA_ENDPOINT = "/api/v2/schema"; public readonly string ORGBOOK_API_CREDENTIAL_ENDPOINT = "/api/v2/search/credential/topic"; public OrgBookClient(HttpClient client, string BASE_URL) { ORGBOOK_BASE_URL = BASE_URL; Client = client; } public async Task<int?> GetTopicId(string registrationId) { HttpResponseMessage resp = await Client.GetAsync(ORGBOOK_BASE_URL + ORGBOOK_API_REGISTRATION_ENDPOINT + registrationId); if (resp.IsSuccessStatusCode) { string _responseContent = await resp.Content.ReadAsStringAsync(); var response = (JObject)JsonConvert.DeserializeObject(_responseContent); return (int)response.GetValue("id"); } return null; } public async Task<int?> GetSchemaId(string schemaName, string schemaVersion) { HttpResponseMessage resp = await Client.GetAsync(ORGBOOK_BASE_URL + ORGBOOK_API_SCHEMA_ENDPOINT + "?name=" + schemaName + "&version=" + schemaVersion); if (resp.IsSuccessStatusCode) { string _responseContent = await resp.Content.ReadAsStringAsync(); var response = (JObject)JsonConvert.DeserializeObject(_responseContent); int count = (int)response.GetValue("total"); JArray results = (JArray)response.GetValue("results"); if (count == 1) { return results.First.Value<int>("id"); } } return null; } public async Task<int?> GetLicenceCredentialId(int topicId, int schemaId, string licenceNumber) { HttpResponseMessage resp = await Client.GetAsync(ORGBOOK_BASE_URL + ORGBOOK_API_CREDENTIAL_ENDPOINT + $"?inactive=false&latest=true&revoked=false&credential_type_id={schemaId}&topic_id={topicId}"); if (resp.IsSuccessStatusCode) { string _responseContent = await resp.Content.ReadAsStringAsync(); dynamic response = JObject.Parse(_responseContent); foreach (JObject result in response.results) { foreach (JObject attribute in result["attributes"]) { if (attribute["type"].ToString() == "licence_number" && attribute["value"].ToString() == licenceNumber) { return int.Parse(result["id"].ToString()); } } } } return null; } } }
42.589041
209
0.593438
[ "Apache-2.0" ]
ElizabethWolfe/jag-lcrb-carla-public
orgbook-service/OrgBookClient.cs
3,109
C#
using System.Collections.Generic; using System.IO; using System.Linq; using UnityEditor; using UnityEngine; using UnityEditor.SceneManagement; public class CFindScenesToOpenEditor : EditorWindow { private static EditorWindow window; private const float windowWidth = 640f; private const float windowHeight = 280f; private static string[] assetsScenesPaths; private List<string> _filteredScenes = new List<string>(); private static bool isSearchingScenes; private static string searchFilter = ""; private static string searchDirectory; private Vector2 scrollViewSize; public int CurrentIndex { get { return this._currentIndex; } set { this._currentIndex = value; this.ClampSelectedIndexValue(); } } private int _currentIndex; private static GUIStyle redText = new GUIStyle(); [MenuItem( "Tools/Find scene to open... %q", false, 180 )] public static void OpenWindow() { if (window != null) { CloseWindow(); return; } redText.normal.textColor = Color.red; window = EditorWindow.GetWindow( typeof( CFindScenesToOpenEditor ) ); window.position = new Rect( 720 - windowWidth * .5f, 540 - windowHeight * .5f, windowWidth, windowHeight ); //window.CenterOnMainWin(); window.titleContent = new GUIContent( "Find scene to open" ); searchDirectory = Application.dataPath; isSearchingScenes = true; var info = new DirectoryInfo(searchDirectory); var filesInfos = info.GetFiles("*.unity", SearchOption.AllDirectories).OrderBy(p => p.LastAccessTimeUtc).ToArray(); assetsScenesPaths = filesInfos.Select(fileInfo => fileInfo.FullName).ToArray(); isSearchingScenes = false; window.Repaint(); } private void OnLostFocus() { CloseWindow(); } private void OnGUI() { this.ClampSelectedIndexValue(); var e = Event.current; if (e.type == EventType.KeyDown) { // close window if (e.keyCode == KeyCode.Escape) { CloseWindow(); return; } // open selected scene. if (e.keyCode == KeyCode.KeypadEnter || e.keyCode == KeyCode.Return) { if (this.HasSceneOnAssetsFolder()) { if (e.shift) { EditorSceneManager.OpenScene(this._filteredScenes[this.CurrentIndex], OpenSceneMode.Additive); }else if (e.shift && e.alt) { EditorSceneManager.OpenScene(this._filteredScenes[this.CurrentIndex], OpenSceneMode.AdditiveWithoutLoading); } else { EditorSceneManager.OpenScene(this._filteredScenes[this.CurrentIndex], OpenSceneMode.Single); CloseWindow(); return; } } } // iterate over scenes list if (e.keyCode == KeyCode.UpArrow) { this.CurrentIndex -= 1; }else if (e.keyCode == KeyCode.DownArrow) { this.CurrentIndex += 1; } } EditorGUILayout.BeginVertical(); GUI.SetNextControlName("searchFilter"); searchFilter = EditorGUILayout.TextField(searchFilter); if (this.HasSceneOnAssetsFolder()) { EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField($"{assetsScenesPaths.Length} scenes found in project", EditorStyles.boldLabel); if(isSearchingScenes) EditorGUILayout.LabelField("Updating scenes search..."); EditorGUILayout.EndHorizontal(); this._filteredScenes.Clear(); // filter scenes to show for (int i = 0; i < assetsScenesPaths.Length; i++) { if (!IsEquivalentStrings(TrimScenePath(assetsScenesPaths[i]), searchFilter)) continue; this._filteredScenes.Add(assetsScenesPaths[i]); } // show list result if (this._filteredScenes.Count <= 0) { EditorGUILayout.LabelField("Can't find any scene with this filter"); } else { if(this._filteredScenes.Count != assetsScenesPaths.Length) EditorGUILayout.LabelField($"Found {this._filteredScenes.Count} scenes"); this.scrollViewSize = EditorGUILayout.BeginScrollView(this.scrollViewSize, false, false ); for (int i = 0; i < this._filteredScenes.Count; i++) { EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("Open", EditorStyles.miniButton, GUILayout.Width(44))) { EditorSceneManager.OpenScene(this._filteredScenes[i], OpenSceneMode.Single); } if (GUILayout.Button("Additive", EditorStyles.miniButton, GUILayout.Width(60))) { EditorSceneManager.OpenScene(this._filteredScenes[i], OpenSceneMode.Additive); } if (this.CurrentIndex == i) { EditorGUILayout.LabelField(TrimScenePath(this._filteredScenes[i]), EditorStyles.boldLabel); } else { EditorGUILayout.LabelField(TrimScenePath(this._filteredScenes[i])); } EditorGUILayout.EndHorizontal(); } EditorGUILayout.EndScrollView(); } } else { if (!isSearchingScenes) { EditorGUILayout.LabelField("Can't find any scene on project!", redText); } else { EditorGUILayout.LabelField("Searching scenes..."); } } this.ClampSelectedIndexValue(); EditorGUILayout.EndVertical(); EditorGUI.FocusTextInControl("searchFilter"); } private bool HasSceneOnAssetsFolder() { return assetsScenesPaths != null && assetsScenesPaths.Length > 0; } private bool HasFilteredScenes() { return this._filteredScenes.Count > 0; } private void ClampSelectedIndexValue() { this._currentIndex = Mathf.Clamp(this._currentIndex, 0, this._filteredScenes.Count); } private static string TrimScenePath(string fullPath) { return fullPath.Split('\\').Last().Replace(".unity", string.Empty).Trim(); } private static bool IsEquivalentStrings(string stringOne, string stringTwo ) { return stringOne.ToLower().Contains(stringTwo.ToLower().Trim()); } private static void CloseWindow() { if (window == null) return; window.Close(); } }
35.040201
148
0.573068
[ "MIT" ]
Chrisdbhr/CDK
Scripts/Editor/Utility/CFindScenesToOpenEditor.cs
6,975
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("Arguard.Tests")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Arguard.Tests")] [assembly: AssemblyCopyright("Copyright © 2021")] [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("5680dd14-e255-4ca1-89d7-961f0331ef39")] // 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")]
37.675676
84
0.746772
[ "MIT" ]
brianjosephegan/arguard
Arguard.Tests/Properties/AssemblyInfo.cs
1,397
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.Drawing; using System.Windows.Forms.VisualStyles; using static Interop; namespace System.Windows.Forms { /// <summary> /// This is a rendering class for the RadioButton control. It works downlevel too (obviously /// without visual styles applied.) /// </summary> public static class RadioButtonRenderer { // Make this per-thread, so that different threads can safely use these methods. [ThreadStatic] private static VisualStyleRenderer t_visualStyleRenderer = null; private static readonly VisualStyleElement s_radioElement = VisualStyleElement.Button.RadioButton.UncheckedNormal; /// <summary> /// If this property is true, then the renderer will use the setting from Application.RenderWithVisualStyles to /// determine how to render. /// If this property is false, the renderer will always render with visualstyles. /// </summary> public static bool RenderMatchingApplicationState { get; set; } = true; private static bool RenderWithVisualStyles { get { return (!RenderMatchingApplicationState || Application.RenderWithVisualStyles); } } /// <summary> /// Returns true if the background corresponding to the given state is partially transparent, else false. /// </summary> public static bool IsBackgroundPartiallyTransparent(RadioButtonState state) { if (RenderWithVisualStyles) { InitializeRenderer((int)state); return t_visualStyleRenderer.IsBackgroundPartiallyTransparent(); } else { return false; //for downlevel, this is false } } /// <summary> /// This is just a convenience wrapper for VisualStyleRenderer.DrawThemeParentBackground. For downlevel, /// this isn't required and does nothing. /// </summary> public static void DrawParentBackground(Graphics g, Rectangle bounds, Control childControl) { if (RenderWithVisualStyles) { InitializeRenderer(0); t_visualStyleRenderer.DrawParentBackground(g, bounds, childControl); } } /// <summary> /// Renders a RadioButton control. /// </summary> public static void DrawRadioButton(Graphics g, Point glyphLocation, RadioButtonState state) { DrawRadioButton(g, glyphLocation, state, IntPtr.Zero); } internal static void DrawRadioButtonWithVisualStyles( Gdi32.HDC hdc, Point glyphLocation, RadioButtonState state, IntPtr hWnd) { InitializeRenderer((int)state); Rectangle glyphBounds = new Rectangle(glyphLocation, GetGlyphSize(hdc, state, hWnd)); t_visualStyleRenderer.DrawBackground(hdc, glyphBounds, hWnd); } internal static void DrawRadioButton( Graphics graphics, Point glyphLocation, RadioButtonState state, IntPtr hWnd) { Rectangle glyphBounds; if (RenderWithVisualStyles) { using var hdc = new DeviceContextHdcScope(graphics); DrawRadioButtonWithVisualStyles(hdc, glyphLocation, state, hWnd); } else { using (var hdc = new DeviceContextHdcScope(graphics)) { glyphBounds = new Rectangle(glyphLocation, GetGlyphSize(hdc, state, hWnd)); } ControlPaint.DrawRadioButton(graphics, glyphBounds, ConvertToButtonState(state)); } } /// <summary> /// Renders a RadioButton control. /// </summary> public static void DrawRadioButton(Graphics g, Point glyphLocation, Rectangle textBounds, string radioButtonText, Font font, bool focused, RadioButtonState state) { DrawRadioButton(g, glyphLocation, textBounds, radioButtonText, font, TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.SingleLine, focused, state); } /// <summary> /// Renders a RadioButton control. /// </summary> public static void DrawRadioButton(Graphics g, Point glyphLocation, Rectangle textBounds, string radioButtonText, Font font, TextFormatFlags flags, bool focused, RadioButtonState state) { DrawRadioButton(g, glyphLocation, textBounds, radioButtonText, font, flags, focused, state, IntPtr.Zero); } internal static void DrawRadioButton(Graphics g, Point glyphLocation, Rectangle textBounds, string radioButtonText, Font font, TextFormatFlags flags, bool focused, RadioButtonState state, IntPtr hWnd) { Rectangle glyphBounds; using (var hdc = new DeviceContextHdcScope(g)) { glyphBounds = new Rectangle(glyphLocation, GetGlyphSize(hdc, state, hWnd)); } Color textColor; if (RenderWithVisualStyles) { InitializeRenderer((int)state); t_visualStyleRenderer.DrawBackground(g, glyphBounds); textColor = t_visualStyleRenderer.GetColor(ColorProperty.TextColor); } else { ControlPaint.DrawRadioButton(g, glyphBounds, ConvertToButtonState(state)); textColor = SystemColors.ControlText; } TextRenderer.DrawText(g, radioButtonText, font, textBounds, textColor, flags); if (focused) { ControlPaint.DrawFocusRectangle(g, textBounds); } } /// <summary> /// Renders a RadioButton control. /// </summary> public static void DrawRadioButton(Graphics g, Point glyphLocation, Rectangle textBounds, string radioButtonText, Font font, Image image, Rectangle imageBounds, bool focused, RadioButtonState state) { DrawRadioButton(g, glyphLocation, textBounds, radioButtonText, font, TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.SingleLine, image, imageBounds, focused, state); } /// <summary> /// Renders a RadioButton control. /// </summary> public static void DrawRadioButton(Graphics g, Point glyphLocation, Rectangle textBounds, string radioButtonText, Font font, TextFormatFlags flags, Image image, Rectangle imageBounds, bool focused, RadioButtonState state) { DrawRadioButton(g, glyphLocation, textBounds, radioButtonText, font, flags, image, imageBounds, focused, state, IntPtr.Zero); } internal static void DrawRadioButton(Graphics g, Point glyphLocation, Rectangle textBounds, string radioButtonText, Font font, TextFormatFlags flags, Image image, Rectangle imageBounds, bool focused, RadioButtonState state, IntPtr hWnd) { Rectangle glyphBounds; using (var hdc = new DeviceContextHdcScope(g)) { glyphBounds = new Rectangle(glyphLocation, GetGlyphSize(hdc, state, hWnd)); } Color textColor; if (RenderWithVisualStyles) { InitializeRenderer((int)state); // Keep this drawing order! It matches default drawing order. t_visualStyleRenderer.DrawImage(g, imageBounds, image); t_visualStyleRenderer.DrawBackground(g, glyphBounds); textColor = t_visualStyleRenderer.GetColor(ColorProperty.TextColor); } else { g.DrawImage(image, imageBounds); ControlPaint.DrawRadioButton(g, glyphBounds, ConvertToButtonState(state)); textColor = SystemColors.ControlText; } TextRenderer.DrawText(g, radioButtonText, font, textBounds, textColor, flags); if (focused) { ControlPaint.DrawFocusRectangle(g, textBounds); } } /// <summary> /// Returns the size of the RadioButton glyph. /// </summary> public static Size GetGlyphSize(Graphics g, RadioButtonState state) { using var hdc = new DeviceContextHdcScope(g); return GetGlyphSize(hdc, state, IntPtr.Zero); } internal static Size GetGlyphSize(Gdi32.HDC hdc, RadioButtonState state, IntPtr hWnd) { if (RenderWithVisualStyles) { InitializeRenderer((int)state); return t_visualStyleRenderer.GetPartSize(hdc, ThemeSizeType.Draw, hWnd); } return new Size(13, 13); } internal static ButtonState ConvertToButtonState(RadioButtonState state) { switch (state) { case RadioButtonState.CheckedNormal: case RadioButtonState.CheckedHot: return ButtonState.Checked; case RadioButtonState.CheckedPressed: return (ButtonState.Checked | ButtonState.Pushed); case RadioButtonState.CheckedDisabled: return (ButtonState.Checked | ButtonState.Inactive); case RadioButtonState.UncheckedPressed: return ButtonState.Pushed; case RadioButtonState.UncheckedDisabled: return ButtonState.Inactive; default: return ButtonState.Normal; } } internal static RadioButtonState ConvertFromButtonState(ButtonState state, bool isHot) { if ((state & ButtonState.Checked) == ButtonState.Checked) { if ((state & ButtonState.Pushed) == ButtonState.Pushed) { return RadioButtonState.CheckedPressed; } else if ((state & ButtonState.Inactive) == ButtonState.Inactive) { return RadioButtonState.CheckedDisabled; } else if (isHot) { return RadioButtonState.CheckedHot; } return RadioButtonState.CheckedNormal; } else { //unchecked if ((state & ButtonState.Pushed) == ButtonState.Pushed) { return RadioButtonState.UncheckedPressed; } else if ((state & ButtonState.Inactive) == ButtonState.Inactive) { return RadioButtonState.UncheckedDisabled; } else if (isHot) { return RadioButtonState.UncheckedHot; } return RadioButtonState.UncheckedNormal; } } private static void InitializeRenderer(int state) { RadioButtonState radioButtonState = (RadioButtonState)state; int part = s_radioElement.Part; if (SystemInformation.HighContrast && (radioButtonState == RadioButtonState.CheckedDisabled || radioButtonState == RadioButtonState.UncheckedDisabled) && VisualStyleRenderer.IsCombinationDefined(s_radioElement.ClassName, VisualStyleElement.Button.RadioButton.HighContrastDisabledPart)) { part = VisualStyleElement.Button.RadioButton.HighContrastDisabledPart; } if (t_visualStyleRenderer == null) { t_visualStyleRenderer = new VisualStyleRenderer(s_radioElement.ClassName, part, state); } else { t_visualStyleRenderer.SetParameters(s_radioElement.ClassName, part, state); } } } }
39.44586
244
0.594946
[ "MIT" ]
echalone/winforms
src/System.Windows.Forms/src/System/Windows/Forms/RadioButtonRenderer.cs
12,388
C#
using Transactions.Domain.Common; namespace Transactions.Domain.Events; public class TransactionInvoiceIdUpdated : DomainEvent { public TransactionInvoiceIdUpdated(string transactionId, int invoiceId) { TransactionId = transactionId; InvoiceId = invoiceId; } public string TransactionId { get; } public int InvoiceId { get; } }
22.588235
76
0.697917
[ "MIT" ]
robertsundstrom/accounting-app
Transactions/Transactions/Domain/Events/TransactionInvoiceIdUpdated.cs
384
C#
using Janovrom.Firesimulation.Runtime.Variables; using UnityEngine; namespace Janovrom.Firesimulation.Runtime.Utility { [RequireComponent(typeof(Simulation.FireSimulation))] public class SimulationInteraction : MonoBehaviour { private const int _AddMode = 0; private const int _FireMode = 1; private const int _RemoveMode = 2; public LayerMask PlaceLayer = ~0; public LayerMask FireLayer = ~0; public Vector3Variable CrosshairPosition; public IntVariable SimulationMode; private Simulation.FireSimulation _fireSimulation; private Camera _camera; private void Awake() { _fireSimulation = GetComponent<Simulation.FireSimulation>(); _camera = Camera.main; } private void Update() { if (SimulationMode == _AddMode) TryAddPlant(); else if (SimulationMode == _FireMode) TryLightFire(); else if (SimulationMode == _RemoveMode) TryRemovePlant(); } private void TryAddPlant() { bool clickCheck = Input.GetMouseButtonUp(0); if (clickCheck && !(CrosshairPosition is null)) { _fireSimulation.AddPlant(CrosshairPosition.Value); } } private void TryLightFire() { if (Input.GetMouseButtonUp(0)) { Ray ray = _camera.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(ray, out RaycastHit hit, 100000f, FireLayer)) { _fireSimulation.LightFire(hit.collider.gameObject); } } } private void TryRemovePlant() { if (Input.GetMouseButtonUp(0)) { Ray ray = _camera.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(ray, out RaycastHit hit, 100000f, FireLayer)) { _fireSimulation.RemovePlant(hit.collider.gameObject); } } } } }
30.605634
82
0.552692
[ "MIT" ]
janovrom/fire-simulation
Runtime/Utility/SimulationInteraction.cs
2,175
C#
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.HttpsPolicy; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Microsoft.OpenApi.Models; namespace Holiday.WebApi { public class Startup { public Startup(IConfiguration configuration) { Configuration = configuration; } public IConfiguration Configuration { get; } // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddControllers(); services.AddSwaggerGen(c => { c.SwaggerDoc("v1", new OpenApiInfo { Title = "Holiday.WebApi", Version = "v1" }); }); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseSwagger(); app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "Holiday.WebApi v1")); } app.UseHttpsRedirection(); app.UseRouting(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); } } }
30.266667
107
0.609031
[ "MIT" ]
paolomococci/dotnet-fullstack-workshop
Holiday/src/presentation/Holiday.WebApi/Startup.cs
1,816
C#
using System; using System.Reflection.Metadata; using System.Linq; using System.Collections.Generic; using System.IO; namespace Semmle.Extraction.CIL.Entities { /// <summary> /// A type reference, to a type in a referenced assembly. /// </summary> public sealed class TypeReferenceType : Type { private readonly TypeReferenceHandle handle; private readonly TypeReference tr; private readonly Lazy<TypeTypeParameter[]> typeParams; private readonly NamedTypeIdWriter idWriter; public TypeReferenceType(Context cx, TypeReferenceHandle handle) : base(cx) { this.idWriter = new NamedTypeIdWriter(this); this.handle = handle; this.tr = cx.MdReader.GetTypeReference(handle); this.typeParams = new Lazy<TypeTypeParameter[]>(GenericsHelper.MakeTypeParameters(this, ThisTypeParameterCount)); } public override bool Equals(object? obj) { return obj is TypeReferenceType t && handle.Equals(t.handle); } public override int GetHashCode() { return handle.GetHashCode(); } public override IEnumerable<IExtractionProduct> Contents { get { foreach (var tp in typeParams.Value) yield return tp; foreach (var c in base.Contents) yield return c; } } public override string Name => GenericsHelper.GetNonGenericName(tr.Name, Cx.MdReader); public override Namespace ContainingNamespace => Cx.CreateNamespace(tr.Namespace); public override Type? ContainingType { get { return tr.ResolutionScope.Kind == HandleKind.TypeReference ? (Type)Cx.Create((TypeReferenceHandle)tr.ResolutionScope) : null; } } public override CilTypeKind Kind => CilTypeKind.ValueOrRefType; public override void WriteAssemblyPrefix(TextWriter trapFile) { switch (tr.ResolutionScope.Kind) { case HandleKind.TypeReference: ContainingType!.WriteAssemblyPrefix(trapFile); break; case HandleKind.AssemblyReference: var assemblyDef = Cx.MdReader.GetAssemblyReference((AssemblyReferenceHandle)tr.ResolutionScope); trapFile.Write(Cx.GetString(assemblyDef.Name)); trapFile.Write('_'); trapFile.Write(assemblyDef.Version.ToString()); trapFile.Write(Entities.Type.AssemblyTypeNameSeparator); break; default: Cx.WriteAssemblyPrefix(trapFile); break; } } public override int ThisTypeParameterCount => GenericsHelper.GetGenericTypeParameterCount(tr.Name, Cx.MdReader); public override IEnumerable<Type> TypeParameters => GenericsHelper.GetAllTypeParameters(ContainingType, typeParams!.Value); public override IEnumerable<Type> ThisGenericArguments => typeParams.Value; public override void WriteId(TextWriter trapFile, bool inContext) { idWriter.WriteId(trapFile, inContext); } public override Type Construct(IEnumerable<Type> typeArguments) { if (TotalTypeParametersCount != typeArguments.Count()) throw new InternalError("Mismatched type arguments"); return Cx.Populate(new ConstructedType(Cx, this, typeArguments)); } } }
35.047619
131
0.608152
[ "MIT" ]
denislevin/ql
csharp/extractor/Semmle.Extraction.CIL/Entities/TypeReferenceType.cs
3,680
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; using System.Linq; using Microsoft.Azure.Commands.OperationalInsights.Models; using System.Management.Automation; using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; using Microsoft.Azure.Commands.OperationalInsights.Properties; using Microsoft.WindowsAzure.Commands.Utilities.Common; namespace Microsoft.Azure.Commands.OperationalInsights { [Cmdlet("New", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "OperationalInsightsApplicationInsightsDataSource", SupportsShouldProcess = true, DefaultParameterSetName = ByWorkspaceName), OutputType(typeof(PSDataSource))] public class NewAzureOperationalInsightsApplicationInsightsDataSourceCommand : NewAzureOperationalInsightsDataSourceBaseCmdlet { const string ByWorkspaceNameByApplicationResourceId = "ByWorkspaceNameByApplicationResourceId"; const string ByWorkspaceObjectByApplicationResourceId = "ByWorkspaceObjectByApplicationResourceId"; const string ByWorkspaceNameByApplicationParameters = "ByWorkspaceNameByApplicationParameters"; const string ByWorkspaceObjectByApplicationParameters = "ByWorkspaceObjectByApplicationParameters"; [Parameter(Position = 0, ParameterSetName = ByWorkspaceObjectByApplicationParameters, Mandatory = true, ValueFromPipeline = true, HelpMessage = "The workspace that will contain the data source.")] [Parameter(Position = 0, ParameterSetName = ByWorkspaceObjectByApplicationResourceId, Mandatory = true, ValueFromPipeline = true, HelpMessage = "The workspace that will contain the data source.")] [ValidateNotNull] public override PSWorkspace Workspace { get; set; } [Parameter(Position = 1, ParameterSetName = ByWorkspaceNameByApplicationParameters, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource group name.")] [Parameter(Position = 1, ParameterSetName = ByWorkspaceNameByApplicationResourceId, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource group name.")] [ResourceGroupCompleter] [ValidateNotNullOrEmpty] public override string ResourceGroupName { get; set; } [Parameter(Position = 2, ParameterSetName = ByWorkspaceNameByApplicationParameters, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the workspace that will contain the data source.")] [Parameter(Position = 2, ParameterSetName = ByWorkspaceNameByApplicationResourceId, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the workspace that will contain the data source.")] [ValidateNotNullOrEmpty] public override string WorkspaceName { get; set; } [Parameter(Mandatory = true, ParameterSetName = ByWorkspaceNameByApplicationParameters, ValueFromPipelineByPropertyName = true, HelpMessage = "The subscription id of the linked application.")] [Parameter(Mandatory = true, ParameterSetName = ByWorkspaceObjectByApplicationParameters, ValueFromPipelineByPropertyName = true, HelpMessage = "The subscription id of the linked application.")] [ValidateNotNullOrEmpty] public string ApplicationSubscriptionId { get; set; } [Parameter(Mandatory = true, ParameterSetName = ByWorkspaceNameByApplicationParameters, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource group name of the linked application.")] [Parameter(Mandatory = true, ParameterSetName = ByWorkspaceObjectByApplicationParameters, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource group name of the linked application.")] [ValidateNotNullOrEmpty] public string ApplicationResourceGroupName { get; set; } [Parameter(Mandatory = true, ParameterSetName = ByWorkspaceNameByApplicationParameters, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the linked application.")] [Parameter(Mandatory = true, ParameterSetName = ByWorkspaceObjectByApplicationParameters, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the linked application.")] [ValidateNotNullOrEmpty] public string ApplicationName { get; set; } [Parameter(Mandatory = true, ParameterSetName = ByWorkspaceNameByApplicationResourceId, ValueFromPipelineByPropertyName = true, HelpMessage = "The linked application resource id.")] [Parameter(Mandatory = true, ParameterSetName = ByWorkspaceObjectByApplicationResourceId, ValueFromPipelineByPropertyName = true, HelpMessage = "The linked application resource id.")] [ValidateNotNullOrEmpty] public string ApplicationResourceId { get; set; } [Parameter(Mandatory = false, HelpMessage = "Don't ask for confirmation.")] public override SwitchParameter Force { get; set; } public override void ExecuteCmdlet() { this.Name = PSDataSourceKinds.ApplicationInsights; if (this.IsParameterBound(c => c.Workspace)) { ResourceGroupName = Workspace.ResourceGroupName; WorkspaceName = Workspace.Name; } var resourceId = default(string); if (this.IsParameterBound(c => c.ApplicationResourceId)) { ValidateResourceId(ApplicationResourceId); resourceId = ApplicationResourceId; } else { resourceId = string.Format(Resources.ApplicationInsightsArmResourceFormat, ApplicationSubscriptionId, ApplicationResourceGroupName, ApplicationName); } var applicationInsightsProperties = new PSApplicationInsightsDataSourceProperties() { LinkedResourceId = resourceId }; CreatePSDataSourceWithProperties(applicationInsightsProperties); } private void ValidateResourceId(string resourceId) { int[] indicesToRemove = {1, 3, 7}; // get only constant tokens in arm url template and compare var actualTokens = resourceId.Trim('/').Split('/').Where((token, idx) => !indicesToRemove.Contains(idx)).ToArray(); var expectedTokens = Resources.ApplicationInsightsArmResourceFormat.Trim('/').Split('/').Where((token, idx) => !indicesToRemove.Contains(idx)).ToArray(); if (actualTokens.Except(expectedTokens).Any()) { throw new ArgumentException(Resources.DataSourceInvalidApplicationInsightsResourceId); } } } }
66.410714
235
0.711078
[ "MIT" ]
3quanfeng/azure-powershell
src/OperationalInsights/OperationalInsights/DataSources/NewDataSourceCmdletsPerKind/NewAzureOperationalInsightsApplicationInsightsDataSourceCommand.cs
7,329
C#
//------------------------------------------------------------------------------ // <auto-generated> // 此代码已从模板生成。 // // 手动更改此文件可能导致应用程序出现意外的行为。 // 如果重新生成代码,将覆盖对此文件的手动更改。 // </auto-generated> //------------------------------------------------------------------------------ namespace YihuiMgr.Data { using System; using System.Collections.Generic; public partial class city { public int city_id { get; set; } public string city_name { get; set; } public int province_id { get; set; } } }
24.954545
80
0.428051
[ "MIT" ]
meloht/yihuiServer
YihuiMgr/YihuiMgr/Data/city.cs
659
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace NFSDK { class NFElement : NFIElement { public NFElement() { mxPropertyManager = new NFPropertyManager(new NFGUID()); } public override NFIPropertyManager GetPropertyManager() { return mxPropertyManager; } public override Int64 QueryInt(string strName) { NFIProperty xProperty = GetPropertyManager().GetProperty(strName); if (null != xProperty) { return xProperty.QueryInt(); } return 0; } public override double QueryFloat(string strName) { NFIProperty xProperty = GetPropertyManager().GetProperty(strName); if (null != xProperty) { return xProperty.QueryFloat(); } return 0.0; } public override string QueryString(string strName) { NFIProperty xProperty = GetPropertyManager().GetProperty(strName); if (null != xProperty) { return xProperty.QueryString(); } return NFDataList.NULL_STRING; } public override NFGUID QueryObject(string strName) { NFIProperty xProperty = GetPropertyManager().GetProperty(strName); if (null != xProperty) { return xProperty.QueryObject(); } return NFDataList.NULL_OBJECT; } private NFIPropertyManager mxPropertyManager; } }
25.191176
79
0.530064
[ "MIT" ]
908760230/MyAutoChess
AutoChess/Assets/NFSDK/NFConfig/NFElement.cs
1,715
C#
using Neptuo; 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("com.neptuo.go")] [assembly: AssemblyDescription(ProductInfo.Description)] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Neptuo")] [assembly: AssemblyProduct("Neptuo Go WebSite")] [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("e2b3baa8-f112-4fd2-8511-ba53c6543609")] // 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 Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
38.783784
85
0.736585
[ "Apache-2.0" ]
neptuo/com.neptuo.go
src/WebSite/Properties/AssemblyInfo.cs
1,438
C#
using System; using System.Collections.Generic; using System.Globalization; using System.Threading; using System.Threading.Tasks; namespace MphRead { public static class Output { public enum Operation { Write, Read, Clear } private struct QueueItem { public Operation Operation; public string? Message; public QueueItem(Operation operation, string? message) { Operation = operation; Message = message; } } private struct QueueInput { public int Count; public string Message; public QueueInput(int count, string message) { Count = count; Message = message; } } private static bool _initialized = false; private static readonly SemaphoreSlim _lock = new SemaphoreSlim(1, 1); private static readonly SemaphoreSlim _batchLock = new SemaphoreSlim(1, 1); private static CancellationTokenSource _cts = null!; private static List<QueueItem> _items = null!; private static List<QueueInput> _input = null!; public static async Task Begin() { await _lock.WaitAsync(); if (!_initialized) { _initialized = true; _items = new List<QueueItem>(); _input = new List<QueueInput>(); _cts = new CancellationTokenSource(); _ = Task.Run(async () => { CultureInfo.CurrentCulture = CultureInfo.InvariantCulture; await Run(_cts.Token); }); } _lock.Release(); } private static Guid? _batchGuid = null; public static async Task<Guid> StartBatch() { await _batchLock.WaitAsync(); _batchGuid = Guid.NewGuid(); return _batchGuid.Value; } public static async Task EndBatch() { await _lock.WaitAsync(); _batchGuid = null; _batchLock.Release(); _lock.Release(); } public static async Task Write(Guid? guid = null) { await Write("", guid); } public static async Task Write(string message, Guid? guid = null) { await _lock.WaitAsync(); if (guid != _batchGuid) { await _batchLock.WaitAsync(); } _items.Add(new QueueItem(Operation.Write, message)); if (guid != _batchGuid) { _batchLock.Release(); } _lock.Release(); } public static async Task Clear(Guid? guid = null) { await _lock.WaitAsync(); if (guid != _batchGuid) { await _batchLock.WaitAsync(); } _items.Add(new QueueItem(Operation.Clear, message: null)); if (guid != _batchGuid) { _batchLock.Release(); } _lock.Release(); } public static async Task<string> Read(string? message = null, Guid? guid = null) { await _lock.WaitAsync(); if (guid != _batchGuid) { await _batchLock.WaitAsync(); } _items.Add(new QueueItem(Operation.Read, message)); int count = _input.Count; if (guid != _batchGuid) { _batchLock.Release(); } _lock.Release(); return await DoRead(count); } private static async Task<string> DoRead(int count) { while (true) { await _lock.WaitAsync(); if (_input.Count > 0 && _input[0].Count == count) { string input = _input[0].Message; _input.RemoveAt(0); _lock.Release(); return input; } _lock.Release(); await Task.Delay(100); } } private static async Task Run(CancellationToken token) { while (!token.IsCancellationRequested) { await _lock.WaitAsync(CancellationToken.None); while (_items.Count > 0) { QueueItem item = _items[0]; if (item.Operation == Operation.Write) { Console.WriteLine(item.Message); } else if (item.Operation == Operation.Clear) { Console.Clear(); } else if (item.Operation == Operation.Read) { if (item.Message != null) { Console.Write(item.Message); _input.Add(new QueueInput(_input.Count, Console.ReadLine() ?? "")); } } _items.RemoveAt(0); } _lock.Release(); await Task.Delay(100, CancellationToken.None); } } public static async Task End() { await _lock.WaitAsync(); if (_initialized) { _cts.Cancel(); } _lock.Release(); } } }
29.076923
95
0.454321
[ "MIT" ]
DevCas1/MphRead
src/MphRead/Utility/Output.cs
5,670
C#
using System; namespace Mono.TextTemplating { internal static class StringUtil { public static Boolean IsNullOrWhiteSpace (String value) { if (value == null) return true; for (int i = 0; i < value.Length; i++) { if (!Char.IsWhiteSpace (value[i])) return false; } return true; } } }
16.368421
57
0.649518
[ "MIT" ]
yuanrui/t4
Mono.TextTemplating/Mono.TextTemplating/StringUtil.cs
311
C#
/* ********************************************************************* * This Source Code Form is copyright of 51Degrees Mobile Experts Limited. * Copyright © 2017 51Degrees Mobile Experts Limited, 5 Charlotte Close, * Caversham, Reading, Berkshire, United Kingdom RG4 7BY * * This Source Code Form is the subject of the following patents and patent * applications, owned by 51Degrees Mobile Experts Limited of 5 Charlotte * Close, Caversham, Reading, Berkshire, United Kingdom RG4 7BY: * European Patent No. 2871816; * European Patent Application No. 17184134.9; * United States Patent Nos. 9,332,086 and 9,350,823; and * United States Patent Application No. 15/686,066. * * 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/. * * This Source Code Form is “Incompatible With Secondary Licenses”, as * defined by the Mozilla Public License, v. 2.0. * ********************************************************************* */ using System; using System.Web.UI; using System.Web.UI.WebControls; using FiftyOne.Foundation.Mobile; using FiftyOne.Foundation.Mobile.Detection; namespace FiftyOne.Foundation.UI.Web { /// <summary> /// Displays key stats about the active data provider. /// </summary> public class Stats : UserControl { #region Fields private string _cssClass = "footer"; private Literal _literal = null; private bool _buttonVisible = true; private string _buttonText = Resources.StatsRefreshButtonText; private string _buttonCssClass = "button"; private string _html = Resources.StatsHtml; private Button _buttonRefresh = null; #endregion #region Properties /// <summary> /// Returns true if the refresh button should be visible. /// </summary> public bool ButtonVisible { get { return _buttonVisible; } set { _buttonVisible = value; } } /// <summary> /// Sets the Html for the control with the following replacable sections. /// {0} = CssClass /// {1} = Data type Lite / Premium /// {2} = Published data /// {3} = Count of available properties /// {4} = Detection time /// </summary> public string Html { get { return _html; } set { _html = value; } } /// <summary> /// The text that appears on the CSS button. /// </summary> public string RefreshButtonText { get { return _buttonText; } set { _buttonText = value; } } /// <summary> /// The css class used for the refresh button. /// </summary> public string ButtonCssClass { get { return _buttonCssClass; } set { _buttonCssClass = value; } } /// <summary> /// The css class used for the statistics literal control. /// </summary> public string CssClass { get { return _cssClass; } set { _cssClass = value; } } #endregion #region Events /// <summary> /// Initialise the control. /// </summary> /// <param name="e"></param> protected override void OnInit(EventArgs e) { base.OnInit(e); _buttonRefresh = new Button(); _literal = new Literal(); _buttonRefresh.ID = "ButtonRefresh"; Controls.Add(_literal); Controls.Add(_buttonRefresh); _buttonRefresh.Click += new EventHandler(_buttonRefresh_Click); Page.PreRenderComplete += new EventHandler(Page_PreRenderComplete); } /// <summary> /// The refresh button has been clicked, refresh the data. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void _buttonRefresh_Click(object sender, EventArgs e) { try { if (AutoUpdate.Download(LicenceKey.Keys) == LicenceKeyResults.Success) { WebProvider.Refresh(); } } catch (Exception ex) { EventLog.Warn(new MobileException("Exception refreshing data.", ex)); } } /// <summary> /// Set the properties of the controls. /// </summary> /// <param name="e"></param> protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); _buttonRefresh.Text = RefreshButtonText; _buttonRefresh.CssClass = ButtonCssClass; // Only enable the refresh button if premium keys are available. _buttonRefresh.Visible = ButtonVisible && LicenceKey.Keys != null && LicenceKey.Keys.Length > 0; // Enable the button if there's a chance new data could be available. var provider = WebProvider.ActiveProvider; _buttonRefresh.Enabled = provider != null ? provider.DataSet.Published.Add( FiftyOne.Foundation.Mobile.Detection.Constants.AutoUpdateWait) < DateTime.UtcNow : true; } /// <summary> /// Displays the statistics about the provider. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_PreRenderComplete(object sender, EventArgs e) { var dataSet = WebProvider.ActiveProvider != null ? WebProvider.ActiveProvider.DataSet : null; _literal.Text = String.Format( Html, CssClass, dataSet != null ? dataSet.Name : "Not Present", dataSet != null ? dataSet.Published : DateTime.MinValue, dataSet != null ? dataSet.Properties.Count : 0, Request.Browser[FiftyOne.Foundation.Mobile.Detection.Constants.DetectionTimeProperty], Context.Items["51D_AverageResponseTime"] == null ? "NA" : Context.Items["51D_AverageResponseTime"], Context.Items["51D_AverageCompletionTime"] == null ? "NA" : Context.Items["51D_AverageCompletionTime"]); } #endregion } }
36.43956
121
0.553227
[ "MPL-2.0", "MPL-2.0-no-copyleft-exception" ]
51Degrees/.NET-Device-Detection
FoundationV3/UI/Web/Stats.cs
6,639
C#
using System; using System.Xml.Serialization; using System.ComponentModel.DataAnnotations; using BroadWorksConnector.Ocip.Validation; using System.Collections.Generic; namespace BroadWorksConnector.Ocip.Models { /// <summary> /// Modify data for a group or department Music On Hold Instance. /// The response is either SuccessResponse or ErrorResponse. /// <see cref="SuccessResponse"/> /// <see cref="ErrorResponse"/> /// </summary> [Serializable] [XmlRoot(Namespace = "")] [Groups(@"[{""__type"":""Sequence:#BroadWorksConnector.Ocip.Validation"",""id"":""ab0042aa512abc10edb3c55e4b416b0b:11424""}]")] public class GroupMusicOnHoldModifyInstanceRequest14 : BroadWorksConnector.Ocip.Models.C.OCIRequest { private string _serviceProviderId; [XmlElement(ElementName = "serviceProviderId", IsNullable = false, Namespace = "")] [Group(@"ab0042aa512abc10edb3c55e4b416b0b:11424")] [MinLength(1)] [MaxLength(30)] public string ServiceProviderId { get => _serviceProviderId; set { ServiceProviderIdSpecified = true; _serviceProviderId = value; } } [XmlIgnore] protected bool ServiceProviderIdSpecified { get; set; } private string _groupId; [XmlElement(ElementName = "groupId", IsNullable = false, Namespace = "")] [Group(@"ab0042aa512abc10edb3c55e4b416b0b:11424")] [MinLength(1)] [MaxLength(30)] public string GroupId { get => _groupId; set { GroupIdSpecified = true; _groupId = value; } } [XmlIgnore] protected bool GroupIdSpecified { get; set; } private BroadWorksConnector.Ocip.Models.DepartmentKey _department; [XmlElement(ElementName = "department", IsNullable = false, Namespace = "")] [Optional] [Group(@"ab0042aa512abc10edb3c55e4b416b0b:11424")] public BroadWorksConnector.Ocip.Models.DepartmentKey Department { get => _department; set { DepartmentSpecified = true; _department = value; } } [XmlIgnore] protected bool DepartmentSpecified { get; set; } private bool _isActiveDuringCallHold; [XmlElement(ElementName = "isActiveDuringCallHold", IsNullable = false, Namespace = "")] [Optional] [Group(@"ab0042aa512abc10edb3c55e4b416b0b:11424")] public bool IsActiveDuringCallHold { get => _isActiveDuringCallHold; set { IsActiveDuringCallHoldSpecified = true; _isActiveDuringCallHold = value; } } [XmlIgnore] protected bool IsActiveDuringCallHoldSpecified { get; set; } private bool _isActiveDuringCallPark; [XmlElement(ElementName = "isActiveDuringCallPark", IsNullable = false, Namespace = "")] [Optional] [Group(@"ab0042aa512abc10edb3c55e4b416b0b:11424")] public bool IsActiveDuringCallPark { get => _isActiveDuringCallPark; set { IsActiveDuringCallParkSpecified = true; _isActiveDuringCallPark = value; } } [XmlIgnore] protected bool IsActiveDuringCallParkSpecified { get; set; } private bool _isActiveDuringBusyCampOn; [XmlElement(ElementName = "isActiveDuringBusyCampOn", IsNullable = false, Namespace = "")] [Optional] [Group(@"ab0042aa512abc10edb3c55e4b416b0b:11424")] public bool IsActiveDuringBusyCampOn { get => _isActiveDuringBusyCampOn; set { IsActiveDuringBusyCampOnSpecified = true; _isActiveDuringBusyCampOn = value; } } [XmlIgnore] protected bool IsActiveDuringBusyCampOnSpecified { get; set; } private BroadWorksConnector.Ocip.Models.MusicOnHoldMessageSelection _messageSelection; [XmlElement(ElementName = "messageSelection", IsNullable = false, Namespace = "")] [Optional] [Group(@"ab0042aa512abc10edb3c55e4b416b0b:11424")] public BroadWorksConnector.Ocip.Models.MusicOnHoldMessageSelection MessageSelection { get => _messageSelection; set { MessageSelectionSpecified = true; _messageSelection = value; } } [XmlIgnore] protected bool MessageSelectionSpecified { get; set; } private BroadWorksConnector.Ocip.Models.AccessDeviceEndpointModify _accessDeviceEndpoint; [XmlElement(ElementName = "accessDeviceEndpoint", IsNullable = true, Namespace = "")] [Optional] [Group(@"ab0042aa512abc10edb3c55e4b416b0b:11424")] public BroadWorksConnector.Ocip.Models.AccessDeviceEndpointModify AccessDeviceEndpoint { get => _accessDeviceEndpoint; set { AccessDeviceEndpointSpecified = true; _accessDeviceEndpoint = value; } } [XmlIgnore] protected bool AccessDeviceEndpointSpecified { get; set; } private BroadWorksConnector.Ocip.Models.LabeledFileResource _audioFile; [XmlElement(ElementName = "audioFile", IsNullable = false, Namespace = "")] [Optional] [Group(@"ab0042aa512abc10edb3c55e4b416b0b:11424")] public BroadWorksConnector.Ocip.Models.LabeledFileResource AudioFile { get => _audioFile; set { AudioFileSpecified = true; _audioFile = value; } } [XmlIgnore] protected bool AudioFileSpecified { get; set; } private BroadWorksConnector.Ocip.Models.LabeledFileResource _videoFile; [XmlElement(ElementName = "videoFile", IsNullable = false, Namespace = "")] [Optional] [Group(@"ab0042aa512abc10edb3c55e4b416b0b:11424")] public BroadWorksConnector.Ocip.Models.LabeledFileResource VideoFile { get => _videoFile; set { VideoFileSpecified = true; _videoFile = value; } } [XmlIgnore] protected bool VideoFileSpecified { get; set; } } }
31.81068
131
0.599878
[ "MIT" ]
Rogn/broadworks-connector-net
BroadworksConnector/Ocip/Models/GroupMusicOnHoldModifyInstanceRequest14.cs
6,553
C#
using System; using System.Diagnostics; using System.Runtime.InteropServices; using System.Threading; using System.Windows; namespace RetroGame { public partial class App : Application { private Mutex _mutex; [DllImport("user32.dll")] [return: MarshalAs(UnmanagedType.Bool)] private static extern bool SetForegroundWindow(IntPtr hWnd); private void App_Startup(object sender, StartupEventArgs e) { try { Mutex("RetroGame"); Window window = new MainWindow(); window.Show(); } catch { Current.Shutdown(); } } private void Mutex(string name) { _mutex = new Mutex(true, name, out var createdNew); if (!createdNew) { var current = Process.GetCurrentProcess(); foreach (var process in Process.GetProcessesByName(current.ProcessName)) { if (process.Id == current.Id) continue; SetForegroundWindow(process.MainWindowHandle); break; } Current.Shutdown(); } else { Exit += CloseMutexHandler; } } protected virtual void CloseMutexHandler(object sender, EventArgs e) { _mutex?.Close(); } } }
24.491803
88
0.504685
[ "MIT" ]
rh-utensils/RetroGame
RetroGame/RetroGame/App.xaml.cs
1,496
C#
using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Data; using System.Data.Entity; using System.Data.Entity.ModelConfiguration; using System.Data.Entity.ModelConfiguration.Conventions; using System.Linq; using System.Globalization; using System.Web; using System.Web.Mvc; using System.Web.Security; using APPBASE.Helpers; using APPBASE.Models; using APPBASE.Svcbiz; namespace APPBASE.Models { [Table("VWEDU01SKH_STUDENTD_INFO")] public partial class Skhstudentd_info { public int? CREATEBY { get; set; } public int? UPDATEBY { get; set; } public DateTime? CREATEDT { get; set; } public DateTime? UPDATEDT { get; set; } [Key] public int? ID { get; set; } public Byte? DTA_STS { get; set; } public int? STUDENTSKH_ID { get; set; } public int? EVALUATION_ID { get; set; } public int? RATE_ID { get; set; } public string EVALUATION_CODE { get; set; } public string EVALUATION_DESC { get; set; } public string RATE_CODE { get; set; } public string RATE_DESC { get; set; } } //End public partial class Skhstudentd_info } //End namespace APPBASE.Models
32.897436
56
0.692128
[ "MIT" ]
arinsuga/kindup
APPBASE/Models/EDU/Skhstudentd/SkhstudentdDS.cs
1,285
C#
using System.Linq; using System.Security.Cryptography; using System.Threading.Tasks; using System.Security.Claims; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; namespace Cloud5mins.domain { public static class Utility { //reshuffled for randomisation, same unique characters just jumbled up, you can replace with your own version private const string ConversionCode = "FjTG0s5dgWkbLf_8etOZqMzNhmp7u6lUJoXIDiQB9-wRxCKyrPcv4En3Y21aASHV"; private static readonly int Base = ConversionCode.Length; //sets the length of the unique code to add to vanity private const int MinVanityCodeLength = 5; public static async Task<string> GetValidEndUrl(string vanity, StorageTableHelper stgHelper) { if (string.IsNullOrEmpty(vanity)) { var newKey = await stgHelper.GetNextTableId(); string getCode() => Encode(newKey); if (await stgHelper.IfShortUrlEntityExistByVanity(getCode())) return await GetValidEndUrl(vanity, stgHelper); return string.Join(string.Empty, getCode()); } else { return string.Join(string.Empty, vanity); } } public static string Encode(int i) { if (i == 0) return ConversionCode[0].ToString(); return GenerateUniqueRandomToken(i); } public static string GetShortUrl(string host, string vanity) { return host + "/" + vanity; } // generates a unique, random, and alphanumeric token for the use as a url //(not entirely secure but not sequential so generally not guessable) public static string GenerateUniqueRandomToken(int uniqueId) { using (var generator = new RNGCryptoServiceProvider()) { //minimum size I would suggest is 5, longer the better but we want short URLs! var bytes = new byte[MinVanityCodeLength]; generator.GetBytes(bytes); var chars = bytes .Select(b => ConversionCode[b % ConversionCode.Length]); var token = new string(chars.ToArray()); var reversedToken = string.Join(string.Empty, token.Reverse()); return uniqueId + reversedToken; } } public static IActionResult CatchUnauthorize(ClaimsPrincipal principal, ILogger log) { if (principal == null) { log.LogWarning("No principal."); return new UnauthorizedResult(); } if (principal.Identity == null) { log.LogWarning("No identity."); return new UnauthorizedResult(); } if (!principal.Identity.IsAuthenticated) { log.LogWarning("Request was not authenticated."); return new UnauthorizedResult(); } /* if (principal.FindFirst(ClaimTypes.GivenName) is null) { log.LogError("Claim not Found"); return new BadRequestObjectResult(new { message = "Claim not Found", StatusCode = System.Net.HttpStatusCode.BadRequest }); } */ return null; } } }
35.806122
117
0.564548
[ "MIT" ]
TJBos/AzUrlShortener
src/shortenerTools/Domain/Utility.cs
3,509
C#
using UnityEngine; using TMPro; namespace StoryTime.Components.UI { using Components; using Components.ScriptableObjects; using Events.ScriptableObjects; public class InventoryItemFiller : ItemBaseFiller<ItemStack, ItemSO> { [SerializeField] private TextMeshProUGUI itemCount; public override void SetItem(ItemStack itemStack, bool isSelected, ItemEventChannelSO selectItemEvent) { base.SetItem(itemStack, isSelected, selectItemEvent); itemCount.text = itemStack.Amount.ToString(); OnPointerExit(null); } } }
22.375
104
0.787709
[ "Apache-2.0" ]
vamidi/StoryTime-UPM
Runtime/UI/Inventory/InventoryItemFiller.cs
537
C#
using System; namespace _07.String_Encryption { class Program { static void Main(string[] args) { var n = int.Parse(Console.ReadLine()); string result = string.Empty; for (int i = 0; i < n; i++) { var letter = char.Parse(Console.ReadLine()); result += Enctypt(letter); } Console.WriteLine(result); } static string Enctypt(char letter) { string result = string.Empty; var ascii = (int)letter; var last = ascii % 10; var first = ascii; while(first>=10) { first /= 10; ; } string digitMid = first.ToString() + last.ToString(); var begin = (char)(ascii + last); var end = (char)(ascii - first); result = begin + digitMid + end; return result; } } }
25.375
65
0.433498
[ "MIT" ]
spiderbait90/Step-By-Step-In-C-Sharp
Programming Fundamentals/Methods And Debugging/07. String Encryption/Program.cs
1,017
C#
#if NET472 using Havit.Diagnostics.Contracts; using System; using System.Collections.Generic; using System.Diagnostics; using System.DirectoryServices; using System.DirectoryServices.ActiveDirectory; using System.Linq; using System.Security.Principal; using System.Text; using System.Threading.Tasks; namespace Havit.Services.DirectoryServices.ActiveDirectory { /// <summary> /// Active directory services. /// Třída je dostupná pouze pro full .NET Framework (nikoliv pro .NET Standard 2.0). /// </summary> public class ActiveDirectoryServices { private readonly string domainController; private readonly string directoryServicesUsername; private readonly string directoryServicesPassword; /// <summary> /// Creates an instance of ActiveDirectoryServices class. /// </summary> public ActiveDirectoryServices() : this(null, null, null) { } /// <summary> /// Creates an instance of ActiveDirectoryServices class. /// </summary> public ActiveDirectoryServices(string directoryServicesUsername, string directoryServicesPassword) { this.directoryServicesUsername = directoryServicesUsername; this.directoryServicesPassword = directoryServicesPassword; } /// <summary> /// Creates an instance of ActiveDirectoryServices class. /// </summary> /// <param name="directoryServicesUsername">Username for accessing directory services. When empty or null, username and password is not used for accesing directory services.</param> /// <param name="directoryServicesPassword">Password for accessing directory services.</param> /// <param name="domainController">Specifies which domain controller to use. When not empty, usage of this service is limited to this domain controller domain only. When empty or null, current Domain Controller will be used.</param> public ActiveDirectoryServices(string directoryServicesUsername, string directoryServicesPassword, string domainController) { this.directoryServicesUsername = directoryServicesUsername; this.directoryServicesPassword = directoryServicesPassword; this.domainController = domainController; } /// <summary> /// Returns group members. /// Supports multi-domain environment. /// </summary> /// <param name="groupname">Group name (supported both forms DOMAIN\group and group).</param> /// <param name="includeGroups">When true, result contains members of type group (otherwise contains users only).</param> /// <param name="traverseNestedGroups">When true, result includes members of nested groups (members of members).</param> /// <exception cref="System.InvalidOperationException">Group not found.</exception> /// <remarks> /// Results are "cached" in instance memory, repetitive calls returns same results in zero time. /// </remarks> public string[] GetGroupMembers(string groupname, bool includeGroups = false, bool traverseNestedGroups = false) { Contract.Requires(!String.IsNullOrEmpty(groupname)); // Let's look to the previous calls object cacheKey = new { GroupName = groupname.ToLower(), IncludeGroups = includeGroups, TraverseNestedGroups = traverseNestedGroups }; List<string> members; if (_getGroupsMembersCache.TryGetValue(cacheKey, out members)) { return members.ToArray(); } members = new List<string>(); List<string> processedGroups = new List<string>(); GetGroupMembersInternal(groupname, includeGroups, traverseNestedGroups, members, processedGroups); _getGroupsMembersCache.Add(cacheKey, members); return members.ToArray(); } private readonly Dictionary<object, List<string>> _getGroupsMembersCache = new Dictionary<object, List<string>>(); /// <summary> /// Internal method for retrieving group members (used mainly for traversal groups). /// </summary> private void GetGroupMembersInternal(string groupname, bool includeGroups, bool traverseNestedGroups, List<string> members, List<string> processedGroups) { // checks a) repeated group by nesting, b) group cycles if (processedGroups.Contains(groupname, StringComparer.CurrentCultureIgnoreCase)) { return; } processedGroups.Add(groupname); string domainName; string accountName; SplitNameToDomainAndAccountName(groupname, out domainName, out accountName); SearchResult searchResult; using (DirectorySearcher searcher = GetDirectorySearcher(domainName)) { searcher.Filter = String.Format("(&(objectClass=group)(samaccountname={0}))", accountName); searcher.PropertiesToLoad.Add(ActiveDirectoryProperties.Member); searchResult = searcher.FindOne(); } if (searchResult == null) { throw new GroupNotFoundException(groupname); } List<SearchResult> searchResults = new List<SearchResult>(); ResultPropertyValueCollection groupMembersIdentifiers = searchResult.Properties[ActiveDirectoryProperties.Member]; if (groupMembersIdentifiers.Count > 0) { string distinguishedNames = String.Join("", groupMembersIdentifiers.OfType<string>().Select(memberIdentifier => string.Format("(distinguishedName={0})", memberIdentifier))); using (DirectorySearcher searcher = GetDirectorySearcher(domainName)) { searcher.Filter = String.Format("(|{0})", distinguishedNames); searcher.PropertiesToLoad.Add(ActiveDirectoryProperties.ObjectSid); searcher.SizeLimit = groupMembersIdentifiers.Count; searchResults.AddRange(searcher.FindAll().Cast<SearchResult>()); } } SecurityIdentifier groupSecurityIdentifier = (SecurityIdentifier)(new NTAccount(domainName, accountName).Translate(typeof(SecurityIdentifier))); string groupSsdl = groupSecurityIdentifier.Value; string groupPrimaryID = groupSsdl.Substring(groupSsdl.LastIndexOf('-') + 1); using (DirectorySearcher searcher = GetDirectorySearcher(domainName)) { searcher.Filter = String.Format("(primaryGroupID={0})", groupPrimaryID); searcher.PropertiesToLoad.Add(ActiveDirectoryProperties.ObjectSid); searchResults.AddRange(searcher.FindAll().Cast<SearchResult>()); } foreach (SearchResult memberSearchResult in searchResults) { string memberAccountName; byte[] sid = (byte[])memberSearchResult.Properties[ActiveDirectoryProperties.ObjectSid][0]; if (!TryGetAccountName(sid, out memberAccountName)) { continue; } bool isUser; bool isGroup; if (!TryGetAccountClass(memberAccountName, out isUser, out isGroup)) { continue; } if (isUser || (includeGroups && isGroup)) { if (!members.Contains(memberAccountName, StringComparer.CurrentCultureIgnoreCase)) { members.Add(memberAccountName); } } if (isGroup && traverseNestedGroups) { GetGroupMembersInternal(memberAccountName, includeGroups, traverseNestedGroups /* true */, members, processedGroups); } } } /// <summary> /// Returns users membership (groups of which is a member). /// Does not support BUILTIN\\... groups. /// DOES NOT SUPPORT MULTIDOMAIN ENVIRONMENT - Only groups in the same domain as user are in the result. /// </summary> /// <param name="username">Username (supported both forms DOMAIN\user and user).</param> /// <remarks> /// Results are "cached" in instance memory, repetitive calls returns same results in zero time. /// </remarks> public string[] GetUserDomainMembership(string username) { Contract.Requires(!String.IsNullOrEmpty(username)); List<string> result; string cacheKey = username.ToLower(); if (_getGroupsMembersCache.TryGetValue(cacheKey, out result)) { return result.ToArray(); } string domainName; string accountName; SplitNameToDomainAndAccountName(username, out domainName, out accountName); SearchResult searchResult; using (DirectorySearcher searcher = GetDirectorySearcher(domainName)) { searcher.Filter = String.Format("(&(objectClass=user)(samaccountname={0}))", accountName); searcher.PropertiesToLoad.Add(ActiveDirectoryProperties.ObjectSid); searcher.PropertiesToLoad.Add(ActiveDirectoryProperties.MemberOf); searcher.PropertiesToLoad.Add(ActiveDirectoryProperties.PrimaryGroupID); searchResult = searcher.FindOne(); } if (searchResult == null) { throw new UserNotFoundException(username); } result = new List<string>(); ResultPropertyValueCollection groupIdentifiers = searchResult.Properties[ActiveDirectoryProperties.MemberOf]; byte[] userSid = (byte[])searchResult.Properties[ActiveDirectoryProperties.ObjectSid][0]; int? userPrimaryGroupID = searchResult.Properties[ActiveDirectoryProperties.PrimaryGroupID] != null ? (int?)searchResult.Properties[ActiveDirectoryProperties.PrimaryGroupID][0] : null; if (groupIdentifiers.Count > 0) { string distinguishedNames = String.Join("", groupIdentifiers.OfType<string>().Select(memberIdentifier => string.Format("(distinguishedName={0})", memberIdentifier))); SearchResultCollection groupSearchResults; using (DirectorySearcher searcher = GetDirectorySearcher(domainName)) { searcher.Filter = String.Format("(|{0})", distinguishedNames); searcher.PropertiesToLoad.Add(ActiveDirectoryProperties.ObjectSid); searcher.SizeLimit = groupIdentifiers.Count; groupSearchResults = searcher.FindAll(); } foreach (SearchResult groupSearchResult in groupSearchResults) { string groupName; byte[] groupSid = (byte[])groupSearchResult.Properties[ActiveDirectoryProperties.ObjectSid][0]; if (!TryGetAccountName(groupSid, out groupName)) { continue; } bool isUser; bool isGroup; if (!this.TryGetAccountClass(groupName, out isUser, out isGroup)) { continue; } if (isGroup) { result.Add(groupName); } } } // vyhledání dle primaryGroupID if (userPrimaryGroupID != null) { string primaryGroup = GetPrimaryGroupForSid(domainName, userSid, userPrimaryGroupID.Value); if (primaryGroup != null) { result.Add(primaryGroup); } } _getGroupsMembersCache.Add(cacheKey, result); return result.ToArray(); } private readonly Dictionary<string, List<string>> _getUserDomainMembershipCache = new Dictionary<string, List<string>>(); /// <summary> /// Returns groups from parameter of which user is a member. /// Support multidomain envinronment. /// </summary> /// <param name="username">Username (supported only form DOMAIN\user).</param> /// <param name="groups">Groups for which membership is checked.</param> /// <param name="traverseNestedGroups">When true, return groups from list when user is member of nested group. Otherwise group is in result only when user is a direct member.</param> /// <remarks> /// Results are "cached" in instance memory, repetitive calls returns same results in zero time. /// </remarks> public string[] GetUserCrossDomainMembership(string username, string[] groups, bool traverseNestedGroups = false) { // "caching" delegated to GetGroupMembers method List<string> result = new List<string>(); foreach (string group in groups) { List<string> groupMembers = new List<string>(GetGroupMembers(group, false, traverseNestedGroups)); if (groupMembers.Contains(username, StringComparer.CurrentCultureIgnoreCase)) { result.Add(group); } } return result.ToArray(); } /// <summary> /// Return user info. /// </summary> /// <param name="username">Username (supported both forms DOMAIN\user and user).</param> public UserInfo GetUserInfo(string username) { string domainName; string accountName; SplitNameToDomainAndAccountName(username, out domainName, out accountName); SearchResult searchResult; using (DirectorySearcher searcher = GetDirectorySearcher(domainName)) { searcher.Filter = string.Format("(&(objectClass=user)(samaccountname={0}))", accountName); searcher.PropertiesToLoad.Add(ActiveDirectoryProperties.DistinguishedName); searcher.PropertiesToLoad.Add(ActiveDirectoryProperties.DisplayName); searcher.PropertiesToLoad.Add(ActiveDirectoryProperties.EmailAddress); searcher.PropertiesToLoad.Add(ActiveDirectoryProperties.ObjectSid); searcher.PropertiesToLoad.Add(ActiveDirectoryProperties.FirstName); searcher.PropertiesToLoad.Add(ActiveDirectoryProperties.LastName); searcher.PropertiesToLoad.Add(ActiveDirectoryProperties.Phone); searcher.PropertiesToLoad.Add(ActiveDirectoryProperties.Mobile); searchResult = searcher.FindOne(); } if (searchResult == null) { throw new UserNotFoundException(username); } UserInfo userInfo = new UserInfo(); string accountNameTmp; byte[] sid = (byte[])searchResult.Properties[ActiveDirectoryProperties.ObjectSid][0]; if (this.TryGetAccountName(sid, out accountNameTmp)) { userInfo.AccountName = accountNameTmp; } if (searchResult.Properties.Contains(ActiveDirectoryProperties.EmailAddress)) { userInfo.EmailAddresses = searchResult.Properties[ActiveDirectoryProperties.EmailAddress].OfType<String>().ToArray(); } else { userInfo.EmailAddresses = new string[0]; } if (searchResult.Properties.Contains(ActiveDirectoryProperties.DistinguishedName)) { userInfo.DistinguishedName = searchResult.Properties[ActiveDirectoryProperties.DistinguishedName][0].ToString(); } if (searchResult.Properties.Contains(ActiveDirectoryProperties.DisplayName)) { userInfo.DisplayName = searchResult.Properties[ActiveDirectoryProperties.DisplayName][0].ToString(); } if (searchResult.Properties.Contains(ActiveDirectoryProperties.FirstName)) { userInfo.FirstName = searchResult.Properties[ActiveDirectoryProperties.FirstName][0].ToString(); } if (searchResult.Properties.Contains(ActiveDirectoryProperties.LastName)) { userInfo.LastName = searchResult.Properties[ActiveDirectoryProperties.LastName][0].ToString(); } if (searchResult.Properties.Contains(ActiveDirectoryProperties.Phone)) { userInfo.Phone = searchResult.Properties[ActiveDirectoryProperties.Phone][0].ToString(); } if (searchResult.Properties.Contains(ActiveDirectoryProperties.Mobile)) { userInfo.Mobile = searchResult.Properties[ActiveDirectoryProperties.Mobile][0].ToString(); } return userInfo; } /// <summary> /// Returns directory searcher for given domain name. /// </summary> private DirectorySearcher GetDirectorySearcher(string domainName) { DirectoryContext directoryContext; if (!String.IsNullOrEmpty(domainController)) { directoryContext = String.IsNullOrEmpty(directoryServicesUsername) ? new DirectoryContext(DirectoryContextType.DirectoryServer, domainController) : new DirectoryContext(DirectoryContextType.DirectoryServer, domainController, directoryServicesUsername, directoryServicesPassword); } else if (String.IsNullOrEmpty(domainName)) { directoryContext = String.IsNullOrEmpty(directoryServicesUsername) ? new DirectoryContext(DirectoryContextType.Domain) : new DirectoryContext(DirectoryContextType.Domain, directoryServicesUsername, directoryServicesPassword); } else { directoryContext = String.IsNullOrEmpty(directoryServicesUsername) ? new DirectoryContext(DirectoryContextType.Domain, domainName) : new DirectoryContext(DirectoryContextType.Domain, domainName, directoryServicesUsername, directoryServicesPassword); } using (Domain domain = Domain.GetDomain(directoryContext)) { if (!String.IsNullOrEmpty(domainController) && !String.IsNullOrEmpty(domainName)) { // kontrola domény v situaci, kdy je zadán domain controller a je požadována konkrétní doména // test je značně nedokonalý, porovnáváme jen textové hodnoty if ((domainName.Contains(".") && !String.Equals(domain.Name, domainName, StringComparison.CurrentCultureIgnoreCase)) // pokud je v požadované doméně tečka, jde o celý název domény || (!domainName.Contains(".") && !domain.Name.StartsWith(domainName + ".", StringComparison.CurrentCultureIgnoreCase))) // pokud není v požadované doméně tečka, nesprávně tvrdíme, že tímto textem musí skutečný název domény začínat { throw new InvalidOperationException(String.Format("Domain controller '{0}' obsluhuje doménu '{1}', nikoliv požadovanou doménu '{2}'.", domainController, domain.Name, domainName)); } } using (DirectoryEntry directoryEntry = domain.GetDirectoryEntry()) { DirectorySearcher searcher = new DirectorySearcher(directoryEntry); return searcher; } } } /// <summary> /// Splits name to domain name and account name. /// </summary> private void SplitNameToDomainAndAccountName(string name, out string domainName, out string accountName) { Contract.Requires(!String.IsNullOrEmpty(name)); string[] nameParts = name.Split('\\'); if (nameParts.Length == 1) { domainName = null; accountName = nameParts[0]; } else { domainName = nameParts[0]; accountName = nameParts[1]; } } /// <summary> /// Retrieves object sid and translates it to name (using NTAccount class) in HAVIT\\everyone format. /// When translation succedes returns true, otherwise false. /// </summary> private bool TryGetAccountName(byte[] sid, out string accountName) { try { SecurityIdentifier securityIdentifier = new SecurityIdentifier(sid, 0); accountName = ((NTAccount)securityIdentifier.Translate(typeof(NTAccount))).ToString(); if (accountName.StartsWith("BUILTIN\\")) // Pro buildin { Trace.Write(String.Format("Skipped accountname {0} due internal implementation.", accountName), typeof(ActiveDirectoryServices).Name); return false; } return true; } catch { accountName = null; return false; } } /// <summary> /// Returns account class (user, group). /// </summary> /// <remarks> /// Results are "cached" in instance memory, repetitive calls returns same results in zero time. /// </remarks> private bool TryGetAccountClass(string name, out bool isUser, out bool isGroup) { string cacheKey = name.ToLower(); TryGetAccountClass_Data resultData; if (!_tryGetAccountClass.TryGetValue(cacheKey, out resultData)) { string domainName; string accountName; SplitNameToDomainAndAccountName(name, out domainName, out accountName); SearchResult searchResult; using (DirectorySearcher searcher = GetDirectorySearcher(domainName)) { searcher.Filter = string.Format("(samaccountname={0})", accountName); searcher.PropertiesToLoad.Add(ActiveDirectoryProperties.ObjectClass); searchResult = searcher.FindOne(); } if (searchResult == null) { resultData = new TryGetAccountClass_Data { IsUser = false, IsGroup = false, Result = false }; } else { resultData = new TryGetAccountClass_Data { IsUser = searchResult.Properties[ActiveDirectoryProperties.ObjectClass].Contains("user"), IsGroup = searchResult.Properties[ActiveDirectoryProperties.ObjectClass].Contains("group"), Result = true }; } _tryGetAccountClass.Add(cacheKey, resultData); } isUser = resultData.IsUser; isGroup = resultData.IsGroup; return resultData.Result; } private readonly Dictionary<string, TryGetAccountClass_Data> _tryGetAccountClass = new Dictionary<string, TryGetAccountClass_Data>(); private class TryGetAccountClass_Data { public bool IsUser { get; set; } public bool IsGroup { get; set; } public bool Result { get; set; } } /// <summary> /// Returns primary group for user. /// </summary> private string GetPrimaryGroupForSid(string domainName, byte[] userSid, int userPrimaryGroupID) { // http://support.microsoft.com/kb/297951/en-us SecurityIdentifier userSecurityIdentifier = new SecurityIdentifier(userSid, 0); string userSsdl = userSecurityIdentifier.Value; string primaryGroupSsdl = userSsdl.Left(userSsdl.LastIndexOf('-')) + "-" + userPrimaryGroupID.ToString(); SecurityIdentifier primaryGroupSecurityIdentifier = new SecurityIdentifier(primaryGroupSsdl); byte[] primaryGroupSid = new byte[primaryGroupSecurityIdentifier.BinaryLength]; primaryGroupSecurityIdentifier.GetBinaryForm(primaryGroupSid, 0); string result; if (this.TryGetAccountName(primaryGroupSid, out result)) { return result; } return null; } } } #endif
37.592661
283
0.736138
[ "MIT" ]
havit/HavitFramework
Havit.Services/DirectoryServices/ActiveDirectory/ActiveDirectoryServices.cs
20,537
C#
namespace QuantumGate.GameObjects.Common.Interfaces { //LOW: Maybe add LoadStart and LoadComplete events? public interface ILoadable { bool IsLoaded { get; } void Load(); void Unload(); } }
23
55
0.630435
[ "MIT" ]
daerogami/FormPlayer
FormPlayer/GameObjects/Common/Interfaces/ILoadable.cs
232
C#
using System; using TMPro; using UnityEngine; using UnityEngine.UI; namespace DCL.Builder { public class SearchLandView : BaseComponentView { public event Action<string> OnValueSearch; public event Action OnSearchCanceled; [SerializeField] private TMP_InputField inputField; [SerializeField] private Button cancelSearchButton; [SerializeField] private PublishLandListView publishLandListView; public override void RefreshControl() { } public override void Start() { base.Start(); inputField.onValueChanged.AddListener(InputChanged); cancelSearchButton.onClick.AddListener(ClearSearch); } public override void Dispose() { base.Dispose(); inputField.onValueChanged.RemoveAllListeners(); } public void ClearSearch() { inputField.SetTextWithoutNotify(""); cancelSearchButton.gameObject.SetActive(false); OnSearchCanceled?.Invoke(); } internal void InputChanged(string newValue) { if (string.IsNullOrEmpty(newValue) || newValue.Length == 0) { cancelSearchButton.gameObject.SetActive(false); publishLandListView.HideEmptyContent(); return; } if(newValue.Length < 2) return; cancelSearchButton.gameObject.SetActive(true); OnValueSearch?.Invoke(newValue); } } }
28.5
73
0.589599
[ "Apache-2.0" ]
Timothyoung97/unity-renderer
unity-renderer/Assets/DCLPlugins/BuilderInWorld/Publisher/ProjectPublishHUD/Scripts/Projects/SearchLandView.cs
1,596
C#
using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading.Tasks; namespace Senai.Peoples.WebApi.Domains { public class FuncionariosDomain { public int IdFuncionario { get; set; } public string Nome { get; set; } [Required(ErrorMessage ="Por favor insira o nome")] public string Sobrenome { get; set; } public DateTime DataNascimento { get; set; } } }
23.095238
59
0.686598
[ "MIT" ]
jv-soncini/2s2019-Sprint2
Senai.Peoples.WebApi/Senai.Peoples.WebApi/Domains/FuncionariosDomain.cs
487
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.Runtime.InteropServices; using System.Runtime.CompilerServices; using System.Text; using Silk.NET.Core; using Silk.NET.Core.Native; using Silk.NET.Core.Attributes; using Silk.NET.Core.Contexts; using Silk.NET.Core.Loader; #pragma warning disable 1591 namespace Silk.NET.OpenGL.Extensions.ARB { public static class ArbGetTextureSubImageOverloads { public static unsafe void GetCompressedTextureSubImage<T0>(this ArbGetTextureSubImage thisApi, [Flow(FlowDirection.In)] uint texture, [Flow(FlowDirection.In)] int level, [Flow(FlowDirection.In)] int xoffset, [Flow(FlowDirection.In)] int yoffset, [Flow(FlowDirection.In)] int zoffset, [Flow(FlowDirection.In)] uint width, [Flow(FlowDirection.In)] uint height, [Flow(FlowDirection.In)] uint depth, [Flow(FlowDirection.In)] uint bufSize, [Flow(FlowDirection.Out)] Span<T0> pixels) where T0 : unmanaged { // SpanOverloader thisApi.GetCompressedTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, bufSize, out pixels.GetPinnableReference()); } public static unsafe void GetTextureSubImage<T0>(this ArbGetTextureSubImage thisApi, [Flow(FlowDirection.In)] uint texture, [Flow(FlowDirection.In)] int level, [Flow(FlowDirection.In)] int xoffset, [Flow(FlowDirection.In)] int yoffset, [Flow(FlowDirection.In)] int zoffset, [Flow(FlowDirection.In)] uint width, [Flow(FlowDirection.In)] uint height, [Flow(FlowDirection.In)] uint depth, [Flow(FlowDirection.In)] ARB format, [Flow(FlowDirection.In)] ARB type, [Flow(FlowDirection.In)] uint bufSize, [Flow(FlowDirection.Out)] Span<T0> pixels) where T0 : unmanaged { // SpanOverloader thisApi.GetTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, bufSize, out pixels.GetPinnableReference()); } public static unsafe void GetTextureSubImage<T0>(this ArbGetTextureSubImage thisApi, [Flow(FlowDirection.In)] uint texture, [Flow(FlowDirection.In)] int level, [Flow(FlowDirection.In)] int xoffset, [Flow(FlowDirection.In)] int yoffset, [Flow(FlowDirection.In)] int zoffset, [Flow(FlowDirection.In)] uint width, [Flow(FlowDirection.In)] uint height, [Flow(FlowDirection.In)] uint depth, [Flow(FlowDirection.In)] ARB format, [Flow(FlowDirection.In)] PixelType type, [Flow(FlowDirection.In)] uint bufSize, [Flow(FlowDirection.Out)] Span<T0> pixels) where T0 : unmanaged { // SpanOverloader thisApi.GetTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, bufSize, out pixels.GetPinnableReference()); } public static unsafe void GetTextureSubImage<T0>(this ArbGetTextureSubImage thisApi, [Flow(FlowDirection.In)] uint texture, [Flow(FlowDirection.In)] int level, [Flow(FlowDirection.In)] int xoffset, [Flow(FlowDirection.In)] int yoffset, [Flow(FlowDirection.In)] int zoffset, [Flow(FlowDirection.In)] uint width, [Flow(FlowDirection.In)] uint height, [Flow(FlowDirection.In)] uint depth, [Flow(FlowDirection.In)] PixelFormat format, [Flow(FlowDirection.In)] ARB type, [Flow(FlowDirection.In)] uint bufSize, [Flow(FlowDirection.Out)] Span<T0> pixels) where T0 : unmanaged { // SpanOverloader thisApi.GetTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, bufSize, out pixels.GetPinnableReference()); } public static unsafe void GetTextureSubImage<T0>(this ArbGetTextureSubImage thisApi, [Flow(FlowDirection.In)] uint texture, [Flow(FlowDirection.In)] int level, [Flow(FlowDirection.In)] int xoffset, [Flow(FlowDirection.In)] int yoffset, [Flow(FlowDirection.In)] int zoffset, [Flow(FlowDirection.In)] uint width, [Flow(FlowDirection.In)] uint height, [Flow(FlowDirection.In)] uint depth, [Flow(FlowDirection.In)] PixelFormat format, [Flow(FlowDirection.In)] PixelType type, [Flow(FlowDirection.In)] uint bufSize, [Flow(FlowDirection.Out)] Span<T0> pixels) where T0 : unmanaged { // SpanOverloader thisApi.GetTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, bufSize, out pixels.GetPinnableReference()); } } }
84.75
582
0.735875
[ "MIT" ]
Ar37-rs/Silk.NET
src/OpenGL/Extensions/Silk.NET.OpenGL.Extensions.ARB/ArbGetTextureSubImageOverloads.gen.cs
4,407
C#
/* // <copyright> // dotNetRDF is free and open source software licensed under the MIT License // ------------------------------------------------------------------------- // // Copyright (c) 2009-2020 dotNetRDF Project (http://dotnetrdf.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is furnished // to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // </copyright> */ using System; using System.Threading.Tasks; using VDS.RDF.Parsing.Handlers; using VDS.RDF.Storage; using VDS.RDF.Writing.Formatting; namespace VDS.RDF.Query { /// <summary> /// A SPARQL Query Processor where the query is processed by passing it to the <see cref="IQueryableStorage.Query(String)">Query()</see> method of an <see cref="IQueryableStorage">IQueryableStorage</see>. /// </summary> public class GenericQueryProcessor : QueryProcessorBase, ISparqlQueryProcessor { private readonly IQueryableStorage _manager; private readonly SparqlFormatter _formatter = new SparqlFormatter(); /// <summary> /// Creates a new Generic Query Processor. /// </summary> /// <param name="manager">Generic IO Manager.</param> public GenericQueryProcessor(IQueryableStorage manager) { _manager = manager; } /// <summary> /// Processes a SPARQL Query. /// </summary> /// <param name="query">SPARQL Query.</param> /// <returns></returns> public object ProcessQuery(SparqlQuery query) { query.QueryExecutionTime = null; var start = DateTime.Now; try { return _manager.Query(_formatter.Format(query)); } finally { var elapsed = (DateTime.Now - start); query.QueryExecutionTime = elapsed; } } /// <summary> /// Processes a SPARQL Query passing the results to the RDF or Results handler as appropriate. /// </summary> /// <param name="rdfHandler">RDF Handler.</param> /// <param name="resultsHandler">Results Handler.</param> /// <param name="query">SPARQL Query.</param> public override void ProcessQuery(IRdfHandler rdfHandler, ISparqlResultsHandler resultsHandler, SparqlQuery query) { query.QueryExecutionTime = null; var start = DateTime.Now; try { _manager.Query(rdfHandler, resultsHandler, _formatter.Format(query)); } finally { var elapsed = (DateTime.Now - start); query.QueryExecutionTime = elapsed; } } } }
39.202128
208
0.627408
[ "MIT" ]
blackwork/dotnetrdf
Libraries/dotNetRDF/Query/GenericQueryProcessor.cs
3,685
C#
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Threading; using System.Threading.Tasks; using StarkPlatform.CodeAnalysis.Text; namespace StarkPlatform.CodeAnalysis { internal class SemanticDocument : SyntacticDocument { public readonly SemanticModel SemanticModel; private SemanticDocument(Document document, SourceText text, SyntaxTree tree, SyntaxNode root, SemanticModel semanticModel) : base(document, text, tree, root) { this.SemanticModel = semanticModel; } public static new async Task<SemanticDocument> CreateAsync(Document document, CancellationToken cancellationToken) { var text = await document.GetTextAsync(cancellationToken).ConfigureAwait(false); var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); var model = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false); return new SemanticDocument(document, text, root.SyntaxTree, root, model); } } }
42.607143
161
0.725063
[ "Apache-2.0" ]
stark-lang/stark-roslyn
src/Workspaces/Core/Portable/Workspace/Solution/SemanticDocument.cs
1,195
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 backup-2018-11-15.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for UpdateFramework operation /// </summary> public class UpdateFrameworkResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { UpdateFrameworkResponse response = new UpdateFrameworkResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("CreationTime", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.CreationTime = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("FrameworkArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.FrameworkArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("FrameworkName", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.FrameworkName = unmarshaller.Unmarshall(context); continue; } } return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("ConflictException")) { return ConflictExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InvalidParameterValueException")) { return InvalidParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("LimitExceededException")) { return LimitExceededExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("MissingParameterValueException")) { return MissingParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static UpdateFrameworkResponseUnmarshaller _instance = new UpdateFrameworkResponseUnmarshaller(); internal static UpdateFrameworkResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static UpdateFrameworkResponseUnmarshaller Instance { get { return _instance; } } } }
41.401408
189
0.627828
[ "Apache-2.0" ]
ebattalio/aws-sdk-net
sdk/src/Services/Backup/Generated/Model/Internal/MarshallTransformations/UpdateFrameworkResponseUnmarshaller.cs
5,879
C#
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace vulnerable_asp_net_framework { public partial class Site_Mobile { /// <summary> /// HeadContent control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::System.Web.UI.WebControls.ContentPlaceHolder HeadContent; /// <summary> /// form1 control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::System.Web.UI.HtmlControls.HtmlForm form1; /// <summary> /// FeaturedContent control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::System.Web.UI.WebControls.ContentPlaceHolder FeaturedContent; /// <summary> /// MainContent control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::System.Web.UI.WebControls.ContentPlaceHolder MainContent; } }
35.288462
88
0.513896
[ "Apache-2.0" ]
ShiftLeftSecurity/shiftleft-csharp-example
vulnerable_asp_net_framework/vulnerable_asp_net_framework/Site.Mobile.Master.designer.cs
1,835
C#
/* * Copyright (c) 2006-2008 Clever Age * Copyright (c) 2006-2009 DIaLOGIKa * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the names of copyright holders, nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ using System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Text; using System.Xml; using System.Xml.XPath; using System.Xml.Xsl; using CleverAge.OdfConverter.OdfConverterLib; using DIaLOGIKa.b2xtranslator.ZipUtils; using System.IO; namespace OdfConverter.Wordprocessing { public class Converter : AbstractConverter { private const string ODF_TEXT_MIME = "application/vnd.oasis.opendocument.text"; private const string ODF_TEXT_TEMPLATE_MIME = "application/vnd.oasis.opendocument.text-template"; public Converter() : base(Assembly.GetExecutingAssembly()) { } protected override Type LoadPrecompiledXslt() { Type stylesheet = null; try { if (this.DirectTransform) { stylesheet = Assembly.Load("WordprocessingConverter2Oox") .GetType("WordprocessingConverter2Oox"); } else { stylesheet = Assembly.Load("WordprocessingConverter2Odf") .GetType("WordprocessingConverter2Odf"); } } catch (Exception ex) { System.Diagnostics.Trace.WriteLine(ex.ToString()); return null; } return stylesheet; } protected override string[] DirectPostProcessorsChain { get { //ODF -> DOCX string fullname = Assembly.GetExecutingAssembly().FullName; return new string[] { "OdfConverter.Wordprocessing.OoxChangeTrackingPostProcessor,"+fullname, "CleverAge.OdfConverter.OdfConverterLib.OoxSpacesPostProcessor", "OdfConverter.Wordprocessing.OoxSectionsPostProcessor,"+fullname, "OdfConverter.Wordprocessing.OoxAutomaticStylesPostProcessor,"+fullname, "OdfConverter.Wordprocessing.OoxParagraphsPostProcessor,"+fullname, "CleverAge.OdfConverter.OdfConverterLib.OoxCharactersPostProcessor", }; // "OdfConverter.Wordprocessing.OoxReplacementPostProcessor,"+fullname } } protected override string[] ReversePostProcessorsChain { get { //DOCX -> ODF string fullname = Assembly.GetExecutingAssembly().FullName; return new string[] { "OdfConverter.Wordprocessing.OdfParagraphPostProcessor,"+fullname, //"OdfConverter.Wordprocessing.OdfCheckIfIndexPostProcessor,"+fullname, "CleverAge.OdfConverter.OdfConverterLib.OdfCharactersPostProcessor", "OdfConverter.Wordprocessing.OdfIndexSourceStylesPostProcessor,"+fullname }; } } protected override void CheckOdfFile(string fileName) { // Test for encryption XmlDocument doc; try { XmlReaderSettings settings = new XmlReaderSettings(); settings.XmlResolver = new ZipResolver(fileName); settings.ProhibitDtd = false; doc = new XmlDocument(); XmlReader reader = XmlReader.Create("META-INF/manifest.xml", settings); doc.Load(reader); } catch (XmlException ex) { System.Diagnostics.Trace.WriteLine(ex.ToString()); throw new NotAnOdfDocumentException(ex.Message, ex); } catch (Exception ex) { System.Diagnostics.Trace.WriteLine(ex.ToString()); throw; } XmlNodeList nodes = doc.GetElementsByTagName("encryption-data", "urn:oasis:names:tc:opendocument:xmlns:manifest:1.0"); if (nodes.Count > 0) { throw new EncryptedDocumentException(fileName + " is an encrypted document"); } // Check the document mime-type. XmlNamespaceManager nsmgr = new XmlNamespaceManager(doc.NameTable); nsmgr.AddNamespace("manifest", "urn:oasis:names:tc:opendocument:xmlns:manifest:1.0"); XmlNode node = doc.SelectSingleNode("/manifest:manifest/manifest:file-entry[@manifest:media-type='" + ODF_TEXT_MIME + "']", nsmgr); XmlNodeList mediaTypeNodes = doc.SelectNodes( "/manifest:manifest/manifest:file-entry[@manifest:media-type='" + ODF_TEXT_MIME + "' or @manifest:media-type='" + ODF_TEXT_TEMPLATE_MIME + "']", nsmgr); if (mediaTypeNodes.Count == 0) { throw new NotAnOdfDocumentException("Could not convert " + fileName + ". Invalid OASIS OpenDocument file"); } } /// <summary> /// Pull the input xml document to the xsl transformation /// </summary> protected override XmlReader Source(string inputFile) { if (this.DirectTransform) { // ODT -> DOCX return base.Source(inputFile); } else { // use performance improved method for // DOCX -> ODT conversion XmlReaderSettings xrs = new XmlReaderSettings(); // do not look for DTD xrs.ProhibitDtd = false; DocxDocument doc = new DocxDocument(inputFile); // uncomment for testing for (int i = 0; i < Environment.GetCommandLineArgs().Length; i++) { if (Environment.GetCommandLineArgs()[i].ToString().ToUpper() == "/DUMP") { Stream package = doc.OpenXML; FileInfo fi = new FileInfo(Environment.GetCommandLineArgs()[i + 1]); Stream s = fi.OpenWrite(); byte[] buffer = new byte[package.Length]; package.Read(buffer, 0, (int)package.Length); s.Write(buffer, 0, (int)package.Length); s.Close(); } } return XmlReader.Create(doc.OpenXML, xrs); } } } }
41.522167
169
0.567208
[ "BSD-3-Clause" ]
datadiode/B2XTranslator
src/WordProcessing/Converter/Converter.cs
8,429
C#
using FastqlSample.Infrastructure.Models; using Dapper; using System; using System.Collections.Generic; using System.Data; using System.Linq; using Fastql; namespace FastqlSample.Infrastructure.Core.Repository { public class GenericRepository<TEntity> : RepositoryBase, IGenericRepository<TEntity> where TEntity : class, new() { private FastqlBuilder<TEntity> fastql; public GenericRepository(IDbTransaction transaction) : base(transaction) { fastql = new FastqlBuilder<TEntity>(); } public Response<TEntity> Get(int id) { try { var returnData = Connection.Query<TEntity>( $"SELECT * FROM {fastql.TableName()} WHERE Id=@Id", param: new { Id = id }, transaction: Transaction ).FirstOrDefault(); if (returnData != null) { return new Response<TEntity>() { Entity = returnData, IsSucceeded = true, ResponseMessage = "Success" }; } else { return new Response<TEntity>() { Entity = null, IsSucceeded = true, ResponseMessage = "Not found" }; } } catch (System.Exception ex) { return new Response<TEntity>() { Entity = null, IsSucceeded = false, ResponseMessage = "Error: " + ex.Message }; } } public Response<TEntity> Get(string where) { try { var returnData = Connection.Query<TEntity>( $"SELECT * FROM {fastql.TableName()} WHERE {where}", //param: id, transaction: Transaction ).FirstOrDefault(); if (returnData != null) { return new Response<TEntity>() { Entity = returnData, IsSucceeded = true, ResponseMessage = "Success" }; } else { return new Response<TEntity>() { Entity = null, IsSucceeded = true, ResponseMessage = "Not found" }; } } catch (System.Exception ex) { return new Response<TEntity>() { Entity = null, IsSucceeded = false, ResponseMessage = "Error: " + ex.Message }; } } public Response<IEnumerable<TEntity>> GetAll() { try { var returnData = Connection.Query<TEntity>( $"SELECT * FROM {fastql.TableName()}", transaction: Transaction ); if (returnData != null) { return new Response<IEnumerable<TEntity>>() { Entity = returnData, IsSucceeded = true, ResponseMessage = "Success" }; } else { return new Response<IEnumerable<TEntity>>() { Entity = null, IsSucceeded = true, ResponseMessage = "Not found" }; } } catch (System.Exception ex) { return new Response<IEnumerable<TEntity>>() { Entity = null, IsSucceeded = false, ResponseMessage = "Error: " + ex.Message }; } } public Response<IEnumerable<TEntity>> GetAll(string where) { try { var returnData = Connection.Query<TEntity>( $"SELECT * FROM {fastql.TableName()} WHERE {where}", transaction: Transaction ); if (returnData != null) { return new Response<IEnumerable<TEntity>>() { Entity = returnData, IsSucceeded = true, ResponseMessage = "Success" }; } else { return new Response<IEnumerable<TEntity>>() { Entity = null, IsSucceeded = true, ResponseMessage = "Not found" }; } } catch (System.Exception ex) { return new Response<IEnumerable<TEntity>>() { Entity = null, IsSucceeded = false, ResponseMessage = "Error: " + ex.Message }; } } public Response<long> Insert(TEntity entity) { try { var result = Connection.Execute( fastql.InsertQuery(), param: entity, transaction: Transaction ); if (result == 1) { return new Response<long>() { Entity = result, IsSucceeded = true, ResponseMessage = "Success" }; } else { return new Response<long>() { Entity = result, IsSucceeded = false, ResponseMessage = "Not inserted" }; } } catch (System.Exception ex) { return new Response<long>() { Entity = 0, IsSucceeded = false, ResponseMessage = "Error: " + ex.Message }; } } public Response<bool> Update(TEntity entity, string where) { try { var result = Connection.Execute( fastql.UpdateQuery(entity, where), param: entity, transaction: Transaction ); if (result > 0) { return new Response<bool>() { Entity = true, IsSucceeded = true, ResponseMessage = "Success" }; } else { return new Response<bool>() { Entity = false, IsSucceeded = false, ResponseMessage = "Not updated" }; } } catch (System.Exception ex) { return new Response<bool>() { Entity = false, IsSucceeded = false, ResponseMessage = "Error: " + ex.Message }; } } public Response<bool> Delete(string where) { try { var result = Connection.Execute( $"DELETE FROM {fastql.TableName()} WHERE {where}", // param: entity, transaction: Transaction ); if (result > 0) { return new Response<bool>() { Entity = true, IsSucceeded = true, ResponseMessage = "Success" }; } else { return new Response<bool>() { Entity = false, IsSucceeded = false, ResponseMessage = "Not updated" }; } } catch (System.Exception ex) { return new Response<bool>() { Entity = false, IsSucceeded = false, ResponseMessage = "Error: " + ex.Message }; } } public Response<int> Count(string where = null) { try { string _where = (where == null) ? ";" : $" WHERE {where}"; var returnData = Connection.Query<int>( $"SELECT COUNT(1) FROM {fastql.TableName()}{_where}", transaction: Transaction ).FirstOrDefault(); if (returnData > 0) { return new Response<int>() { Entity = returnData, IsSucceeded = true, ResponseMessage = "Success" }; } else { return new Response<int>() { Entity = 0, IsSucceeded = true, ResponseMessage = "Not found" }; } } catch (System.Exception ex) { return new Response<int>() { Entity = -1, IsSucceeded = false, ResponseMessage = "Error: " + ex.Message }; } } } }
29.887931
118
0.353716
[ "MIT" ]
SERAP-KEREM/fastql-unit-of-work-in-repository-pattern
src/FastqlSample/FastqlSample.Infrastructure/Core/Repository/Generic/GenericRepository.cs
10,403
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.Web.V20210201.Inputs { /// <summary> /// Specification for a Kubernetes Environment to use for this resource. /// </summary> public sealed class KubeEnvironmentProfileArgs : Pulumi.ResourceArgs { /// <summary> /// Resource ID of the Kubernetes Environment. /// </summary> [Input("id")] public Input<string>? Id { get; set; } public KubeEnvironmentProfileArgs() { } } }
27.137931
81
0.655654
[ "Apache-2.0" ]
polivbr/pulumi-azure-native
sdk/dotnet/Web/V20210201/Inputs/KubeEnvironmentProfileArgs.cs
787
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using SharpDX.D3DCompiler; using SharpDX.Direct3D; using SharpDX.Direct3D11; namespace Molten.Graphics { internal class ComputeCompiler : HlslSubCompiler { internal override List<IShader> Parse(ShaderCompilerContext context, RendererDX11 renderer, string header) { List<IShader> result = new List<IShader>(); ComputeTask compute = new ComputeTask(renderer.Device, context.Filename); try { context.Compiler.ParserHeader(compute, ref header, context); CompilationResult computeResult = null; if (Compile(compute.Composition.EntryPoint, ShaderType.ComputeShader, context, out computeResult)) { ShaderReflection shaderRef = new ShaderReflection(computeResult.Bytecode); if (BuildStructure(context, compute, shaderRef, computeResult, compute.Composition)) { compute.Composition.RawShader = new ComputeShader(renderer.Device.D3d, computeResult.Bytecode); } } } catch (Exception e) { context.Errors.Add($"{context.Filename ?? "Material header error"}: {e.Message}"); } if(context.Errors.Count == 0) { result.Add(compute); (renderer.Compute as ComputeManager).AddTask(compute); } return result; } protected override void OnBuildVariableStructure(ShaderCompilerContext context, HlslShader shader, ShaderReflection reflection, InputBindingDescription binding, ShaderInputType inputType) { ComputeTask ct = shader as ComputeTask; switch (inputType) { case ShaderInputType.UnorderedAccessViewRWStructured: if (ct != null) OnBuildRWStructuredVariable(context, ct, binding); break; case ShaderInputType.UnorderedAccessViewRWTyped: if (ct != null) OnBuildRWTypedVariable(context, ct, binding); break; } } protected void OnBuildRWStructuredVariable(ShaderCompilerContext context, ComputeTask shader, InputBindingDescription binding) { RWBufferVariable rwBuffer = GetVariableResource<RWBufferVariable>(context, shader, binding); int bindPoint = binding.BindPoint; if (bindPoint >= shader.UAVs.Length) Array.Resize(ref shader.UAVs, bindPoint + 1); shader.UAVs[bindPoint] = rwBuffer; } protected void OnBuildRWTypedVariable(ShaderCompilerContext context, ComputeTask shader, InputBindingDescription binding) { RWVariable resource = null; int bindPoint = binding.BindPoint; switch (binding.Dimension) { case ShaderResourceViewDimension.Texture1D: resource = GetVariableResource<RWTexture1DVariable>(context, shader, binding); break; case ShaderResourceViewDimension.Texture2D: resource = GetVariableResource<RWTexture2DVariable>(context, shader, binding); break; } if (bindPoint >= shader.UAVs.Length) Array.Resize(ref shader.UAVs, bindPoint + 1); // Store the resource variable shader.UAVs[bindPoint] = resource; } } }
37.867347
195
0.594718
[ "MIT" ]
Syncaidius/MoltenEngine
Molten.DX11/Shaders/Compiler/ComputeCompiler.cs
3,713
C#
namespace Verticular.Extensions { using System; using System.Text.RegularExpressions; /// <summary> /// Helps with matches against regular expressions. /// </summary> public static class RegularExpressionExtensions { /// <summary> /// Returns a value indicating whether a given string matches a regular expression pattern. /// </summary> /// <param name="value">The current string.</param> /// <param name="pattern">Ther regular expression pattern to match.</param> /// <returns> /// <see langword="true"/> if the regular expression finds a match; otherwise, <see langword="false"/>. /// </returns> /// <exception cref="ArgumentException">A regular expression parsing error occurred.</exception> /// <exception cref="ArgumentNullException">The regular expression instance is null.</exception> public static bool IsMatch(this string? value, string pattern) => value.IsMatch(new Regex(pattern, RegexOptions.None)); /// <summary> /// Returns a value indicating whether a given string matches a regular expression pattern. /// </summary> /// <param name="value">The current string.</param> /// <param name="pattern">Ther regular expression pattern to match.</param> /// <param name="options">A bitwise combination of the enumeration values that modify the regular expression.</param> /// <returns> /// <see langword="true"/> if the regular expression finds a match; otherwise, <see langword="false"/>. /// </returns> /// <exception cref="ArgumentException">A regular expression parsing error occurred.</exception> /// <exception cref="ArgumentOutOfRangeException">options is not a valid <see cref="RegexOptions"/> value.</exception> /// <exception cref="ArgumentNullException">The regular expression instance is null.</exception> public static bool IsMatch(this string? value, string pattern, RegexOptions options) => value.IsMatch(new Regex(pattern, options)); /// <summary> /// Returns a value indicating whether a given string matches a regular expression pattern. /// </summary> /// <param name="value">The current string.</param> /// <param name="pattern">Ther regular expression pattern to match.</param> /// <param name="options">A bitwise combination of the enumeration values that modify the regular expression.</param> /// <param name="matchTimeout">A time-out interval, or <see cref="Regex.InfiniteMatchTimeout"/> /// to indicate that the method should not time out.</param> /// <returns> /// <see langword="true"/> if the regular expression finds a match; otherwise, <see langword="false"/>. /// </returns> /// <exception cref="ArgumentException">A regular expression parsing error occurred.</exception> /// <exception cref="ArgumentOutOfRangeException">options is not a valid <see cref="RegexOptions"/> value.</exception> /// <exception cref="ArgumentNullException">The regular expression instance is null.</exception> /// <exception cref="RegexMatchTimeoutException">A time-out occurred. For more information about time-outs, see the Remarks section.</exception> public static bool IsMatch(this string? value, string pattern, RegexOptions options, TimeSpan matchTimeout) => value.IsMatch(new Regex(pattern, options, matchTimeout)); /// <summary> /// Returns a value indicating whether a given string matches a regular expression pattern. /// </summary> /// <param name="value">The current string.</param> /// <param name="pattern">Ther regular expression pattern to match.</param> /// <param name="matchTimeout">A time-out interval, or <see cref="Regex.InfiniteMatchTimeout"/> /// to indicate that the method should not time out.</param> /// <returns> /// <see langword="true"/> if the regular expression finds a match; otherwise, <see langword="false"/>. /// </returns> /// <exception cref="ArgumentException">A regular expression parsing error occurred.</exception> /// <exception cref="ArgumentNullException">The regular expression instance is null.</exception> /// <exception cref="RegexMatchTimeoutException">A time-out occurred. For more information about time-outs, see the Remarks section.</exception> public static bool IsMatch(this string? value, string pattern, TimeSpan matchTimeout) => value.IsMatch(new Regex(pattern, RegexOptions.None, matchTimeout)); /// <summary> /// Returns a value indicating whether a given string matches the rules defined in the given <paramref name="regex"/>. /// </summary> /// <param name="value">The current string.</param> /// <param name="regex">The <see cref="Regex"/> instance to match.</param> /// <returns> /// <see langword="true"/> if the regular expression finds a match; otherwise, <see langword="false"/>. /// </returns> /// <exception cref="ArgumentNullException">The regular expression instance is null.</exception> /// <exception cref="RegexMatchTimeoutException">A time-out occurred. For more information about time-outs, see the Remarks section.</exception> public static bool IsMatch(this string? value, Regex regex) { if (value is null) { return false; } if (regex is null) { throw new ArgumentNullException(nameof(regex)); } return regex.IsMatch(value!); } } }
54.606061
148
0.694414
[ "MIT" ]
mhudasch/Verticular.Extensions.Strings
src/Verticular.Extensions.Strings/RegularExpressionExtensions.cs
5,406
C#
using System.Collections; using System.Collections.Generic; using System.Linq; using UnityEngine; using UnityEngine.EventSystems; public class TileEditorProxy : MonoBehaviour, IHasNeighbours<TileEditorProxy>, IPointerDownHandler, IPointerEnterHandler, IPointerExitHandler, IBeginDragHandler, IDragHandler, IEndDragHandler { public static float NO_ATK_WAIT = .5f; public static float ATK_WAIT = 1.6f; public static Color MOVE = Color.grey; public Color ATK_INACTIVE = new Color(.86f,.079f,.24f); public static Color ATK_ACTIVE = Color.magenta; [SerializeField] private Tile tile; [SerializeField] private Transform anchor; private UnitProxyEditor unitThatSetTileOnFire; private int fireTrns, wallTrns, divineTrns, snowTrns; private Sprite def, fireAlt, wallAlt, divineAlt, snowAlt; private float timeLeft = 0; private float FIRE_DELAY_TIME = .5f; private bool lifetimeWall; private bool lifetimeDivine; private bool lifetimeSnow; private bool lifetimeFire; private List<GridObjectProxyEdit> objectProxies = new List<GridObjectProxyEdit>(); //private GameObject instanceDummy; //void Awake(){ // instanceDummy = new GameObject(); //} public Vector3Int GetPosition() { return tile.position; } public IEnumerable<TileEditorProxy> Neighbours { get { return BoardEditProxy.instance.GetNeighborTiles(tile.position); } } void SnapToPosition() { transform.position = BoardEditProxy.instance.grid.CellToLocal(tile.position); } public void Init(Tile t, Sprite fireAlt, Sprite wallAlt, Sprite divineAlt, Sprite snowAlt) { def = GetComponent<SpriteRenderer>().sprite; this.fireAlt = fireAlt; this.wallAlt = wallAlt; this.divineAlt = divineAlt; this.snowAlt = snowAlt; tile = t; name = t.position.ToString();//for convenience in the heirarchy SnapToPosition(); } public void HighlightSelected() { GetComponent<Renderer>().material.color = MOVE; } public void HighlightSelectedAdv(UnitProxyEditor inRangeUnit, List<TileEditorProxy> visitable, List<TileEditorProxy> attackable) { bool canAtk = inRangeUnit.GetData().GetTurnActions().CanAttack(); bool canMv = inRangeUnit.GetData().GetTurnActions().CanMove(); if (BoardEditProxy.instance.GetTileAtPosition(inRangeUnit.GetPosition()) == this) { if (!canAtk && !canMv) { GetComponent<Renderer>().material.color = MOVE; } return; } if (canAtk) { if (attackable.Contains(this)) { if (HasUnit() && inRangeUnit.GetData().GetTeam() != GetUnit().GetData().GetTeam()) { GetComponent<Renderer>().material.color = ATK_ACTIVE; } } } if (canMv) { if (visitable.Contains(this)) { if (!(HasUnit() && canAtk)) { GetComponent<Renderer>().material.color = MOVE; } } } } public void ClearAllEffects(){ SetLifeWall(false); SetLifeDivine(false); SetLifeSnow(false); SetLifeFire(false); FlushGridObjectProxies(); } public void SetLifeWall(bool lifetimeWall){ this.lifetimeWall = lifetimeWall; wallTrns = 0; if (lifetimeWall) { wallTrns = 1; ObstacleProxyEdit obs = Instantiate(BoardEditProxy.instance.glossary.GetComponent<Glossary>().obstacleEditTile, BoardEditProxy.instance.transform); obs.Init(); ReceiveGridObjectProxy(obs); obs.SnapToCurrentPosition(); } } public void SetLifeDivine(bool lifetimeDivine){ this.lifetimeDivine = lifetimeDivine; divineTrns = 0; if (lifetimeDivine) { divineTrns = 1; } } public void SetLifeSnow(bool lifetimeSnow){ this.lifetimeSnow = lifetimeSnow; snowTrns = 0; if (lifetimeSnow) { snowTrns = 1; } } public void SetLifeFire(bool lifetimeFire){ this.lifetimeFire = lifetimeFire; fireTrns = 0; if (lifetimeFire) { fireTrns = 1; } } public void ForceHighlight() { if(this != null){ GetComponent<Renderer>().material.color = Color.green; } } public void UnHighlight() { if(this != null){ GetComponent<Renderer>().material.color = Color.white; } } public void ReceiveGridObjectProxy(GridObjectProxyEdit proxy) { if (!objectProxies.Contains(proxy) && proxy != null) { objectProxies.Add(proxy); proxy.SetPosition(tile.position); } } public void RemoveGridObjectProxy(GridObjectProxyEdit proxy) { Debug.Log("Grid Object Removed: " + proxy.name); if (objectProxies.Contains(proxy)) { objectProxies.Remove(proxy); } } public void FlushGridObjectProxies(){ foreach (GridObjectProxyEdit proxy in objectProxies) { Destroy(proxy.gameObject); } objectProxies.Clear(); } public List<GridObjectProxyEdit> GetContents() { return objectProxies; } public bool CanReceive(GridObjectProxyEdit obj) { if (obj is UnitProxyEditor) { if (HasUnit())//TODO: rework to a better system with layers return false; } return true;//for now } public UnitProxyEditor GetUnit() { return (UnitProxyEditor) objectProxies.ToList().Where(op => op is UnitProxyEditor).First(); } //public ObstacleProxy GetObstacle() //{ // return (ObstacleProxy) objectProxies.ToList().Where(op => op is ObstacleProxy).First(); //} public bool HasObstacle() { return objectProxies.ToList().Where(op => op is ObstacleProxyEdit).Any(); } public bool HasUnit() { return objectProxies.ToList().Where(op => op is UnitProxyEditor).Any(); } public bool HasObstruction() { return HasUnit(); } public bool UnitOnTeam(int team) { return objectProxies.ToList().Where(op => op is UnitProxyEditor && ((UnitProxyEditor)op).GetData().GetTeam() == team).Any(); } //void ResetTile(){ // fireTrns = 0; // wallTrns = 0; // divineTrns = 0; // snowTrns = 0; //} /* Fire */ //public void SetTurnsOnFire(int trns, UnitProxyEditor unit){ // unitThatSetTileOnFire = unit; // if (fireTrns == 0) { // ResetTile(); // } // fireTrns += trns; // if (fireTrns > 0) { // GetComponent<SpriteRenderer>().sprite = fireAlt; // } //} public bool OnFire(){ return fireTrns > 0; } /* Wall */ //public void SetTurnsWall(int trns, UnitProxyEditor unit){ // unitThatSetTileOnFire = unit; // if (wallTrns == 0) { // ResetTile(); // } // wallTrns += trns; // if (wallTrns > 0) { // GetComponent<SpriteRenderer>().sprite = wallAlt; // ObstacleProxyEdit obs = Instantiate(BoardEditProxy.instance.GetComponent<Glossary>().obstacleEditTile, transform); // obs.Init(); // ReceiveGridObjectProxy(obs); // obs.SnapToCurrentPosition(); // } //} public bool IsWall(){ return wallTrns > 0; } /* Divine */ //public void SetTurnsDivine(int trns, UnitProxyEditor unit){ // unitThatSetTileOnFire = unit; // if (divineTrns == 0) { // ResetTile(); // } // divineTrns += trns; // if (divineTrns > 0) { // GetComponent<SpriteRenderer>().sprite = divineAlt; // } //} public bool IsDivine(){ return divineTrns > 0; } public void CreateUnitOnTile(UnitProxyEditor unt, int team){ UnitProxyEditor newEditable = Instantiate(unt, BoardEditProxy.instance.transform); UnitEdit cMeta = new UnitEdit(); cMeta.SetTeam(team); newEditable.PutData(cMeta); newEditable.Init(); newEditable.SetPosition(GetPosition()); ReceiveGridObjectProxy(newEditable); newEditable.SnapToCurrentPosition(); } /* Snow */ //public void SetTurnsFrozen(int trns, UnitProxyEditor unit){ // unitThatSetTileOnFire = unit; // if (snowTrns == 0) { // ResetTile(); // } // snowTrns += trns; // if (snowTrns > 0) { // GetComponent<SpriteRenderer>().sprite = snowAlt; // } //} public bool Frozen(){ return snowTrns > 0; } //public void DecrementTileEffects(){ // if (fireTrns > 0 && HasUnit()) { // //Only injure unit from fire if it's that unit's team's turn // if (GetUnit().GetData().GetTeam() == TurnController.instance.currentTeam && GetUnit().IsAttackedEnvironment(1)){ // if (unitThatSetTileOnFire != null) { // unitThatSetTileOnFire.GetData().SetLvl(unitThatSetTileOnFire.GetData().GetLvl() + 1); // } // ConditionTracker.instance.EvalDeath(GetUnit()); // } // } // if (divineTrns > 0 && HasUnit()) { // //Divine tiles heal // FloatUp(Skill.Actions.None, "+1", Color.green, "Healed from tile"); // GetUnit().GetData().SetCurrHealth(GetUnit().GetData().GetCurrHealth() + 1); // } // if (snowTrns > 0 && HasUnit()) { // //Snow tiles apply enfeeble and rooted at the end of the turn // if (GetUnit().GetData().GetTeam() == TurnController.instance.currentTeam){ // FloatUp(Skill.Actions.None, "enfeebled", Color.red, "Enfeebled from tile"); // FloatUp(Skill.Actions.None, "rooted", Color.red, "Rooted from tile"); // GetUnit().GetData().GetTurnActions().EnfeebledForTurns(1); // GetUnit().GetData().GetTurnActions().RootForTurns(1); // } // } // if (wallTrns <= 0 && HasObstacle()) { // RemoveGridObjectProxy(GetObstacle()); // } // if (!lifetimeWall) { // wallTrns = wallTrns - 1 > 0 ? wallTrns - 1 : 0; // } // if (!lifetimeDivine) { // divineTrns = divineTrns - 1 > 0 ? divineTrns - 1 : 0; // } // if (!lifetimeSnow) { // snowTrns = snowTrns - 1 > 0 ? snowTrns - 1 : 0; // } // if (!lifetimeFire) { // fireTrns = fireTrns - 1 > 0 ? fireTrns - 1 : 0; // } // //fireTrns = fireTrns - 1 > 0 ? fireTrns - 1 : 0; // //wallTrns = wallTrns - 1 > 0 ? wallTrns - 1 : 0; // //divineTrns = divineTrns - 1 > 0 ? divineTrns - 1 : 0; // //snowTrns = snowTrns - 1 > 0 ? snowTrns - 1 : 0; // if (!OnFire() && !IsWall() && !Frozen() && !IsDivine()) { // GetComponent<SpriteRenderer>().sprite = def; // unitThatSetTileOnFire = null; // } //} //Update is called once per frame void Update () { //if (IsWall()) { // timeLeft -= Time.deltaTime; // if ( timeLeft <= 0 ) // { // timeLeft = FIRE_DELAY_TIME; // } //} //if (HasObstacle()) { // transform.GetComponent<SpriteRenderer>().color = Color.red; //} } //public void FloatUp(Skill.Actions interaction, string msg, Color color, string desc){ // AnimationInteractionController.InteractionAnimation(interaction, this, msg, color, desc); //} public void CreateSmoke(){ StartCoroutine(CreateSmokeAnim()); } IEnumerator CreateSmokeAnim(){ Vector3 instPos = transform.position; instPos.y += .8f; GameObject smoke = Instantiate(BoardEditProxy.instance.glossary.GetComponent<Glossary>().fxSmoke1, instPos, Quaternion.identity); yield return new WaitForSeconds(1f); Destroy(smoke); } #region events public void OnPointerDown(PointerEventData eventData) { InteractivityManagerEditor.instance.OnTileSelected(this); foreach (var obj in objectProxies.ToList()) { obj.OnSelected(); } } public void OnPointerExit(PointerEventData eventData) { InteractivityManagerEditor.instance.OnTileUnHovered(this); } public void OnPointerEnter(PointerEventData eventData) { //if (TurnController.instance.PlayersTurn()){ InteractivityManagerEditor.instance.OnTileHovered(this); //} } Vector3 _startPosition; Vector3 _offsetToMouse; float _zDistanceToCamera; public void OnBeginDrag (PointerEventData eventData) { Debug.Log("OnBeginDrag"); _startPosition = BoardEditProxy.instance.grid.transform.position; _zDistanceToCamera = Mathf.Abs (_startPosition.z - Camera.main.transform.position.z); _offsetToMouse = _startPosition - Camera.main.ScreenToWorldPoint ( new Vector3 (Input.mousePosition.x, Input.mousePosition.y, _zDistanceToCamera) ); } public void OnDrag (PointerEventData eventData) { Debug.Log("OnDrag"); if(Input.touchCount > 1) return; //BoardProxy.instance.grid. BoardEditProxy.instance.grid.transform.position = Camera.main.ScreenToWorldPoint ( new Vector3 (Input.mousePosition.x, Input.mousePosition.y, _zDistanceToCamera) ) + _offsetToMouse; } public void OnEndDrag (PointerEventData eventData) { Debug.Log("OnEndDrag"); _offsetToMouse = Vector3.zero; } #endregion }
29.334029
191
0.579389
[ "MIT" ]
BradZzz/EldersQuest
Assets/Scripts/BoardEdit/TileEditorProxy.cs
14,053
C#
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Sketch360.XPlat.UWP; using System; using System.Collections.Generic; using System.Linq; using Windows.UI.Core; using Windows.UI.Xaml.Controls; using Xamarin.Forms.Inking; using Xamarin.Forms.Inking.Interfaces; using Xamarin.Forms.Inking.Support; [assembly: Xamarin.Forms.Dependency(typeof(UWPInkPresenter))] namespace Sketch360.XPlat.UWP { /// <summary> /// UWP InkPresenter /// </summary> public class UWPInkPresenter : IInkPresenter { private InkCanvas _inkCanvas; /// <summary> /// Initializes a new instance of the UWPInkPresenter class /// </summary> public UWPInkPresenter() { InputProcessingConfiguration = new XInkInputProcessingConfiguration(); StrokeContainer = new UWPInkStrokeContainer(); } /// <summary> /// Gets or sets the ink canvas /// </summary> public InkCanvas InkCanvas { get => _inkCanvas; set { _inkCanvas = value; (StrokeContainer as UWPInkStrokeContainer).NativeStrokeContainer = _inkCanvas.InkPresenter.StrokeContainer; } } /// <summary> /// Gets or sets the stroke container /// </summary> public Xamarin.Forms.Inking.Interfaces.IInkStrokeContainer StrokeContainer { get; set; } XCoreInputDeviceTypes _inputDeviceTypes = XCoreInputDeviceTypes.Pen; /// <summary> /// Gets or sets the input device types /// </summary> public XCoreInputDeviceTypes InputDeviceTypes { get { if (_inkCanvas != null) { _inputDeviceTypes = GetXInputDeviceTypes(_inkCanvas.InkPresenter.InputDeviceTypes); } return _inputDeviceTypes; } set { _inputDeviceTypes = value; if (_inkCanvas != null) { _inkCanvas.InkPresenter.InputDeviceTypes = GetInputDeviceTypes(value); } } } internal static XCoreInputDeviceTypes GetXInputDeviceTypes(CoreInputDeviceTypes inputDeviceTypes) { XCoreInputDeviceTypes deviceTypes = XCoreInputDeviceTypes.None; if (inputDeviceTypes.HasFlag(CoreInputDeviceTypes.Mouse)) { deviceTypes |= XCoreInputDeviceTypes.Mouse; } if (inputDeviceTypes.HasFlag(CoreInputDeviceTypes.Pen)) { deviceTypes |= XCoreInputDeviceTypes.Pen; } if (inputDeviceTypes.HasFlag(CoreInputDeviceTypes.Touch)) { deviceTypes |= XCoreInputDeviceTypes.Touch; } return deviceTypes; } internal static CoreInputDeviceTypes GetInputDeviceTypes(XCoreInputDeviceTypes inputDeviceTypes) { CoreInputDeviceTypes deviceTypes = CoreInputDeviceTypes.None; if (inputDeviceTypes.HasFlag(XCoreInputDeviceTypes.Mouse)) { deviceTypes |= CoreInputDeviceTypes.Mouse; } if (inputDeviceTypes.HasFlag(XCoreInputDeviceTypes.Pen)) { deviceTypes |= CoreInputDeviceTypes.Pen; } if (inputDeviceTypes.HasFlag(XCoreInputDeviceTypes.Touch)) { deviceTypes |= CoreInputDeviceTypes.Touch; } return deviceTypes; } /// <summary> /// Gets the ink input processing configuration /// </summary> public XInkInputProcessingConfiguration InputProcessingConfiguration { get; } /// <summary> /// Gets or sets the unprocessed input /// </summary> public XInkUnprocessedInput UnprocessedInput => throw new NotImplementedException(); /// <summary> /// Gets or sets the wet stroke update source /// </summary> public XCoreWetStrokeUpdateSource WetStrokeUpdateSource { get; set; } /// <summary> /// strokes collected event handler /// </summary> public event TypedEventHandler<IInkPresenter, XInkStrokesCollectedEventArgs> StrokesCollected; /// <summary> /// Strokes erased event handler; /// </summary> public event TypedEventHandler<XInkPresenter, XInkStrokesErasedEventArgs> StrokesErased; /// <summary> /// Copy the default drawing attributes /// </summary> /// <returns></returns> public XInkDrawingAttributes CopyDefaultDrawingAttributes() { var attributes = InkCanvas.InkPresenter.CopyDefaultDrawingAttributes(); return attributes.ToXInkDrawingAttributes(); } /// <summary> /// Trigger the strokes collected event /// </summary> /// <param name="strokes">the strokes</param> public void TriggerStrokesCollected(IEnumerable<XInkStroke> strokes) { StrokesCollected?.Invoke(this, new XInkStrokesCollectedEventArgs { Strokes = strokes.ToList() }); } /// <summary> /// Trigger the strokes erased event /// </summary> /// <param name="list">the strokes</param> public void TriggerStrokesErased(IReadOnlyList<XInkStroke> list) { throw new NotImplementedException(); } /// <summary> /// Updates the default drawing attributes /// </summary> /// <param name="attributes">the ink drawing attributes</param> public void UpdateDefaultDrawingAttributes(XInkDrawingAttributes attributes) { var attributes2 = attributes.ToInkDrawingAttributes(); InkCanvas.InkPresenter.UpdateDefaultDrawingAttributes(attributes2); } } }
31.338462
123
0.596465
[ "MIT" ]
MCKLMT/sketch360
Source/Sketch360.XPlat.UWP/UWPInkPresenter.cs
6,113
C#
using AutoMapper; using EventBus.Messages.Events; using Ordering.Application.Features.Orders.Commands.CheckOutOrderCommand; namespace Ordering.API.Mapper { public class OrderingProfile : Profile { public OrderingProfile() { CreateMap<CheckoutOrderCommand, BasketCheckoutEvent>().ReverseMap(); } } }
23.266667
80
0.704871
[ "MIT" ]
desperad1/aspnetMicroservice
src/Services/Ordering/Ordering.API/Mapper/OrderingProfile.cs
351
C#
using System; namespace GlobalInsightsWebApp.Models { public class ErrorViewModel { public string RequestId { get; set; } public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); } }
19.818182
70
0.683486
[ "MIT" ]
AurelianoBuendia/azure-intelligent-edge-patterns
staged-data-analytics/GlobalInsightsWebApp/Models/ErrorViewModel.cs
218
C#
using System; using System.Configuration; using System.Threading; using Gis.Infrastructure.OrganizationsRegistryCommonService; using Gis.Crypto; namespace Gis.Helpers.HelperOrganizationRegistryCommonService { class HelperOrganizationRegistryCommonService { /// <summary> /// Экспорт сведений из реестра организаций /// </summary> /// <param name="_orgRootEntityGUID"> /// Идентификатор корневой сущности организации в реестре организаций /// </param> /// <returns></returns> public exportOrgRegistryResponse GetOrgRegistry(string _orgRootEntityGUID) { var srvOrgRegistry = new RegOrgPortsTypeClient(); srvOrgRegistry.ClientCredentials.UserName.UserName = ConfigurationManager.AppSettings["_login"]; srvOrgRegistry.ClientCredentials.UserName.Password = ConfigurationManager.AppSettings["_pass"]; var reqOrgRegistry = new exportOrgRegistryRequest1 { ISRequestHeader = new ISRequestHeader { MessageGUID = Guid.NewGuid().ToString(), Date = DateTime.Now }, exportOrgRegistryRequest = new exportOrgRegistryRequest { version = "10.0.2.1", Id = CryptoConsts.CONTAINER_ID, SearchCriteria = new exportOrgRegistryRequestSearchCriteria[] { new exportOrgRegistryRequestSearchCriteria { ItemsElementName = new ItemsChoiceType3[] { ItemsChoiceType3.orgRootEntityGUID }, Items = new string[] { _orgRootEntityGUID } } } } }; exportOrgRegistryResponse resOrgRegistry = null; do { try { resOrgRegistry = srvOrgRegistry.exportOrgRegistry(reqOrgRegistry); } catch (Exception e) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine(e.Message); Console.ResetColor(); Thread.Sleep(1000); } } while (resOrgRegistry is null); return resOrgRegistry; } } }
35.849315
108
0.506687
[ "Unlicense" ]
bogich/InsertSettlements
Gis/Helpers/HelperOrganizationRegistryCommonService.cs
2,713
C#
using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; namespace BilibiliEvolved.Build { static class RegexReplacer { public static string Replace(string text, string regexText, Func<Match, string> func) { var regex = new Regex(regexText, RegexOptions.Compiled | RegexOptions.IgnoreCase); while (true) { var match = regex.Match(text); if (!match.Success) { break; } text = text.Replace(match.Value, func(match)); } return text; } } }
26.62069
94
0.57772
[ "MIT" ]
01093170/Bilibili-Evolved
builder/dotnet/RegexReplacer.cs
772
C#
using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.IO; using System.Text.RegularExpressions; namespace Bridge.Contract { public class ConfigHelper { class PathChanger { //private Regex PathSchemaRegex = new Regex(@"(?<=(^\w+:)|^)[\\/]{2,}"); //private Regex PathNonSchemaRegex = new Regex(@"(?<!((^\w+:)|^)[\\/]*)[\\/]+"); private Regex PathRegex = new Regex(@"(?<schema>(?<=(^\w+:)|^)[\\/]{2,})|[\\/]+"); public string Separator { get; private set; } public string DoubleSeparator { get; private set; } public string Path { get; private set; } public PathChanger(string path, char separator) { Path = path; Separator = separator.ToString(); DoubleSeparator = new string(separator, 2); } private string ReplaceSlashEvaluator(Match m) { if (m.Groups["schema"].Success) { return DoubleSeparator; } return Separator; } public string ConvertPath() { //path = PathSchemaRegex.Replace(path, directorySeparator.ToString()); //path = PathNonSchemaRegex.Replace(path, directorySeparator.ToString()); return PathRegex.Replace(Path, ReplaceSlashEvaluator); } } public string ConvertPath(string path, char directorySeparator = char.MinValue) { if (path == null) { return null; } if (directorySeparator == char.MinValue) { directorySeparator = Path.DirectorySeparatorChar; } path = new PathChanger(path, directorySeparator).ConvertPath(); return path; } public string ApplyToken(string token, string tokenValue, string input) { if (string.IsNullOrEmpty(token)) { throw new ArgumentException("token cannot be null or empty", "token"); } if (input == null) { return null; } if (token.Contains("$")) { token = Regex.Escape(token); } if (tokenValue == null) { tokenValue = ""; } return Regex.Replace(input, token, tokenValue, RegexOptions.IgnoreCase); } public string ApplyTokens(Dictionary<string, string> tokens, string input) { if (tokens == null) { throw new ArgumentNullException("tokens"); } if (input == null) { return null; } foreach (var token in tokens) { input = ApplyToken(token.Key, token.Value, input); } return input; } public string ApplyPathToken(string token, string tokenValue, string input) { return ConvertPath(ApplyToken(token, tokenValue, input)); } public string ApplyPathTokens(Dictionary<string, string> tokens, string input) { if (input == null) { return null; } input = ApplyTokens(tokens, input); return ConvertPath(input); } } public class ConfigHelper<T> : ConfigHelper { private ILogger Logger { get; set; } public ConfigHelper(ILogger logger) { this.Logger = logger; } public virtual T ReadConfig(string configFileName, bool folderMode, string location, string configuration) { string configPath = null; string mergePath = null; Logger.Info("Reading configuration file " + (configFileName ?? "") + " at " + (location ?? "") + " for configuration " + (configuration ?? "") + " ..."); if (!string.IsNullOrWhiteSpace(configuration)) { configPath = GetConfigPath(configFileName.Insert(configFileName.LastIndexOf(".", StringComparison.Ordinal), "." + configuration), folderMode, location); mergePath = GetConfigPath(configFileName, folderMode, location); if (configPath == null) { configPath = mergePath; mergePath = null; } } else { configPath = GetConfigPath(configFileName, folderMode, location); if (configPath == null) { configPath = GetConfigPath(configFileName.Insert(configFileName.LastIndexOf(".", StringComparison.Ordinal), ".debug"), folderMode, location); } if (configPath == null) { configPath = GetConfigPath(configFileName.Insert(configFileName.LastIndexOf(".", StringComparison.Ordinal), ".release"), folderMode, location); } } if (configPath == null) { Logger.Info("Config path is not found. Returning default config"); return default(T); } try { this.Logger.Info("Reading base configuration at " + (configPath ?? "") + " ..."); var json = File.ReadAllText(configPath); T config; if (mergePath != null) { this.Logger.Info("Reading merge configuration at " + (mergePath ?? "") + " ..."); var jsonMerge = File.ReadAllText(mergePath); var cfgMain = JObject.Parse(json); var cfgMerge = JObject.Parse(jsonMerge); cfgMerge.Merge(cfgMain); config = cfgMerge.ToObject<T>(); } else { config = JsonConvert.DeserializeObject<T>(json); } if (config == null) { return default(T); } return config; } catch (Exception e) { throw new InvalidOperationException("Cannot read " + configFileName, e); } } public string GetConfigPath(string configFileName, bool folderMode, string location) { this.Logger.Info("Getting configuration by file path " + (configFileName ?? "") + " at " + (location ?? "") + " ..."); var folder = folderMode ? location : Path.GetDirectoryName(location); var path = folder + Path.DirectorySeparatorChar + "Bridge" + Path.DirectorySeparatorChar + configFileName; if (!File.Exists(path)) { path = folder + Path.DirectorySeparatorChar + configFileName; } if (!File.Exists(path)) { path = folder + Path.DirectorySeparatorChar + "Bridge.NET" + Path.DirectorySeparatorChar + configFileName; } if (!File.Exists(path)) { this.Logger.Info("Skipping " + configFileName + " (not found)"); return null; } this.Logger.Info("Found configuration file " + (path ?? "")); return path; } } }
30.646825
168
0.486987
[ "Apache-2.0" ]
Angolar/Bridge
Compiler/Contract/Config/ConfigHelper.cs
7,723
C#
using Xunit; using System.Collections.Generic; using GildedRoseKata; namespace GildedRoseTests { public class StandardItemTests { [Theory] [InlineData(4,3,2)] [InlineData(0,2,0)] [InlineData(0,1,0)] public void UpdateQuality_GivenSellIn_ShouldChangeQuality(int sellIn, int initialQuality, int expectedQuality) { //Given var items = new List<Item> { new Item { Name = "foo", SellIn = sellIn, Quality = initialQuality } }; var app = new GildedRose(items); //When app.UpdateQuality(); //Then Assert.Equal(expectedQuality,items[0].Quality); } [Fact] public void UpdateQuality_ShouldNotDropQualityBelowZero() { //Given var items = new List<Item> { new Item { Name = "foo", SellIn = 10, Quality = 0 } }; var app = new GildedRose(items); //When app.UpdateQuality(); //Then Assert.Equal(0,items[0].Quality); } [Fact] public void UpdateQuality_ShouldNotHaveNegative() { //Given var items = new List<Item> { new Item { Name = "foo", SellIn = 10, Quality = -2 } }; var app = new GildedRose(items); //When app.UpdateQuality(); //Then Assert.Equal(-2,items[0].Quality); } } }
28.109091
118
0.499353
[ "MIT" ]
twierzchowski/GildedRose-Refactoring-Kata
csharpcore/GildedRoseTests/StandardItemTests.cs
1,546
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using ExitGames.Logging; using MultiplayerGameFramework.Implementation.Messaging; using MultiplayerGameFramework.Interfaces; using MultiplayerGameFramework.Interfaces.Client; using MultiplayerGameFramework.Interfaces.Messaging; using Photon.SocketServer; using PhotonHostRuntimeInterfaces; namespace MGF_Photon.Implementation.Client { public class PhotonClientPeer : ClientPeer, IClientPeer { public bool IsProxy { get { return false; } set { /*dont set anything */ } } public Guid PeerId { get; set; } public IConnectionCollection<IClientPeer> ConnectionCollection { get; set; } protected ILogger Log; private readonly IServerApplication _server; private readonly IHandlerList<IClientPeer> _handlerList; private readonly Dictionary<Type, IClientData> _clientData; #region Factory Method public delegate PhotonClientPeer ClientPeerFactory(InitRequest initRequest); #endregion public PhotonClientPeer(InitRequest initRequest, ILogger log, IServerApplication server, IEnumerable<IClientData> clientData, IConnectionCollection<IClientPeer> connectionCollection, IHandlerList<IClientPeer> handlerList) : base(initRequest) { Log = log; _server = server; _handlerList = handlerList; Log.DebugFormat("Created Client Peer"); ConnectionCollection = connectionCollection; connectionCollection.Connect(this); PeerId = Guid.NewGuid(); _clientData = new Dictionary<Type, IClientData>(); foreach (var data in clientData) { _clientData.Add(data.GetType(), data); } } protected override void OnOperationRequest(OperationRequest operationRequest, SendParameters sendParameters) { Log.DebugFormat("Handling operation request"); _handlerList.HandleMessage(new Request(operationRequest.OperationCode, operationRequest.Parameters.ContainsKey(_server.SubCodeParameterCode) ? (int?)Convert.ToInt32(operationRequest.Parameters[_server.SubCodeParameterCode]) : null, operationRequest.Parameters), this); } protected override void OnDisconnect(DisconnectReason reasonCode, string reasonDetail) { ConnectionCollection.Disconnect(this); Log.DebugFormat("Client Disconnected {0}", PeerId); } public void SendMessage(IMessage message) { if (!message.Parameters.Keys.Contains(_server.SubCodeParameterCode)) { message.Parameters.Add(_server.SubCodeParameterCode, message.SubCode); } if (message is Event) { SendEvent(new EventData(message.Code) { Parameters = message.Parameters }, new SendParameters()); } var response = message as Response; if (response != null) { SendOperationResponse(new OperationResponse(response.Code, response.Parameters) { DebugMessage = response.DebugMessage, ReturnCode = response.ReturnCode }, new SendParameters()); } } public T ClientData<T>() where T : class, IClientData { IClientData result; _clientData.TryGetValue(typeof(T), out result); if (result != null) { return result as T; } return null; } } }
34.518182
194
0.628918
[ "MIT" ]
astonished12/mmorpg-implementation
Server-project/PhotonMMORPG/PhotonMMORPG/MGF-Photon4/Implementation/Client/PhotonClientPeer.cs
3,799
C#
namespace Steepshot.Core.Models.Responses { public class MessageField { public string Message { get; set; } } public class OffsetCountFields { public string Offset { get; set; } public int Count { get; set; } } }
18.785714
43
0.596958
[ "Unlicense" ]
AnCh7/sweetshot
src/Steepshot.Core/Models/Responses/BaseResponses.cs
265
C#
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ using System; using NUnit.Framework; using StandardAnalyzer = Lucene.Net.Analysis.Standard.StandardAnalyzer; using Document = Lucene.Net.Documents.Document; using Field = Lucene.Net.Documents.Field; using IndexWriter = Lucene.Net.Index.IndexWriter; using ParseException = Lucene.Net.QueryParsers.ParseException; using QueryParser = Lucene.Net.QueryParsers.QueryParser; using Directory = Lucene.Net.Store.Directory; using RAMDirectory = Lucene.Net.Store.RAMDirectory; using LuceneTestCase = Lucene.Net.Util.LuceneTestCase; namespace Lucene.Net.Search { /// <summary> Tests {@link MultiSearcher} ranking, i.e. makes sure this bug is fixed: /// http://issues.apache.org/bugzilla/show_bug.cgi?id=31841 /// </summary> [TestFixture] public class TestMultiSearcherRanking:LuceneTestCase { private bool verbose = false; // set to true to output hits private System.String FIELD_NAME = "body"; private Searcher multiSearcher; private Searcher singleSearcher; [Test] public virtual void TestOneTermQuery() { CheckQuery("three"); } [Test] public virtual void TestTwoTermQuery() { CheckQuery("three foo"); } [Test] public virtual void TestPrefixQuery() { CheckQuery("multi*"); } [Test] public virtual void TestFuzzyQuery() { CheckQuery("multiThree~"); } [Test] public virtual void TestRangeQuery() { CheckQuery("{multiA TO multiP}"); } [Test] public virtual void TestMultiPhraseQuery() { CheckQuery("\"blueberry pi*\""); } [Test] public virtual void TestNoMatchQuery() { CheckQuery("+three +nomatch"); } /* public void testTermRepeatedQuery() throws IOException, ParseException { // TODO: this corner case yields different results. checkQuery("multi* multi* foo"); } */ /// <summary> checks if a query yields the same result when executed on /// a single IndexSearcher containing all documents and on a /// MultiSearcher aggregating sub-searchers /// </summary> /// <param name="queryStr"> the query to check. /// </param> /// <throws> IOException </throws> /// <throws> ParseException </throws> private void CheckQuery(System.String queryStr) { // check result hit ranking if (verbose) System.Console.Out.WriteLine("Query: " + queryStr); QueryParser queryParser = new QueryParser(Util.Version.LUCENE_CURRENT, FIELD_NAME, new StandardAnalyzer(Util.Version.LUCENE_CURRENT)); Query query = queryParser.Parse(queryStr); ScoreDoc[] multiSearcherHits = multiSearcher.Search(query, null, 1000).ScoreDocs; ScoreDoc[] singleSearcherHits = singleSearcher.Search(query, null, 1000).ScoreDocs; Assert.AreEqual(multiSearcherHits.Length, singleSearcherHits.Length); for (int i = 0; i < multiSearcherHits.Length; i++) { Document docMulti = multiSearcher.Doc(multiSearcherHits[i].Doc); Document docSingle = singleSearcher.Doc(singleSearcherHits[i].Doc); if (verbose) System.Console.Out.WriteLine("Multi: " + docMulti.Get(FIELD_NAME) + " score=" + multiSearcherHits[i].Score); if (verbose) System.Console.Out.WriteLine("Single: " + docSingle.Get(FIELD_NAME) + " score=" + singleSearcherHits[i].Score); Assert.AreEqual(multiSearcherHits[i].Score, singleSearcherHits[i].Score, 0.001f); Assert.AreEqual(docMulti.Get(FIELD_NAME), docSingle.Get(FIELD_NAME)); } if (verbose) System.Console.Out.WriteLine(); } /// <summary> initializes multiSearcher and singleSearcher with the same document set</summary> [SetUp] public override void SetUp() { base.SetUp(); // create MultiSearcher from two seperate searchers Directory d1 = new RAMDirectory(); IndexWriter iw1 = new IndexWriter(d1, new StandardAnalyzer(Util.Version.LUCENE_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED); AddCollection1(iw1); iw1.Close(); Directory d2 = new RAMDirectory(); IndexWriter iw2 = new IndexWriter(d2, new StandardAnalyzer(Util.Version.LUCENE_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED); AddCollection2(iw2); iw2.Close(); Searchable[] s = new Searchable[2]; s[0] = new IndexSearcher(d1, true); s[1] = new IndexSearcher(d2, true); multiSearcher = new MultiSearcher(s); // create IndexSearcher which contains all documents Directory d = new RAMDirectory(); IndexWriter iw = new IndexWriter(d, new StandardAnalyzer(Util.Version.LUCENE_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED); AddCollection1(iw); AddCollection2(iw); iw.Close(); singleSearcher = new IndexSearcher(d, true); } private void AddCollection1(IndexWriter iw) { Add("one blah three", iw); Add("one foo three multiOne", iw); Add("one foobar three multiThree", iw); Add("blueberry pie", iw); Add("blueberry strudel", iw); Add("blueberry pizza", iw); } private void AddCollection2(IndexWriter iw) { Add("two blah three", iw); Add("two foo xxx multiTwo", iw); Add("two foobar xxx multiThreee", iw); Add("blueberry chewing gum", iw); Add("bluebird pizza", iw); Add("bluebird foobar pizza", iw); Add("piccadilly circus", iw); } private void Add(System.String value_Renamed, IndexWriter iw) { Document d = new Document(); d.Add(new Field(FIELD_NAME, value_Renamed, Field.Store.YES, Field.Index.ANALYZED)); iw.AddDocument(d); } } }
33.225806
137
0.710841
[ "Apache-2.0" ]
Distrotech/mono
external/Lucene.Net/test/core/Search/TestMultiSearcherRanking.cs
6,180
C#
using System; using System.Runtime.InteropServices; using Vanara.InteropServices; namespace Vanara.PInvoke { /// <summary>Functions, structures and constants from Windows Core Audio Api.</summary> public static partial class CoreAudio { /// <summary>The reason that the audio session was disconnected.</summary> [PInvokeData("audiopolicy.h")] public enum AudioSessionDisconnectReason { /// <summary>The user removed the audio endpoint device.</summary> DisconnectReasonDeviceRemoval = 0, /// <summary>The Windows audio service has stopped.</summary> DisconnectReasonServerShutdown = (DisconnectReasonDeviceRemoval + 1), /// <summary>The stream format changed for the device that the audio session is connected to.</summary> DisconnectReasonFormatChanged = (DisconnectReasonServerShutdown + 1), /// <summary>The user logged off the Windows Terminal Services (WTS) session that the audio session was running in.</summary> DisconnectReasonSessionLogoff = (DisconnectReasonFormatChanged + 1), /// <summary>The WTS session that the audio session was running in was disconnected.</summary> DisconnectReasonSessionDisconnected = (DisconnectReasonSessionLogoff + 1), /// <summary> /// The (shared-mode) audio session was disconnected to make the audio endpoint device available for an exclusive-mode connection. /// </summary> DisconnectReasonExclusiveModeOverride = (DisconnectReasonSessionDisconnected + 1) } /// <summary> /// <para> /// The <c>IAudioSessionControl</c> interface enables a client to configure the control parameters for an audio session and to /// monitor events in the session. The IAudioClient::Initialize method initializes a stream object and assigns the stream to an /// audio session. The client obtains a reference to the <c>IAudioSessionControl</c> interface on a stream object by calling the /// IAudioClient::GetService method with parameter riid set to <c>REFIID</c> IID_IAudioSessionControl. /// </para> /// <para> /// Alternatively, a client can obtain the <c>IAudioSessionControl</c> interface of an existing session without having to first /// create a stream object and add the stream to the session. Instead, the client calls the /// IAudioSessionManager::GetAudioSessionControl method with parameter AudioSessionGuid set to the session GUID. /// </para> /// <para> /// The client can register to receive notification from the session manager when clients change session parameters through the /// methods in the <c>IAudioSessionControl</c> interface. /// </para> /// <para> /// When releasing an <c>IAudioSessionControl</c> interface instance, the client must call the interface's <c>Release</c> method /// from the same thread as the call to <c>IAudioClient::GetService</c> that created the object. /// </para> /// <para> /// The <c>IAudioSessionControl</c> interface controls an audio session. An audio session is a collection of shared-mode streams. /// This interface does not work with exclusive-mode streams. /// </para> /// <para>For a code example that uses the <c>IAudioSessionControl</c> interface, see Audio Events for Legacy Audio Applications.</para> /// </summary> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nn-audiopolicy-iaudiosessioncontrol [PInvokeData("audiopolicy.h", MSDNShortId = "4446140e-2e61-40ed-b0f9-4c1b90e7c2de")] [ComImport, Guid("F4B1A599-7266-4319-A8CA-E70ACB11E8CD"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] public interface IAudioSessionControl { /// <summary>The <c>GetState</c> method retrieves the current state of the audio session.</summary> /// <returns> /// <para>A variable into which the method writes the current session state.</para> /// <para> /// These values indicate that the session state is active, inactive, or expired, respectively. For more information, see Remarks. /// </para> /// </returns> /// <remarks> /// <para> /// This method indicates whether the state of the session is active, inactive, or expired. The state is active if the session /// has one or more streams that are running. The state changes from active to inactive when the last running stream in the /// session stops. The session state changes to expired when the client destroys the last stream in the session by releasing all /// references to the stream object. /// </para> /// <para> /// The Sndvol program displays volume and mute controls for sessions that are in the active and inactive states. When a session /// expires, Sndvol stops displaying the controls for that session. If a session has previously expired, but the session state /// changes to active (because a stream in the session begins running) or inactive (because a client assigns a new stream to the /// session), Sndvol resumes displaying the controls for the session. /// </para> /// <para> /// The client creates a stream by calling the IAudioClient::Initialize method. At the time that it creates a stream, the client /// assigns the stream to a session. A session begins when a client assigns the first stream to the session. Initially, the /// session is in the inactive state. The session state changes to active when the first stream in the session begins running. /// The session terminates when a client releases the final reference to the last remaining stream object in the session. /// </para> /// </remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessioncontrol-getstate HRESULT GetState( // AudioSessionState *pRetVal ); AudioSessionState GetState(); /// <summary>The <c>GetDisplayName</c> method retrieves the display name for the audio session.</summary> /// <returns>A string that contains the display name.</returns> /// <remarks> /// If the client has not called IAudioSessionControl::SetDisplayName to set the display name, the string will be empty. Rather /// than display an empty name string, the Sndvol program uses a default, automatically generated name to label the volume /// control for the audio session. /// </remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessioncontrol-getdisplayname HRESULT // GetDisplayName( LPWSTR *pRetVal ); SafeCoTaskMemString GetDisplayName(); /// <summary>The <c>SetDisplayName</c> method assigns a display name to the current session.</summary> /// <param name="Value">Pointer to a null-terminated, wide-character string that contains the display name for the session.</param> /// <param name="EventContext"> /// Pointer to the event-context GUID. If a call to this method generates a name-change event, the session manager sends /// notifications to all clients that have registered IAudioSessionEvents interfaces with the session manager. The session /// manager includes the EventContext pointer value with each notification. Upon receiving a notification, a client can /// determine whether it or another client is the source of the event by inspecting the EventContext value. This scheme depends /// on the client selecting a value for this parameter that is unique among all clients in the session. If the caller supplies a /// <c>NULL</c> pointer for this parameter, the client's notification method receives a <c>NULL</c> context pointer. /// </param> /// <remarks> /// <para> /// In Windows Vista, the system-supplied program, Sndvol.exe, uses the display name to label the volume control for the /// session. If the client does not call <c>SetDisplayName</c> to assign a display name to the session, the Sndvol program uses /// a default, automatically generated name to label the session. The default name incorporates information such as the window /// title or version resource of the audio application. /// </para> /// <para> /// If a client has more than one active session, client-specified display names are especially helpful for distinguishing among /// the volume controls for the various sessions. /// </para> /// <para> /// In the case of a cross-process session, the session has no identifying information, such as an application name or process /// ID, from which to generate a default display name. Thus, the client must call <c>SetDisplayName</c> to avoid displaying a /// meaningless default display name. /// </para> /// <para> /// The display name does not persist beyond the lifetime of the IAudioSessionControl object. Thus, after all references to the /// object are released, a subsequently created version of the object (with the same application, same session GUID, and same /// endpoint device) will once again have a default, automatically generated display name until the client calls <c>SetDisplayName</c>. /// </para> /// <para>The client can retrieve the display name for the session by calling the IAudioSessionControl::GetDisplayName method.</para> /// </remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessioncontrol-setdisplayname HRESULT // SetDisplayName( LPCWSTR Value, LPCGUID EventContext ); void SetDisplayName([MarshalAs(UnmanagedType.LPWStr)] string Value, in Guid EventContext); /// <summary>The <c>GetIconPath</c> method retrieves the path for the display icon for the audio session.</summary> /// <returns> /// Pointer to a pointer variable into which the method writes the address of a null-terminated, wide-character string that /// specifies the fully qualified path of an .ico, .dll, or .exe file that contains the icon. The method allocates the storage /// for the string. The caller is responsible for freeing the storage, when it is no longer needed, by calling the CoTaskMemFree /// function. For information about icon paths and <c>CoTaskMemFree</c>, see the Windows SDK documentation. /// </returns> /// <remarks> /// If a client has not called IAudioSessionControl::SetIconPath to set the display icon, the string will be empty. If no /// client-specified icon is available, the Sndvol program uses the icon from the client's application window to label the /// volume control for the audio session. /// </remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessioncontrol-geticonpath HRESULT // GetIconPath( LPWSTR *pRetVal ); SafeCoTaskMemString GetIconPath(); /// <summary>The <c>SetIconPath</c> method assigns a display icon to the current session.</summary> /// <param name="Value"> /// Pointer to a null-terminated, wide-character string that specifies the path and file name of an .ico, .dll, or .exe file /// that contains the icon. For information about icon paths, see the Windows SDK documentation. /// </param> /// <param name="EventContext"> /// Pointer to the event-context GUID. If a call to this method generates an icon-change event, the session manager sends /// notifications to all clients that have registered IAudioSessionEvents interfaces with the session manager. The session /// manager includes the EventContext pointer value with each notification. Upon receiving a notification, a client can /// determine whether it or another client is the source of the event by inspecting the EventContext value. This scheme depends /// on the client selecting a value for this parameter that is unique among all clients in the session. If the caller supplies a /// <c>NULL</c> pointer for this parameter, the client's notification method receives a <c>NULL</c> context pointer. /// </param> /// <remarks> /// <para> /// In Windows Vista, the system-supplied program, Sndvol.exe, uses the display icon (along with the display name) to label the /// volume control for the session. If the client does not call <c>SetIconPath</c> to assign an icon to the session, the Sndvol /// program uses the icon from the application window as the default icon for the session. /// </para> /// <para> /// In the case of a cross-process session, the session is not associated with a single application process. Thus, Sndvol has no /// application-specific icon to use by default, and the client must call <c>SetIconPath</c> to avoid displaying a meaningless icon. /// </para> /// <para> /// The display icon does not persist beyond the lifetime of the IAudioSessionControl object. Thus, after all references to the /// object are released, a subsequently created version of the object (with the same application, same session GUID, and same /// endpoint device) will once again have a default icon until the client calls <c>SetIconPath</c>. /// </para> /// <para>The client can retrieve the display icon for the session by calling the IAudioSessionControl::GetIconPath method.</para> /// </remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessioncontrol-seticonpath HRESULT // SetIconPath( LPCWSTR Value, LPCGUID EventContext ); void SetIconPath([MarshalAs(UnmanagedType.LPWStr)] string Value, in Guid EventContext); /// <summary>The <c>GetGroupingParam</c> method retrieves the grouping parameter of the audio session.</summary> /// <returns> /// Output pointer for the grouping-parameter GUID. This parameter must be a valid, non- <c>NULL</c> pointer to a /// caller-allocated GUID variable. The method writes the grouping parameter into this variable. /// </returns> /// <remarks> /// <para> /// All of the audio sessions that have the same grouping parameter value are under the control of the same volume-level slider /// in the system volume-control program, Sndvol. For more information, see Grouping Parameters. /// </para> /// <para>A client can call the IAudioSessionControl::SetGroupingParam method to change the grouping parameter of a session.</para> /// <para> /// If a client has never called SetGroupingParam to assign a grouping parameter to an audio session, the session's grouping /// parameter value is GUID_NULL by default and a call to <c>GetGroupingParam</c> retrieves this value. A grouping parameter /// value of GUID_NULL indicates that the session does not belong to any grouping. In that case, the session has its own /// volume-level slider in the Sndvol program. /// </para> /// </remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessioncontrol-getgroupingparam HRESULT // GetGroupingParam( GUID *pRetVal ); Guid GetGroupingParam(); /// <summary>The <c>SetGroupingParam</c> method assigns a session to a grouping of sessions.</summary> /// <param name="Override"> /// The new grouping parameter. This parameter must be a valid, non- <c>NULL</c> pointer to a grouping-parameter GUID. For more /// information, see Remarks. /// </param> /// <param name="EventContext"> /// Pointer to the event-context GUID. If a call to this method generates a grouping-change event, the session manager sends /// notifications to all clients that have registered IAudioSessionEvents interfaces with the session manager. The session /// manager includes the EventContext pointer value with each notification. Upon receiving a notification, a client can /// determine whether it or another client is the source of the event by inspecting the EventContext value. This scheme depends /// on the client selecting a value for this parameter that is unique among all clients in the session. If the caller supplies a /// <c>NULL</c> pointer for this parameter, the client's notification method receives a <c>NULL</c> context pointer. /// </param> /// <remarks> /// <para> /// A client calls this method to change the grouping parameter of a session. All of the audio sessions that have the same /// grouping parameter value are under the control of the same volume-level slider in the system volume-control program, Sndvol. /// For more information, see Grouping Parameters. /// </para> /// <para> /// The client can get the current grouping parameter for the session by calling the IAudioSessionControl::GetGroupingParam method. /// </para> /// <para> /// If a client has never called <c>SetGroupingParam</c> to assign a grouping parameter to a session, the session does not /// belong to any grouping. A session that does not belong to any grouping has its own, dedicated volume-level slider in the /// Sndvol program. /// </para> /// </remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessioncontrol-setgroupingparam HRESULT // SetGroupingParam( LPCGUID Override, LPCGUID EventContext ); void SetGroupingParam(in Guid Override, in Guid EventContext); /// <summary> /// The <c>RegisterAudioSessionNotification</c> method registers the client to receive notifications of session events, /// including changes in the stream state. /// </summary> /// <param name="NewNotifications"> /// Pointer to a client-implemented IAudioSessionEvents interface. If the method succeeds, it calls the AddRef method on the /// client's <c>IAudioSessionEvents</c> interface. /// </param> /// <remarks> /// <para> /// This method passes a client-implemented IAudioSessionEvents interface to the session manager. Following a successful call to /// this method, the session manager calls the methods in the <c>IAudioSessionEvents</c> interface to notify the client of /// various session events. Through these methods, the client receives notifications of the following session-related events: /// </para> /// <list type="bullet"> /// <item> /// <term>Display name changes</term> /// </item> /// <item> /// <term>Volume level changes</term> /// </item> /// <item> /// <term>Session state changes (inactive to active, or active to inactive)</term> /// </item> /// <item> /// <term>Grouping parameter changes</term> /// </item> /// <item> /// <term> /// Disconnection of the client from the session (caused by the user removing the audio endpoint device, shutting down the /// session manager, or changing the stream format) /// </term> /// </item> /// </list> /// <para> /// When notifications are no longer needed, the client can call the IAudioSessionControl::UnregisterAudioSessionNotification /// method to terminate the notifications. /// </para> /// <para> /// Before the client releases its final reference to the IAudioSessionEvents interface, it should call /// UnregisterAudioSessionNotification to unregister the interface. Otherwise, the application leaks the resources held by the /// <c>IAudioSessionEvents</c> and IAudioSessionControl objects. Note that <c>RegisterAudioSessionNotification</c> calls the /// client's IAudioSessionEvents::AddRef method, and <c>UnregisterAudioSessionNotification</c> calls the /// IAudioSessionEvents::Release method. If the client errs by releasing its reference to the <c>IAudioSessionEvents</c> /// interface before calling <c>UnregisterAudioSessionNotification</c>, the session manager never releases its reference to the /// <c>IAudioSessionEvents</c> interface. For example, a poorly designed <c>IAudioSessionEvents</c> implementation might call /// <c>UnregisterAudioSessionNotification</c> from the destructor for the <c>IAudioSessionEvents</c> object. In this case, the /// client will not call <c>UnregisterAudioSessionNotification</c> until the session manager releases its reference to the /// <c>IAudioSessionEvents</c> interface, and the session manager will not release its reference to the /// <c>IAudioSessionEvents</c> interface until the client calls <c>UnregisterAudioSessionNotification</c>. For more information /// about the <c>AddRef</c> and <c>Release</c> methods, see the discussion of the IUnknown interface in the Windows SDK documentation. /// </para> /// <para> /// In addition, the client should call UnregisterAudioSessionNotification before releasing all of its references to the /// IAudioSessionControl and IAudioSessionManager objects. Unless the client retains a reference to at least one of these two /// objects, the session manager leaks the storage that it allocated to hold the registration information. After registering a /// notification interface, the client continues to receive notifications for only as long as at least one of these two objects exists. /// </para> /// <para> /// For a code example that calls the <c>RegisterAudioSessionNotification</c> method, see Audio Events for Legacy Audio Applications. /// </para> /// </remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessioncontrol-registeraudiosessionnotification // HRESULT RegisterAudioSessionNotification( IAudioSessionEvents *NewNotifications ); void RegisterAudioSessionNotification([In] IAudioSessionEvents NewNotifications); /// <summary> /// The <c>UnregisterAudioSessionNotification</c> method deletes a previous registration by the client to receive notifications. /// </summary> /// <param name="NewNotifications"> /// Pointer to a client-implemented IAudioSessionEvents interface. The client passed this same interface pointer to the session /// manager in a previous call to the IAudioSessionControl::RegisterAudioSessionNotification method. If the /// <c>UnregisterAudioSessionNotification</c> method succeeds, it calls the Release method on the client's /// <c>IAudioSessionEvents</c> interface. /// </param> /// <remarks> /// <para> /// The client calls this method when it no longer needs to receive notifications. The <c>UnregisterAudioSessionNotification</c> /// method removes the registration of an IAudioSessionEvents interface that the client previously registered with the session /// manager by calling the IAudioSessionControl::RegisterAudioSessionNotification method. /// </para> /// <para> /// Before the client releases its final reference to the IAudioSessionEvents interface, it should call /// <c>UnregisterAudioSessionNotification</c> to unregister the interface. Otherwise, the application leaks the resources held /// by the <c>IAudioSessionEvents</c> and IAudioSessionControl objects. Note that RegisterAudioSessionNotification calls the /// client's IAudioSessionEvents::AddRef method, and <c>UnregisterAudioSessionNotification</c> calls the /// IAudioSessionEvents::Release method. If the client errs by releasing its reference to the <c>IAudioSessionEvents</c> /// interface before calling <c>UnregisterAudioSessionNotification</c>, the session manager never releases its reference to the /// <c>IAudioSessionEvents</c> interface. For example, a poorly designed <c>IAudioSessionEvents</c> implementation might call /// <c>UnregisterAudioSessionNotification</c> from the destructor for the <c>IAudioSessionEvents</c> object. In this case, the /// client will not call <c>UnregisterAudioSessionNotification</c> until the session manager releases its reference to the /// <c>IAudioSessionEvents</c> interface, and the session manager will not release its reference to the /// <c>IAudioSessionEvents</c> interface until the client calls <c>UnregisterAudioSessionNotification</c>. For more information /// about the <c>AddRef</c> and <c>Release</c> methods, see the discussion of the IUnknown interface in the Windows SDK documentation. /// </para> /// <para> /// For a code example that calls the <c>UnregisterAudioSessionNotification</c> method, see Audio Events for Legacy Audio Applications. /// </para> /// </remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessioncontrol-unregisteraudiosessionnotification // HRESULT UnregisterAudioSessionNotification( IAudioSessionEvents *NewNotifications ); void UnregisterAudioSessionNotification([In] IAudioSessionEvents NewNotifications); } /// <summary> /// <para>The <c>IAudioSessionControl2</c> interface can be used by a client to get information about the audio session.</para> /// <para> /// To get a reference to the <c>IAudioSessionControl2</c> interface, the application must call /// <c>IAudioSessionControl::QueryInterface</c> to request the interface pointer from the stream object's IAudioSessionControl /// interface. There are two ways an application can get a pointer to the <c>IAudioSessionControl</c> interface: /// </para> /// <list type="bullet"> /// <item> /// <term> /// By calling IAudioClient::GetService on the audio client after opening a stream on the device. The audio client opens a stream /// for rendering or capturing, and associates it with an audio session by calling IAudioClient::Initialize. /// </term> /// </item> /// <item> /// <term>By calling IAudioSessionManager::GetAudioSessionControl for an existing audio session without opening the stream.</term> /// </item> /// </list> /// <para> /// When the application wants to release the <c>IAudioSessionControl2</c> interface instance, the application must call the /// interface's <c>Release</c> method from the same thread as the call to IAudioClient::GetService that created the object. /// </para> /// <para> /// The application thread that uses this interface must be initialized for COM. For more information about COM initialization, see /// the description of the <c>CoInitializeEx</c> function in the Windows SDK documentation. /// </para> /// </summary> /// <remarks> /// <para> /// This interface supports custom implementations for stream attenuation or ducking, a new feature in Windows 7. An application /// playing a media stream can make it behave differently when a new communication stream is opened on the default communication /// device. For example, the original media stream can be paused while the new communication stream is open. For more information /// about this feature, see Default Ducking Experience. /// </para> /// <para>An application can use this interface to perform the following tasks:</para> /// <list type="bullet"> /// <item> /// <term>Specify that it wants to opt out of the default stream attenuation experience provided by the system.</term> /// </item> /// <item> /// <term> /// Get the audio session identifier that is associated with the stream. The identifier is required during the notification /// registration. The application can register itself to receive ducking notifications from the system. /// </term> /// </item> /// <item> /// <term>Check whether the stream associated with the audio session is a system sound.</term> /// </item> /// </list> /// <para>Examples</para> /// <para> /// The following example code shows how to get a reference to the <c>IAudioSessionControl2</c> interface and call its methods to /// determine whether the stream associated with the audio session is a system sound. /// </para> /// </remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nn-audiopolicy-iaudiosessioncontrol2 [PInvokeData("audiopolicy.h", MSDNShortId = "3bb65edf-103c-4eeb-82b4-7c571cddfcf3")] [ComImport, Guid("bfb7ff88-7239-4fc9-8fa2-07c950be9c6d"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] public interface IAudioSessionControl2 : IAudioSessionControl { /// <summary>The <c>GetState</c> method retrieves the current state of the audio session.</summary> /// <returns> /// <para>A variable into which the method writes the current session state.</para> /// <para> /// These values indicate that the session state is active, inactive, or expired, respectively. For more information, see Remarks. /// </para> /// </returns> /// <remarks> /// <para> /// This method indicates whether the state of the session is active, inactive, or expired. The state is active if the session /// has one or more streams that are running. The state changes from active to inactive when the last running stream in the /// session stops. The session state changes to expired when the client destroys the last stream in the session by releasing all /// references to the stream object. /// </para> /// <para> /// The Sndvol program displays volume and mute controls for sessions that are in the active and inactive states. When a session /// expires, Sndvol stops displaying the controls for that session. If a session has previously expired, but the session state /// changes to active (because a stream in the session begins running) or inactive (because a client assigns a new stream to the /// session), Sndvol resumes displaying the controls for the session. /// </para> /// <para> /// The client creates a stream by calling the IAudioClient::Initialize method. At the time that it creates a stream, the client /// assigns the stream to a session. A session begins when a client assigns the first stream to the session. Initially, the /// session is in the inactive state. The session state changes to active when the first stream in the session begins running. /// The session terminates when a client releases the final reference to the last remaining stream object in the session. /// </para> /// </remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessioncontrol-getstate HRESULT GetState( // AudioSessionState *pRetVal ); new AudioSessionState GetState(); /// <summary>The <c>GetDisplayName</c> method retrieves the display name for the audio session.</summary> /// <returns>A string that contains the display name.</returns> /// <remarks> /// If the client has not called IAudioSessionControl::SetDisplayName to set the display name, the string will be empty. Rather /// than display an empty name string, the Sndvol program uses a default, automatically generated name to label the volume /// control for the audio session. /// </remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessioncontrol-getdisplayname HRESULT // GetDisplayName( LPWSTR *pRetVal ); new SafeCoTaskMemString GetDisplayName(); /// <summary>The <c>SetDisplayName</c> method assigns a display name to the current session.</summary> /// <param name="Value">Pointer to a null-terminated, wide-character string that contains the display name for the session.</param> /// <param name="EventContext"> /// Pointer to the event-context GUID. If a call to this method generates a name-change event, the session manager sends /// notifications to all clients that have registered IAudioSessionEvents interfaces with the session manager. The session /// manager includes the EventContext pointer value with each notification. Upon receiving a notification, a client can /// determine whether it or another client is the source of the event by inspecting the EventContext value. This scheme depends /// on the client selecting a value for this parameter that is unique among all clients in the session. If the caller supplies a /// <c>NULL</c> pointer for this parameter, the client's notification method receives a <c>NULL</c> context pointer. /// </param> /// <remarks> /// <para> /// In Windows Vista, the system-supplied program, Sndvol.exe, uses the display name to label the volume control for the /// session. If the client does not call <c>SetDisplayName</c> to assign a display name to the session, the Sndvol program uses /// a default, automatically generated name to label the session. The default name incorporates information such as the window /// title or version resource of the audio application. /// </para> /// <para> /// If a client has more than one active session, client-specified display names are especially helpful for distinguishing among /// the volume controls for the various sessions. /// </para> /// <para> /// In the case of a cross-process session, the session has no identifying information, such as an application name or process /// ID, from which to generate a default display name. Thus, the client must call <c>SetDisplayName</c> to avoid displaying a /// meaningless default display name. /// </para> /// <para> /// The display name does not persist beyond the lifetime of the IAudioSessionControl object. Thus, after all references to the /// object are released, a subsequently created version of the object (with the same application, same session GUID, and same /// endpoint device) will once again have a default, automatically generated display name until the client calls <c>SetDisplayName</c>. /// </para> /// <para>The client can retrieve the display name for the session by calling the IAudioSessionControl::GetDisplayName method.</para> /// </remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessioncontrol-setdisplayname HRESULT // SetDisplayName( LPCWSTR Value, LPCGUID EventContext ); new void SetDisplayName([MarshalAs(UnmanagedType.LPWStr)] string Value, in Guid EventContext); /// <summary>The <c>GetIconPath</c> method retrieves the path for the display icon for the audio session.</summary> /// <returns> /// Pointer to a pointer variable into which the method writes the address of a null-terminated, wide-character string that /// specifies the fully qualified path of an .ico, .dll, or .exe file that contains the icon. The method allocates the storage /// for the string. The caller is responsible for freeing the storage, when it is no longer needed, by calling the CoTaskMemFree /// function. For information about icon paths and <c>CoTaskMemFree</c>, see the Windows SDK documentation. /// </returns> /// <remarks> /// If a client has not called IAudioSessionControl::SetIconPath to set the display icon, the string will be empty. If no /// client-specified icon is available, the Sndvol program uses the icon from the client's application window to label the /// volume control for the audio session. /// </remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessioncontrol-geticonpath HRESULT // GetIconPath( LPWSTR *pRetVal ); new SafeCoTaskMemString GetIconPath(); /// <summary>The <c>SetIconPath</c> method assigns a display icon to the current session.</summary> /// <param name="Value"> /// Pointer to a null-terminated, wide-character string that specifies the path and file name of an .ico, .dll, or .exe file /// that contains the icon. For information about icon paths, see the Windows SDK documentation. /// </param> /// <param name="EventContext"> /// Pointer to the event-context GUID. If a call to this method generates an icon-change event, the session manager sends /// notifications to all clients that have registered IAudioSessionEvents interfaces with the session manager. The session /// manager includes the EventContext pointer value with each notification. Upon receiving a notification, a client can /// determine whether it or another client is the source of the event by inspecting the EventContext value. This scheme depends /// on the client selecting a value for this parameter that is unique among all clients in the session. If the caller supplies a /// <c>NULL</c> pointer for this parameter, the client's notification method receives a <c>NULL</c> context pointer. /// </param> /// <remarks> /// <para> /// In Windows Vista, the system-supplied program, Sndvol.exe, uses the display icon (along with the display name) to label the /// volume control for the session. If the client does not call <c>SetIconPath</c> to assign an icon to the session, the Sndvol /// program uses the icon from the application window as the default icon for the session. /// </para> /// <para> /// In the case of a cross-process session, the session is not associated with a single application process. Thus, Sndvol has no /// application-specific icon to use by default, and the client must call <c>SetIconPath</c> to avoid displaying a meaningless icon. /// </para> /// <para> /// The display icon does not persist beyond the lifetime of the IAudioSessionControl object. Thus, after all references to the /// object are released, a subsequently created version of the object (with the same application, same session GUID, and same /// endpoint device) will once again have a default icon until the client calls <c>SetIconPath</c>. /// </para> /// <para>The client can retrieve the display icon for the session by calling the IAudioSessionControl::GetIconPath method.</para> /// </remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessioncontrol-seticonpath HRESULT // SetIconPath( LPCWSTR Value, LPCGUID EventContext ); new void SetIconPath([MarshalAs(UnmanagedType.LPWStr)] string Value, in Guid EventContext); /// <summary>The <c>GetGroupingParam</c> method retrieves the grouping parameter of the audio session.</summary> /// <returns> /// Output pointer for the grouping-parameter GUID. This parameter must be a valid, non- <c>NULL</c> pointer to a /// caller-allocated GUID variable. The method writes the grouping parameter into this variable. /// </returns> /// <remarks> /// <para> /// All of the audio sessions that have the same grouping parameter value are under the control of the same volume-level slider /// in the system volume-control program, Sndvol. For more information, see Grouping Parameters. /// </para> /// <para>A client can call the IAudioSessionControl::SetGroupingParam method to change the grouping parameter of a session.</para> /// <para> /// If a client has never called SetGroupingParam to assign a grouping parameter to an audio session, the session's grouping /// parameter value is GUID_NULL by default and a call to <c>GetGroupingParam</c> retrieves this value. A grouping parameter /// value of GUID_NULL indicates that the session does not belong to any grouping. In that case, the session has its own /// volume-level slider in the Sndvol program. /// </para> /// </remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessioncontrol-getgroupingparam HRESULT // GetGroupingParam( GUID *pRetVal ); new Guid GetGroupingParam(); /// <summary>The <c>SetGroupingParam</c> method assigns a session to a grouping of sessions.</summary> /// <param name="Override"> /// The new grouping parameter. This parameter must be a valid, non- <c>NULL</c> pointer to a grouping-parameter GUID. For more /// information, see Remarks. /// </param> /// <param name="EventContext"> /// Pointer to the event-context GUID. If a call to this method generates a grouping-change event, the session manager sends /// notifications to all clients that have registered IAudioSessionEvents interfaces with the session manager. The session /// manager includes the EventContext pointer value with each notification. Upon receiving a notification, a client can /// determine whether it or another client is the source of the event by inspecting the EventContext value. This scheme depends /// on the client selecting a value for this parameter that is unique among all clients in the session. If the caller supplies a /// <c>NULL</c> pointer for this parameter, the client's notification method receives a <c>NULL</c> context pointer. /// </param> /// <remarks> /// <para> /// A client calls this method to change the grouping parameter of a session. All of the audio sessions that have the same /// grouping parameter value are under the control of the same volume-level slider in the system volume-control program, Sndvol. /// For more information, see Grouping Parameters. /// </para> /// <para> /// The client can get the current grouping parameter for the session by calling the IAudioSessionControl::GetGroupingParam method. /// </para> /// <para> /// If a client has never called <c>SetGroupingParam</c> to assign a grouping parameter to a session, the session does not /// belong to any grouping. A session that does not belong to any grouping has its own, dedicated volume-level slider in the /// Sndvol program. /// </para> /// </remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessioncontrol-setgroupingparam HRESULT // SetGroupingParam( LPCGUID Override, LPCGUID EventContext ); new void SetGroupingParam(in Guid Override, in Guid EventContext); /// <summary> /// The <c>RegisterAudioSessionNotification</c> method registers the client to receive notifications of session events, /// including changes in the stream state. /// </summary> /// <param name="NewNotifications"> /// Pointer to a client-implemented IAudioSessionEvents interface. If the method succeeds, it calls the AddRef method on the /// client's <c>IAudioSessionEvents</c> interface. /// </param> /// <remarks> /// <para> /// This method passes a client-implemented IAudioSessionEvents interface to the session manager. Following a successful call to /// this method, the session manager calls the methods in the <c>IAudioSessionEvents</c> interface to notify the client of /// various session events. Through these methods, the client receives notifications of the following session-related events: /// </para> /// <list type="bullet"> /// <item> /// <term>Display name changes</term> /// </item> /// <item> /// <term>Volume level changes</term> /// </item> /// <item> /// <term>Session state changes (inactive to active, or active to inactive)</term> /// </item> /// <item> /// <term>Grouping parameter changes</term> /// </item> /// <item> /// <term> /// Disconnection of the client from the session (caused by the user removing the audio endpoint device, shutting down the /// session manager, or changing the stream format) /// </term> /// </item> /// </list> /// <para> /// When notifications are no longer needed, the client can call the IAudioSessionControl::UnregisterAudioSessionNotification /// method to terminate the notifications. /// </para> /// <para> /// Before the client releases its final reference to the IAudioSessionEvents interface, it should call /// UnregisterAudioSessionNotification to unregister the interface. Otherwise, the application leaks the resources held by the /// <c>IAudioSessionEvents</c> and IAudioSessionControl objects. Note that <c>RegisterAudioSessionNotification</c> calls the /// client's IAudioSessionEvents::AddRef method, and <c>UnregisterAudioSessionNotification</c> calls the /// IAudioSessionEvents::Release method. If the client errs by releasing its reference to the <c>IAudioSessionEvents</c> /// interface before calling <c>UnregisterAudioSessionNotification</c>, the session manager never releases its reference to the /// <c>IAudioSessionEvents</c> interface. For example, a poorly designed <c>IAudioSessionEvents</c> implementation might call /// <c>UnregisterAudioSessionNotification</c> from the destructor for the <c>IAudioSessionEvents</c> object. In this case, the /// client will not call <c>UnregisterAudioSessionNotification</c> until the session manager releases its reference to the /// <c>IAudioSessionEvents</c> interface, and the session manager will not release its reference to the /// <c>IAudioSessionEvents</c> interface until the client calls <c>UnregisterAudioSessionNotification</c>. For more information /// about the <c>AddRef</c> and <c>Release</c> methods, see the discussion of the IUnknown interface in the Windows SDK documentation. /// </para> /// <para> /// In addition, the client should call UnregisterAudioSessionNotification before releasing all of its references to the /// IAudioSessionControl and IAudioSessionManager objects. Unless the client retains a reference to at least one of these two /// objects, the session manager leaks the storage that it allocated to hold the registration information. After registering a /// notification interface, the client continues to receive notifications for only as long as at least one of these two objects exists. /// </para> /// <para> /// For a code example that calls the <c>RegisterAudioSessionNotification</c> method, see Audio Events for Legacy Audio Applications. /// </para> /// </remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessioncontrol-registeraudiosessionnotification // HRESULT RegisterAudioSessionNotification( IAudioSessionEvents *NewNotifications ); new void RegisterAudioSessionNotification([In] IAudioSessionEvents NewNotifications); /// <summary> /// The <c>UnregisterAudioSessionNotification</c> method deletes a previous registration by the client to receive notifications. /// </summary> /// <param name="NewNotifications"> /// Pointer to a client-implemented IAudioSessionEvents interface. The client passed this same interface pointer to the session /// manager in a previous call to the IAudioSessionControl::RegisterAudioSessionNotification method. If the /// <c>UnregisterAudioSessionNotification</c> method succeeds, it calls the Release method on the client's /// <c>IAudioSessionEvents</c> interface. /// </param> /// <remarks> /// <para> /// The client calls this method when it no longer needs to receive notifications. The <c>UnregisterAudioSessionNotification</c> /// method removes the registration of an IAudioSessionEvents interface that the client previously registered with the session /// manager by calling the IAudioSessionControl::RegisterAudioSessionNotification method. /// </para> /// <para> /// Before the client releases its final reference to the IAudioSessionEvents interface, it should call /// <c>UnregisterAudioSessionNotification</c> to unregister the interface. Otherwise, the application leaks the resources held /// by the <c>IAudioSessionEvents</c> and IAudioSessionControl objects. Note that RegisterAudioSessionNotification calls the /// client's IAudioSessionEvents::AddRef method, and <c>UnregisterAudioSessionNotification</c> calls the /// IAudioSessionEvents::Release method. If the client errs by releasing its reference to the <c>IAudioSessionEvents</c> /// interface before calling <c>UnregisterAudioSessionNotification</c>, the session manager never releases its reference to the /// <c>IAudioSessionEvents</c> interface. For example, a poorly designed <c>IAudioSessionEvents</c> implementation might call /// <c>UnregisterAudioSessionNotification</c> from the destructor for the <c>IAudioSessionEvents</c> object. In this case, the /// client will not call <c>UnregisterAudioSessionNotification</c> until the session manager releases its reference to the /// <c>IAudioSessionEvents</c> interface, and the session manager will not release its reference to the /// <c>IAudioSessionEvents</c> interface until the client calls <c>UnregisterAudioSessionNotification</c>. For more information /// about the <c>AddRef</c> and <c>Release</c> methods, see the discussion of the IUnknown interface in the Windows SDK documentation. /// </para> /// <para> /// For a code example that calls the <c>UnregisterAudioSessionNotification</c> method, see Audio Events for Legacy Audio Applications. /// </para> /// </remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessioncontrol-unregisteraudiosessionnotification // HRESULT UnregisterAudioSessionNotification( IAudioSessionEvents *NewNotifications ); new void UnregisterAudioSessionNotification([In] IAudioSessionEvents NewNotifications); /// <summary>The <c>GetSessionIdentifier</c> method retrieves the audio session identifier.</summary> /// <returns>A string that receives the audio session identifier.</returns> /// <remarks> /// <para> /// Each audio session is identified by an identifier string. This session identifier string is not unique across all instances. /// If there are two instances of the application playing, both instances will have the same session identifier. The identifier /// retrieved by <c>GetSessionIdentifier</c> is different from the session instance identifier, which is unique across all /// sessions. To get the session instance identifier, call IAudioSessionControl2::GetSessionInstanceIdentifier. /// </para> /// <para> /// <c>GetSessionIdentifier</c> checks whether the session has been disconnected on the default device. It retrieves the /// identifier string that is cached by the audio client for the device. If the session identifier is not found, this method /// retrieves it from the audio engine. /// </para> /// </remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessioncontrol2-getsessionidentifier // HRESULT GetSessionIdentifier( LPWSTR *pRetVal ); SafeCoTaskMemString GetSessionIdentifier(); /// <summary>The <c>GetSessionInstanceIdentifier</c> method retrieves the identifier of the audio session instance.</summary> /// <returns>A string that receives the identifier of a particular instance of the audio session.</returns> /// <remarks> /// <para> /// Each audio session instance is identified by a unique string. This string represents a particular instance of the audio /// session and, unlike the session identifier, is unique across all instances. If there are two instances of the application /// playing, they will have different session instance identifiers. The identifier retrieved by /// <c>GetSessionInstanceIdentifier</c> is different from the session identifier, which is shared by all session instances. To /// get the session identifier, call IAudioSessionControl2::GetSessionIdentifier. /// </para> /// <para> /// <c>GetSessionInstanceIdentifier</c> checks whether the session has been disconnected on the default device. It retrieves the /// identifier string that is cached by the audio client for the device. If the session instance identifier is not found, this /// method retrieves it from the audio engine. For example code about getting a session instance identifier, see Getting Ducking /// Events from a Communication Device. /// </para> /// </remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessioncontrol2-getsessioninstanceidentifier // HRESULT GetSessionInstanceIdentifier( LPWSTR *pRetVal ); SafeCoTaskMemString GetSessionInstanceIdentifier(); /// <summary>The <c>GetProcessId</c> method retrieves the process identifier of the audio session.</summary> /// <returns>A <c>DWORD</c> variable that receives the process identifier of the audio session.</returns> /// <remarks> /// <para>This method overwrites the value that was passed by the application in pRetVal.</para> /// <para> /// <c>GetProcessId</c> checks whether the audio session has been disconnected on the default device or if the session has /// switched to another stream. In the case of stream switching, this method transfers state information for the new stream to /// the session. State information includes volume controls, metadata information (display name, icon path), and the session's /// property store. /// </para> /// </remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessioncontrol2-getprocessid HRESULT // GetProcessId( DWORD *pRetVal ); uint GetProcessId(); /// <summary>The <c>IsSystemSoundsSession</c> method indicates whether the session is a system sounds session.</summary> /// <returns> /// <para>The possible return codes include, but are not limited to, the values shown in the following table.</para> /// <list type="table"> /// <listheader> /// <term>Return code</term> /// <term>Description</term> /// </listheader> /// <item> /// <term>S_OK</term> /// <term>The session is a system sounds session.</term> /// </item> /// <item> /// <term>S_FALSE</term> /// <term>The session is not a system sounds session.</term> /// </item> /// </list> /// </returns> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessioncontrol2-issystemsoundssession // HRESULT IsSystemSoundsSession(); [PreserveSig] HRESULT IsSystemSoundsSession(); /// <summary> /// The <c>SetDuckingPreference</c> method enables or disables the default stream attenuation experience (auto-ducking) provided /// by the system. /// </summary> /// <param name="optOut">A <c>BOOL</c> variable that enables or disables system auto-ducking.</param> /// <remarks> /// <para> /// By default, the system adjusts the volume for all currently playing sounds when the system starts a communication session /// and receives a new communication stream on the default communication device. For more information about this feature, see /// Using a Communication Device. /// </para> /// <para> /// If the application passes <c>TRUE</c> in optOut, the system disables the Default Ducking Experience. For more information, /// see Disabling the Default Ducking Experience. /// </para> /// <para> /// To provide a custom implementation, the application needs to get notifications from the system when it opens or closes the /// communication stream. To receive the notifications, the application must call this method before registering itself by /// calling <c>IAudioSessionManager2::RegisterForDuckNotification</c>. For more information and example code, see Getting /// Ducking Events. /// </para> /// <para> /// If the application passes <c>FALSE</c> in optOut, the application provides the default stream attenuation experience /// provided by the system. /// </para> /// <para> /// We recommend that the application call <c>SetDuckingPreference</c> during stream creation. However, this method can be /// called dynamically during the session to change the initial preference. /// </para> /// </remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessioncontrol2-setduckingpreference // HRESULT SetDuckingPreference( BOOL optOut ); void SetDuckingPreference([MarshalAs(UnmanagedType.Bool)] bool optOut); } /// <summary> /// The <c>IAudioSessionEnumerator</c> interface enumerates audio sessions on an audio device. To get a reference to the /// <c>IAudioSessionEnumerator</c> interface of the session enumerator object, the application must call IAudioSessionManager2::GetSessionEnumerator. /// </summary> /// <remarks> /// <para> /// If an application wants to be notified when new sessions are created, it must register its implementation of /// IAudioSessionNotification with the session manager. Upon successful registration, the session manager sends create-session /// notifications to the application in the form of callbacks. These notifications contain a reference to the IAudioSessionControl /// pointer of the newly created session. /// </para> /// <para> /// The session enumerator maintains a list of current sessions by holding references to each session's IAudioSessionControl /// pointer. However, the session enumerator might not be aware of the new sessions that are reported through /// IAudioSessionNotification. In that case, the application would have access to only a partial list of sessions. This might occur /// if the <c>IAudioSessionControl</c> pointer (in the callback) is released before the session enumerator is initialized. /// Therefore, if an application wants a complete set of sessions for the audio endpoint, the application should maintain its own list. /// </para> /// <para>The application must perform the following steps to receive session notifications and manage a list of current sessions.</para> /// <list type="number"> /// <item> /// <term> /// Initialize COM with the Multithreaded Apartment (MTA) model by calling in a non-UI thread. If MTA is not initialized, the /// application does not receive session notifications from the session manager. /// </term> /// </item> /// <item> /// <term> /// Activate an IAudioSessionManager2 interface from the audio endpoint device. Call IMMDevice::Activate with parameter iid set to /// <c>IID_IAudioSessionManager2</c>. This call receives a reference to the session manager's <c>IAudioSessionManager2</c> interface /// in the ppInterface parameter. /// </term> /// </item> /// <item> /// <term>Implement the IAudioSessionNotification interface to provide the callback behavior.</term> /// </item> /// <item> /// <term>Call IAudioSessionManager2::RegisterSessionNotification to register the application's implementation of IAudioSessionNotification.</term> /// </item> /// <item> /// <term> /// Create and initialize the session enumerator object by calling IAudioSessionManager2::GetSessionEnumerator. This method /// generates a list of current sessions available for the endpoint and adds the IAudioSessionControl pointers for each session in /// the list, if they are not already present. /// </term> /// </item> /// <item> /// <term> /// Use the <c>IAudioSessionEnumerator</c> interface returned in the previous step to retrieve and enumerate the list of sessions. /// The session control for each session can be retrieved by calling IAudioSessionEnumerator::GetSession. Make sure you call /// <c>AddRef</c> for each session control to maintain the reference count. /// </term> /// </item> /// <item> /// <term> /// When the application gets a create-session notification, add the IAudioSessionControl pointer of the new session (received in /// IAudioSessionNotification::OnSessionCreated) to the list of existing sessions. /// </term> /// </item> /// </list> /// <para> /// Because the application maintains this list of sessions and manages the lifetime of the session based on the application's /// requirements, there is no expiration mechanism enforced by the audio system on the session control objects. /// </para> /// <para>A session control is valid as long as the application has a reference to the session control in the list.</para> /// <para>Examples</para> /// <para>The following example code shows how to create the session enumerator object and then enumerate sessions.</para> /// </remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nn-audiopolicy-iaudiosessionenumerator [PInvokeData("audiopolicy.h", MSDNShortId = "a7976d13-3391-4747-b83a-cfb9407b34f2")] [ComImport, Guid("E2F5BB11-0570-40CA-ACDD-3AA01277DEE8"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] public interface IAudioSessionEnumerator { /// <summary>The <c>GetCount</c> method gets the total number of audio sessions that are open on the audio device.</summary> /// <returns>Receives the total number of audio sessions.</returns> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessionenumerator-getcount HRESULT // GetCount( int *SessionCount ); int GetCount(); /// <summary>The <c>GetSession</c> method gets the audio session specified by an audio session number.</summary> /// <param name="SessionCount"> /// The session number. If there are n sessions, the sessions are numbered from 0 to n – 1. To get the number of sessions, call /// the IAudioSessionEnumerator::GetCount method. /// </param> /// <returns> /// Receives a pointer to the IAudioSessionControl interface of the session object in the collection that is maintained by the /// session enumerator. The caller must release the interface pointer. /// </returns> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessionenumerator-getsession HRESULT // GetSession( int SessionCount, IAudioSessionControl **Session ); IAudioSessionControl GetSession(int SessionCount); } /// <summary> /// <para> /// The <c>IAudioSessionEvents</c> interface provides notifications of session-related events such as changes in the volume level, /// display name, and session state. Unlike the other interfaces in this section, which are implemented by the WASAPI system /// component, a WASAPI client implements the <c>IAudioSessionEvents</c> interface. To receive event notifications, the client /// passes a pointer to its <c>IAudioSessionEvents</c> interface to the IAudioSessionControl::RegisterAudioSessionNotification method. /// </para> /// <para> /// After registering its <c>IAudioClientSessionEvents</c> interface, the client receives event notifications in the form of /// callbacks through the methods in the interface. /// </para> /// <para> /// In implementing the <c>IAudioSessionEvents</c> interface, the client should observe these rules to avoid deadlocks and undefined behavior: /// </para> /// <list type="bullet"> /// <item> /// <term> /// The methods in the interface must be nonblocking. The client should never wait on a synchronization object during an event callback. /// </term> /// </item> /// <item> /// <term>The client should never call the IAudioSessionControl::UnregisterAudioSessionNotification method during an event callback.</term> /// </item> /// <item> /// <term>The client should never release the final reference on a WASAPI object during an event callback.</term> /// </item> /// </list> /// <para> /// For a code example that implements an <c>IAudioSessionEvents</c> interface, see Audio Session Events. For a code example that /// registers a client's <c>IAudioSessionEvents</c> interface to receive notifications, see Audio Events for Legacy Audio Applications. /// </para> /// </summary> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nn-audiopolicy-iaudiosessionevents [PInvokeData("audiopolicy.h", MSDNShortId = "fd287ef7-8a37-4342-b4c2-79b84a56c30e")] [ComImport, Guid("24918ACC-64B3-37C1-8CA9-74A66E9957A8"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] public interface IAudioSessionEvents { /// <summary>The <c>OnDisplayNameChanged</c> method notifies the client that the display name for the session has changed.</summary> /// <param name="NewDisplayName"> /// The new display name for the session. This parameter points to a null-terminated, wide-character string containing the new /// display name. The string remains valid for the duration of the call. /// </param> /// <param name="EventContext"> /// The event context value. This is the same value that the caller passed to IAudioSessionControl::SetDisplayName in the call /// that changed the display name for the session. For more information, see Remarks. /// </param> /// <returns>If the method succeeds, it returns S_OK. If it fails, it returns an error code.</returns> /// <remarks> /// <para> /// The session manager calls this method each time a call to the IAudioSessionControl::SetDisplayName method changes the /// display name of the session. The Sndvol program uses a session's display name to label the volume slider for the session. /// </para> /// <para> /// The EventContext parameter provides a means for a client to distinguish between a display-name change that it initiated and /// one that some other client initiated. When calling the IAudioSessionControl::SetDisplayName method, a client passes in an /// EventContext parameter value that its implementation of the <c>OnDisplayNameChanged</c> method can recognize. /// </para> /// <para>For a code example that implements the methods in the IAudioSessionEvents interface, see Audio Session Events.</para> /// </remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessionevents-ondisplaynamechanged // HRESULT OnDisplayNameChanged( LPCWSTR NewDisplayName, LPCGUID EventContext ); [PreserveSig] HRESULT OnDisplayNameChanged([MarshalAs(UnmanagedType.LPWStr)] string NewDisplayName, in Guid EventContext); /// <summary>The <c>OnIconPathChanged</c> method notifies the client that the display icon for the session has changed.</summary> /// <param name="NewIconPath"> /// The path for the new display icon for the session. This parameter points to a string that contains the path for the new /// icon. The string pointer remains valid only for the duration of the call. /// </param> /// <param name="EventContext"> /// The event context value. This is the same value that the caller passed to IAudioSessionControl::SetIconPath in the call that /// changed the display icon for the session. For more information, see Remarks. /// </param> /// <returns>If the method succeeds, it returns S_OK. If it fails, it returns an error code.</returns> /// <remarks> /// <para> /// The session manager calls this method each time a call to the IAudioSessionControl::SetIconPath method changes the display /// icon for the session. The Sndvol program uses a session's display icon to label the volume slider for the session. /// </para> /// <para> /// The EventContext parameter provides a means for a client to distinguish between a display-icon change that it initiated and /// one that some other client initiated. When calling the IAudioSessionControl::SetIconPath method, a client passes in an /// EventContext parameter value that its implementation of the <c>OnIconPathChanged</c> method can recognize. /// </para> /// <para>For a code example that implements the methods in the IAudioSessionEvents interface, see Audio Session Events.</para> /// </remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessionevents-oniconpathchanged HRESULT // OnIconPathChanged( LPCWSTR NewIconPath, LPCGUID EventContext ); [PreserveSig] HRESULT OnIconPathChanged([MarshalAs(UnmanagedType.LPWStr)] string NewIconPath, in Guid EventContext); /// <summary> /// The <c>OnSimpleVolumeChanged</c> method notifies the client that the volume level or muting state of the audio session has changed. /// </summary> /// <param name="NewVolume"> /// The new volume level for the audio session. This parameter is a value in the range 0.0 to 1.0, where 0.0 is silence and 1.0 /// is full volume (no attenuation). /// </param> /// <param name="NewMute">The new muting state. If <c>TRUE</c>, muting is enabled. If <c>FALSE</c>, muting is disabled.</param> /// <param name="EventContext"> /// The event context value. This is the same value that the caller passed to ISimpleAudioVolume::SetMasterVolume or /// ISimpleAudioVolume::SetMute in the call that changed the volume level or muting state of the session. For more information, /// see Remarks. /// </param> /// <returns>If the method succeeds, it returns S_OK. If it fails, it returns an error code.</returns> /// <remarks> /// <para> /// The session manager calls this method each time a call to the ISimpleAudioVolume::SetMasterVolume or /// ISimpleAudioVolume::SetMute method changes the volume level or muting state of the session. /// </para> /// <para> /// The EventContext parameter provides a means for a client to distinguish between a volume or mute change that it initiated /// and one that some other client initiated. When calling the ISimpleAudioVolume::SetMasterVolume or /// ISimpleAudioVolume::SetMute method, a client passes in an EventContext parameter value that its implementation of the /// <c>OnSimpleVolumeChanged</c> method can recognize. /// </para> /// <para>For a code example that implements the methods in the IAudioSessionEvents interface, see Audio Session Events.</para> /// </remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessionevents-onsimplevolumechanged // HRESULT OnSimpleVolumeChanged( float NewVolume, BOOL NewMute, LPCGUID EventContext ); [PreserveSig] HRESULT OnSimpleVolumeChanged([In] float NewVolume, [MarshalAs(UnmanagedType.Bool)] bool NewMute, in Guid EventContext); /// <summary> /// The <c>OnChannelVolumeChanged</c> method notifies the client that the volume level of an audio channel in the session submix /// has changed. /// </summary> /// <param name="ChannelCount">The channel count. This parameter specifies the number of audio channels in the session submix.</param> /// <param name="NewChannelVolumeArray"> /// Pointer to an array of volume levels. Each element is a value of type <c>float</c> that specifies the volume level for a /// particular channel. Each volume level is a value in the range 0.0 to 1.0, where 0.0 is silence and 1.0 is full volume (no /// attenuation). The number of elements in the array is specified by the ChannelCount parameter. If an audio stream contains n /// channels, the channels are numbered from 0 to n– 1. The array element whose index matches the channel number, contains the /// volume level for that channel. Assume that the array remains valid only for the duration of the call. /// </param> /// <param name="ChangedChannel"> /// The number of the channel whose volume level changed. Use this value as an index into the NewChannelVolumeArray array. If /// the session submix contains n channels, the channels are numbered from 0 to n– 1. If more than one channel might have /// changed (for example, as a result of a call to the IChannelAudioVolume::SetAllVolumes method), the value of ChangedChannel /// is ( <c>DWORD</c>)(–1). /// </param> /// <param name="EventContext"> /// The event context value. This is the same value that the caller passed to the IChannelAudioVolume::SetChannelVolume or /// <c>IChannelAudioVolume::SetAllVolumes</c> method in the call that initiated the change in volume level of the channel. For /// more information, see Remarks. /// </param> /// <returns>If the method succeeds, it returns S_OK. If it fails, it returns an error code.</returns> /// <remarks> /// <para> /// The session manager calls this method each time a call to the <c>IChannelAudioVolume::SetChannelVolume</c> or /// <c>IChannelAudioVolume::SetAllVolumes</c> method successfully updates the volume level of one or more channels in the /// session submix. Note that the <c>OnChannelVolumeChanged</c> call occurs regardless of whether the new channel volume level /// or levels differ in value from the previous channel volume level or levels. /// </para> /// <para> /// The EventContext parameter provides a means for a client to distinguish between a channel-volume change that it initiated /// and one that some other client initiated. When calling the <c>IChannelAudioVolume::SetChannelVolume</c> or /// <c>IChannelAudioVolume::SetAllVolumes</c> method, a client passes in an EventContext parameter value that its implementation /// of the <c>OnChannelVolumeChanged</c> method can recognize. /// </para> /// <para>For a code example that implements the methods in the <c>IAudioSessionEvents</c> interface, see Audio Session Events.</para> /// </remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessionevents-onchannelvolumechanged // HRESULT OnChannelVolumeChanged( DWORD ChannelCount, float [] NewChannelVolumeArray, DWORD ChangedChannel, LPCGUID // EventContext ); [PreserveSig] HRESULT OnChannelVolumeChanged(uint ChannelCount, [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] float[] NewChannelVolumeArray, uint ChangedChannel, in Guid EventContext); /// <summary> /// The <c>OnGroupingParamChanged</c> method notifies the client that the grouping parameter for the session has changed. /// </summary> /// <param name="NewGroupingParam"> /// The new grouping parameter for the session. This parameter points to a grouping-parameter GUID. /// </param> /// <param name="EventContext"> /// The event context value. This is the same value that the caller passed to IAudioSessionControl::SetGroupingParam in the call /// that changed the grouping parameter for the session. For more information, see Remarks. /// </param> /// <returns>If the method succeeds, it returns S_OK. If it fails, it returns an error code.</returns> /// <remarks> /// <para> /// The session manager calls this method each time a call to the IAudioSessionControl::SetGroupingParam method changes the /// grouping parameter for the session. /// </para> /// <para> /// The EventContext parameter provides a means for a client to distinguish between a grouping-parameter change that it /// initiated and one that some other client initiated. When calling the IAudioSessionControl::SetGroupingParam method, a client /// passes in an EventContext parameter value that its implementation of the <c>OnGroupingParamChanged</c> method can recognize. /// </para> /// <para>For a code example that implements the methods in the IAudioSessionEvents interface, see Audio Session Events.</para> /// </remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessionevents-ongroupingparamchanged // HRESULT OnGroupingParamChanged( LPCGUID NewGroupingParam, LPCGUID EventContext ); [PreserveSig] HRESULT OnGroupingParamChanged(in Guid NewGroupingParam, in Guid EventContext); /// <summary>The <c>OnStateChanged</c> method notifies the client that the stream-activity state of the session has changed.</summary> /// <param name="NewState"> /// <para>The new session state. The value of this parameter is one of the following AudioSessionState enumeration values:</para> /// <para>AudioSessionStateActive</para> /// <para>AudioSessionStateInactive</para> /// <para>AudioSessionStateExpired</para> /// </param> /// <returns>If the method succeeds, it returns S_OK. If it fails, it returns an error code.</returns> /// <remarks> /// <para> /// A client cannot generate a session-state-change event. The system is always the source of this type of event. Thus, unlike /// some other IAudioSessionEvents methods, this method does not supply a context parameter. /// </para> /// <para> /// The system changes the state of a session from inactive to active at the time that a client opens the first stream in the /// session. A client opens a stream by calling the IAudioClient::Initialize method. The system changes the session state from /// active to inactive at the time that a client closes the last stream in the session. The client that releases the last /// reference to an IAudioClient object closes the stream that is associated with the object. /// </para> /// <para>For a code example that implements the methods in the IAudioSessionEvents interface, see Audio Session Events.</para> /// </remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessionevents-onstatechanged HRESULT // OnStateChanged( AudioSessionState NewState ); [PreserveSig] HRESULT OnStateChanged(AudioSessionState NewState); /// <summary>The <c>OnSessionDisconnected</c> method notifies the client that the audio session has been disconnected.</summary> /// <param name="DisconnectReason"> /// <para> /// The reason that the audio session was disconnected. The caller sets this parameter to one of the /// <c>AudioSessionDisconnectReason</c> enumeration values shown in the following table. /// </para> /// <list type="table"> /// <listheader> /// <term>Value</term> /// <term>Description</term> /// </listheader> /// <item> /// <term>DisconnectReasonDeviceRemoval</term> /// <term>The user removed the audio endpoint device.</term> /// </item> /// <item> /// <term>DisconnectReasonServerShutdown</term> /// <term>The Windows audio service has stopped.</term> /// </item> /// <item> /// <term>DisconnectReasonFormatChanged</term> /// <term>The stream format changed for the device that the audio session is connected to.</term> /// </item> /// <item> /// <term>DisconnectReasonSessionLogoff</term> /// <term>The user logged off the Windows Terminal Services (WTS) session that the audio session was running in.</term> /// </item> /// <item> /// <term>DisconnectReasonSessionDisconnected</term> /// <term>The WTS session that the audio session was running in was disconnected.</term> /// </item> /// <item> /// <term>DisconnectReasonExclusiveModeOverride</term> /// <term> /// The (shared-mode) audio session was disconnected to make the audio endpoint device available for an exclusive-mode connection. /// </term> /// </item> /// </list> /// <para>For more information about WTS sessions, see the Windows SDK documentation.</para> /// </param> /// <returns>If the method succeeds, it returns S_OK. If it fails, it returns an error code.</returns> /// <remarks> /// <para> /// When disconnecting a session, the session manager closes the streams that belong to that session and invalidates all /// outstanding requests for services on those streams. The client should respond to a disconnection by releasing all of its /// references to the IAudioClient interface for a closed stream and releasing all references to the service interfaces that it /// obtained previously through calls to the IAudioClient::GetService method. /// </para> /// <para> /// Following disconnection, many of the methods in the WASAPI interfaces that are tied to closed streams in the disconnected /// session return error code AUDCLNT_E_DEVICE_INVALIDATED (for example, see IAudioClient::GetCurrentPadding). For information /// about recovering from this error, see Recovering from an Invalid-Device Error. /// </para> /// <para> /// If the Windows audio service terminates unexpectedly, it does not have an opportunity to notify clients that it is shutting /// down. In that case, clients learn that the service has stopped when they call a method such as /// IAudioClient::GetCurrentPadding that discovers that the service is no longer running and fails with error code AUDCLNT_E_SERVICE_NOT_RUNNING. /// </para> /// <para> /// A client cannot generate a session-disconnected event. The system is always the source of this type of event. Thus, unlike /// some other IAudioSessionEvents methods, this method does not have a context parameter. /// </para> /// <para>For a code example that implements the methods in the IAudioSessionEvents interface, see Audio Session Events.</para> /// </remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessionevents-onsessiondisconnected // HRESULT OnSessionDisconnected( AudioSessionDisconnectReason DisconnectReason ); [PreserveSig] HRESULT OnSessionDisconnected([In] AudioSessionDisconnectReason DisconnectReason); } /// <summary> /// <para> /// The <c>IAudioSessionManager</c> interface enables a client to access the session controls and volume controls for both /// cross-process and process-specific audio sessions. The client obtains a reference to an <c>IAudioSessionManager</c> interface by /// calling the IMMDevice::Activate method with parameter iid set to <c>REFIID</c> IID_IAudioSessionManager. /// </para> /// <para> /// This interface enables clients to access the controls for an existing session without first opening a stream. This capability is /// useful for clients of higher-level APIs that are built on top of WASAPI and use session controls internally but do not give /// their clients access to session controls. /// </para> /// <para> /// In Windows Vista, the higher-level APIs that use WASAPI include Media Foundation, DirectSound, the Windows multimedia /// <c>waveInXxx</c>, <c>waveOutXxx</c>, and <c>mciXxx</c> functions, and third-party APIs. /// </para> /// <para> /// When a client creates an audio stream through a higher-level API, that API typically adds the stream to the default audio /// session for the client's process (the session that is identified by the session GUID value, GUID_NULL), but the same API might /// not provide a means for the client to access the controls for that session. In that case, the client can access the controls /// through the <c>IAudioSessionManager</c> interface. /// </para> /// <para>For a code example that uses the <c>IAudioSessionManager</c> interface, see Audio Events for Legacy Audio Applications.</para> /// </summary> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nn-audiopolicy-iaudiosessionmanager [PInvokeData("audiopolicy.h", MSDNShortId = "606b0a42-d1d1-4196-911f-5b095bf56c4e")] [ComImport, Guid("BFA971F1-4D5E-40BB-935E-967039BFBEE4"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] public interface IAudioSessionManager { /// <summary>The <c>GetAudioSessionControl</c> method retrieves an audio session control.</summary> /// <param name="AudioSessionGuid"> /// Pointer to a session GUID. If the GUID does not identify a session that has been previously opened, the call opens a new but /// empty session. The Sndvol program does not display a volume-level control for a session unless it contains one or more /// active streams. If this parameter is <c>NULL</c> or points to the value GUID_NULL, the method assigns the stream to the /// default session. /// </param> /// <param name="StreamFlags">Specifies the status of the flags for the audio stream.</param> /// <returns> /// A pointer to the IAudioSessionControl interface of the audio session control object. The caller is responsible for releasing /// the interface, when it is no longer needed, by calling the interface's <c>Release</c> method. If the call fails, /// *SessionControl is <c>NULL</c>. /// </returns> /// <remarks>For a code example that calls this method, see Audio Events for Legacy Audio Applications.</remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessionmanager-getaudiosessioncontrol // HRESULT GetAudioSessionControl( LPCGUID AudioSessionGuid, DWORD StreamFlags, IAudioSessionControl **SessionControl ); IAudioSessionControl GetAudioSessionControl([In, Optional] in Guid AudioSessionGuid, [In] AUDCLNT_STREAMFLAGS StreamFlags); /// <summary>The <c>GetSimpleAudioVolume</c> method retrieves a simple audio volume control.</summary> /// <param name="AudioSessionGuid"> /// Pointer to a session GUID. If the GUID does not identify a session that has been previously opened, the call opens a new but /// empty session. The Sndvol program does not display a volume-level control for a session unless it contains one or more /// active streams. If this parameter is <c>NULL</c> or points to the value GUID_NULL, the method assigns the stream to the /// default session. /// </param> /// <param name="StreamFlags"> /// Specifies whether the request is for a cross-process session. Set to <c>TRUE</c> if the session is cross-process. Set to /// <c>FALSE</c> if the session is not cross-process. /// </param> /// <returns> /// Pointer to a pointer variable into which the method writes a pointer to the ISimpleAudioVolume interface of the audio volume /// control object. This interface represents the simple audio volume control for the current process. The caller is responsible /// for releasing the interface, when it is no longer needed, by calling the interface's <c>Release</c> method. If the /// <c>Activate</c> call fails, *AudioVolume is <c>NULL</c>. /// </returns> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessionmanager-getsimpleaudiovolume // HRESULT GetSimpleAudioVolume( LPCGUID AudioSessionGuid, DWORD StreamFlags, ISimpleAudioVolume **AudioVolume ); ISimpleAudioVolume GetSimpleAudioVolume([In, Optional] in Guid AudioSessionGuid, [In] AUDCLNT_STREAMFLAGS StreamFlags); } /// <summary> /// <para>The <c>IAudioSessionManager2</c> interface enables an application to manage submixes for the audio device.</para> /// <para> /// To a get a reference to an <c>IAudioSessionManager2</c> interface, the application must activate it on the audio device by /// following these steps: /// </para> /// <list type="number"> /// <item> /// <term> /// Use one of the techniques described on the IMMDevice interface page to obtain a reference to the <c>IMMDevice</c> interface for /// an audio endpoint device. /// </term> /// </item> /// <item> /// <term>Call the IMMDevice::Activate method with parameter iid set to IID_IAudioSessionManager2.</term> /// </item> /// </list> /// <para> /// When the application wants to release the <c>IAudioSessionManager2</c> interface instance, the application must call the /// interface's <c>Release</c> method. /// </para> /// <para> /// The application thread that uses this interface must be initialized for COM. For more information about COM initialization, see /// the description of the <c>CoInitializeEx</c> function in the Windows SDK documentation. /// </para> /// </summary> /// <remarks> /// <para>An application can use this interface to perform the following tasks:</para> /// <list type="bullet"> /// <item> /// <term>Register to receive ducking notifications.</term> /// </item> /// <item> /// <term>Register to receive a notification when a session is created.</term> /// </item> /// <item> /// <term>Enumerate sessions on the audio device that was used to get the interface pointer.</term> /// </item> /// </list> /// <para> /// This interface supports custom implementations for stream attenuation or ducking, a new feature in Windows 7. An application /// playing a media stream can make the it behave differently when a new communication stream is opened on the default communication /// device. For example, the original media stream can be paused while the new communication stream is open. For more information /// about this feature, see Using a Communication Device. /// </para> /// <para> /// An application that manages the media streams and wants to provide a custom ducking implementation, must register to receive /// notifications when session events occur. For stream attenuation, a session event is raised by the system when a communication /// stream is opened or closed on the default communication device. For more information, see Providing a Custom Ducking Behavior. /// </para> /// <para>Examples</para> /// <para>The following example code shows how to get a reference to the <c>IAudioSessionManager2</c> interface of the audio device.</para> /// </remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nn-audiopolicy-iaudiosessionmanager2 [PInvokeData("audiopolicy.h", MSDNShortId = "476dac90-d0c4-499c-973e-33ea55546659")] [ComImport, Guid("77AA99A0-1BD6-484F-8BC7-2C654C9A9B6F"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] public interface IAudioSessionManager2 : IAudioSessionManager { /// <summary>The <c>GetAudioSessionControl</c> method retrieves an audio session control.</summary> /// <param name="AudioSessionGuid"> /// Pointer to a session GUID. If the GUID does not identify a session that has been previously opened, the call opens a new but /// empty session. The Sndvol program does not display a volume-level control for a session unless it contains one or more /// active streams. If this parameter is <c>NULL</c> or points to the value GUID_NULL, the method assigns the stream to the /// default session. /// </param> /// <param name="StreamFlags">Specifies the status of the flags for the audio stream.</param> /// <returns> /// A pointer to the IAudioSessionControl interface of the audio session control object. The caller is responsible for releasing /// the interface, when it is no longer needed, by calling the interface's <c>Release</c> method. If the call fails, /// *SessionControl is <c>NULL</c>. /// </returns> /// <remarks>For a code example that calls this method, see Audio Events for Legacy Audio Applications.</remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessionmanager-getaudiosessioncontrol // HRESULT GetAudioSessionControl( LPCGUID AudioSessionGuid, DWORD StreamFlags, IAudioSessionControl **SessionControl ); new IAudioSessionControl GetAudioSessionControl([In, Optional] in Guid AudioSessionGuid, [In] AUDCLNT_STREAMFLAGS StreamFlags); /// <summary>The <c>GetSimpleAudioVolume</c> method retrieves a simple audio volume control.</summary> /// <param name="AudioSessionGuid"> /// Pointer to a session GUID. If the GUID does not identify a session that has been previously opened, the call opens a new but /// empty session. The Sndvol program does not display a volume-level control for a session unless it contains one or more /// active streams. If this parameter is <c>NULL</c> or points to the value GUID_NULL, the method assigns the stream to the /// default session. /// </param> /// <param name="StreamFlags"> /// Specifies whether the request is for a cross-process session. Set to <c>TRUE</c> if the session is cross-process. Set to /// <c>FALSE</c> if the session is not cross-process. /// </param> /// <returns> /// Pointer to a pointer variable into which the method writes a pointer to the ISimpleAudioVolume interface of the audio volume /// control object. This interface represents the simple audio volume control for the current process. The caller is responsible /// for releasing the interface, when it is no longer needed, by calling the interface's <c>Release</c> method. If the /// <c>Activate</c> call fails, *AudioVolume is <c>NULL</c>. /// </returns> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessionmanager-getsimpleaudiovolume // HRESULT GetSimpleAudioVolume( LPCGUID AudioSessionGuid, DWORD StreamFlags, ISimpleAudioVolume **AudioVolume ); new ISimpleAudioVolume GetSimpleAudioVolume([In, Optional] in Guid AudioSessionGuid, [In] AUDCLNT_STREAMFLAGS StreamFlags); /// <summary>The <c>GetSessionEnumerator</c> method gets a pointer to the audio session enumerator object.</summary> /// <returns> /// Receives a pointer to the IAudioSessionEnumerator interface of the session enumerator object that the client can use to /// enumerate audio sessions on the audio device. Through this method, the caller obtains a counted reference to the interface. /// The caller is responsible for releasing the interface, when it is no longer needed, by calling the interface's /// <c>Release</c> method. /// </returns> /// <remarks> /// <para> /// The session manager maintains a collection of audio sessions that are active on the audio device by querying the audio /// engine. <c>GetSessionEnumerator</c> creates a session control for each session in the collection. To get a reference to the /// IAudioSessionControl interface of the session in the enumerated collection, the application must call /// IAudioSessionEnumerator::GetSession. For a code example, see IAudioSessionEnumerator Interface. /// </para> /// <para> /// The session enumerator might not be aware of the new sessions that are reported through IAudioSessionNotification. So if an /// application exclusively relies on the session enumerator for getting all the sessions for an audio endpoint, the results /// might not be accurate. To work around this, the application should manually maintain a list. For more information, see IAudioSessionEnumerator. /// </para> /// </remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessionmanager2-getsessionenumerator // HRESULT GetSessionEnumerator( IAudioSessionEnumerator **SessionEnum ); IAudioSessionEnumerator GetSessionEnumerator(); /// <summary> /// The <c>RegisterSessionNotification</c> method registers the application to receive a notification when a session is created. /// </summary> /// <param name="SessionNotification"> /// A pointer to the application's implementation of the IAudioSessionNotification interface. If the method call succeeds, it /// calls the <c>AddRef</c> method on the application's <c>IAudioSessionNotification</c> interface. /// </param> /// <remarks> /// <para> /// The application can register to receive a notification when a session is created, through the methods of the /// IAudioSessionNotification interface. The application implements the <c>IAudioSessionNotification</c> interface. The methods /// defined in this interface receive callbacks from the system when a session is created. For example code that shows how to /// implement this interface, see /// </para> /// <para>IAudioSessionNotification Interface.</para> /// <para> /// To begin receiving notifications, the application calls the <c>IAudioSessionManager2::RegisterSessionNotification</c> method /// to register its IAudioSessionNotification interface. When the application no longer requires notifications, it calls the /// IAudioSessionManager2::UnregisterSessionNotification method to delete the registration. /// </para> /// <para> /// <c>Note</c> Make sure that the application initializes COM with Multithreaded Apartment (MTA) model by calling in a non-UI /// thread. If MTA is not initialized, the application does not receive session notifications from the session manager. Threads /// that run the user interface of an application should be initialized apartment threading model. /// </para> /// </remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessionmanager2-registersessionnotification // HRESULT RegisterSessionNotification( IAudioSessionNotification *SessionNotification ); void RegisterSessionNotification(IAudioSessionNotification SessionNotification); /// <summary> /// The <c>UnregisterSessionNotification</c> method deletes the registration to receive a notification when a session is created. /// </summary> /// <param name="SessionNotification"> /// <para> /// A pointer to the application's implementation of the IAudioSessionNotification interface. Pass the same interface pointer /// that was specified to the session manager in a previous call to IAudioSessionManager2::RegisterSessionNotification to /// register for notification. /// </para> /// <para> /// If the <c>UnregisterSessionNotification</c> method succeeds, it calls the <c>Release</c> method on the application's /// IAudioSessionNotification interface. /// </para> /// </param> /// <remarks> /// The application calls this method when it no longer needs to receive notifications. The <c>UnregisterSessionNotification</c> /// method removes the registration of an IAudioSessionNotification interface that the application previously registered with /// the session manager by calling the IAudioSessionControl::RegisterAudioSessionNotification method. /// </remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessionmanager2-unregistersessionnotification // HRESULT UnregisterSessionNotification( IAudioSessionNotification *SessionNotification ); void UnregisterSessionNotification(IAudioSessionNotification SessionNotification); /// <summary> /// The <c>RegisterDuckNotification</c> method registers the application with the session manager to receive ducking notifications. /// </summary> /// <param name="sessionID"> /// <para> /// Pointer to a null-terminated string that contains a session instance identifier. Applications that are playing a media /// stream and want to provide custom stream attenuation or ducking behavior, pass their own session instance identifier. For /// more information, see Remarks. /// </para> /// <para> /// Other applications that do not want to alter their streams but want to get all the ducking notifications must pass <c>NULL</c>. /// </para> /// </param> /// <param name="duckNotification"> /// Pointer to the application's implementation of the IAudioVolumeDuckNotification interface. The implementation is called when /// ducking events are raised by the audio system and notifications are sent to the registered applications. /// </param> /// <remarks> /// <para> /// Stream Attenuation or ducking is a new feature in Windows 7. An application playing a media stream can make the stream /// behave differently when a new communication stream is opened on the default communication device. For example, the original /// media stream can be paused while the new communication stream is open. To provide this custom implementation for stream /// attenuation, the application can opt out of the default stream attenuation experience by calling /// IAudioSessionControl::SetDuckingPreference and then register itself to receive notifications when session events occur. For /// stream attenuation, a session event is raised by the system when a communication stream is opened or closed on the default /// communication device. For more information about this feature, see Getting Ducking Events. /// </para> /// <para> /// To begin receiving notifications, the application calls the <c>RegisterDuckNotification</c> method to register its /// IAudioVolumeDuckNotification interface with the session manager. When the application no longer requires notifications, it /// calls the IAudioSessionManager2::UnregisterDuckNotification method to delete the registration. /// </para> /// <para> /// The application receives notifications about the ducking events through the methods of the IAudioVolumeDuckNotification /// interface. The application implements <c>IAudioVolumeDuckNotification</c>. After the registration call has succeeded, the /// system calls the methods of this interface when session events occur. /// </para> /// </remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessionmanager2-registerducknotification // HRESULT RegisterDuckNotification( LPCWSTR sessionID, IAudioVolumeDuckNotification *duckNotification ); void RegisterDuckNotification([MarshalAs(UnmanagedType.LPWStr)] string sessionID, [In] IAudioVolumeDuckNotification duckNotification); /// <summary>The <c>UnregisterDuckNotification</c> method deletes a previous registration by the application to receive notifications.</summary> /// <param name="duckNotification"> /// Pointer to the IAudioVolumeDuckNotification interface that is implemented by the application. Pass the same interface /// pointer that was specified to the session manager in a previous call to the IAudioSessionManager2::RegisterDuckNotification /// method. If the <c>UnregisterDuckNotification</c> method succeeds, it calls the <c>Release</c> method on the application's /// <c>IAudioVolumeDuckNotification</c> interface. /// </param> /// <remarks> /// <para> /// The application calls this method when it no longer needs to receive notifications. The <c>UnregisterDuckNotification</c> /// method removes the registration of an IAudioVolumeDuckNotification interface that the application previously registered with /// the session manager by calling the IAudioSessionManager2::RegisterDuckNotification method. /// </para> /// <para>After the application calls <c>UnregisterDuckNotification</c>, any pending events are not reported to the application.</para> /// </remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessionmanager2-unregisterducknotification // HRESULT UnregisterDuckNotification( IAudioVolumeDuckNotification *duckNotification ); void UnregisterDuckNotification([In] IAudioVolumeDuckNotification duckNotification); } /// <summary>The <c>IAudioSessionNotification</c> interface provides notification when an audio session is created.</summary> /// <remarks> /// <para> /// Unlike the other WASAPI interfaces, which are implemented by the WASAPI system component, the <c>IAudioSessionNotification</c> /// interface is implemented by the application. To receive event notifications, the application passes to the /// IAudioSessionManager2::RegisterSessionNotification method a pointer to its <c>IAudioSessionNotification</c> implementation . /// </para> /// <para> /// After registering its <c>IAudioSessionNotification</c> interface, the application receives event notifications in the form of /// callbacks through the methods in the interface. /// </para> /// <para> /// When the application no longer needs to receive notifications, it calls the IAudioSessionManager2::UnregisterSessionNotification /// method. This method removes the registration of an <c>IAudioSessionNotification</c> interface that the application previously registered. /// </para> /// <para>The application must not register or unregister notification callbacks during an event callback.</para> /// <para> /// The session enumerator might not be aware of the new sessions that are reported through <c>IAudioSessionNotification</c>. So if /// an application exclusively relies on the session enumerator for getting all the sessions for an audio endpoint, the results /// might not be accurate. To work around this, the application should manually maintain a list. For more information, see IAudioSessionEnumerator. /// </para> /// <para> /// <c>Note</c> Make sure that the application initializes COM with Multithreaded Apartment (MTA) model by calling in a non-UI /// thread. If MTA is not initialized, the application does not receive session notifications from the session manager. Threads that /// run the user interface of an application should be initialized apartment threading model. /// </para> /// <para>Examples</para> /// <para>The following code example shows a sample implementation of the <c>IAudioSessionNotification</c> interface.</para> /// </remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nn-audiopolicy-iaudiosessionnotification [PInvokeData("audiopolicy.h", MSDNShortId = "69222168-87d7-4f5a-93b1-6d91263a54bd")] [ComImport, Guid("641DD20B-4D41-49CC-ABA3-174B9477BB08"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] public interface IAudioSessionNotification { /// <summary>The <c>OnSessionCreated</c> method notifies the registered processes that the audio session has been created.</summary> /// <param name="NewSession">Pointer to the IAudioSessionControl interface of the audio session that was created.</param> /// <returns>If the method succeeds, it returns S_OK.</returns> /// <remarks> /// <para> /// After registering its IAudioSessionNotification interface, the application receives event notifications in the form of /// callbacks through the methods of the interface. /// </para> /// <para> /// The audio engine calls <c>OnSessionCreated</c> when a new session is activated on the device endpoint. This method is called /// from the session manager thread. This method must take a reference to the session in the NewSession parameter if it wants to /// keep the reference after this call completes. /// </para> /// </remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessionnotification-onsessioncreated // HRESULT OnSessionCreated( IAudioSessionControl *NewSession ); HRESULT OnSessionCreated(IAudioSessionControl NewSession); } /// <summary> /// The <c>IAudioVolumeDuckNotification</c> interface is used to by the system to send notifications about stream attenuation /// changes.Stream Attenuation, or ducking, is a feature introduced in Windows 7, where the system adjusts the volume of a /// non-communication stream when a new communication stream is opened. For more information about this feature, see Default Ducking Experience. /// </summary> /// <remarks> /// <para> /// If an application needs to opt out of the system attenuation experience provided by the system, it must call /// IAudioSessionControl2::SetDuckingPreference and specify that preference. /// </para> /// <para> /// Unlike the other WASAPI interfaces, which are implemented by the WASAPI system component, the /// <c>IAudioVolumeDuckNotification</c> interface is implemented by the application to provide custom stream attenuation behavior. /// To receive event notifications, the application passes to the IAudioSessionManager2::RegisterDuckNotification method a pointer /// to the application's implementation of <c>IAudioVolumeDuckNotification</c>. /// </para> /// <para> /// After the application has registered its <c>IAudioVolumeDuckNotification</c> interface, the session manager calls the /// <c>IAudioVolumeDuckNotification</c> implementation when it needs to send ducking notifications. The application receives event /// notifications in the form of callbacks through the methods of the interface. /// </para> /// <para> /// When the application no longer needs to receive notifications, it calls the IAudioSessionManager2::UnregisterDuckNotification /// method. The <c>UnregisterDuckNotification</c> method removes the registration of an <c>IAudioVolumeDuckNotification</c> /// interface that the application previously registered. /// </para> /// <para>The application must not register or unregister notification callbacks during an event callback.</para> /// <para>For more information, see Implementation Considerations for Ducking Notifications.</para> /// <para>Examples</para> /// <para>The following example code shows a sample implementation of the <c>IAudioVolumeDuckNotification</c> interface.</para> /// </remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nn-audiopolicy-iaudiovolumeducknotification [PInvokeData("audiopolicy.h", MSDNShortId = "08e90a50-a6ac-4405-ba90-a862b78efaf8")] [ComImport, Guid("C3B284D4-6D39-4359-B3CF-B56DDB3BB39C"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] public interface IAudioVolumeDuckNotification { /// <summary> /// The <c>OnVolumeDuckNotification</c> method sends a notification about a pending system ducking event. For more information, /// see Implementation Considerations for Ducking Notifications. /// </summary> /// <param name="sessionID"> /// A string containing the session instance identifier of the communications session that raises the the auto-ducking event. To /// get the session instance identifier, call IAudioSessionControl2::GetSessionInstanceIdentifier. /// </param> /// <param name="countCommunicationSessions"> /// The number of active communications sessions. If there are n sessions, the sessions are numbered from 0 to –1. /// </param> /// <returns>If the method succeeds, it returns S_OK.</returns> /// <remarks> /// After the application registers its implementation of the IAudioVolumeDuckNotification interface by calling /// IAudioSessionManager2::RegisterDuckNotification, the session manager calls <c>OnVolumeDuckNotification</c> when it wants to /// send a notification about when ducking begins. The application receives the event notifications in the form of callbacks. /// </remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiovolumeducknotification-onvolumeducknotification // HRESULT OnVolumeDuckNotification( LPCWSTR sessionID, UINT32 countCommunicationSessions ); HRESULT OnVolumeDuckNotification([MarshalAs(UnmanagedType.LPWStr)] string sessionID, uint countCommunicationSessions); /// <summary> /// The <c>OnVolumeUnduckNotification</c> method sends a notification about a pending system unducking event. For more /// information, see Implementation Considerations for Ducking Notifications. /// </summary> /// <param name="sessionID"> /// A string containing the session instance identifier of the terminating communications session that intiated the ducking. To /// get the session instance identifier, call IAudioSessionControl2::GetSessionInstanceIdentifier. /// </param> /// <returns>If the method succeeds, it returns S_OK.</returns> /// <remarks> /// After the application registers its implementation of the IAudioVolumeDuckNotification interface by calling /// IAudioSessionManager2::RegisterDuckNotification, the session manager calls <c>OnVolumeUnduckNotification</c> when it wants /// to send a notification about when ducking ends. The application receives the event notifications in the form of callbacks. /// </remarks> // https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiovolumeducknotification-onvolumeunducknotification // HRESULT OnVolumeUnduckNotification( LPCWSTR sessionID ); HRESULT OnVolumeUnduckNotification([MarshalAs(UnmanagedType.LPWStr)] string sessionID); } } }
67.750307
186
0.737162
[ "MIT" ]
AndreGleichner/Vanara
PInvoke/CoreAudio/AudioPolicy.cs
110,445
C#
#pragma warning disable 1591 //------------------------------------------------------------------------------ // <auto-generated> // このコードはツールによって生成されました。 // ランタイム バージョン:4.0.30319.42000 // // このファイルへの変更は、以下の状況下で不正な動作の原因になったり、 // コードが再生成されるときに損失したりします。 // </auto-generated> //------------------------------------------------------------------------------ [assembly: global::Android.Runtime.ResourceDesignerAttribute("LiveWithPrism.Droid.Resource", IsApplication=true)] namespace LiveWithPrism.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::Xamarin.Forms.Platform.Android.Resource.Attribute.actionBarSize = global::LiveWithPrism.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: 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.622772
138
0.730807
[ "MIT" ]
jc-150272/aaaaaaaaaaaaaaaaaaaaaaatarasii
LiveWithPrism/LiveWithPrism/LiveWithPrism.Droid/Resources/Resource.Designer.cs
188,201
C#
using System; using System.Text; using Lucene.Net.Analysis.Standard; using System.IO; using Lucene.Net.Analysis; public class StandardTokenizer { public const int ALPHANUM = 0; public const int APOSTROPHE = 1; public const int ACRONYM = 2; public const int COMPANY = 3; public const int EMAIL = 4; public const int HOST = 5; public const int NUM = 6; public const int CJ = 7; public const int ACRONYM_DEP = 8; /* deprecated */ public static void Main(string[] args) { StringBuilder sb = new StringBuilder(); foreach (string arg in args) { sb.Append(arg + " "); } StringReader reader = new StringReader(sb.ToString()); StandardTokenizerImpl scanner = StandardTokenizerImpl.GetStandardTokenizerImpl(reader); Lucene.Net.Analysis.Token token; while ((token = Next(scanner)) != null) { Console.WriteLine("{0}", token.TermText()); } } public static Token Next(StandardTokenizerImpl scanner) { int tokenType = scanner.GetNextToken(); if (tokenType == StandardTokenizerImpl.YYEOF) { return null; } int startPosition = scanner.yychar(); string tokenImage = scanner.yytext(); return new Token(tokenImage, startPosition, startPosition + tokenImage.Length, StandardTokenizerImpl.TOKEN_TYPES[tokenType]); } }
27.433962
91
0.626547
[ "MIT" ]
baohaojun/beagrep
tools/BreakWords.cs
1,454
C#
using System; using SharpGAN.Common; namespace SharpGAN.Layers.ActivationFunctions { /// <summary> /// Class Softmax for implementation softmax activation function /// </summary> [Serializable] public class Softmax : ActivationFunction { /// <summary> /// Empty constructor for creating instance of softmax class /// for later usage /// </summary> public Softmax() { } public override double[][][][] Derivate(double[][][][] value) { // value is derivated together with loss function // and we expected that softmax will be used only // as last layer because if we use softmax as hidden // layer we minimaze the nonlinearity return value; } public override double[][][][] Compute(double[][][][] values) { TestIsFlatten(values); int l0 = values.Length; int l1 = values[0].Length; int l2 = values[0][0].Length; int l3 = values[0][0][0].Length; double sum, value; for (int i = 0; i < l0; i++) { sum = 0; for (int l = 0; l < l3; l++) { value = Math.Pow(Math.E, values[i][0][0][l]); values[i][0][0][l] = value; sum += value; } for (int l = 0; l < l3; l++) { values[i][0][0][l] /= sum; } } return values; } /// <summary> /// Test if the input into dense layer has flatten /// shape /// </summary> /// <param name="input">input data into dense layer</param> private void TestIsFlatten(double[][][][] input) { int numFilters = input[0].GetLength(0); int numRows = input[0][0].GetLength(0); if (numFilters != 1 || numRows != 1) { string msg = "Input into dense layer is not flatten, please use " + "the flatten layer before dense layer."; Utils.ThrowException(msg); } } /// <summary> /// Normalize softmax into [0-1] value /// </summary> /// <param name="value">activation x</param> /// <param name="sum">divisor which is equal to sum of all /// activation for current vector</param> /// <returns>final activation for neuron</returns> public double Normalize(double value, double sum) { return value / sum; } } }
30.862069
83
0.478585
[ "MIT" ]
pedroam14/Neural-Link
Assets/Scripts/GAN/Layers/ActivationFunctions/Softmax.cs
2,687
C#
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="ColumnDefinition.cs" company="PropertyTools"> // Copyright (c) 2014 PropertyTools contributors // </copyright> // <summary> // Defines a column in a DataGrid. // </summary> // -------------------------------------------------------------------------------------------------------------------- namespace PropertyTools.Wpf { using System.Windows; /// <summary> /// Defines a column in a <see cref="DataGrid" />. /// </summary> public class ColumnDefinition : PropertyDefinition { /// <summary> /// Initializes a new instance of the <see cref="ColumnDefinition" /> class. /// </summary> public ColumnDefinition() { this.Width = GridLength.Auto; } /// <summary> /// Gets or sets the column width. /// </summary> /// <value>The width.</value> public GridLength Width { get; set; } } }
32.939394
121
0.432383
[ "MIT" ]
JawadJaber/PropertyTools
Source/PropertyTools.Wpf/DataGrid/Definitions/ColumnDefinition.cs
1,089
C#
using System; using NUnit.Framework; using AdoTools.Common.Extensions; namespace AdoTools.Common.Tests.Extensions { [TestFixture] public class XmlExtensionTests { [Test] public void SerializeObject_Format() { var input = new TestObject {TestString = "testing"}; var result = input.SerializeObject(true); Assert.That(result, Is.Not.Null); Assert.That(result.Length, Is.GreaterThan(0)); StringAssert.Contains("testing", result); } [Test] public void SerializeObject_NoFormat() { var input = new TestObject {TestString = "testing"}; var result = input.SerializeObject(); Assert.That(result, Is.Not.Null); Assert.That(result.Length, Is.GreaterThan(0)); StringAssert.Contains("testing", result); } } }
26.558824
64
0.593577
[ "MIT" ]
robbratton/AdoTools
AdoTools.Common.Tests/Extensions/XmlExtensionTests.cs
905
C#
using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Data; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Threading; using System.Threading.Tasks; using Ding; using Ding.Collections; using Ding.Data; using Ding.Log; using Ding.Threading; using XCode.Cache; using XCode.Configuration; using XCode.DataAccessLayer; using XCode.Model; /* * 检查表结构流程: * Create 创建实体会话,此时不能做任何操作,原则上各种操作要延迟到最后 * Query/Execute 查询修改数据 * WaitForInitData 等待数据初始化 * Monitor.TryEnter 只会被调用一次,后续线程进入需要等待 * CheckModel lock阻塞检查模型架构 * CheckTable 检查表 * FixIndexName 修正索引名称 * SetTables 设置表架构 * CheckTableAync 异步检查表 * InitData * Monitor.Exit 初始化完成 * Count 总记录数 * CheckModel * WaitForInitData * * 缓存流程: * Insert/Update/Delete * IEntityPersistence.Insert/Update/Delete * Execute * DataChange <= Tran!=null * ClearCache * OnDataChange * 更新缓存 * Tran.Completed * Tran = null * Success * DataChange * else * 回滚缓存 * * 缓存更新规则如下: * 1、直接执行SQL语句进行新增、编辑、删除操作,强制清空实体缓存、单对象缓存 * 2、无论独占模式或非独占模式,使用实体对象或实体列表进行的对象操作,不再主动清空缓存。 * 3、事务提交时对缓存的操作参考前两条 * 4、事务回滚时一律强制清空缓存(因为无法判断什么异常触发回滚,回滚之前对缓存进行了哪些修改无法记录) * 5、强制清空缓存时传入执行更新操作记录数,如果存在更新操作清除实体缓存、单对象缓存。 * 6、强制清空缓存时如果只有新增和删除操作,先判断当前实体类有无使用实体缓存,如果使用了实体缓存证明当前实体总记录数不大, * 清空实体缓存的同时清空单对象缓存,确保单对象缓存和实体缓存引用同一实体对象;没有实体缓存则不对单对象缓存进行清空操作。 * */ namespace XCode { /// <summary>实体会话。每个实体类、连接名和表名形成一个实体会话</summary> public class EntitySession<TEntity> : IEntitySession where TEntity : Entity<TEntity>, new() { #region 属性 /// <summary>连接名</summary> public String ConnName { get; } /// <summary>表名</summary> public String TableName { get; } /// <summary>用于标识会话的键值</summary> public String Key { get; } #endregion #region 构造 private EntitySession(String connName, String tableName) { ConnName = connName; TableName = tableName; Key = connName + "###" + tableName; Queue = new EntityQueue(this); } private static ConcurrentDictionary<String, EntitySession<TEntity>> _es = new ConcurrentDictionary<String, EntitySession<TEntity>>(StringComparer.OrdinalIgnoreCase); /// <summary>创建指定表名连接名的会话</summary> /// <param name="connName"></param> /// <param name="tableName"></param> /// <returns></returns> public static EntitySession<TEntity> Create(String connName, String tableName) { if (connName.IsNullOrEmpty()) throw new ArgumentNullException(nameof(connName)); if (tableName.IsNullOrEmpty()) throw new ArgumentNullException(nameof(tableName)); // 字符串连接有较大性能损耗 var key = connName + "###" + tableName; return _es.GetOrAdd(key, k => new EntitySession<TEntity>(connName, tableName)); } #endregion #region 主要属性 private Type ThisType => typeof(TEntity); /// <summary>表信息</summary> TableItem Table => TableItem.Create(ThisType); IEntityOperate Operate => EntityFactory.CreateOperate(ThisType); private DAL _Dal; /// <summary>数据操作层</summary> public DAL Dal => _Dal ?? (_Dal = DAL.Create(ConnName)); private String _FormatedTableName; /// <summary>已格式化的表名,带有中括号等</summary> public virtual String FormatedTableName { get { if (_FormatedTableName.IsNullOrEmpty()) _FormatedTableName = Dal.Db.FormatTableName(TableName); return _FormatedTableName; } } private String _TableNameWithPrefix; /// <summary>带前缀的表名</summary> public virtual String TableNameWithPrefix { get { if (_TableNameWithPrefix.IsNullOrEmpty()) { var str = TableName; // 检查自动表前缀 var db = Dal.Db; var pf = db.TablePrefix; if (!pf.IsNullOrEmpty() && !str.StartsWithIgnoreCase(pf)) str = pf + str; _TableNameWithPrefix = str; } return _TableNameWithPrefix; } } private EntitySession<TEntity> _Default; /// <summary>该实体类的默认会话。</summary> private EntitySession<TEntity> Default { get { if (_Default != null) return _Default; var cname = Table.ConnName; var tname = Table.TableName; if (ConnName == cname && TableName == tname) _Default = this; else _Default = Create(cname, tname); return _Default; } } /// <summary>用户数据</summary> public IDictionary<String, Object> Items { get; set; } = new Dictionary<String, Object>(); #endregion #region 数据初始化 /// <summary>记录已进行数据初始化</summary> Boolean hasCheckInitData = false; Int32 initThread = 0; readonly Object _wait_lock = new Object(); /// <summary>检查并初始化数据。参数等待时间为0表示不等待</summary> /// <param name="ms">等待时间,-1表示不限,0表示不等待</param> /// <returns>如果等待,返回是否收到信号</returns> public Boolean WaitForInitData(Int32 ms = 3000) { // 已初始化 if (hasCheckInitData) return true; var tid = Thread.CurrentThread.ManagedThreadId; //!!! 一定一定小心堵塞的是自己 if (initThread == tid) return true; if (!Monitor.TryEnter(_wait_lock, ms)) { //if (DAL.Debug) DAL.WriteLog("等待初始化{0}数据{1}ms,调用栈:{2}", ThisType.Name, ms, XTrace.GetCaller(1, 8)); if (DAL.Debug) DAL.WriteLog("等待初始化{0}数据{1:n0}ms失败 initThread={2}", ThisType.Name, ms, initThread); return false; } //initThread = tid; try { // 已初始化 if (hasCheckInitData) return true; var name = ThisType.Name; if (name == TableName) name = String.Format("{0}@{1}", ThisType.Name, ConnName); else name = String.Format("{0}#{1}@{2}", ThisType.Name, TableName, ConnName); var task = Task.Factory.StartNew(() => { initThread = Thread.CurrentThread.ManagedThreadId; // 如果该实体类是首次使用检查模型,则在这个时候检查 try { CheckModel(); } catch (Exception ex) { XTrace.WriteException(ex); } //var init = Setting.Current.InitData; var init = this == Default; if (init) { //BeginTrans(); try { if (Operate.Default is EntityBase entity) { entity.InitData(); //// 异步执行初始化,只等一会,避免死锁 //var task = TaskEx.Run(() => entity.InitData()); //if (!task.Wait(ms) && DAL.Debug) DAL.WriteLog("{0}未能在{1:n0}ms内完成数据初始化 Task={2}", ThisType.Name, ms, task.Id); } //Commit(); } catch (Exception ex) { if (XTrace.Debug) XTrace.WriteLine("初始化数据出错!" + ex.ToString()); //Rollback(); } } }); task.Wait(3_000); return true; } finally { initThread = 0; hasCheckInitData = true; Monitor.Exit(_wait_lock); } } #endregion #region 架构检查 private void CheckTable() { //if (Dal.CheckAndAdd(TableName)) return; #if DEBUG DAL.WriteLog("开始{2}检查表[{0}/{1}]的数据表架构……", Table.DataTable.Name, Dal.Db.Type, Setting.Current.Migration == Migration.ReadOnly ? "异步" : "同步"); #endif var sw = Stopwatch.StartNew(); try { // 检查新表名对应的数据表 var table = Table.DataTable; // 克隆一份,防止修改 table = table.Clone() as IDataTable; if (table != null && table.TableName != TableName) { // 表名去掉前缀 var name = TableName; if (name.Contains(".")) name = name.Substring("."); table.TableName = name; FixIndexName(table); } Dal.SetTables(table); } finally { sw.Stop(); #if DEBUG DAL.WriteLog("检查表[{0}/{1}]的数据表架构耗时{2:n0}ms", Table.DataTable.Name, Dal.DbType, sw.Elapsed.TotalMilliseconds); #endif } } void FixIndexName(IDataTable table) { // 修改一下索引名,否则,可能因为同一个表里面不同的索引冲突 if (table.Indexes != null) { foreach (var di in table.Indexes) { var sb = Pool.StringBuilder.Get(); sb.AppendFormat("IX_{0}", TableName); foreach (var item in di.Columns) { sb.Append("_"); sb.Append(item); } di.Name = sb.Put(true); } } } private Boolean IsGenerated => ThisType.GetCustomAttribute<CompilerGeneratedAttribute>(true) != null; Boolean _hasCheckModel = false; readonly Object _checkLock = new Object(); /// <summary>检查模型。依据反向工程设置、是否首次使用检查、是否已常规检查等</summary> private void CheckModel() { if (_hasCheckModel) return; lock (_checkLock) { if (_hasCheckModel) return; // 是否默认连接和默认表名,非默认则强制检查,并且不允许异步检查(异步检查会导致ConnName和TableName不对) var def = Default; var cname = ConnName; var tname = TableName; if (def == this) { //if (!Setting.Current.Negative.Enable || // DAL.NegativeExclude.Contains(cname) || // DAL.NegativeExclude.Contains(tname) || // IsGenerated) if (Dal.Db.Migration == Migration.Off || IsGenerated) { _hasCheckModel = true; return; } } #if DEBUG else { DAL.WriteLog("[{0}@{1}]非默认表名连接名,强制要求检查架构!", tname, cname); } #endif // 输出调用者,方便调试 //if (DAL.Debug) DAL.WriteLog("检查实体{0}的数据表架构,模式:{1},调用栈:{2}", ThisType.FullName, Table.ModelCheckMode, XTrace.GetCaller(1, 0, "\r\n<-")); // CheckTableWhenFirstUse的实体类,在这里检查,有点意思,记下来 var mode = Table.ModelCheckMode; if (DAL.Debug && mode == ModelCheckModes.CheckTableWhenFirstUse) DAL.WriteLog("检查实体{0}的数据表架构,模式:{1}", ThisType.FullName, mode); // 第一次使用才检查的,此时检查 var ck = mode == ModelCheckModes.CheckTableWhenFirstUse; // 或者前面初始化的时候没有涉及的,也在这个时候检查 var dal = DAL.Create(cname); if (!dal.HasCheckTables.Contains(tname)) { if (!ck) { dal.HasCheckTables.Add(tname); #if DEBUG if (!ck && DAL.Debug) DAL.WriteLog("集中初始化表架构时没赶上,现在补上!"); #endif ck = true; } } else ck = false; if (ck) { // 打开了开关,并且设置为true时,使用同步方式检查 // 设置为false时,使用异步方式检查,因为上级的意思是不大关心数据库架构 if (dal.Db.Migration > Migration.ReadOnly || def != this) CheckTable(); else ThreadPoolX.QueueUserWorkItem(CheckTable); } _hasCheckModel = true; } } #endregion #region 缓存 private EntityCache<TEntity> _cache; /// <summary>实体缓存</summary> /// <returns></returns> public EntityCache<TEntity> Cache { get { // 以连接名和表名为key,因为不同的库不同的表,缓存也不一样 if (_cache == null) { var ec = new EntityCache<TEntity> { ConnName = ConnName, TableName = TableName }; // 从默认会话复制参数 if (Default != this) ec.CopySettingFrom(Default.Cache); //_cache = ec; Interlocked.CompareExchange(ref _cache, ec, null); } return _cache; } } private ISingleEntityCache<Object, TEntity> _singleCache; /// <summary>单对象实体缓存。</summary> public ISingleEntityCache<Object, TEntity> SingleCache { get { // 以连接名和表名为key,因为不同的库不同的表,缓存也不一样 if (_singleCache == null) { var sc = new SingleEntityCache<Object, TEntity> { ConnName = ConnName, TableName = TableName }; // 从默认会话复制参数 if (Default != this) sc.CopySettingFrom(Default.SingleCache); Interlocked.CompareExchange(ref _singleCache, sc, null); } return _singleCache; } } IEntityCache IEntitySession.Cache => Cache; ISingleEntityCache IEntitySession.SingleCache => SingleCache; /// <summary>总记录数,小于1000时是精确的,大于1000时缓存10秒</summary> public Int32 Count { get { var v = LongCount; return v > Int32.MaxValue ? Int32.MaxValue : (Int32)v; } } private DateTime _NextCount; /// <summary>总记录数较小时,使用静态字段,较大时增加使用Cache</summary> private Int64 _Count = -2L; /// <summary>总记录数,小于1000时是精确的,大于1000时缓存10分钟</summary> /// <remarks> /// 1,检查静态字段,如果有数据且小于1000,直接返回,否则=>3 /// 2,如果有数据但大于1000,则返回缓存里面的有效数据 /// 3,来到这里,有可能是第一次访问,静态字段没有缓存,也有可能是大于1000的缓存过期 /// 4,检查模型 /// 5,根据需要查询数据 /// 6,如果大于1000,缓存数据 /// 7,检查数据初始化 /// </remarks> public Int64 LongCount { get { var key = CacheKey; // 当前缓存的值 var n = _Count; var now = TimerX.Now; // 如果有缓存,则考虑返回吧 if (n >= 0) { if (_NextCount < now) { _NextCount = now.AddSeconds(60); // 异步更新 ThreadPoolX.QueueUserWorkItem(() => LongCount = GetCount(_Count)); } return n; } // 来到这里,是第一次访问 CheckModel(); // 从配置读取 var dc = DataCache.Current; if (n < 0) { if (dc.Counts.TryGetValue(key, out var c)) n = c; } if (DAL.Debug) DAL.WriteLog("{0}.Count 快速计算表记录数(非精确)[{1}/{2}] 参考值 {3:n0}", ThisType.Name, TableName, ConnName, n); var m = GetCount(n); _Count = m; dc.Counts[key] = m; dc.SaveAsync(); _NextCount = now.AddSeconds(60); // 先拿到记录数再初始化,因为初始化时会用到记录数,同时也避免了死循环 //WaitForInitData(); InitData(); return m; } private set { _Count = value; _NextCount = TimerX.Now.AddSeconds(60); var dc = DataCache.Current; dc.Counts[CacheKey] = value; dc.SaveAsync(); } } private Int64 GetCount(Int64 count) { //if (count >= 0) //{ // // 小于1000的精确查询,大于1000的快速查询 // if (count <= 1000L) // { // var builder = new SelectBuilder // { // Table = FormatedTableName // }; // return Dal.SelectCount(builder); // } //} // 第一次访问,SQLite的Select Count非常慢,数据大于阀值时,使用最大ID作为表记录数 if (count < 0 && Dal.DbType == DatabaseType.SQLite && Table.Identity != null) { var builder = new SelectBuilder { Table = FormatedTableName, OrderBy = Table.Identity.Desc() }; var ds = Dal.Query(builder, 0, 1); if (ds.Columns.Length > 0 && ds.Rows.Count > 0) count = Convert.ToInt64(ds.Rows[0][0]); //var rs = Dal.Query(builder, 0, 0, dr => dr.Read() ? dr[0].ToInt() : -1); //if (rs > 0) count = rs; } // 100w数据时,没有预热Select Count需要3000ms,预热后需要500ms if (count < 500000) { if (count <= 0) count = Dal.Session.QueryCountFast(TableNameWithPrefix); // 查真实记录数,修正FastCount不够准确的情况 if (count < 10000000) { var builder = new SelectBuilder { Table = FormatedTableName }; count = Dal.SelectCount(builder); } } else { // 异步查询弥补不足,千万数据以内 if (count < 10000000) count = Dal.Session.QueryCountFast(TableNameWithPrefix); } return count; } /// <summary>清除缓存</summary> /// <param name="reason">原因</param> public void ClearCache(String reason) { _cache?.Clear(reason); _singleCache?.Clear(reason); // Count提供的是非精确数据,避免频繁更新 //_Count = -1L; //_NextCount = DateTime.MinValue; } String CacheKey => $"{ConnName}_{TableName}_{ThisType.Name}"; #endregion #region 数据库操作 /// <summary>初始化数据</summary> public void InitData() => WaitForInitData(); /// <summary>执行SQL查询,返回记录集</summary> /// <param name="builder">SQL语句</param> /// <param name="startRowIndex">开始行,0表示第一行</param> /// <param name="maximumRows">最大返回行数,0表示所有行</param> /// <returns></returns> public virtual DbTable Query(SelectBuilder builder, Int64 startRowIndex, Int64 maximumRows) { InitData(); return Dal.Query(builder, startRowIndex, maximumRows); } /// <summary>执行SQL查询,返回记录集</summary> /// <param name="sql">SQL语句</param> /// <returns></returns> public virtual DbTable Query(String sql) { InitData(); return Dal.Query(sql); } /// <summary>查询记录数</summary> /// <param name="builder">查询生成器</param> /// <returns>记录数</returns> public virtual Int32 QueryCount(SelectBuilder builder) { InitData(); return Dal.SelectCount(builder); } /// <summary>查询记录数</summary> /// <param name="sql">SQL语句</param> /// <returns></returns> public virtual Int32 QueryCount(String sql) { InitData(); return Dal.SelectCount(sql, CommandType.Text, null); } /// <summary>执行</summary> /// <param name="sql">SQL语句</param> /// <param name="type">命令类型,默认SQL文本</param> /// <param name="ps">命令参数</param> /// <returns>影响的结果</returns> public Int32 Execute(String sql, CommandType type = CommandType.Text, params IDataParameter[] ps) { InitData(); var rs = Dal.Execute(sql, type, ps); DataChange("Execute " + type); return rs; } /// <summary>执行插入语句并返回新增行的自动编号</summary> /// <param name="sql">SQL语句</param> /// <param name="type">命令类型,默认SQL文本</param> /// <param name="ps">命令参数</param> /// <returns>新增行的自动编号</returns> public Int64 InsertAndGetIdentity(String sql, CommandType type = CommandType.Text, params IDataParameter[] ps) { InitData(); var rs = Dal.InsertAndGetIdentity(sql, type, ps); DataChange("InsertAndGetIdentity " + type); return rs; } private void DataChange(String reason) { //var tr = GetTran(); //// 实体添删改时,有修改缓存,数据变更事件里不需要再次清空 //if (tr == null || tr.Count == 0) ClearCache(reason); _OnDataChange?.Invoke(ThisType); } private Action<Type> _OnDataChange; /// <summary>数据改变后触发。参数指定触发该事件的实体类</summary> public event Action<Type> OnDataChange { add { if (value != null) { // 这里不能对委托进行弱引用,因为GC会回收委托,应该改为对对象进行弱引用 //WeakReference<Action<Type>> w = value; // 弱引用事件,只会执行一次,一次以后自动取消注册 _OnDataChange += new WeakAction<Type>(value, handler => { _OnDataChange -= handler; }, true); } } remove { } } #endregion #region 数据库高级操作 /// <summary>清空数据表,标识归零</summary> /// <returns></returns> public Int32 Truncate() { var rs = Dal.Session.Truncate(TableNameWithPrefix); // 干掉所有缓存 _cache?.Clear("Truncate"); _singleCache?.Clear("Truncate"); LongCount = 0; //// 重新初始化 //hasCheckInitData = false; return rs; } #endregion #region 事务保护 private ITransaction GetTran() => (Dal.Session as DbSession).Transaction; /// <summary>开始事务</summary> /// <returns>剩下的事务计数</returns> public virtual Int32 BeginTrans() { /* 这里也需要执行初始化检查架构,因为无法确定在调用此方法前是否已使用实体类进行架构检查,如下调用会造成事务不平衡而上抛异常: * Exception:执行SqlServer的Dispose时出错:System.InvalidOperationException: 此 SqlTransaction 已完成;它再也无法使用。 * * 如果实体的模型检查模式为CheckTableWhenFirstUse,直接执行静态操作 * using (var trans = new EntityTransaction<TEntity>()) * { * TEntity.Delete(whereExp); * TEntity.Update(new String[] { 字段1,字段2 }, new Object[] { 值1,值1 }, whereExp); * trans.Commit(); * } */ InitData(); var count = Dal.BeginTransaction(); return count; } /// <summary>提交事务</summary> /// <returns>剩下的事务计数</returns> public virtual Int32 Commit() { var rs = Dal.Commit(); if (rs == 0) DataChange("Commit"); return rs; } /// <summary>回滚事务,忽略异常</summary> /// <returns>剩下的事务计数</returns> public virtual Int32 Rollback() { var rs = Dal.Rollback(); if (rs == 0) DataChange($"Rollback"); return rs; } #endregion #region 参数化 /// <summary>格式化参数名</summary> /// <param name="name">名称</param> /// <returns></returns> public virtual String FormatParameterName(String name) => Dal.Db.FormatParameterName(name); #endregion #region 实体操作 private IEntityPersistence Persistence => XCodeService.Container.ResolveInstance<IEntityPersistence>(); /// <summary>把该对象持久化到数据库,添加/更新实体缓存和单对象缓存,增加总计数</summary> /// <param name="entity">实体对象</param> /// <returns></returns> public virtual Int32 Insert(IEntity entity) { var rs = Persistence.Insert(entity); var e = entity as TEntity; // 加入实体缓存 var ec = _cache; if (ec != null) ec.Add(e); // 增加计数 if (_Count >= 0) Interlocked.Increment(ref _Count); return rs; } /// <summary>更新数据库,同时更新实体缓存</summary> /// <param name="entity">实体对象</param> /// <returns></returns> public virtual Int32 Update(IEntity entity) { var rs = Persistence.Update(entity); var e = entity as TEntity; // 更新缓存 TEntity old = null; var ec = _cache; if (ec != null) old = ec.Update(e); // 干掉缓存项,让它重新获取 _singleCache?.Remove(e); return rs; } /// <summary>从数据库中删除该对象,同时从实体缓存和单对象缓存中删除,扣减总数量</summary> /// <param name="entity">实体对象</param> /// <returns></returns> public virtual Int32 Delete(IEntity entity) { var rs = Persistence.Delete(entity); var e = entity as TEntity; // 从实体缓存删除 TEntity old = null; var ec = _cache; if (ec != null) old = ec.Remove(e); // 从单对象缓存删除 _singleCache?.Remove(e); // 减少计数 if (_Count > 0) Interlocked.Decrement(ref _Count); return rs; } #endregion #region 队列 /// <summary>实体队列</summary> public EntityQueue Queue { get; private set; } #endregion } }
31.22104
173
0.480975
[ "MIT" ]
EnhWeb/DC.Framework
src/Ding.XCode/Entity/EntitySession.cs
30,609
C#
using System; namespace TC4_Alumnos { class Persona { public string apellido; public string nombre; public string NombreCompleto { get => this.nombre + " " + this.apellido; } private string colorFavorito; public string ColorFavorito { get => "color " + this.colorFavorito; set => this.colorFavorito = value; } // Método constructor public Persona(string nombre, string apellido) { this.apellido = apellido; this.nombre = nombre; } public virtual void Presentarse() { Console.WriteLine("Hola, mi nombre es " + this.NombreCompleto); } } }
21.361111
75
0.521456
[ "MIT" ]
Bondweb-on/TC4-Alumnos
Persona.cs
770
C#
using FluiTec.AppFx.Data.Dapper.Migration; using FluiTec.AppFx.Localization.Schema; namespace FluiTec.AppFx.Localization.Dapper.Schema.Migration.Versions { /// <summary> A translation migration. </summary> [DapperMigration(2020, 06, 09, 11, 03, "Achim Schnell")] public class _202006091103_TranslationMigration : FluentMigrator.Migration { /// <summary> Name of the foreign key. </summary> private const string ForeignKeyName = "FK_Translation_Resource"; /// <summary>Name of the contraint.</summary> private const string ContraintName = "UX_Language_Resource"; /// <summary> Collect the UP migration expressions. </summary> public override void Up() { IfDatabase("sqlserver", "postgres") .Create .Table(SchemaGlobals.TranslationTable) .InSchema(SchemaGlobals.Schema) .WithColumn("Id").AsInt32().NotNullable().PrimaryKey().Identity() .WithColumn("ResourceId").AsInt32().NotNullable() .WithColumn("Value").AsString(int.MaxValue).Nullable() .WithColumn("Language").AsString().Nullable(); IfDatabase("sqlserver", "postgres") .Create .ForeignKey(ForeignKeyName) .FromTable(SchemaGlobals.TranslationTable) .InSchema(SchemaGlobals.Schema) .ForeignColumn("ResourceId") .ToTable(SchemaGlobals.ResourceTable) .InSchema(SchemaGlobals.Schema) .PrimaryColumn("Id"); IfDatabase("sqlserver", "postgres") .Create .UniqueConstraint(ContraintName) .OnTable(SchemaGlobals.TranslationTable) .WithSchema(SchemaGlobals.Schema) .Columns("ResourceId", "Language"); IfDatabase("mysql") .Create .Table($"{SchemaGlobals.Schema}_{SchemaGlobals.TranslationTable}") .WithColumn("Id").AsInt32().NotNullable().PrimaryKey().Identity() .WithColumn("ResourceId").AsInt32().NotNullable() .WithColumn("Value").AsString(int.MaxValue).Nullable() .WithColumn("Language").AsString().Nullable(); IfDatabase("mysql") .Create .UniqueConstraint(ContraintName) .OnTable($"{SchemaGlobals.Schema}_{SchemaGlobals.TranslationTable}") .Columns("ResourceId", "Language"); } /// <summary> Collects the DOWN migration expressions. </summary> public override void Down() { IfDatabase("sqlserver", "postgres") .Delete .ForeignKey(ForeignKeyName) .OnTable(SchemaGlobals.TranslationTable) .InSchema(SchemaGlobals.Schema); IfDatabase("sqlserver", "postgres") .Delete .Table(SchemaGlobals.TranslationTable) .InSchema(SchemaGlobals.Schema); IfDatabase("sqlserver", "postgres") .Delete .UniqueConstraint(ContraintName) .FromTable($"{SchemaGlobals.Schema}_{SchemaGlobals.TranslationTable}"); IfDatabase("mysql") .Delete .Table($"{SchemaGlobals.Schema}_{SchemaGlobals.TranslationTable}"); IfDatabase("mysql") .Alter .Column("Value") .OnTable($"{SchemaGlobals.Schema}_{SchemaGlobals.TranslationTable}") .AsString(); } } }
40.555556
87
0.570685
[ "Apache-2.0", "MIT" ]
FluiTec/FluiTec.AppFx.Localization
src/FluiTec.AppFx.Localization.Dapper/Schema/Migration/Versions/202006091103_TranslationMigration.cs
3,652
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("WindowsFormsApp1")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("WindowsFormsApp1")] [assembly: AssemblyCopyright("Copyright © 2020")] [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("c470d745-0f9d-42cc-88a4-1bbb5edd9b49")] // 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")]
37.837838
84
0.749286
[ "MIT" ]
DominikRicko/AlphaBot2_ControllerApplication
Properties/AssemblyInfo.cs
1,403
C#
using UIKit; namespace mvvm.iOS { public class Application { // This is the main entry point of the application. private static void Main(string[] args) { // if you want to use a different Application Delegate class from "AppDelegate" // you can specify it here. UIApplication.Main(args, null, "AppDelegate"); } } }
26.466667
91
0.594458
[ "MIT" ]
Leand3k/simple-LoginUsingGrid
mvvm/mvvm.iOS/Main.cs
399
C#
using System; using System.Runtime.Serialization; namespace StandardDot.Dto.Exception { /// <summary> /// A serializable version of <see cref="System.RuntimeMethodHandle" />. /// </summary> [DataContract] public struct SerializableRuntimeMethodHandle { /// <param name="runtimeMethodHandle">The runtimeMethodHandle info to serialize</param> public SerializableRuntimeMethodHandle(RuntimeMethodHandle runtimeMethodHandle) { // runtimeMethodHandle can't be null Value = runtimeMethodHandle.Value; } /// <summary> /// The <see cref="System.IntPtr" /> that represents the method handle. /// </summary> [DataMember(Name = "value")] public IntPtr Value { get; set; } } }
26.846154
89
0.726361
[ "MIT" ]
mrlunchbox777/StandardDot
src/Dto/Exception/SerializableRuntimeMethodHandle.cs
698
C#
//------------------------------------------------------------------------------ // <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> //------------------------------------------------------------------------------ namespace VWiFiManager.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); public static Settings Default { get { return defaultInstance; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("")] public string NetworkName { get { return ((string)(this["NetworkName"])); } set { this["NetworkName"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("")] public string NetworkPass { get { return ((string)(this["NetworkPass"])); } set { this["NetworkPass"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("True")] public bool AppUpgraded { get { return ((bool)(this["AppUpgraded"])); } set { this["AppUpgraded"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("False")] public bool AutoStart { get { return ((bool)(this["AutoStart"])); } set { this["AutoStart"] = value; } } } }
36.986667
151
0.555155
[ "Unlicense" ]
linkshift/VWiFiManager
VWiFiManager/Properties/Settings.Designer.cs
2,776
C#
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Senai.Peoples.WebApi.Domains; using Senai.Peoples.WebApi.Repository; namespace Senai.Peoples.WebApi.Controller { [Route("api/[controller]")] [Produces("application/json")] [ApiController] public class FuncionarioController : ControllerBase { FuncionarioRepository FunciarioRepository = new FuncionarioRepository(); [HttpGet] public IEnumerable<FuncionarioDomain> ListarTodos() { return FunciarioRepository.Listar(); } [HttpGet ("{Id}")] public IActionResult BuscarPorId(int Id) { FuncionarioDomain funcionarioDomain = FunciarioRepository.BuscarPorId(Id); if (funcionarioDomain == null) return NotFound(); return Ok(funcionarioDomain); } // [HttpGet ("{Nome}")] // public IActionResult BuscarPorNome(string Nome) // { // FuncionarioDomain funcionarioDomain = FunciarioRepository.BuscarPorNome(Nome); // if (funcionarioDomain == null) // return NotFound(); // return Ok(funcionarioDomain); // } [HttpPost] public IActionResult Cadastrar(FuncionarioDomain funcionarioDomain) { FunciarioRepository.Cadastrar(funcionarioDomain); return Ok(); } public IActionResult Atualizar(FuncionarioDomain funcionarioDomain) { FunciarioRepository.Atualizar(funcionarioDomain); return Ok(); } [HttpDelete("{Id}")] public IActionResult Deletar (int Id) { FunciarioRepository.Deletar(Id); return Ok(); } } }
28.661538
92
0.620505
[ "MIT" ]
Psouza-queiroz/2s2019-t2-sprint-2-backend-peoples
Senai.Peoples.WebApi/Senai.Peoples.WebApi/Controller/FuncionarioController.cs
1,865
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("14-pointAndRectangle")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("14-pointAndRectangle")] [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("8307d3f4-13d2-4ca2-b879-500353df45a7")] // 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.054054
84
0.74929
[ "MIT" ]
MrPIvanov/SoftUni
01-Progr Basics with Csharp/07-More Complex Logic Checks/07-Complex Logic Checks/14-pointAndRectangle/Properties/AssemblyInfo.cs
1,411
C#
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace MegaCasting.Models { public class Content { } }
14.083333
33
0.733728
[ "Apache-2.0" ]
NyanUnicorn/MegaCastingProj
MagaCasting.DataLib/Models/MGCasting/Content.cs
171
C#
// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel // // 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 SharpGen.Logging { /// <summary> /// Logging interface for backend output. /// </summary> public interface ILogger { /// <summary> /// Exits the process with the specified reason. /// </summary> void Exit(string reason, int exitCode); /// <summary> /// Logs the specified log message. /// </summary> void Log(LogLevel logLevel, LogLocation logLocation, string context, string code, string message, Exception exception, params object[] parameters); } }
43.512821
155
0.713612
[ "MIT" ]
JetBrains/SharpGenTools
SharpGen/Logging/ILogger.cs
1,699
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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Xml.Serialization; using System.Text; using System.IO; using System.Net; using Amazon.Runtime; using Amazon.Runtime.Internal; namespace Amazon.AuditManager.Model { /// <summary> /// Container for the parameters to the GetControl operation. /// Returns a control from Audit Manager. /// </summary> public partial class GetControlRequest : AmazonAuditManagerRequest { private string _controlId; /// <summary> /// Gets and sets the property ControlId. /// <para> /// The identifier for the specified control. /// </para> /// </summary> [AWSProperty(Required=true, Min=36, Max=36)] public string ControlId { get { return this._controlId; } set { this._controlId = value; } } // Check to see if ControlId property is set internal bool IsSetControlId() { return this._controlId != null; } } }
29.423729
110
0.657258
[ "Apache-2.0" ]
ChristopherButtars/aws-sdk-net
sdk/src/Services/AuditManager/Generated/Model/GetControlRequest.cs
1,736
C#
namespace EasyDurableTask.Core { // Dummy interface to indicate an Activity interface which could be used by TaskHubWorker.AddTaskActivitiesFromInterface public interface IActivity { } }
22.777778
124
0.760976
[ "Apache-2.0" ]
t-bzhan/EasyDurableTask
src/EasyDurableTask/Core/IActivity.cs
207
C#
// ----------------------------------------------------------------------- // <copyright file="Middleware.cs" company="Asynkron AB"> // Copyright (C) 2015-2022 Asynkron AB All rights reserved // </copyright> // ----------------------------------------------------------------------- using System.Threading.Tasks; namespace Proto; public static class Middleware { internal static Task Receive(IReceiverContext context, MessageEnvelope envelope) => context.Receive(envelope); internal static Task Sender(ISenderContext context, PID target, MessageEnvelope envelope) { target.SendUserMessage(context.System, envelope); return Task.CompletedTask; } }
36.105263
114
0.578717
[ "Apache-2.0" ]
BearerPipelineTest/protoactor-dotnet
src/Proto.Actor/Middleware.cs
686
C#
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using System.Web.Optimization; using System.Web.Routing; namespace Example1Project { public class MvcApplication : System.Web.HttpApplication { protected void Application_Start() { AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); } } }
26.090909
70
0.709059
[ "MIT" ]
dimitrov9/newmansexercise
Back End/SQL and ASpNET/Example/Example1/Example1/Global.asax.cs
576
C#
using OmniSharp.Models.V2; #nullable enable annotations namespace OmniSharp.Models.v1.InlayHints; public sealed record InlayHint { public Point Position { get; set; } public string Label { get; set; } public string? Tooltip { get; set; } public (string SolutionVersion, int Position) Data { get; set; } #nullable enable public override string ToString() { return $"InlineHint {{ {nameof(Position)} = {Position}, {nameof(Label)} = {Label}, {nameof(Tooltip)} = {Tooltip} }}"; } public bool Equals(InlayHint? other) { if (ReferenceEquals(this, other)) return true; if (other is null) return false; return Position == other.Position && Label == other.Label && Tooltip == other.Tooltip; } public override int GetHashCode() => (Position, Label, Tooltip).GetHashCode(); } public enum InlayHintKind { Type = 1, Parameter = 2, }
25.361111
125
0.651698
[ "MIT" ]
ShuiRuTian/omnisharp-roslyn
src/OmniSharp.Abstractions/Models/v1/InlayHints/InlayHint.cs
915
C#
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //------------------------------------------------------------ namespace Microsoft.Azure.Cosmos.ChangeFeed.Tests { using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Http; using System.Threading; using System.Threading.Tasks; using Microsoft.Azure.Cosmos.ChangeFeed.LeaseManagement; using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; using Newtonsoft.Json.Linq; [TestClass] [TestCategory("ChangeFeed")] public class ChangeFeedEstimatorIteratorTests { [TestMethod] public async Task ShouldRequestForAllPartitionKeyRanges() { List<string> expectedPKRanges = new List<string>() { "0", "1" }; List<DocumentServiceLeaseCore> leases = expectedPKRanges.Select(pkRangeId => new DocumentServiceLeaseCore() { LeaseToken = pkRangeId }).ToList(); Mock<FeedIterator> mockIterator = new Mock<FeedIterator>(); mockIterator.Setup(i => i.ReadNextAsync(It.IsAny<CancellationToken>())).ReturnsAsync(GetResponse(HttpStatusCode.NotModified, "0:1")); Mock<DocumentServiceLeaseContainer> mockContainer = new Mock<DocumentServiceLeaseContainer>(); mockContainer.Setup(c => c.GetAllLeasesAsync()).ReturnsAsync(leases); List<string> requestedPKRanges = new List<string>(); FeedIterator feedCreator(DocumentServiceLease lease, string continuationToken, bool startFromBeginning) { requestedPKRanges.Add(lease.CurrentLeaseToken); return mockIterator.Object; } ChangeFeedEstimatorIterator remainingWorkEstimator = new ChangeFeedEstimatorIterator( Mock.Of<ContainerInternal>(), Mock.Of<ContainerInternal>(), mockContainer.Object, feedCreator, null); await remainingWorkEstimator.ReadNextAsync(default); CollectionAssert.AreEquivalent(expectedPKRanges, requestedPKRanges); } [TestMethod] public async Task ShouldReturnZeroWhenNoItems() { long globalLsnPKRange0 = 10; long globalLsnPKRange1 = 30; long expectedTotal = 0; List<DocumentServiceLeaseCore> leases = new List<DocumentServiceLeaseCore>(){ new DocumentServiceLeaseCore() { LeaseToken = "0" }, new DocumentServiceLeaseCore() { LeaseToken = "1" } }; Mock<FeedIterator> mockIteratorPKRange0 = new Mock<FeedIterator>(); mockIteratorPKRange0.Setup(i => i.ReadNextAsync(It.IsAny<CancellationToken>())) .ReturnsAsync(GetResponse(HttpStatusCode.NotModified, "0:" + globalLsnPKRange0.ToString())); Mock<FeedIterator> mockIteratorPKRange1 = new Mock<FeedIterator>(); mockIteratorPKRange1.Setup(i => i.ReadNextAsync(It.IsAny<CancellationToken>())) .ReturnsAsync(GetResponse(HttpStatusCode.NotModified, "1:" + globalLsnPKRange1.ToString())); Mock<DocumentServiceLeaseContainer> mockContainer = new Mock<DocumentServiceLeaseContainer>(); mockContainer.Setup(c => c.GetAllLeasesAsync()).ReturnsAsync(leases); FeedIterator feedCreator(DocumentServiceLease lease, string continuationToken, bool startFromBeginning) { if (lease.CurrentLeaseToken == "0") { return mockIteratorPKRange0.Object; } return mockIteratorPKRange1.Object; } ChangeFeedEstimatorIterator remainingWorkEstimator = new ChangeFeedEstimatorIterator( Mock.Of<ContainerInternal>(), Mock.Of<ContainerInternal>(), mockContainer.Object, feedCreator, null); long estimation = 0; while (remainingWorkEstimator.HasMoreResults) { FeedResponse<ChangeFeedProcessorState> response = await remainingWorkEstimator.ReadNextAsync(default); estimation += response.Sum(e => e.EstimatedLag); } Assert.AreEqual(expectedTotal, estimation); } [TestMethod] public async Task ShouldReturnEstimationFromLSNWhenResponseContainsItems() { long globalLsnPKRange0 = 10; long processedLsnPKRange0 = 5; long globalLsnPKRange1 = 30; long processedLsnPKRange1 = 15; long expectedTotal = globalLsnPKRange0 - processedLsnPKRange0 + globalLsnPKRange1 - processedLsnPKRange1 + 2; /* 2 because it doesnt take into consideration the current one */ List<DocumentServiceLeaseCore> leases = new List<DocumentServiceLeaseCore>(){ new DocumentServiceLeaseCore() { LeaseToken = "0" }, new DocumentServiceLeaseCore() { LeaseToken = "1" } }; Mock<FeedIterator> mockIteratorPKRange0 = new Mock<FeedIterator>(); mockIteratorPKRange0.Setup(i => i.ReadNextAsync(It.IsAny<CancellationToken>())) .ReturnsAsync(GetResponse(HttpStatusCode.OK, "0:" + globalLsnPKRange0.ToString(), processedLsnPKRange0.ToString())); Mock<FeedIterator> mockIteratorPKRange1 = new Mock<FeedIterator>(); mockIteratorPKRange1.Setup(i => i.ReadNextAsync(It.IsAny<CancellationToken>())) .ReturnsAsync(GetResponse(HttpStatusCode.OK, "1:" + globalLsnPKRange1.ToString(), processedLsnPKRange1.ToString())); Mock<DocumentServiceLeaseContainer> mockContainer = new Mock<DocumentServiceLeaseContainer>(); mockContainer.Setup(c => c.GetAllLeasesAsync()).ReturnsAsync(leases); FeedIterator feedCreator(DocumentServiceLease lease, string continuationToken, bool startFromBeginning) { if (lease.CurrentLeaseToken == "0") { return mockIteratorPKRange0.Object; } return mockIteratorPKRange1.Object; } ChangeFeedEstimatorIterator remainingWorkEstimator = new ChangeFeedEstimatorIterator( Mock.Of<ContainerInternal>(), Mock.Of<ContainerInternal>(), mockContainer.Object, feedCreator, null); long estimation = 0; while (remainingWorkEstimator.HasMoreResults) { FeedResponse<ChangeFeedProcessorState> response = await remainingWorkEstimator.ReadNextAsync(default); estimation += response.Sum(e => e.EstimatedLag); } Assert.AreEqual(expectedTotal, estimation); } [TestMethod] public async Task ShouldReturnAllLeasesInOnePage() { // no max item count await this.ShouldReturnAllLeasesInOnePage(null); // higher max item count await this.ShouldReturnAllLeasesInOnePage(new ChangeFeedEstimatorRequestOptions() { MaxItemCount = 10 }); } private async Task ShouldReturnAllLeasesInOnePage(ChangeFeedEstimatorRequestOptions changeFeedEstimatorRequestOptions) { List<string> ranges = new List<string>() { "0", "1" }; List<DocumentServiceLeaseCore> leases = ranges.Select(pkRangeId => new DocumentServiceLeaseCore() { LeaseToken = pkRangeId }).ToList(); Mock<FeedIterator> mockIterator = new Mock<FeedIterator>(); mockIterator.Setup(i => i.ReadNextAsync(It.IsAny<CancellationToken>())).ReturnsAsync(GetResponse(HttpStatusCode.NotModified, "0:1")); Mock<DocumentServiceLeaseContainer> mockContainer = new Mock<DocumentServiceLeaseContainer>(); mockContainer.Setup(c => c.GetAllLeasesAsync()).ReturnsAsync(leases); FeedIterator feedCreator(DocumentServiceLease lease, string continuationToken, bool startFromBeginning) { return mockIterator.Object; } ChangeFeedEstimatorIterator remainingWorkEstimator = new ChangeFeedEstimatorIterator( Mock.Of<ContainerInternal>(), Mock.Of<ContainerInternal>(), mockContainer.Object, feedCreator, changeFeedEstimatorRequestOptions); FeedResponse<ChangeFeedProcessorState> response = await remainingWorkEstimator.ReadNextAsync(default); Assert.IsFalse(remainingWorkEstimator.HasMoreResults); Assert.AreEqual(ranges.Count, response.Count); } [TestMethod] public async Task ShouldReturnAllLeasesInPages() { const int pageSize = 1; List<string> ranges = new List<string>() { "0", "1" }; List<DocumentServiceLeaseCore> leases = ranges.Select(pkRangeId => new DocumentServiceLeaseCore() { LeaseToken = pkRangeId }).ToList(); Mock<FeedIterator> mockIterator = new Mock<FeedIterator>(); mockIterator.Setup(i => i.ReadNextAsync(It.IsAny<CancellationToken>())).ReturnsAsync(GetResponse(HttpStatusCode.NotModified, "0:1")); Mock<DocumentServiceLeaseContainer> mockContainer = new Mock<DocumentServiceLeaseContainer>(); mockContainer.Setup(c => c.GetAllLeasesAsync()).ReturnsAsync(leases); FeedIterator feedCreator(DocumentServiceLease lease, string continuationToken, bool startFromBeginning) { return mockIterator.Object; } ChangeFeedEstimatorIterator remainingWorkEstimator = new ChangeFeedEstimatorIterator( Mock.Of<ContainerInternal>(), Mock.Of<ContainerInternal>(), mockContainer.Object, feedCreator, new ChangeFeedEstimatorRequestOptions() { MaxItemCount = pageSize }); // Expect multiple pages FeedResponse<ChangeFeedProcessorState> firstResponse = await remainingWorkEstimator.ReadNextAsync(default); Assert.IsTrue(remainingWorkEstimator.HasMoreResults); Assert.AreEqual(pageSize, firstResponse.Count); FeedResponse<ChangeFeedProcessorState> secondResponse = await remainingWorkEstimator.ReadNextAsync(default); Assert.IsFalse(remainingWorkEstimator.HasMoreResults); Assert.AreEqual(pageSize, secondResponse.Count); } [TestMethod] public async Task ShouldAggregateRUAndDiagnostics() { List<string> ranges = new List<string>() { "0", "1" }; List<DocumentServiceLeaseCore> leases = ranges.Select(pkRangeId => new DocumentServiceLeaseCore() { LeaseToken = pkRangeId }).ToList(); Mock<FeedIterator> mockIterator = new Mock<FeedIterator>(); mockIterator.Setup(i => i.ReadNextAsync(It.IsAny<CancellationToken>())).ReturnsAsync(GetResponse(HttpStatusCode.NotModified, "0:1")); Mock<DocumentServiceLeaseContainer> mockContainer = new Mock<DocumentServiceLeaseContainer>(); mockContainer.Setup(c => c.GetAllLeasesAsync()).ReturnsAsync(leases); FeedIterator feedCreator(DocumentServiceLease lease, string continuationToken, bool startFromBeginning) { return mockIterator.Object; } ChangeFeedEstimatorIterator remainingWorkEstimator = new ChangeFeedEstimatorIterator( Mock.Of<ContainerInternal>(), Mock.Of<ContainerInternal>(), mockContainer.Object, feedCreator, null); FeedResponse<ChangeFeedProcessorState> response = await remainingWorkEstimator.ReadNextAsync(default); Assert.AreEqual(2, response.Headers.RequestCharge, "Should contain the sum of all RU charges for each partition read."); // Each request costs 1 RU Assert.AreEqual(2, response.Count, $"Should contain one result per range"); } [TestMethod] public async Task ReportsInstanceNameAndToken() { string instanceName = Guid.NewGuid().ToString(); string leaseToken = Guid.NewGuid().ToString(); List<string> ranges = new List<string>() { leaseToken }; List<DocumentServiceLeaseCore> leases = new List<DocumentServiceLeaseCore>() { new DocumentServiceLeaseCore() { LeaseToken = leaseToken, Owner = instanceName } }; Mock<FeedIterator> mockIterator = new Mock<FeedIterator>(); mockIterator.Setup(i => i.ReadNextAsync(It.IsAny<CancellationToken>())).ReturnsAsync(GetResponse(HttpStatusCode.NotModified, "0:1")); Mock<DocumentServiceLeaseContainer> mockContainer = new Mock<DocumentServiceLeaseContainer>(); mockContainer.Setup(c => c.GetAllLeasesAsync()).ReturnsAsync(leases); FeedIterator feedCreator(DocumentServiceLease lease, string continuationToken, bool startFromBeginning) { return mockIterator.Object; } ChangeFeedEstimatorIterator remainingWorkEstimator = new ChangeFeedEstimatorIterator( Mock.Of<ContainerInternal>(), Mock.Of<ContainerInternal>(), mockContainer.Object, feedCreator, null); FeedResponse<ChangeFeedProcessorState> firstResponse = await remainingWorkEstimator.ReadNextAsync(default); ChangeFeedProcessorState remainingLeaseWork = firstResponse.First(); Assert.AreEqual(instanceName, remainingLeaseWork.InstanceName); Assert.AreEqual(leaseToken, remainingLeaseWork.LeaseToken); } [TestMethod] public void ExtractLsnFromSessionToken_ShouldParseOldSessionToken() { string oldToken = "0:12345"; string expectedLsn = "12345"; Assert.AreEqual(expectedLsn, ChangeFeedEstimatorIterator.ExtractLsnFromSessionToken(oldToken)); } [TestMethod] public void ExtractLsnFromSessionToken_ShouldParseNewSessionToken() { string newToken = "0:-1#12345"; string expectedLsn = "12345"; Assert.AreEqual(expectedLsn, ChangeFeedEstimatorIterator.ExtractLsnFromSessionToken(newToken)); } [TestMethod] public void ExtractLsnFromSessionToken_ShouldParseNewSessionTokenWithMultipleRegionalLsn() { string newTokenWithRegionalLsn = "0:-1#12345#Region1=1#Region2=2"; string expectedLsn = "12345"; Assert.AreEqual(expectedLsn, ChangeFeedEstimatorIterator.ExtractLsnFromSessionToken(newTokenWithRegionalLsn)); } private static ResponseMessage GetResponse(HttpStatusCode statusCode, string localLsn, string itemLsn = null) { ResponseMessage message = new ResponseMessage(statusCode); message.Headers.Add(Documents.HttpConstants.HttpHeaders.SessionToken, localLsn); message.Headers.Add(Documents.HttpConstants.HttpHeaders.RequestCharge, "1"); message.DiagnosticsContext.AddDiagnosticsInternal(new Diagnostics.PointOperationStatistics(Guid.NewGuid().ToString(), statusCode, Documents.SubStatusCodes.Unknown, DateTime.UtcNow, 1, "", HttpMethod.Post, "https://localhost", localLsn, localLsn)); if (!string.IsNullOrEmpty(itemLsn)) { JObject firstDocument = new JObject { ["_lsn"] = itemLsn }; message.Content = new CosmosJsonDotNetSerializer().ToStream( new { Documents = new List<JObject>() { firstDocument } }); } return message; } } }
44.303523
259
0.62711
[ "MIT" ]
ConnectionMaster/azure-cosmos-dotnet-v3
Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedEstimatorIteratorTests.cs
16,350
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 BenchmarkDotNet.Attributes; using Microsoft.ML.Runtime; using Microsoft.ML.Runtime.Data; using Microsoft.ML.Runtime.Internal.Calibration; using Microsoft.ML.Runtime.Learners; using Microsoft.ML.Trainers.KMeans; using Microsoft.ML.Transforms; using Microsoft.ML.Transforms.Categorical; using Microsoft.ML.Transforms.Normalizers; namespace Microsoft.ML.Benchmarks { public class KMeansAndLogisticRegressionBench { private readonly string _dataPath = Program.GetInvariantCultureDataPath("adult.train"); [Benchmark] public ParameterMixingCalibratedPredictor TrainKMeansAndLR() { using (var env = new ConsoleEnvironment(seed: 1)) { // Pipeline var loader = TextLoader.ReadFile(env, new TextLoader.Arguments() { HasHeader = true, Separator = ",", Column = new[] { new TextLoader.Column("Label", DataKind.R4, 14), new TextLoader.Column("CatFeatures", DataKind.TX, new [] { new TextLoader.Range() { Min = 1, Max = 1 }, new TextLoader.Range() { Min = 3, Max = 3 }, new TextLoader.Range() { Min = 5, Max = 9 }, new TextLoader.Range() { Min = 13, Max = 13 } }), new TextLoader.Column("NumFeatures", DataKind.R4, new [] { new TextLoader.Range() { Min = 0, Max = 0 }, new TextLoader.Range() { Min = 2, Max = 2 }, new TextLoader.Range() { Min = 4, Max = 4 }, new TextLoader.Range() { Min = 10, Max = 12 } }) } }, new MultiFileSource(_dataPath)); IDataView trans = new OneHotEncodingEstimator(env, "CatFeatures").Fit(loader).Transform(loader); trans = NormalizeTransform.CreateMinMaxNormalizer(env, trans, "NumFeatures"); trans = new ConcatTransform(env, "Features", "NumFeatures", "CatFeatures").Transform(trans); trans = TrainAndScoreTransform.Create(env, new TrainAndScoreTransform.Arguments { Trainer = ComponentFactoryUtils.CreateFromFunction(host => new KMeansPlusPlusTrainer(host, "Features", advancedSettings: s=> { s.K = 100; })), FeatureColumn = "Features" }, trans); trans = new ConcatTransform(env, "Features", "Features", "Score").Transform(trans); // Train var trainer = new LogisticRegression(env, "Label", "Features", advancedSettings: args => { args.EnforceNonNegativity = true; args.OptTol = 1e-3f; }); var trainRoles = new RoleMappedData(trans, label: "Label", feature: "Features"); return trainer.Train(trainRoles); } } } }
48.452055
165
0.514278
[ "MIT" ]
Caraul/machinelearning
test/Microsoft.ML.Benchmarks/KMeansAndLogisticRegressionBench.cs
3,539
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.AppPlatform.V20200701.Outputs { [OutputType] public sealed class BindingResourcePropertiesResponse { /// <summary> /// Binding parameters of the Binding resource /// </summary> public readonly ImmutableDictionary<string, object>? BindingParameters; /// <summary> /// Creation time of the Binding resource /// </summary> public readonly string CreatedAt; /// <summary> /// The generated Spring Boot property file for this binding. The secret will be deducted. /// </summary> public readonly string GeneratedProperties; /// <summary> /// The key of the bound resource /// </summary> public readonly string? Key; /// <summary> /// The Azure resource id of the bound resource /// </summary> public readonly string? ResourceId; /// <summary> /// The name of the bound resource /// </summary> public readonly string ResourceName; /// <summary> /// The standard Azure resource type of the bound resource /// </summary> public readonly string ResourceType; /// <summary> /// Update time of the Binding resource /// </summary> public readonly string UpdatedAt; [OutputConstructor] private BindingResourcePropertiesResponse( ImmutableDictionary<string, object>? bindingParameters, string createdAt, string generatedProperties, string? key, string? resourceId, string resourceName, string resourceType, string updatedAt) { BindingParameters = bindingParameters; CreatedAt = createdAt; GeneratedProperties = generatedProperties; Key = key; ResourceId = resourceId; ResourceName = resourceName; ResourceType = resourceType; UpdatedAt = updatedAt; } } }
30.423077
98
0.602613
[ "Apache-2.0" ]
pulumi-bot/pulumi-azure-native
sdk/dotnet/AppPlatform/V20200701/Outputs/BindingResourcePropertiesResponse.cs
2,373
C#
// ------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. // ------------------------------------------------------------------------------ // **NOTE** This file was generated by a tool and any changes will be overwritten. // Template Source: Templates\CSharp\Model\EnumType.cs.tt namespace Microsoft.Graph { using Newtonsoft.Json; /// <summary> /// The enum SelectionLikelihoodInfo. /// </summary> [JsonConverter(typeof(EnumConverter))] public enum SelectionLikelihoodInfo { /// <summary> /// not Specified /// </summary> NotSpecified = 0, /// <summary> /// high /// </summary> High = 1, } }
26.69697
153
0.499432
[ "MIT" ]
AzureMentor/msgraph-sdk-dotnet
src/Microsoft.Graph/Models/Generated/SelectionLikelihoodInfo.cs
881
C#
using OfficeOpenXml; using OfficeOpenXml.Style; using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Net.Http.Formatting; using System.Net.Http.Headers; using System.Security.Permissions; using System.Threading.Tasks; using ContentDispositionHeaderValue = System.Net.Http.Headers.ContentDispositionHeaderValue; using MediaTypeHeaderValue = System.Net.Http.Headers.MediaTypeHeaderValue; using util = WebApiContrib.Formatting.Xlsx.FormatterUtils; namespace WebApiContrib.Formatting.Xlsx { /// <summary> /// Class used to send an Excel file to the response. /// </summary> public class XlsxMediaTypeFormatter : MediaTypeFormatter { public override void SetDefaultContentHeaders(Type type, HttpContentHeaders headers, MediaTypeHeaderValue mediaType) { string fileName; // Look for ExcelDocumentAttribute on class. var itemType = util.GetEnumerableItemType(type); var excelDocumentAttribute = util.GetAttribute<ExcelDocumentAttribute>(itemType ?? type); if (excelDocumentAttribute != null && !string.IsNullOrEmpty(excelDocumentAttribute.FileName)) { // If attribute exists with file name defined, use that. fileName = excelDocumentAttribute.FileName; } else { // Otherwise, use "data". fileName = "data"; } // Add XLSX extension if not present. if (!fileName.EndsWith("xlsx", StringComparison.CurrentCultureIgnoreCase)) { fileName += ".xlsx"; } // Set content disposition to use this file name. headers.ContentDisposition = new ContentDispositionHeaderValue("inline") { FileName = fileName }; base.SetDefaultContentHeaders(type, headers, mediaType); } /// <summary> /// An action method that can be used to set the default cell style. /// </summary> protected Action<ExcelStyle> CellStyle { get; set; } /// <summary> /// An action method that can be used to set the default header row style. /// </summary> protected Action<ExcelStyle> HeaderStyle { get; set; } /// <summary> /// True if columns should be auto-fit to the cell contents after writing. /// </summary> protected bool AutoFit { get; set; } /// <summary> /// True if an auto-filter should be enabled for the data. /// </summary> protected bool AutoFilter { get; set; } /// <summary> /// True if the header row should be frozen. /// </summary> protected bool FreezeHeader { get; set; } /// <summary> /// Height for header row. (Default if null.) /// </summary> protected double? HeaderHeight { get; set; } /// <summary> /// Create a new ExcelMediaTypeFormatter. /// </summary> /// <param name="autoFit">True if the formatter should autofit columns after writing the data. (Default true.)</param> /// <param name="autoFilter">True if an autofilter should be applied to the worksheet. (Default false.)</param> /// <param name="freezeHeader">True if the header row should be frozen. (Default false.)</param> /// <param name="headerHeight">Height of the header row.</param> /// <param name="cellStyle">An action method that modifies the worksheet cell style.</param> /// <param name="headerStyle">An action method that modifies the cell style of the first (header) row in the worksheet.</param> public XlsxMediaTypeFormatter(bool autoFit = true, bool autoFilter = false, bool freezeHeader = false, double? headerHeight = null, Action<ExcelStyle> cellStyle = null, Action<ExcelStyle> headerStyle = null) { SupportedMediaTypes.Clear(); SupportedMediaTypes.Add(new MediaTypeHeaderValue("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")); SupportedMediaTypes.Add(new MediaTypeHeaderValue("application/vnd.ms-excel")); AutoFit = autoFit; AutoFilter = autoFilter; FreezeHeader = freezeHeader; HeaderHeight = headerHeight; CellStyle = cellStyle; HeaderStyle = headerStyle; } [SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)] public override Task WriteToStreamAsync(Type type, object value, System.IO.Stream writeStream, System.Net.Http.HttpContent content, System.Net.TransportContext transportContext) { // Create a worksheet var package = new ExcelPackage(); package.Workbook.Worksheets.Add("Data"); var worksheet = package.Workbook.Worksheets[1]; int rowCount = 0; var valueType = value.GetType(); // Apply cell styles. CellStyle?.Invoke(worksheet.Cells.Style); // Get the item type. var itemType = (util.IsSimpleType(valueType)) ? null : util.GetEnumerableItemType(valueType); // If a single object was passed, treat it like a list with one value. if (itemType == null) { itemType = valueType; value = new[] { value }; } // Enumerations of primitive types are also handled separately, since they have // no properties to serialise (and thus, no headers or attributes to consider). if (util.IsSimpleType(itemType)) { // Can't convert IEnumerable<primitive> to IEnumerable<object> var values = (IEnumerable)value; foreach (var val in values) { AppendRow(new[] { val }, worksheet, ref rowCount); } // Autofit cells if specified. if (AutoFit) worksheet.Cells[worksheet.Dimension.Address].AutoFitColumns(); // Save and done. return Task.Factory.StartNew(() => package.SaveAs(writeStream)); } // What remains is an enumeration of object types. var serialisableMembers = util.GetMemberNames(itemType); var properties = (from p in itemType.GetProperties() where p.CanRead & p.GetGetMethod().IsPublic & p.GetGetMethod().GetParameters().Length == 0 select p).ToList(); var fields = new List<string>(); var fieldInfo = new ExcelFieldInfoCollection(); // Instantiate field names and fieldInfo lists with serialisable members. foreach (var field in serialisableMembers) { var propName = field; var prop = properties.FirstOrDefault(p => p.Name == propName); if (prop == null) continue; fields.Add(field); fieldInfo.Add(new ExcelFieldInfo(field, util.GetAttribute<ExcelColumnAttribute>(prop))); } var props = itemType.GetProperties().ToList(); foreach (var prop in props) { var attributes = prop.GetCustomAttributes(true); foreach (var attribute in attributes) { var propertyName = prop.Name; if (!fieldInfo.Contains(propertyName)) { continue; } string displayFormatString = null; var displayFormatAttribute = (DisplayFormatAttribute)prop.GetCustomAttributes(typeof(DisplayFormatAttribute), true).FirstOrDefault(); if (displayFormatAttribute != null) { displayFormatString = displayFormatAttribute.DataFormatString; } string displayName = null; var displayNameAttribute = (DisplayNameAttribute)prop.GetCustomAttributes(typeof(DisplayNameAttribute), true).FirstOrDefault(); if (displayNameAttribute != null) { displayName = displayNameAttribute.DisplayName; } var field = fieldInfo[propertyName]; if (!field.IsExcelHeaderDefined) { field.Header = propertyName; } if (!field.IsExcelHeaderDefined) { field.Header = displayName ?? propertyName; } var excelAttribute = attribute as ExcelColumnAttribute; if (excelAttribute != null && excelAttribute.UseDisplayFormatString) { field.FormatString = displayFormatString; } } } if (fields.Count == 0) { return Task.Factory.StartNew(() => package.SaveAs(writeStream)); } // Add header row AppendRow((from f in fieldInfo select f.Header).ToList(), worksheet, ref rowCount); var data = value as IEnumerable<object>; // Output each row of data if (data?.FirstOrDefault() != null) { foreach (var dataObject in data) { var row = new List<object>(); for (int i = 0; i <= fields.Count - 1; i++) { var cellValue = GetFieldOrPropertyValue(dataObject, fields[i]); var info = fieldInfo[i]; // Boolean transformations. if (info.ExcelAttribute != null && info.ExcelAttribute.TrueValue != null && cellValue.Equals("True")) row.Add(info.ExcelAttribute.TrueValue); else if (info.ExcelAttribute != null && info.ExcelAttribute.FalseValue != null && cellValue.Equals("False")) row.Add(info.ExcelAttribute.FalseValue); else if (!string.IsNullOrWhiteSpace(info.FormatString) & string.IsNullOrEmpty(info.ExcelNumberFormat)) row.Add(string.Format(info.FormatString, cellValue)); else row.Add(cellValue); } AppendRow(row.ToArray(), worksheet, ref rowCount); } } // Enforce any attributes on columns. for (int i = 1; i <= fields.Count; i++) { if (!string.IsNullOrEmpty(fieldInfo[i - 1].ExcelNumberFormat)) { worksheet.Cells[2, i, rowCount, i].Style.Numberformat.Format = fieldInfo[i - 1].ExcelNumberFormat; } } // Header cell styles HeaderStyle?.Invoke(worksheet.Row(1).Style); if (FreezeHeader) { worksheet.View.FreezePanes(2, 1); } var cells = worksheet.Cells[worksheet.Dimension.Address]; // Add autofilter and fit to max column width (if requested). if (AutoFilter) { cells.AutoFilter = AutoFilter; } if (AutoFit) { cells.AutoFitColumns(); } // Set header row where specified. if (HeaderHeight.HasValue) { worksheet.Row(1).Height = HeaderHeight.Value; worksheet.Row(1).CustomHeight = true; } return Task.Factory.StartNew(() => package.SaveAs(writeStream)); } /// <summary> /// Get a property value from an object. /// </summary> /// <param name="rowObject">The object whose property we want.</param> /// <param name="name">The name of the property we want.</param> private static object GetFieldOrPropertyValue(object rowObject, string name) { var rowValue = util.GetFieldOrPropertyValue(rowObject, name); if (IsExcelSupportedType(rowValue)) { return rowValue; } return rowValue == null || DBNull.Value.Equals(rowValue) ? string.Empty : rowValue.ToString(); } public static bool IsExcelSupportedType(object expression) { return expression is string || expression is short || expression is int || expression is long || expression is decimal || expression is float || expression is double || expression is DateTime; } /// <summary> /// Append a row to the <c>StringBuilder</c> containing the CSV data. /// </summary> /// <param name="row">The row to append to this instance.</param> /// <param name="worksheet">The worksheet to append this row to.</param> /// <param name="rowCount">The number of rows appended so far.</param> private static void AppendRow(IEnumerable<object> row, ExcelWorksheet worksheet, ref int rowCount) { rowCount++; var enumerable = row as IList<object> ?? row.ToList(); for (var i = 1; i <= enumerable.Count(); i++) { // Unary-based indexes should not mix with zero-based. :( worksheet.Cells[rowCount, i].Value = enumerable.ElementAt(i - 1); } } public override bool CanWriteType(Type type) { // Should be able to serialise any type. return true; } public override bool CanReadType(Type type) { // Not yet possible; see issue page to track progress: // https://github.com/jordangray/xlsx-for-web-api/issues/5 return false; } } }
39.732044
215
0.552597
[ "MIT" ]
bmeredith/WebApiContrib.Formatting.Xlsx
src/WebApiContrib.Formatting.Xlsx.NetStandard/XlsxMediaTypeFormatter.cs
14,385
C#
using DelonixRegiaHMS.Models; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace DelonixRegiaHMS.Manage { public partial class Room_Type_Add : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { btnSubmit.ServerClick += new EventHandler(btnSubmit_ServerClick); if (!Page.IsPostBack) { } } protected void btnSubmit_ServerClick(object sender, EventArgs e) { RoomType roomType = new RoomType(); try { // Second layer of validation. if (!string.IsNullOrEmpty(tbxRoomType.Value) && !string.IsNullOrEmpty(tbxRoomRate.Value)) { roomType.Type = tbxRoomType.Value; roomType.Rate = Double.Parse(tbxRoomRate.Value); if (new RoomBookingDbManager().AddRoomType(roomType)) { alertSuccess.Visible = true; alertError.Visible = false; } } else { lblMessage.InnerText = "Unable to save this record!"; alertError.Visible = true; alertSuccess.Visible = false; } } catch (Exception ex) { lblMessage.InnerText = "Unable to save this record!"; alertError.Visible = true; alertSuccess.Visible = false; } } } }
26.652174
68
0.700653
[ "MIT" ]
JiaJian/swen
DelonixRegia/DelonixRegiaHMS/Manage/Room_Type_Add.aspx.cs
1,228
C#
/** * Copyright 2013 Canada Health Infoway, Inc. * * 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. * * Author: $LastChangedBy: gng $ * Last modified: $LastChangedDate: 2015-11-19 18:20:12 -0500 (Fri, 30 Jan 2015) $ * Revision: $LastChangedRevision: 9755 $ */ using Ca.Infoway.Messagebuilder; using Ca.Infoway.Messagebuilder.Domainvalue.Util; using Ca.Infoway.Messagebuilder.Lang; namespace Ca.Infoway.Messagebuilder.Domainvalue.Payload { /// <summary>The Enum TopicPriority.</summary> /// <remarks>The Enum TopicPriority.</remarks> [System.Serializable] public class TopicPriority : EnumPattern, Ca.Infoway.Messagebuilder.Domainvalue.TopicPriority, Describable { static TopicPriority() { } private const long serialVersionUID = 4476190535780761850L; public static readonly Ca.Infoway.Messagebuilder.Domainvalue.Payload.TopicPriority NL_MANDATORY = new Ca.Infoway.Messagebuilder.Domainvalue.Payload.TopicPriority ("NL_MANDATORY", "NL_MAND"); public static readonly Ca.Infoway.Messagebuilder.Domainvalue.Payload.TopicPriority GROUP_MANDATORY = new Ca.Infoway.Messagebuilder.Domainvalue.Payload.TopicPriority ("GROUP_MANDATORY", "GROUP_MAND"); public static readonly Ca.Infoway.Messagebuilder.Domainvalue.Payload.TopicPriority OPTIONAL = new Ca.Infoway.Messagebuilder.Domainvalue.Payload.TopicPriority ("OPTIONAL", "OPTIONAL"); private readonly string codeValue; private TopicPriority(string name, string codeValue) : base(name) { this.codeValue = codeValue; } /// <summary><inheritDoc></inheritDoc></summary> public virtual string CodeSystem { get { return Ca.Infoway.Messagebuilder.Codesystem.CodeSystem.TOPIC_PRIORITY.Root; } } /// <summary><inheritDoc></inheritDoc></summary> public virtual string CodeSystemName { get { return null; } } /// <summary><inheritDoc></inheritDoc></summary> public virtual string CodeValue { get { return this.codeValue; } } /// <summary><inheritDoc></inheritDoc></summary> public virtual string Description { get { return DescribableUtil.GetDefaultDescription(this); } } } }
30.032609
167
0.711907
[ "ECL-2.0", "Apache-2.0" ]
CanadaHealthInfoway/message-builder-dotnet
message-builder-core/Main/Ca/Infoway/Messagebuilder/Domainvalue/Payload/TopicPriority.cs
2,763
C#
using Microsoft.VisualStudio.TestTools.UnitTesting; using Newtonsoft.Json; using stellar_dotnet_sdk; using stellar_dotnet_sdk.responses; using stellar_dotnet_sdk.responses.operations; using System; using System.Collections.Generic; using System.IO; using System.Text; namespace stellar_dotnet_sdk_test.responses.operations { public class CreatePassiveOfferOperationResponseTest { [TestMethod] public void TestDeserializeCreatePassiveOfferOperation() { var json = File.ReadAllText(Path.Combine("testdata/operations/createPassiveOffer", "createPassiveOffer.json")); var instance = JsonSingleton.GetInstance<OperationResponse>(json); AssertCreatePassiveOfferData(instance); } [TestMethod] public void TestSerializeDeserializeCreatePassiveOfferOperation() { var json = File.ReadAllText(Path.Combine("testdata/operations/createPassiveOffer", "createPassiveOffer.json")); var instance = JsonSingleton.GetInstance<OperationResponse>(json); var serialized = JsonConvert.SerializeObject(instance); var back = JsonConvert.DeserializeObject<OperationResponse>(serialized); AssertCreatePassiveOfferData(back); } private static void AssertCreatePassiveOfferData(OperationResponse instance) { Assert.IsTrue(instance is CreatePassiveOfferOperationResponse); var operation = (CreatePassiveOfferOperationResponse)instance; Assert.AreEqual(operation.Amount, "11.27827"); Assert.AreEqual(operation.BuyingAsset, Asset.CreateNonNativeAsset("USD", "GDS5JW5E6DRSSN5XK4LW7E6VUMFKKE2HU5WCOVFTO7P2RP7OXVCBLJ3Y")); Assert.AreEqual(operation.SellingAsset, new AssetTypeNative()); } } }
39.586957
146
0.727073
[ "Apache-2.0" ]
mootz12/dotnet-stellar-sdk
stellar-dotnet-sdk-test/responses/operations/CreatePassiveOfferOperationResponseTest.cs
1,823
C#
using System; using System.Collections.Generic; using System.Reflection; using Android.Views; using AoLibs.Navigation.Android.Navigation.Attributes; using AoLibs.Navigation.Core; using AoLibs.Navigation.Core.Interfaces; using AoLibs.Navigation.Core.PageProviders; using FragmentManager = Android.Support.V4.App.FragmentManager; using FragmentTransaction = Android.Support.V4.App.FragmentTransaction; namespace AoLibs.Navigation.Android.Navigation { /// <summary> /// Class that fulfills the purpose of executing actual navigation transactions. /// </summary> /// <typeparam name="TPageIdentifier">Page enum type.</typeparam> public class NavigationManager<TPageIdentifier> : NavigationManagerBase<NavigationFragmentBase, TPageIdentifier> { private readonly FragmentManager _fragmentManager; private readonly ViewGroup _rootFrame; private readonly Action<FragmentTransaction> _interceptTransaction; /// <summary> /// Gets or sets a value indicating whether failed navigation should throw an exception. /// </summary> public bool ThrowOnNavigationException { get; set; } = true; /// <summary> /// Initializes a new instance of the <see cref="NavigationManager{TPageIdentifier}"/> class. /// </summary> /// <param name="fragmentManager">Fragment manager of main activity.</param> /// <param name="rootFrame">The view which will be used as the one being replaced with new Views</param> /// <param name="pageDefinitions">The dictionary defining pages.</param> /// <param name="viewModelResolver">Class used to resolve ViewModels for pages derived from <see cref="FragmentBase{TViewModel}"/></param> /// <param name="stackResolver">Class allowing to differentiate to which stack given indentigier belongs.</param> /// <param name="interceptTransaction">Delegate allowing to modify <see cref="FragmentTransaction"/> before commiting.</param> public NavigationManager( FragmentManager fragmentManager, ViewGroup rootFrame, Dictionary<TPageIdentifier, IPageProvider<NavigationFragmentBase>> pageDefinitions, IViewModelResolver viewModelResolver = null, IStackResolver<NavigationFragmentBase, TPageIdentifier> stackResolver = null, Action<FragmentTransaction> interceptTransaction = null) : base(pageDefinitions, stackResolver) { _fragmentManager = fragmentManager; _rootFrame = rootFrame; _interceptTransaction = interceptTransaction; NavigationFragmentBase.ViewModelResolver = viewModelResolver; } /// <summary> /// Initializes a new instance of the <see cref="NavigationManager{TPageIdentifier}"/> class. /// To gather page definitions it searches for classes marked with <see cref="NavigationPageAttribute"/> from <see cref="Assembly.GetCallingAssembly"/> /// </summary> /// <param name="fragmentManager">Fragment manager of main activity.</param> /// <param name="rootFrame">The view which will be used as the one being replaced with new Views</param> /// <param name="viewModelResolver">Class used to resolve ViewModels for pages derived from <see cref="FragmentBase{TViewModel}"/></param> /// <param name="stackResolver">Class allowing to differentiate to which stack given indentigier belongs.</param> /// <param name="interceptTransaction">Delegate allowing to modify <see cref="FragmentTransaction"/> before commiting.</param> public NavigationManager( FragmentManager fragmentManager, ViewGroup rootFrame, IViewModelResolver viewModelResolver = null, IStackResolver<NavigationFragmentBase, TPageIdentifier> stackResolver = null, Action<FragmentTransaction> interceptTransaction = null) : base(stackResolver) { _fragmentManager = fragmentManager; _rootFrame = rootFrame; _interceptTransaction = interceptTransaction; NavigationFragmentBase.ViewModelResolver = viewModelResolver; var types = Assembly.GetCallingAssembly().GetTypes(); foreach (var type in types) { var attr = type.GetTypeInfo().GetCustomAttribute<NavigationPageAttribute>(); if (attr != null) { IPageProvider<NavigationFragmentBase> provider = null; switch (attr.PageProviderType) { case NavigationPageAttribute.PageProvider.Cached: provider = ObtainProviderFromType(typeof(CachedPageProvider<>)); break; case NavigationPageAttribute.PageProvider.Oneshot: provider = ObtainProviderFromType(typeof(OneshotPageProvider<>)); break; default: throw new ArgumentOutOfRangeException(); } PageDefinitions.Add((TPageIdentifier)(object)attr.Page, provider); } IPageProvider<NavigationFragmentBase> ObtainProviderFromType(Type providerType) { return (IPageProvider<NavigationFragmentBase>)providerType.MakeGenericType(type) .GetConstructor(new Type[] { }) .Invoke(null); } } foreach (var pageDefinition in PageDefinitions) { pageDefinition.Value.PageIdentifier = pageDefinition.Key; } } public override void CommitPageTransaction(NavigationFragmentBase page) { try { var transaction = _fragmentManager.BeginTransaction(); _interceptTransaction?.Invoke(transaction); transaction.Replace(_rootFrame.Id, page) .DisallowAddToBackStack(); transaction.CommitNowAllowingStateLoss(); _fragmentManager.ExecutePendingTransactions(); } catch (Exception e) { Console.WriteLine($"There was an issue navigating to idndicated page, please ensure everyhting is set-up correctly. Exception: {e}"); if (ThrowOnNavigationException) throw e; } } } }
48.669118
159
0.633177
[ "MIT" ]
mmaasstteerr/AoLibs
AoLibs.Navigation.Android/Navigation/NavigationManager.cs
6,621
C#
#if NET6_0 using DiffEngine; public class DiffRunnerTests : XunitContextBase { static ResolvedTool tool; string file2; string file1; string command; [Fact(Skip = "Explicit")] public async Task MaxInstancesToLaunch() { DiffRunner.MaxInstancesToLaunch(1); try { await Task.Delay(500); ProcessCleanup.Refresh(); var result = DiffRunner.Launch(file1, "fake.txt"); await Task.Delay(300); Assert.Equal(LaunchResult.StartedNewInstance, result); ProcessCleanup.Refresh(); result = DiffRunner.Launch(file2, "fake.txt"); Assert.Equal(LaunchResult.TooManyRunningDiffTools, result); ProcessCleanup.Refresh(); DiffRunner.Kill(file1, "fake.txt"); DiffRunner.Kill(file2, "fake.txt"); } finally { DiffRunner.MaxInstancesToLaunch(5); } } [Fact(Skip = "Explicit")] public async Task MaxInstancesToLaunchAsync() { DiffRunner.MaxInstancesToLaunch(1); try { await Task.Delay(500); ProcessCleanup.Refresh(); var result = await DiffRunner.LaunchAsync(file1, "fake.txt"); await Task.Delay(300); Assert.Equal(LaunchResult.StartedNewInstance, result); ProcessCleanup.Refresh(); result = await DiffRunner.LaunchAsync(file2, "fake.txt"); Assert.Equal(LaunchResult.TooManyRunningDiffTools, result); ProcessCleanup.Refresh(); DiffRunner.Kill(file1, "fake.txt"); DiffRunner.Kill(file2, "fake.txt"); } finally { DiffRunner.MaxInstancesToLaunch(5); } } async Task Launch() { var targetFile = ""; var tempFile = ""; #region DiffRunnerLaunch await DiffRunner.LaunchAsync(tempFile, targetFile); #endregion } [Fact(Skip = "Explicit")] public async Task KillAsync() { await DiffRunner.LaunchAsync(file1, file2); ProcessCleanup.Refresh(); #region DiffRunnerKill DiffRunner.Kill(file1, file2); #endregion } [Fact] public void LaunchAndKillDisabled() { DiffRunner.Disabled = true; try { Assert.False(IsRunning()); Assert.False(ProcessCleanup.IsRunning(command)); var result = DiffRunner.Launch(file1, file2); Assert.Equal(LaunchResult.Disabled, result); Thread.Sleep(500); ProcessCleanup.Refresh(); Assert.False(IsRunning()); Assert.False(ProcessCleanup.IsRunning(command)); DiffRunner.Kill(file1, file2); Thread.Sleep(500); ProcessCleanup.Refresh(); Assert.False(IsRunning()); Assert.False(ProcessCleanup.IsRunning(command)); } finally { DiffRunner.Disabled = false; } } [Fact] public async Task LaunchAndKillDisabledAsync() { DiffRunner.Disabled = true; try { Assert.False(IsRunning()); Assert.False(ProcessCleanup.IsRunning(command)); var result = await DiffRunner.LaunchAsync(file1, file2); Assert.Equal(LaunchResult.Disabled, result); Thread.Sleep(500); ProcessCleanup.Refresh(); Assert.False(IsRunning()); Assert.False(ProcessCleanup.IsRunning(command)); DiffRunner.Kill(file1, file2); Thread.Sleep(500); ProcessCleanup.Refresh(); Assert.False(IsRunning()); Assert.False(ProcessCleanup.IsRunning(command)); } finally { DiffRunner.Disabled = false; } } [Fact] public void LaunchAndKill() { Assert.False(IsRunning()); Assert.False(ProcessCleanup.IsRunning(command)); var result = DiffRunner.Launch(file1, file2); Assert.Equal(LaunchResult.StartedNewInstance, result); Thread.Sleep(500); ProcessCleanup.Refresh(); Assert.True(IsRunning()); Assert.True(ProcessCleanup.IsRunning(command)); DiffRunner.Kill(file1, file2); Thread.Sleep(500); ProcessCleanup.Refresh(); Assert.False(IsRunning()); Assert.False(ProcessCleanup.IsRunning(command)); } [Fact] public async Task LaunchAndKillAsync() { Assert.False(IsRunning()); Assert.False(ProcessCleanup.IsRunning(command)); var result = await DiffRunner.LaunchAsync(file1, file2); Assert.Equal(LaunchResult.StartedNewInstance, result); Thread.Sleep(500); ProcessCleanup.Refresh(); Assert.True(IsRunning()); Assert.True(ProcessCleanup.IsRunning(command)); DiffRunner.Kill(file1, file2); Thread.Sleep(500); ProcessCleanup.Refresh(); Assert.False(IsRunning()); Assert.False(ProcessCleanup.IsRunning(command)); } static bool IsRunning() { return ProcessCleanup .FindAll() .Any(x => x.Command.Contains("FakeDiffTool")); } public DiffRunnerTests(ITestOutputHelper output) : base(output) { file1 = Path.Combine(SourceDirectory, "DiffRunner.file1.txt"); file2 = Path.Combine(SourceDirectory, "DiffRunner.file2.txt"); command = tool.BuildCommand(file1, file2); } static DiffRunnerTests() { tool = DiffTools.AddTool( name: "FakeDiffTool", autoRefresh: true, isMdi: false, supportsText: true, requiresTarget: true, targetRightArguments: (tempFile, targetFile) => $"\"{tempFile}\" \"{targetFile}\"", targetLeftArguments: (tempFile, targetFile) => $"\"{targetFile}\" \"{tempFile}\"", exePath: FakeDiffTool.Exe, binaryExtensions: new[] {"knownBin"})!; } } #endif
31.029703
96
0.56238
[ "MIT" ]
GitHubPang/DiffEngine
src/DiffEngine.Tests/DiffRunnerTests.cs
6,069
C#
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. using System; using NUnit.Framework; namespace Azure.Messaging.EventHubs.Tests { /// <summary> /// The suite of tests for the <see cref="EventProcessorClientOptions" /> /// class. /// </summary> /// [TestFixture] public class EventProcessorClientOptionsTests { /// <summary> /// Verifies functionality of the <see cref="EventProcessorClientOptions.Clone" /> /// method. /// </summary> /// [Test] public void CloneProducesACopy() { var options = new EventProcessorClientOptions { MaximumReceiveWaitTime = TimeSpan.FromMinutes(65), TrackLastEnqueuedEventProperties = false, RetryOptions = new EventHubsRetryOptions { TryTimeout = TimeSpan.FromMinutes(1), Delay = TimeSpan.FromMinutes(4) }, ConnectionOptions = new EventHubConnectionOptions { TransportType = EventHubsTransportType.AmqpWebSockets } }; EventProcessorClientOptions clone = options.Clone(); Assert.That(clone, Is.Not.Null, "The clone should not be null."); Assert.That(clone, Is.Not.SameAs(options), "The clone should be a different instance."); Assert.That(clone.MaximumReceiveWaitTime, Is.EqualTo(options.MaximumReceiveWaitTime), "The maximum receive wait time of the clone should match."); Assert.That(clone.TrackLastEnqueuedEventProperties, Is.EqualTo(options.TrackLastEnqueuedEventProperties), "The tracking of last event information of the clone should match."); Assert.That(clone.ConnectionOptions.TransportType, Is.EqualTo(options.ConnectionOptions.TransportType), "The connection options of the clone should copy properties."); Assert.That(clone.ConnectionOptions, Is.Not.SameAs(options.ConnectionOptions), "The connection options of the clone should be a copy, not the same instance."); Assert.That(clone.RetryOptions.IsEquivalentTo(options.RetryOptions), Is.True, "The retry options of the clone should be considered equal."); Assert.That(clone.RetryOptions, Is.Not.SameAs(options.RetryOptions), "The retry options of the clone should be a copy, not the same instance."); } /// <summary> /// Verifies that setting the <see cref="EventProcessorClientOptions.MaximumReceiveWaitTime" /> is /// validated. /// </summary> /// [Test] [TestCase(-1)] [TestCase(-100)] [TestCase(-1000)] [TestCase(-10000)] public void MaximumReceiveWaitTimeIsValidated(int timeSpanDelta) { var options = new EventProcessorClientOptions(); Assert.That(() => options.MaximumReceiveWaitTime = TimeSpan.FromMilliseconds(timeSpanDelta), Throws.InstanceOf<ArgumentOutOfRangeException>()); } /// <summary> /// Verifies functionality of the <see cref="EventProcessorClientOptions.MaximumReceiveWaitTime" /> /// method. /// </summary> /// [Test] public void MaximumReceiveWaitTimeAllowsNull() { var options = new EventProcessorClientOptions(); Assert.That(() => options.MaximumReceiveWaitTime = null, Throws.Nothing); } /// <summary> /// Verifies functionality of the <see cref="EventProcessorClientOptions.ConnectionOptions" /> /// property. /// </summary> /// [Test] public void ConnectionOptionsAreValidated() { Assert.That(() => new EventProcessorClientOptions { ConnectionOptions = null }, Throws.ArgumentNullException); } /// <summary> /// Verifies functionality of the <see cref="EventProcessorClientOptions.RetryOptions" /> /// property. /// </summary> /// [Test] public void RetryOptionsAreValidated() { Assert.That(() => new EventProcessorClientOptions { RetryOptions = null }, Throws.ArgumentNullException); } } }
43.71875
187
0.636883
[ "MIT" ]
amitmag-ms/azure-sdk-for-net
sdk/eventhub/Azure.Messaging.EventHubs/tests/EventProcessorClient/EventProcessorClientOptionsTests.cs
4,199
C#
using Cinema.DAL.Abstract.IRepositoryBases; using Cinema.Entity.Concrete; using Framework.Core.DAL; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Data.Entity; using System.Linq; using System.Linq.Expressions; using System.Text; using System.Threading.Tasks; using System.Web.Script.Serialization; namespace Cinema.DAL { public class Repository<TEntity> : IRepository<TEntity> where TEntity:class,IEntity { DbContext _db; public Repository(DbContext db) { _db = db; } public TEntity Add(TEntity entity) { _db.Set<TEntity>().Add(entity); int ess = _db.SaveChanges(); if (ess > 0) { return entity; } return null; } public ICollection<TEntity> Get(Expression<Func<TEntity, bool>> filter = null) { if (filter == null) { filter = x => true; } return _db.Set<TEntity>().Where(filter).ToList(); } public TEntity GetSpesific(Expression<Func<TEntity, bool>> filter = null) { if (filter == null) { filter = x => false; } return _db.Set<TEntity>().Where(filter).SingleOrDefault(); } public TEntity Get(Guid Id) { return _db.Set<TEntity>().Find(Id); } public TEntity Update(TEntity entity) { _db.Entry(entity).State = EntityState.Modified; int ess = _db.SaveChanges(); if (ess > 0) { return entity; } return null; } } }
24.513889
86
0.522946
[ "MIT" ]
ahmettyavuz/CinemaSeance
Cinema.DAL/Repository.cs
1,767
C#
// Copyright (C) 2018 Mohammad Javad HoseinPour. All rights reserved. // Licensed under the Private License. See LICENSE in the project root for license information. // Author: Mohammad Javad HoseinPour <mjavadhpour@gmail.com> using ShopPromotion.Domain.Infrastructure.Models.Resource.Custom; namespace ShopPromotion.Domain.Infrastructure.Models.Resource { public class MinimumShopPromotionLikeResource : MinimumBaseEntity { public MinimumIdentityUserResource LikedBy { get; set; } public MinimumShopPromotionResource ShopPromotion { get; set; } } }
38.733333
95
0.777969
[ "MIT" ]
mjavadhpour/shop-promotion
src/ShopPromotion.Domain/Infrastructure/Models/Resource/MinimumShopPromotionLikeResource.cs
583
C#
using System.IO; using System.Runtime.Serialization; using GameEstate.Red.Formats.Red.CR2W.Reflection; using FastMember; using static GameEstate.Red.Formats.Red.Records.Enums; namespace GameEstate.Red.Formats.Red.Types { [DataContract(Namespace = "")] [REDMeta] public class CBehTreeTaskCSEffect : IBehTreeTask { [Ordinal(1)] [RED("CSType")] public CEnum<ECriticalStateType> CSType { get; set;} [Ordinal(2)] [RED("requestedCSType")] public CEnum<ECriticalStateType> RequestedCSType { get; set;} [Ordinal(3)] [RED("buffType")] public CEnum<EEffectType> BuffType { get; set;} [Ordinal(4)] [RED("buff")] public CHandle<CBaseGameplayEffect> Buff { get; set;} [Ordinal(5)] [RED("finisherAnimName")] public CName FinisherAnimName { get; set;} [Ordinal(6)] [RED("hasBuff")] public CBool HasBuff { get; set;} [Ordinal(7)] [RED("allowBlend")] public CBool AllowBlend { get; set;} [Ordinal(8)] [RED("hitReactionDisabled")] public CBool HitReactionDisabled { get; set;} [Ordinal(9)] [RED("waitForDropItem")] public CBool WaitForDropItem { get; set;} [Ordinal(10)] [RED("isInAir")] public CBool IsInAir { get; set;} [Ordinal(11)] [RED("heightDiff")] public CFloat HeightDiff { get; set;} [Ordinal(12)] [RED("isInPotentialRagdoll")] public CBool IsInPotentialRagdoll { get; set;} [Ordinal(13)] [RED("guardOpen")] public CBool GuardOpen { get; set;} [Ordinal(14)] [RED("criticalStatesToResist")] public CInt32 CriticalStatesToResist { get; set;} [Ordinal(15)] [RED("resistCriticalStateChance")] public CInt32 ResistCriticalStateChance { get; set;} [Ordinal(16)] [RED("combatDataStorage")] public CHandle<CBaseAICombatStorage> CombatDataStorage { get; set;} [Ordinal(17)] [RED("reactionDataStorage")] public CHandle<CAIStorageReactionData> ReactionDataStorage { get; set;} [Ordinal(18)] [RED("finisherEnabled")] public CBool FinisherEnabled { get; set;} [Ordinal(19)] [RED("forceFinisherActivation")] public CBool ForceFinisherActivation { get; set;} [Ordinal(20)] [RED("finisherDisabled")] public CBool FinisherDisabled { get; set;} [Ordinal(21)] [RED("pullToNavRadiusMult")] public CFloat PullToNavRadiusMult { get; set;} [Ordinal(22)] [RED("m_storedInteractionPri")] public CEnum<EInteractionPriority> M_storedInteractionPri { get; set;} [Ordinal(23)] [RED("armored")] public CBool Armored { get; set;} [Ordinal(24)] [RED("hitAnim")] public CBool HitAnim { get; set;} [Ordinal(25)] [RED("unstoppable")] public CBool Unstoppable { get; set;} [Ordinal(26)] [RED("ragdollPullingEventReceived")] public CBool RagdollPullingEventReceived { get; set;} [Ordinal(27)] [RED("distanceFromRootToBone")] public CFloat DistanceFromRootToBone { get; set;} [Ordinal(28)] [RED("boneIndex")] public CInt32 BoneIndex { get; set;} [Ordinal(29)] [RED("hitsToRaiseGuard")] public CFloat HitsToRaiseGuard { get; set;} [Ordinal(30)] [RED("raiseGuardChance")] public CFloat RaiseGuardChance { get; set;} [Ordinal(31)] [RED("hitsToCounter")] public CFloat HitsToCounter { get; set;} [Ordinal(32)] [RED("counterChance")] public CFloat CounterChance { get; set;} [Ordinal(33)] [RED("counterStaminaCost")] public CFloat CounterStaminaCost { get; set;} [Ordinal(34)] [RED("canCounter")] public CBool CanCounter { get; set;} [Ordinal(35)] [RED("counterRequested")] public CBool CounterRequested { get; set;} [Ordinal(36)] [RED("counterRequestTimeStamp")] public CFloat CounterRequestTimeStamp { get; set;} [Ordinal(37)] [RED("counterType")] public CEnum<ECriticalEffectCounterType> CounterType { get; set;} [Ordinal(38)] [RED("startAirPos")] public Vector StartAirPos { get; set;} [Ordinal(39)] [RED("endAirPos")] public Vector EndAirPos { get; set;} [Ordinal(40)] [RED("cachedInAir")] public CBool CachedInAir { get; set;} [Ordinal(41)] [RED("airStartTime")] public CFloat AirStartTime { get; set;} [Ordinal(42)] [RED("screamPlayed")] public CBool ScreamPlayed { get; set;} [Ordinal(43)] [RED("fallingDamage")] public CFloat FallingDamage { get; set;} [Ordinal(44)] [RED("maxFallingHeightDiff")] public CFloat MaxFallingHeightDiff { get; set;} public CBehTreeTaskCSEffect(CR2WFile cr2w, CVariable parent, string name) : base(cr2w, parent, name){ } public static new CVariable Create(CR2WFile cr2w, CVariable parent, string name) => new CBehTreeTaskCSEffect(cr2w, parent, name); public override void Read(BinaryReader file, uint size) => base.Read(file, size); public override void Write(BinaryWriter file) => base.Write(file); } }
42.684685
132
0.688054
[ "MIT" ]
bclnet/GameEstate
src/Estates/Red/GameEstate.Red.Format/Red/W3/RTTIConvert/CBehTreeTaskCSEffect.cs
4,738
C#