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.Globalization; using System.Net; using System.Net.Http; using System.Threading.Tasks; using Kudu.Contracts.Settings; using Kudu.Contracts.SiteExtensions; using Kudu.TestHarness; using Kudu.TestHarness.Xunit; using Xunit; namespace Kudu.FunctionalTests.SiteExtensions { [KuduXunitTestClass] public class SiteExtensionsIncrementalDeploymentTests { [Theory] [InlineData(false)] [InlineData(true)] public async Task CanInstallAndUpdate(bool useSiteExtensionV1) { const string appName = "IncrementalDeploymentTests"; const string packageId = "IncrementalDeployment"; const string packageOldVersion = "1.0.0"; const string packageLatestVersion = "2.0.0"; const string externalFeed = "https://www.myget.org/F/simplesvc/"; await ApplicationManager.RunAsync(appName, async appManager => { if (!useSiteExtensionV1) { await appManager.SettingsManager.SetValue(SettingsKeys.UseSiteExtensionV2, "1"); } var manager = appManager.SiteExtensionManager; await SiteExtensionApiFacts.CleanSiteExtensions(manager); TestTracer.Trace("Perform InstallExtension with id '{0}', version '{1}' from '{2}'", packageId, packageOldVersion, externalFeed); HttpResponseMessage responseMessage = await manager.InstallExtension(packageId, packageOldVersion, externalFeed, SiteExtensionInfo.SiteExtensionType.WebRoot); Assert.Equal(HttpStatusCode.OK, responseMessage.StatusCode); HttpClient client = new HttpClient(); TestTracer.Trace("Package is installed to wwwroot, perform get to verify content."); responseMessage = await client.GetAsync(appManager.SiteUrl + "default.aspx"); string responseContent = await responseMessage.Content.ReadAsStringAsync(); Assert.True(responseContent.Contains("<h1>World's most amazing file counter</h1>"), string.Format(CultureInfo.InvariantCulture, "Not contain expected content. Actual: {0}", responseContent)); responseMessage = await client.GetAsync(appManager.SiteUrl + "delete.txt"); responseContent = await responseMessage.Content.ReadAsStringAsync(); Assert.Equal("delete", responseContent); responseMessage = await client.GetAsync(appManager.SiteUrl + "new.txt"); Assert.Equal(HttpStatusCode.NotFound, responseMessage.StatusCode); TestTracer.Trace("Perform update with id '{0}', version '{1}' to WebRoot", packageId, packageLatestVersion); responseMessage = await manager.InstallExtension(packageId, packageLatestVersion, externalFeed, SiteExtensionInfo.SiteExtensionType.WebRoot); Assert.Equal(HttpStatusCode.OK, responseMessage.StatusCode); responseMessage = await client.GetAsync(appManager.SiteUrl + "default.aspx"); responseContent = await responseMessage.Content.ReadAsStringAsync(); Assert.True(responseContent.Contains("<h1>World's most amazing file counter v2!</h1>"), string.Format(CultureInfo.InvariantCulture, "Not contain expected content. Actual: {0}", responseContent)); responseMessage = await client.GetAsync(appManager.SiteUrl + "new.txt"); responseContent = await responseMessage.Content.ReadAsStringAsync(); Assert.Equal("new", responseContent); responseMessage = await client.GetAsync(appManager.SiteUrl + "delete.txt"); Assert.Equal(HttpStatusCode.NotFound, responseMessage.StatusCode); }); } [Theory] [InlineData(false)] [InlineData(true)] public async Task CanInstallAndUpdateWithoutType(bool useSiteExtensionV1) { const string appName = "IncrementalDeploymentTests"; const string packageId = "IncrementalDeployment"; const string packageOldVersion = "1.0.0"; const string packageLatestVersion = "2.0.0"; const string externalFeed = "https://www.myget.org/F/simplesvc/"; await ApplicationManager.RunAsync(appName, async appManager => { if (!useSiteExtensionV1) { await appManager.SettingsManager.SetValue(SettingsKeys.UseSiteExtensionV2, "1"); } var manager = appManager.SiteExtensionManager; await SiteExtensionApiFacts.CleanSiteExtensions(manager); TestTracer.Trace("Perform InstallExtension with id '{0}', version '{1}' from '{2}' to WebRoot", packageId, packageOldVersion, externalFeed); HttpResponseMessage responseMessage = await manager.InstallExtension(packageId, packageOldVersion, externalFeed, SiteExtensionInfo.SiteExtensionType.WebRoot); Assert.Equal(HttpStatusCode.OK, responseMessage.StatusCode); HttpClient client = new HttpClient(); TestTracer.Trace("Package is installed to wwwroot, perform get to verify content."); responseMessage = await client.GetAsync(appManager.SiteUrl + "default.aspx"); string responseContent = await responseMessage.Content.ReadAsStringAsync(); Assert.True(responseContent.Contains("<h1>World's most amazing file counter</h1>"), string.Format(CultureInfo.InvariantCulture, "Not contain expected content. Actual: {0}", responseContent)); responseMessage = await client.GetAsync(appManager.SiteUrl + "delete.txt"); responseContent = await responseMessage.Content.ReadAsStringAsync(); Assert.Equal("delete", responseContent); responseMessage = await client.GetAsync(appManager.SiteUrl + "new.txt"); Assert.Equal(HttpStatusCode.NotFound, responseMessage.StatusCode); TestTracer.Trace("Perform update with id '{0}', version '{1}' to WebRoot without specifiy type", packageId, packageLatestVersion); responseMessage = await manager.InstallExtension(packageId, packageLatestVersion, externalFeed); Assert.Equal(HttpStatusCode.OK, responseMessage.StatusCode); responseMessage = await client.GetAsync(appManager.SiteUrl + "default.aspx"); responseContent = await responseMessage.Content.ReadAsStringAsync(); Assert.True(responseContent.Contains("<h1>World's most amazing file counter v2!</h1>"), string.Format(CultureInfo.InvariantCulture, "Not contain expected content. Actual: {0}", responseContent)); responseMessage = await client.GetAsync(appManager.SiteUrl + "new.txt"); responseContent = await responseMessage.Content.ReadAsStringAsync(); Assert.Equal("new", responseContent); responseMessage = await client.GetAsync(appManager.SiteUrl + "delete.txt"); Assert.Equal(HttpStatusCode.NotFound, responseMessage.StatusCode); }); } /// <summary> /// <para>Test package that are not zip by nuget tool</para> /// <para>Differences are, package zip by nuget tool will not include 'folder', others might</para> /// </summary> [Theory] [InlineData(false)] [InlineData(true)] public async Task CanInstallAndUpdateWithAbnormalPackage(bool useSiteExtensionV1) { const string appName = "IncrementalDeploymentWithComplexPackageTests"; const string packageId = "microsoft.com.azuremediaservicesconnector"; const string packageOldVersion = "0.1.1"; const string packageNewerVersion = "0.1.3"; const string packageLatestVersion = "0.1.4"; const string externalFeed = "https://www.myget.org/F/simplesvc/"; await ApplicationManager.RunAsync(appName, async appManager => { if (!useSiteExtensionV1) { await appManager.SettingsManager.SetValue(SettingsKeys.UseSiteExtensionV2, "1"); } var manager = appManager.SiteExtensionManager; await SiteExtensionApiFacts.CleanSiteExtensions(manager); TestTracer.Trace("Perform InstallExtension with id '{0}', version '{1}' from '{2}'", packageId, packageOldVersion, externalFeed); HttpResponseMessage responseMessage = await manager.InstallExtension(packageId, packageOldVersion, externalFeed, SiteExtensionInfo.SiteExtensionType.WebRoot); Assert.Equal(HttpStatusCode.OK, responseMessage.StatusCode); HttpClient client = new HttpClient(); TestTracer.Trace("Package is installed to wwwroot, perform get to verify content."); TestTracer.Trace("Should see web.config.txt"); responseMessage = await client.GetAsync(appManager.SiteUrl + "web.config.txt"); Assert.Equal(HttpStatusCode.OK, responseMessage.StatusCode); TestTracer.Trace(@"Should see NewFolder/NewFile.txt"); responseMessage = await client.GetAsync(appManager.SiteUrl + @"NewFolder/NewFile.txt"); Assert.Equal(HttpStatusCode.OK, responseMessage.StatusCode); TestTracer.Trace("Perform InstallExtension with id '{0}', version '{1}' from '{2}'", packageId, packageNewerVersion, externalFeed); responseMessage = await manager.InstallExtension(packageId, packageNewerVersion, externalFeed, SiteExtensionInfo.SiteExtensionType.WebRoot); TestTracer.Trace(@"Should NOT see web.config.txt"); responseMessage = await client.GetAsync(appManager.SiteUrl + "web.config.txt"); Assert.Equal(HttpStatusCode.NotFound, responseMessage.StatusCode); TestTracer.Trace(@"Should NOT see NewFolder/NewFile.txt"); responseMessage = await client.GetAsync(appManager.SiteUrl + @"NewFolder/NewFile.txt"); Assert.Equal(HttpStatusCode.NotFound, responseMessage.StatusCode); TestTracer.Trace(@"Should see metadata/UIDefinition.txt"); responseMessage = await client.GetAsync(appManager.SiteUrl + @"metadata/UIDefinition.txt"); Assert.Equal(HttpStatusCode.OK, responseMessage.StatusCode); TestTracer.Trace("Perform InstallExtension with id '{0}', version '{1}' from '{2}'", packageId, packageLatestVersion, externalFeed); responseMessage = await manager.InstallExtension(packageId, packageLatestVersion, externalFeed, SiteExtensionInfo.SiteExtensionType.WebRoot); TestTracer.Trace(@"Should NOT see web.config.txt"); responseMessage = await client.GetAsync(appManager.SiteUrl + "web.config.txt"); Assert.Equal(HttpStatusCode.NotFound, responseMessage.StatusCode); TestTracer.Trace(@"Should NOT see NewFolder/NewFile.txt"); responseMessage = await client.GetAsync(appManager.SiteUrl + @"NewFolder/NewFile.txt"); Assert.Equal(HttpStatusCode.NotFound, responseMessage.StatusCode); TestTracer.Trace(@"Should NOT see metadata/UIDefinition.txt"); responseMessage = await client.GetAsync(appManager.SiteUrl + @"metadata/UIDefinition.txt"); Assert.Equal(HttpStatusCode.NotFound, responseMessage.StatusCode); TestTracer.Trace(@"Should see metadata/NewFile.txt"); responseMessage = await client.GetAsync(appManager.SiteUrl + @"metadata/NewFile.txt"); Assert.Equal(HttpStatusCode.OK, responseMessage.StatusCode); TestTracer.Trace(@"Should see apiapp.txt"); responseMessage = await client.GetAsync(appManager.SiteUrl + @"apiapp.txt"); Assert.Equal(HttpStatusCode.OK, responseMessage.StatusCode); }); } } }
58.204762
174
0.65614
[ "Apache-2.0" ]
Watemlifts/kudu
Kudu.FunctionalTests/SiteExtensions/SiteExtensionsIncrementalDeploymentTests.cs
12,225
C#
// SPDX-License-Identifier: Apache-2.0 // Licensed to the Ed-Fi Alliance under one or more agreements. // The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0. // See the LICENSE and NOTICES files in the project root for more information. using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Xml; using System.Xml.Linq; using EdFi.LoadTools.Engine; using EdFi.LoadTools.Engine.XmlLookupPipeline; using NUnit.Framework; namespace EdFi.LoadTools.Test { [TestFixture] public class XmlLookupToResourceProcessorTests { private readonly XElement _a1Identity = XElement.Parse("<AIdentity><Id>1</Id></AIdentity>"); private readonly XElement _a1Lookup = XElement.Parse("<ALookup><Value>A</Value></ALookup>"); private readonly XElement _a2Identity = XElement.Parse("<AIdentity><Id>2</Id></AIdentity>"); private readonly XElement _a2Lookup = XElement.Parse("<ALookup><Value>B</Value></ALookup>"); private readonly XElement _bLookup = XElement.Parse("<BLookup><Value>B</Value></BLookup>"); private readonly IHashProvider _hashProvider = new HashProvider(); private readonly Func<IHashProvider, XElement, string> _x2Hs = (h, x) => h.BytesToStr(h.Hash(x.ToString())); private IDictionary<string, XElement> HashIdentities { get { var result = new Dictionary<string, XElement> { { _x2Hs(_hashProvider, _a1Lookup), _a1Identity }, { _x2Hs(_hashProvider, _a2Lookup), _a2Identity } }; return result; } } private XElement RunProcessorOnInputElement(XElement source) { var processor = new XmlLookupToResourceProcessor( _hashProvider, HashIdentities); var reader = new XmlTextReader(new StringReader(source.ToString())); var sb = new StringBuilder(); var writer = new XmlTextWriter(new StringWriter(sb)); processor.CopyXmlLookupsToResources(reader, writer); var xmlResult = XElement.Parse(sb.ToString()); return xmlResult; } [Test] public void Should_add_identity_for_successful_lookup() { var xmlSource = XElement.Parse("<AReference>" + _a1Lookup + "</AReference>"); var xmlResult = RunProcessorOnInputElement(xmlSource); Console.WriteLine($"xmlSource:\r\n {xmlSource}\r\n\r\nxmlResult:\r\n {xmlResult}"); Assert.IsNotNull(xmlResult.Element("AIdentity")); } [Test] public void Should_ignore_identity_for_no_lookup() { var xmlSource = XElement.Parse("<AReference>" + _a1Identity + "</AReference>"); var xmlResult = RunProcessorOnInputElement(xmlSource); Console.WriteLine($"xmlSource:\r\n {xmlSource}\r\n\r\nxmlResult:\r\n {xmlResult}"); Assert.IsFalse(xmlResult.Nodes().Any(x => x.NodeType == XmlNodeType.Comment)); } [Test] public void Should_prefer_provided_identity_information_over_lookup() { var xmlSource = XElement.Parse("<AReference>" + _a1Identity + _a1Lookup + "</AReference>"); var xmlResult = RunProcessorOnInputElement(xmlSource); Console.WriteLine($"xmlSource:\r\n {xmlSource}\r\n\r\nxmlResult:\r\n {xmlResult}"); var identities = xmlResult.Descendants("AIdentity").ToArray(); Assert.IsTrue(identities.All(x => x.PreviousNode == null)); } [Test] public void Should_show_failure_comment_for_unsuccessful_lookup() { var xmlSource = XElement.Parse("<BReference>" + _bLookup + "</BReference>"); var xmlResult = RunProcessorOnInputElement(xmlSource); Console.WriteLine($"xmlSource:\r\n {xmlSource}\r\n\r\nxmlResult:\r\n {xmlResult}"); Assert.IsNull(xmlResult.Element("BIdentity")); Assert.IsTrue(xmlResult.Nodes().Any(x => x.NodeType == XmlNodeType.Comment)); Assert.IsTrue(xmlResult.ToString().Contains("No BIdentity could be retrieved")); } [Test] public void Should_recurse_identity_lookups() { var xmlSource = XElement.Parse( "<Root><CReference><CIdentity>" + "<AReference>" + _a1Lookup + "</AReference>" + "<AReference>" + _a2Lookup + "</AReference>" + "<AReference>" + _a1Lookup + "</AReference>" + "</CIdentity></CReference></Root>"); var xmlResult = RunProcessorOnInputElement(xmlSource); Console.WriteLine($"xmlSource:\r\n {xmlSource}\r\n\r\nxmlResult:\r\n {xmlResult}"); var identities = xmlResult.Descendants("AIdentity").ToArray(); Assert.AreEqual(3, identities.Length); Assert.IsTrue(identities.All(x => x.PreviousNode.NodeType == XmlNodeType.Comment)); } } }
42.918699
116
0.602008
[ "Apache-2.0" ]
stephenfuqua/Ed-Fi-ODS
Utilities/DataLoading/EdFi.LoadTools.Test/XmlLookupToResourceProcessorTests.cs
5,281
C#
using J2N.Numerics; using J2N.Runtime.CompilerServices; using Lucene.Net.Diagnostics; using Lucene.Net.Support; using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Reflection; using System.Runtime.CompilerServices; using JCG = J2N.Collections.Generic; namespace Lucene.Net.Util { /* * 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. */ /// <summary> /// Estimates the size (memory representation) of .NET objects. /// <para/> /// @lucene.internal /// </summary> /// <seealso cref="SizeOf(object)"/> /// <seealso cref="ShallowSizeOf(object)"/> /// <seealso cref="ShallowSizeOfInstance(Type)"/> public sealed class RamUsageEstimator { ///// <summary> ///// JVM info string for debugging and reports. </summary> //public static readonly string JVM_INFO_STRING; // LUCENENET specific - this is not being used /// <summary> /// One kilobyte bytes. </summary> public const long ONE_KB = 1024; /// <summary> /// One megabyte bytes. </summary> public const long ONE_MB = ONE_KB * ONE_KB; /// <summary> /// One gigabyte bytes. </summary> public const long ONE_GB = ONE_KB * ONE_MB; /// <summary> /// No instantiation. </summary> private RamUsageEstimator() { } public const int NUM_BYTES_BOOLEAN = sizeof(bool); //1; public const int NUM_BYTES_BYTE = sizeof(byte); //1; public const int NUM_BYTES_CHAR = sizeof(char); //2; /// <summary> /// NOTE: This was NUM_BYTES_SHORT in Lucene /// </summary> public const int NUM_BYTES_INT16 = sizeof(short); //2; /// <summary> /// NOTE: This was NUM_BYTES_INT in Lucene /// </summary> public const int NUM_BYTES_INT32 = sizeof(int); //4; /// <summary> /// NOTE: This was NUM_BYTES_FLOAT in Lucene /// </summary> public const int NUM_BYTES_SINGLE = sizeof(float); //4; /// <summary> /// NOTE: This was NUM_BYTES_LONG in Lucene /// </summary> public const int NUM_BYTES_INT64 = sizeof(long); //8; public const int NUM_BYTES_DOUBLE = sizeof(double); //8; /// <summary> /// Number of bytes this .NET runtime uses to represent an object reference. /// </summary> public static readonly int NUM_BYTES_OBJECT_REF = Constants.RUNTIME_IS_64BIT ? 8 : 4; // LUCENENET: Avoid static constructors (see https://github.com/apache/lucenenet/pull/224#issuecomment-469284006) /// <summary> /// Number of bytes to represent an object header (no fields, no alignments). /// </summary> public static readonly int NUM_BYTES_OBJECT_HEADER = Constants.RUNTIME_IS_64BIT ? (8 + 8) : 8; // LUCENENET: Avoid static constructors (see https://github.com/apache/lucenenet/pull/224#issuecomment-469284006) /// <summary> /// Number of bytes to represent an array header (no content, but with alignments). /// </summary> public static readonly int NUM_BYTES_ARRAY_HEADER = Constants.RUNTIME_IS_64BIT ? (8 + 2 * 8) : 12; // LUCENENET: Avoid static constructors (see https://github.com/apache/lucenenet/pull/224#issuecomment-469284006) /// <summary> /// A constant specifying the object alignment boundary inside the .NET runtime. Objects will /// always take a full multiple of this constant, possibly wasting some space. /// </summary> public static readonly int NUM_BYTES_OBJECT_ALIGNMENT = Constants.RUNTIME_IS_64BIT ? 8 : 4; // LUCENENET: Avoid static constructors (see https://github.com/apache/lucenenet/pull/224#issuecomment-469284006) /// <summary> /// Sizes of primitive classes. /// </summary> // LUCENENET specific - Identity comparer is not necessary here because Type is already representing an identity private static readonly IDictionary<Type, int> primitiveSizes = new Dictionary<Type, int>(/*IdentityEqualityComparer<Type>.Default*/) // LUCENENET: Avoid static constructors (see https://github.com/apache/lucenenet/pull/224#issuecomment-469284006) { [typeof(bool)] = NUM_BYTES_BOOLEAN, [typeof(sbyte)] = NUM_BYTES_BYTE, [typeof(byte)] = NUM_BYTES_BYTE, [typeof(char)] = NUM_BYTES_CHAR, [typeof(short)] = NUM_BYTES_INT16, [typeof(ushort)] = NUM_BYTES_INT16, [typeof(int)] = NUM_BYTES_INT32, [typeof(uint)] = NUM_BYTES_INT32, [typeof(float)] = NUM_BYTES_SINGLE, [typeof(double)] = NUM_BYTES_DOUBLE, [typeof(long)] = NUM_BYTES_INT64, [typeof(ulong)] = NUM_BYTES_INT64 }; // LUCENENET specific: Moved all estimates to static initializers to avoid using a static constructor //static RamUsageEstimator() //{ // Initialize empirically measured defaults. We'll modify them to the current // JVM settings later on if possible. // int referenceSize = Constants.RUNTIME_IS_64BIT ? 8 : 4; // int objectHeader = Constants.RUNTIME_IS_64BIT ? 16 : 8; // The following is objectHeader + NUM_BYTES_INT32, but aligned(object alignment) // so on 64 bit JVMs it'll be align(16 + 4, @8) = 24. // int arrayHeader = Constants.RUNTIME_IS_64BIT ? 24 : 12; // int objectAlignment = Constants.RUNTIME_IS_64BIT ? 8 : 4; // Type unsafeClass = null; // object tempTheUnsafe = null; // try // { // unsafeClass = Type.GetType("sun.misc.Unsafe"); // FieldInfo unsafeField = unsafeClass.getDeclaredField("theUnsafe"); // unsafeField.Accessible = true; // tempTheUnsafe = unsafeField.get(null); // } // catch (Exception e) // { // // Ignore. // } // TheUnsafe = tempTheUnsafe; // // get object reference size by getting scale factor of Object[] arrays: // try // { // Method arrayIndexScaleM = unsafeClass.GetMethod("arrayIndexScale", typeof(Type)); // referenceSize = (int)((Number)arrayIndexScaleM.invoke(TheUnsafe, typeof(object[]))); // } // catch (Exception e) // { // // ignore. // } // // "best guess" based on reference size. We will attempt to modify // // these to exact values if there is supported infrastructure. // objectHeader = Constants.RUNTIME_IS_64BIT ? (8 + referenceSize) : 8; // arrayHeader = Constants.RUNTIME_IS_64BIT ? (8 + 2 * referenceSize) : 12; // // get the object header size: // // - first try out if the field offsets are not scaled (see warning in Unsafe docs) // // - get the object header size by getting the field offset of the first field of a dummy object // // If the scaling is byte-wise and unsafe is available, enable dynamic size measurement for // // estimateRamUsage(). // Method tempObjectFieldOffsetMethod = null; // try // { // Method objectFieldOffsetM = unsafeClass.GetMethod("objectFieldOffset", typeof(FieldInfo)); // FieldInfo dummy1Field = typeof(DummyTwoLongObject).getDeclaredField("dummy1"); // int ofs1 = (int)((Number)objectFieldOffsetM.invoke(TheUnsafe, dummy1Field)); // FieldInfo dummy2Field = typeof(DummyTwoLongObject).getDeclaredField("dummy2"); // int ofs2 = (int)((Number)objectFieldOffsetM.invoke(TheUnsafe, dummy2Field)); // if (Math.Abs(ofs2 - ofs1) == NUM_BYTES_LONG) // { // FieldInfo baseField = typeof(DummyOneFieldObject).getDeclaredField("base"); // objectHeader = (int)((Number)objectFieldOffsetM.invoke(TheUnsafe, baseField)); // tempObjectFieldOffsetMethod = objectFieldOffsetM; // } // } // catch (Exception e) // { // // Ignore. // } // ObjectFieldOffsetMethod = tempObjectFieldOffsetMethod; // // Get the array header size by retrieving the array base offset // // (offset of the first element of an array). // try // { // Method arrayBaseOffsetM = unsafeClass.GetMethod("arrayBaseOffset", typeof(Type)); // // we calculate that only for byte[] arrays, it's actually the same for all types: // arrayHeader = (int)((Number)arrayBaseOffsetM.invoke(TheUnsafe, typeof(sbyte[]))); // } // catch (Exception e) // { // // Ignore. // } // NUM_BYTES_OBJECT_REF = referenceSize; // NUM_BYTES_OBJECT_HEADER = objectHeader; // NUM_BYTES_ARRAY_HEADER = arrayHeader; // // Try to get the object alignment (the default seems to be 8 on Hotspot, // // regardless of the architecture). // int objectAlignment = 8; // try // { // Type beanClazz = Type.GetType("com.sun.management.HotSpotDiagnosticMXBean").asSubclass(typeof(PlatformManagedObject)); // object hotSpotBean = ManagementFactory.getPlatformMXBean(beanClazz); // if (hotSpotBean != null) // { // Method getVMOptionMethod = beanClazz.GetMethod("getVMOption", typeof(string)); // object vmOption = getVMOptionMethod.invoke(hotSpotBean, "ObjectAlignmentInBytes"); // objectAlignment = Convert.ToInt32(vmOption.GetType().GetMethod("getValue").invoke(vmOption).ToString(), CultureInfo.InvariantCulture); // } // } // catch (Exception e) // { // // Ignore. // } // NUM_BYTES_OBJECT_ALIGNMENT = objectAlignment; // // LUCENENET specific -this is not being used // JVM_INFO_STRING = "[JVM: " + Constants.JVM_NAME + ", " + Constants.JVM_VERSION + ", " + Constants.JVM_VENDOR + ", " + Constants.JAVA_VENDOR + ", " + Constants.JAVA_VERSION + "]"; //} ///// <summary> ///// A handle to <code>sun.misc.Unsafe</code>. ///// </summary> //private static readonly object TheUnsafe; ///// <summary> ///// A handle to <code>sun.misc.Unsafe#fieldOffset(Field)</code>. ///// </summary> //private static readonly Method ObjectFieldOffsetMethod; /// <summary> /// Cached information about a given class. /// </summary> private sealed class ClassCache { public long AlignedShallowInstanceSize { get; private set; } [WritableArray] [SuppressMessage("Microsoft.Performance", "CA1819", Justification = "Lucene's design requires some writable array properties")] public FieldInfo[] ReferenceFields { get; private set; } public ClassCache(long alignedShallowInstanceSize, FieldInfo[] referenceFields) { this.AlignedShallowInstanceSize = alignedShallowInstanceSize; this.ReferenceFields = referenceFields; } } //// Object with just one field to determine the object header size by getting the offset of the dummy field: //private sealed class DummyOneFieldObject //{ // public sbyte @base; //} //// Another test object for checking, if the difference in offsets of dummy1 and dummy2 is 8 bytes. //// Only then we can be sure that those are real, unscaled offsets: //private sealed class DummyTwoLongObject //{ // public long Dummy1, Dummy2; //} /// <summary> /// Aligns an object size to be the next multiple of <see cref="NUM_BYTES_OBJECT_ALIGNMENT"/>. /// </summary> public static long AlignObjectSize(long size) { size += (long)NUM_BYTES_OBJECT_ALIGNMENT - 1L; return size - (size % NUM_BYTES_OBJECT_ALIGNMENT); } /// <summary> /// Returns the size in bytes of the <see cref="T:byte[]"/> object. </summary> // LUCENENET specific overload for CLS compliance public static long SizeOf(byte[] arr) { return AlignObjectSize((long)NUM_BYTES_ARRAY_HEADER + arr.Length); } /// <summary> /// Returns the size in bytes of the <see cref="T:sbyte[]"/> object. </summary> [CLSCompliant(false)] public static long SizeOf(sbyte[] arr) { return AlignObjectSize((long)NUM_BYTES_ARRAY_HEADER + arr.Length); } /// <summary> /// Returns the size in bytes of the <see cref="T:bool[]"/> object. </summary> public static long SizeOf(bool[] arr) { return AlignObjectSize((long)NUM_BYTES_ARRAY_HEADER + arr.Length); } /// <summary> /// Returns the size in bytes of the <see cref="T:char[]"/> object. </summary> public static long SizeOf(char[] arr) { return AlignObjectSize((long)NUM_BYTES_ARRAY_HEADER + (long)NUM_BYTES_CHAR * arr.Length); } /// <summary> /// Returns the size in bytes of the <see cref="T:short[]"/> object. </summary> public static long SizeOf(short[] arr) { return AlignObjectSize((long)NUM_BYTES_ARRAY_HEADER + (long)NUM_BYTES_INT16 * arr.Length); } /// <summary> /// Returns the size in bytes of the <see cref="T:int[]"/> object. </summary> public static long SizeOf(int[] arr) { return AlignObjectSize((long)NUM_BYTES_ARRAY_HEADER + (long)NUM_BYTES_INT32 * arr.Length); } /// <summary> /// Returns the size in bytes of the <see cref="T:float[]"/> object. </summary> public static long SizeOf(float[] arr) { return AlignObjectSize((long)NUM_BYTES_ARRAY_HEADER + (long)NUM_BYTES_SINGLE * arr.Length); } /// <summary> /// Returns the size in bytes of the <see cref="T:long[]"/> object. </summary> public static long SizeOf(long[] arr) { return AlignObjectSize((long)NUM_BYTES_ARRAY_HEADER + (long)NUM_BYTES_INT64 * arr.Length); } /// <summary> /// Returns the size in bytes of the <see cref="T:double[]"/> object. </summary> public static long SizeOf(double[] arr) { return AlignObjectSize((long)NUM_BYTES_ARRAY_HEADER + (long)NUM_BYTES_DOUBLE * arr.Length); } /// <summary> /// Returns the size in bytes of the <see cref="T:ulong[]"/> object. </summary> [CLSCompliant(false)] public static long SizeOf(ulong[] arr) { return AlignObjectSize((long)NUM_BYTES_ARRAY_HEADER + (long)NUM_BYTES_INT64 * arr.Length); } /// <summary> /// Returns the size in bytes of the <see cref="T:uint[]"/> object. </summary> [CLSCompliant(false)] public static long SizeOf(uint[] arr) { return AlignObjectSize((long)NUM_BYTES_ARRAY_HEADER + (long)NUM_BYTES_INT32 * arr.Length); } /// <summary> /// Returns the size in bytes of the <see cref="T:ushort[]"/> object. </summary> [CLSCompliant(false)] public static long SizeOf(ushort[] arr) { return AlignObjectSize((long)NUM_BYTES_ARRAY_HEADER + (long)NUM_BYTES_INT16 * arr.Length); } /// <summary> /// Estimates the RAM usage by the given object. It will /// walk the object tree and sum up all referenced objects. /// /// <para><b>Resource Usage:</b> this method internally uses a set of /// every object seen during traversals so it does allocate memory /// (it isn't side-effect free). After the method exits, this memory /// should be GCed.</para> /// </summary> public static long SizeOf(object obj) { return MeasureObjectSize(obj); } /// <summary> /// Estimates a "shallow" memory usage of the given object. For arrays, this will be the /// memory taken by array storage (no subreferences will be followed). For objects, this /// will be the memory taken by the fields. /// <para/> /// .NET object alignments are also applied. /// </summary> public static long ShallowSizeOf(object obj) { if (obj == null) { return 0; } Type clz = obj.GetType(); if (clz.IsArray) { return ShallowSizeOfArray((Array)obj); } else { return ShallowSizeOfInstance(clz); } } /// <summary> /// Returns the shallow instance size in bytes an instance of the given class would occupy. /// This works with all conventional classes and primitive types, but not with arrays /// (the size then depends on the number of elements and varies from object to object). /// </summary> /// <seealso cref="ShallowSizeOf(object)"/> /// <exception cref="ArgumentException"> if <paramref name="clazz"/> is an array class. </exception> public static long ShallowSizeOfInstance(Type clazz) { if (clazz.IsArray) { throw new ArgumentException("this method does not work with array classes."); } if (clazz.IsPrimitive) { return primitiveSizes[clazz]; } long size = NUM_BYTES_OBJECT_HEADER; // Walk type hierarchy for (; clazz != null; clazz = clazz.BaseType) { FieldInfo[] fields = clazz.GetFields( BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.DeclaredOnly | BindingFlags.Static); foreach (FieldInfo f in fields) { if (!f.IsStatic) { size = AdjustForField(size, f); } } } return AlignObjectSize(size); } /// <summary> /// Return shallow size of any <paramref name="array"/>. /// </summary> private static long ShallowSizeOfArray(Array array) { long size = NUM_BYTES_ARRAY_HEADER; int len = array.Length; if (len > 0) { Type arrayElementClazz = array.GetType().GetElementType(); if (arrayElementClazz.IsPrimitive) { size += (long)len * primitiveSizes[arrayElementClazz]; } else { size += (long)NUM_BYTES_OBJECT_REF * len; } } return AlignObjectSize(size); } /* * Non-recursive version of object descend. this consumes more memory than recursive in-depth * traversal but prevents stack overflows on long chains of objects * or complex graphs (a max. recursion depth on my machine was ~5000 objects linked in a chain * so not too much). */ private static long MeasureObjectSize(object root) { // Objects seen so far. IdentityHashSet<object> seen = new IdentityHashSet<object>(); // Class cache with reference Field and precalculated shallow size. IDictionary<Type, ClassCache> classCache = new JCG.Dictionary<Type, ClassCache>(IdentityEqualityComparer<Type>.Default); // Stack of objects pending traversal. Recursion caused stack overflows. Stack<object> stack = new Stack<object>(); stack.Push(root); long totalSize = 0; while (stack.Count > 0) { object ob = stack.Pop(); if (ob == null || seen.Contains(ob)) { continue; } seen.Add(ob); Type obClazz = ob.GetType(); // LUCENENET specific - .NET cannot return a null type for an object, so no need to assert it if (obClazz.Equals(typeof(string))) { // LUCENENET specific - we can get a closer estimate of a string // by using simple math. Reference: http://stackoverflow.com/a/8171099. // This fixes the TestSanity test. totalSize += (2 * (((string)ob).Length + 1)); } if (obClazz.IsArray) { /* * Consider an array, possibly of primitive types. Push any of its references to * the processing stack and accumulate this array's shallow size. */ long size = NUM_BYTES_ARRAY_HEADER; Array array = (Array)ob; int len = array.Length; if (len > 0) { Type componentClazz = obClazz.GetElementType(); if (componentClazz.IsPrimitive) { size += (long)len * primitiveSizes[componentClazz]; } else { size += (long)NUM_BYTES_OBJECT_REF * len; // Push refs for traversal later. for (int i = len; --i >= 0; ) { object o = array.GetValue(i); if (o != null && !seen.Contains(o)) { stack.Push(o); } } } } totalSize += AlignObjectSize(size); } else { /* * Consider an object. Push any references it has to the processing stack * and accumulate this object's shallow size. */ try { if (!classCache.TryGetValue(obClazz, out ClassCache cachedInfo) || cachedInfo == null) { classCache[obClazz] = cachedInfo = CreateCacheEntry(obClazz); } foreach (FieldInfo f in cachedInfo.ReferenceFields) { // Fast path to eliminate redundancies. object o = f.GetValue(ob); if (o != null && !seen.Contains(o)) { stack.Push(o); } } totalSize += cachedInfo.AlignedShallowInstanceSize; } catch (Exception e) { // this should never happen as we enabled setAccessible(). throw new Exception("Reflective field access failed?", e); } } } // Help the GC (?). seen.Clear(); stack.Clear(); classCache.Clear(); return totalSize; } /// <summary> /// Create a cached information about shallow size and reference fields for /// a given class. /// </summary> private static ClassCache CreateCacheEntry(Type clazz) { ClassCache cachedInfo; long shallowInstanceSize = NUM_BYTES_OBJECT_HEADER; List<FieldInfo> referenceFields = new List<FieldInfo>(32); for (Type c = clazz; c != null; c = c.BaseType) { FieldInfo[] fields = c.GetFields( BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.DeclaredOnly | BindingFlags.Static); foreach (FieldInfo f in fields) { if (!f.IsStatic) { shallowInstanceSize = AdjustForField(shallowInstanceSize, f); if (!f.FieldType.IsPrimitive) { referenceFields.Add(f); } } } } cachedInfo = new ClassCache(AlignObjectSize(shallowInstanceSize), referenceFields.ToArray()); return cachedInfo; } /// <summary> /// This method returns the maximum representation size of an object. <paramref name="sizeSoFar"/> /// is the object's size measured so far. <paramref name="f"/> is the field being probed. /// /// <para/>The returned offset will be the maximum of whatever was measured so far and /// <paramref name="f"/> field's offset and representation size (unaligned). /// </summary> private static long AdjustForField(long sizeSoFar, FieldInfo f) { Type type = f.FieldType; int fsize = 0; if (!(typeof(IntPtr) == type) && !(typeof(UIntPtr) == type)) fsize = type.IsPrimitive ? primitiveSizes[type] : NUM_BYTES_OBJECT_REF; // LUCENENET NOTE: I dont think this will ever not be null //if (ObjectFieldOffsetMethod != null) //{ // try // { // long offsetPlusSize = (long)((Number) ObjectFieldOffsetMethod.invoke(TheUnsafe, f)) + fsize; // return Math.Max(sizeSoFar, offsetPlusSize); // } // catch (Exception ex) // { // throw new Exception("Access problem with sun.misc.Unsafe", ex); // } //} //else //{ // // TODO: No alignments based on field type/ subclass fields alignments? // return sizeSoFar + fsize; //} return sizeSoFar + fsize; } /// <summary> /// Returns <c>size</c> in human-readable units (GB, MB, KB or bytes). /// </summary> public static string HumanReadableUnits(long bytes) { return HumanReadableUnits(bytes, new NumberFormatInfo() { NumberDecimalDigits = 1 }); } /// <summary> /// Returns <c>size</c> in human-readable units (GB, MB, KB or bytes). /// </summary> public static string HumanReadableUnits(long bytes, IFormatProvider df) { if (bytes / ONE_GB > 0) { return Convert.ToString(((float)bytes / ONE_GB), df) + " GB"; } else if (bytes / ONE_MB > 0) { return Convert.ToString(((float)bytes / ONE_MB), df) + " MB"; } else if (bytes / ONE_KB > 0) { return Convert.ToString(((float)bytes / ONE_KB), df) + " KB"; } else { return Convert.ToString(bytes) + " bytes"; } } /// <summary> /// Return a human-readable size of a given object. </summary> /// <seealso cref="SizeOf(object)"/> /// <seealso cref="HumanReadableUnits(long)"/> public static string HumanSizeOf(object @object) { return HumanReadableUnits(SizeOf(@object)); } /// <summary> /// Return a human-readable size of a given object. </summary> /// <seealso cref="SizeOf(object)"/> /// <seealso cref="HumanReadableUnits(long)"/> public static string HumanSizeOf(object @object, IFormatProvider df) { return HumanReadableUnits(SizeOf(@object), df); } /// <summary> /// An identity hash set implemented using open addressing. No null keys are allowed. /// <para/> /// TODO: If this is useful outside this class, make it public - needs some work /// </summary> internal sealed class IdentityHashSet<KType> : IEnumerable<KType> { /// <summary> /// Default load factor. /// </summary> public const float DEFAULT_LOAD_FACTOR = 0.75f; /// <summary> /// Minimum capacity for the set. /// </summary> public const int MIN_CAPACITY = 4; /// <summary> /// All of set entries. Always of power of two length. /// </summary> [WritableArray] [SuppressMessage("Microsoft.Performance", "CA1819", Justification = "Lucene's design requires some writable array properties")] public object[] Keys { get => keys; set => keys = value; } private object[] keys; /// <summary> /// Cached number of assigned slots. /// </summary> public int Assigned { get; set; } /// <summary> /// The load factor for this set (fraction of allocated or deleted slots before /// the buffers must be rehashed or reallocated). /// </summary> public float LoadFactor { get; private set; } /// <summary> /// Cached capacity threshold at which we must resize the buffers. /// </summary> private int resizeThreshold; /// <summary> /// Creates a hash set with the default capacity of 16, /// load factor of <see cref="DEFAULT_LOAD_FACTOR"/>. /// </summary> public IdentityHashSet() : this(16, DEFAULT_LOAD_FACTOR) { } /// <summary> /// Creates a hash set with the given capacity, load factor of /// <see cref="DEFAULT_LOAD_FACTOR"/>. /// </summary> public IdentityHashSet(int initialCapacity) : this(initialCapacity, DEFAULT_LOAD_FACTOR) { } /// <summary> /// Creates a hash set with the given capacity and load factor. /// </summary> public IdentityHashSet(int initialCapacity, float loadFactor) { initialCapacity = Math.Max(MIN_CAPACITY, initialCapacity); if (Debugging.AssertsEnabled) { Debugging.Assert(initialCapacity > 0, "Initial capacity must be between (0, {0}].", int.MaxValue); Debugging.Assert(loadFactor > 0 && loadFactor < 1, "Load factor must be between (0, 1)."); } this.LoadFactor = loadFactor; AllocateBuffers(RoundCapacity(initialCapacity)); } /// <summary> /// Adds a reference to the set. Null keys are not allowed. /// </summary> public bool Add(KType e) { if (Debugging.AssertsEnabled) Debugging.Assert(e != null, "Null keys not allowed."); if (Assigned >= resizeThreshold) { ExpandAndRehash(); } int mask = keys.Length - 1; int slot = Rehash(e) & mask; object existing; while ((existing = keys[slot]) != null) { if (object.ReferenceEquals(e, existing)) { return false; // already found. } slot = (slot + 1) & mask; } Assigned++; keys[slot] = e; return true; } /// <summary> /// Checks if the set contains a given ref. /// </summary> public bool Contains(KType e) { int mask = keys.Length - 1; int slot = Rehash(e) & mask; object existing; while ((existing = keys[slot]) != null) { if (object.ReferenceEquals(e, existing)) { return true; } slot = (slot + 1) & mask; } return false; } /// <summary> /// Rehash via MurmurHash. /// /// <para/>The implementation is based on the /// finalization step from Austin Appleby's /// <c>MurmurHash3</c>. /// /// See <a target="_blank" href="http://sites.google.com/site/murmurhash/">http://sites.google.com/site/murmurhash/</a>. /// </summary> private static int Rehash(object o) { int k = RuntimeHelpers.GetHashCode(o); unchecked { k ^= k.TripleShift(16); k *= (int)0x85ebca6b; k ^= k.TripleShift(13); k *= (int)0xc2b2ae35; k ^= k.TripleShift(16); } return k; } /// <summary> /// Expand the internal storage buffers (capacity) or rehash current keys and /// values if there are a lot of deleted slots. /// </summary> private void ExpandAndRehash() { object[] oldKeys = this.keys; if (Debugging.AssertsEnabled) Debugging.Assert(Assigned >= resizeThreshold); AllocateBuffers(NextCapacity(keys.Length)); /* * Rehash all assigned slots from the old hash table. */ int mask = keys.Length - 1; for (int i = 0; i < oldKeys.Length; i++) { object key = oldKeys[i]; if (key != null) { int slot = Rehash(key) & mask; while (keys[slot] != null) { slot = (slot + 1) & mask; } keys[slot] = key; } } Array.Clear(oldKeys, 0, oldKeys.Length); } /// <summary> /// Allocate internal buffers for a given <paramref name="capacity"/>. /// </summary> /// <param name="capacity"> /// New capacity (must be a power of two). </param> private void AllocateBuffers(int capacity) { this.keys = new object[capacity]; this.resizeThreshold = (int)(capacity * DEFAULT_LOAD_FACTOR); } /// <summary> /// Return the next possible capacity, counting from the current buffers' size. /// </summary> private int NextCapacity(int current) // LUCENENET NOTE: made private, since protected is not valid in a sealed class { if (Debugging.AssertsEnabled) { Debugging.Assert(current > 0 && ((current & (current - 1)) == 0), "Capacity must be a power of two."); Debugging.Assert((current << 1) > 0, "Maximum capacity exceeded ({0}).", ((int)((uint)0x80000000 >> 1))); } if (current < MIN_CAPACITY / 2) { current = MIN_CAPACITY / 2; } return current << 1; } /// <summary> /// Round the capacity to the next allowed value. /// </summary> private int RoundCapacity(int requestedCapacity) // LUCENENET NOTE: made private, since protected is not valid in a sealed class { // Maximum positive integer that is a power of two. if (requestedCapacity > ((int)((uint)0x80000000 >> 1))) { return ((int)((uint)0x80000000 >> 1)); } int capacity = MIN_CAPACITY; while (capacity < requestedCapacity) { capacity <<= 1; } return capacity; } public void Clear() { Assigned = 0; Array.Clear(keys, 0, keys.Length); } public int Count => Assigned; // LUCENENET NOTE: This was size() in Lucene. //public bool IsEmpty // LUCENENET NOTE: in .NET we can just use !Any() on IEnumerable<T> //{ // get // { // return Count == 0; // } //} public IEnumerator<KType> GetEnumerator() { return new IteratorAnonymousInnerClassHelper(this); } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { return GetEnumerator(); } private class IteratorAnonymousInnerClassHelper : IEnumerator<KType> { private readonly IdentityHashSet<KType> outerInstance; public IteratorAnonymousInnerClassHelper(IdentityHashSet<KType> outerInstance) { this.outerInstance = outerInstance; pos = -1; nextElement = FetchNext(); } internal int pos; internal object nextElement; internal KType current; public bool MoveNext() { object r = nextElement; if (nextElement == null) { return false; } nextElement = FetchNext(); current = (KType)r; return true; } public KType Current => current; object System.Collections.IEnumerator.Current => Current; private object FetchNext() { pos++; while (pos < outerInstance.keys.Length && outerInstance.keys[pos] == null) { pos++; } return (pos >= outerInstance.keys.Length ? null : outerInstance.keys[pos]); } public void Reset() { throw new NotSupportedException(); } public void Dispose() { } } } } }
39.681996
255
0.515202
[ "Apache-2.0" ]
azhoshkin/lucenenet
src/Lucene.Net/Util/RamUsageEstimator.cs
40,555
C#
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="AssemblyInfo.cs" company="Microsoft Corporation"> // Copyright (c) Microsoft Corporation. // </copyright> // <summary> // Assembly properties. // </summary> // -------------------------------------------------------------------------------------------------------------------- using System; using System.Reflection; 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("EsentCollectionsTests")] [assembly: AssemblyDescription("Persistent Dictionary Tests for ESE/ESENT")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("EsentCollectionsTests")] [assembly: AssemblyCopyright("Copyright (c) Microsoft. All Rights Reserved.")] [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)] [assembly: CLSCompliant(true)] // 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")]
40.488889
120
0.627881
[ "MIT" ]
Bhaskers-Blu-Org2/ManagedEsent
EsentCollectionsTests/Properties/AssemblyInfo.cs
1,822
C#
using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Runtime.CompilerServices; using ElmSharp; using ElmSharp.Wearable; using EColor = ElmSharp.Color; using ELayout = ElmSharp.Layout; namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Watch { public class NavigationView : ELayout { readonly int _defaultIconSize = ThemeConstants.Shell.Resources.Watch.DefaultNavigationViewIconSize; class Item : INotifyPropertyChanged { Element _source; public Element Source { get { return _source; } set { if (_source != null) { _source.PropertyChanged -= OnElementPropertyChanged; } _source = value; _source.PropertyChanged += OnElementPropertyChanged; UpdateContent(); } } public string Text { get; set; } public string Icon { get; set; } public event PropertyChangedEventHandler PropertyChanged; void UpdateContent() { if (Source is BaseShellItem shellItem) { Text = shellItem.Title; Icon = (shellItem.Icon as FileImageSource)?.ToAbsPath(); } else if (Source is MenuItem menuItem) { Text = menuItem.Text; Icon = (menuItem.IconImageSource as FileImageSource)?.ToAbsPath(); } else { Text = null; Icon = null; } SendPropertyChanged(); } void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e) { UpdateContent(); } void SendPropertyChanged([CallerMemberName] string propertyName = "") { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } } Box _outterBox; ELayout _surfaceLayout; CircleSurface _surface; CircleGenList _naviMenu; GenItemClass _defaultClass; SmartEvent _draggedUpCallback; SmartEvent _draggedDownCallback; GenListItem _header; GenListItem _footer; List<List<Element>> _itemCache; List<GenListItem> _items = new List<GenListItem>(); public NavigationView(EvasObject parent) : base(parent) { InitializeComponent(); } public event EventHandler<SelectedItemChangedEventArgs> ItemSelected; public event EventHandler<DraggedEventArgs> Dragged; EColor _backgroundColor = ThemeConstants.Shell.ColorClass.Watch.DefaultNavigationViewBackgroundColor; public override EColor BackgroundColor { get => _backgroundColor; set { _backgroundColor = value.IsDefault ? ThemeConstants.Shell.ColorClass.Watch.DefaultNavigationViewBackgroundColor : value; UpdateBackgroundColor(); } } EColor _foregroundColor = ThemeConstants.Shell.ColorClass.Watch.DefaultNavigationViewForegroundColor; public EColor ForegroundColor { get => _foregroundColor; set { _foregroundColor = value; UpdateForegroundColor(); } } public void Build(List<List<Element>> items) { // Only update when items was changed if (!IsUpdated(items)) { return; } _itemCache = items; ClearItemPropertyChangedHandler(); _naviMenu.Clear(); _items.Clear(); // header _header = _naviMenu.Append(_defaultClass, new Item { Text = "" }); // TODO. need to improve, need to support group foreach (var group in items) { foreach (var item in group) { var data = new Item { Source = item }; if (item is BaseShellItem shellItem) { data.Text = shellItem.Title; data.Icon = (shellItem.Icon as FileImageSource)?.ToAbsPath(); } else if (item is MenuItem menuItem) { data.Text = menuItem.Text; data.Icon = (menuItem.IconImageSource as FileImageSource)?.ToAbsPath(); } var genitem = _naviMenu.Append(_defaultClass, data, GenListItemType.Normal); _items.Add(genitem); data.PropertyChanged += OnItemPropertyChanged; } } _footer = _naviMenu.Append(_defaultClass, new Item { Text = "" }); } public void Activate() { (_naviMenu as IRotaryActionWidget)?.Activate(); } public void Deactivate() { (_naviMenu as IRotaryActionWidget)?.Deactivate(); } protected override IntPtr CreateHandle(EvasObject parent) { _outterBox = new Box(parent); return _outterBox.Handle; } void InitializeComponent() { _outterBox.SetLayoutCallback(OnLayout); _surfaceLayout = new ELayout(this); _surfaceLayout.Show(); _surface = new CircleSurface(_surfaceLayout); _naviMenu = new CircleGenList(this, _surface) { Homogeneous = true, BackgroundColor = _backgroundColor }; _naviMenu.Show(); _draggedUpCallback = new SmartEvent(_naviMenu, "drag,start,up"); _draggedUpCallback.On += (s, e) => { if (_footer.TrackObject.IsVisible) { Dragged?.Invoke(this, new DraggedEventArgs(DraggedState.EdgeBottom)); } else { Dragged?.Invoke(this, new DraggedEventArgs(DraggedState.Up)); } }; _draggedDownCallback = new SmartEvent(_naviMenu, "drag,start,down"); _draggedDownCallback.On += (s, e) => { if (_header.TrackObject.IsVisible) { Dragged?.Invoke(this, new DraggedEventArgs(DraggedState.EdgeTop)); } else { Dragged?.Invoke(this, new DraggedEventArgs(DraggedState.Down)); } }; _outterBox.PackEnd(_naviMenu); _outterBox.PackEnd(_surfaceLayout); _surfaceLayout.StackAbove(_naviMenu); _defaultClass = new GenItemClass(ThemeConstants.GenItemClass.Styles.Watch.Text1Icon1) { GetTextHandler = (obj, part) => { if (part == ThemeConstants.GenItemClass.Parts.Text) { var text = (obj as Item).Text; if (_foregroundColor != EColor.Default) return $"<span color='{_foregroundColor.ToHex()}'>{text}</span>"; else return text; } return null; }, GetContentHandler = (obj, part) => { if (part == ThemeConstants.GenItemClass.Parts.Watch.Icon && obj is Item menuItem && !string.IsNullOrEmpty(menuItem.Icon)) { var icon = new ElmSharp.Image(Microsoft.Maui.Controls.Compatibility.Forms.NativeParent) { AlignmentX = -1, AlignmentY = -1, WeightX = 1.0, WeightY = 1.0, MinimumWidth = _defaultIconSize, MinimumHeight = _defaultIconSize, }; icon.Show(); icon.Load(menuItem.Icon); return icon; } return null; } }; _naviMenu.ItemSelected += OnItemSelected; } void OnItemSelected(object sender, GenListItemEventArgs e) { ItemSelected?.Invoke(this, new SelectedItemChangedEventArgs((e.Item.Data as Item).Source, -1)); } void OnLayout() { _surfaceLayout.Geometry = Geometry; _naviMenu.Geometry = Geometry; } void UpdateBackgroundColor() { _naviMenu.BackgroundColor = _backgroundColor; } void UpdateForegroundColor() { foreach (var item in _items) { item.Update(); } } bool IsUpdated(List<List<Element>> items) { if (_itemCache == null) return true; if (_itemCache.Count != items.Count) return true; for (int i = 0; i < items.Count; i++) { if (_itemCache[i].Count != items[i].Count) return true; for (int j = 0; j < items[i].Count; j++) { if (_itemCache[i][j] != items[i][j]) return true; } } return false; } void ClearItemPropertyChangedHandler() { foreach (var item in _items) { (item.Data as Item).PropertyChanged -= OnItemPropertyChanged; } } void OnItemPropertyChanged(object sender, PropertyChangedEventArgs e) { var item = _items.Where((d) => d.Data == sender).FirstOrDefault(); item?.Update(); } } public enum DraggedState { EdgeTop, Up, Down, EdgeBottom, } public class DraggedEventArgs { public DraggedState State { get; private set; } public DraggedEventArgs(DraggedState state) { State = state; } } static class FileImageSourceEX { public static string ToAbsPath(this FileImageSource source) { return ResourcePath.GetPath(source.File); } } static class ColorEX { public static string ToHex(this EColor c) { return string.Format("#{0:X2}{1:X2}{2:X2}{3:X2}", c.R, c.G, c.B, c.A); } } }
22.551532
126
0.670331
[ "MIT" ]
3DSX/maui
src/Compatibility/Core/src/Tizen/Shell/Watch/NavigationView.cs
8,096
C#
/* Copyright 2010-present MongoDB 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. */ using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using MongoDB.Bson; using MongoDB.Bson.Serialization; using MongoDB.Bson.Serialization.Attributes; using MongoDB.Bson.Serialization.Serializers; using MongoDB.Driver.Linq.Utils; namespace MongoDB.Driver.Builders { /// <summary> /// A builder for specifying the keys for an index. /// </summary> public static class IndexKeys { // public static methods /// <summary> /// Sets one or more key names to index in ascending order. /// </summary> /// <param name="names">One or more key names.</param> /// <returns>The builder (so method calls can be chained).</returns> public static IndexKeysBuilder Ascending(params string[] names) { return new IndexKeysBuilder().Ascending(names); } /// <summary> /// Sets one or more key names to index in descending order. /// </summary> /// <param name="names">One or more key names.</param> /// <returns>The builder (so method calls can be chained).</returns> public static IndexKeysBuilder Descending(params string[] names) { return new IndexKeysBuilder().Descending(names); } /// <summary> /// Sets the key name to create a geospatial index on. /// </summary> /// <param name="name">The key name.</param> /// <returns>The builder (so method calls can be chained).</returns> public static IndexKeysBuilder GeoSpatial(string name) { return new IndexKeysBuilder().GeoSpatial(name); } /// <summary> /// Sets the key name to create a geospatial haystack index on. /// </summary> /// <param name="name">The key name.</param> /// <returns>The builder (so method calls can be chained).</returns> public static IndexKeysBuilder GeoSpatialHaystack(string name) { return new IndexKeysBuilder().GeoSpatialHaystack(name); } /// <summary> /// Sets the key name and additional field name to create a geospatial haystack index on. /// </summary> /// <param name="name">The key name.</param> /// <param name="additionalName">The name of an additional field to index.</param> /// <returns>The builder (so method calls can be chained).</returns> public static IndexKeysBuilder GeoSpatialHaystack(string name, string additionalName) { return new IndexKeysBuilder().GeoSpatialHaystack(name, additionalName); } /// <summary> /// Sets the key name to create a spherical geospatial index on. /// </summary> /// <param name="name">The key name.</param> /// <returns>The builder (so method calls can be chained).</returns> public static IndexKeysBuilder GeoSpatialSpherical(string name) { return new IndexKeysBuilder().GeoSpatialSpherical(name); } /// <summary> /// Sets the key name to create a hashed index on. /// </summary> /// <param name="name">The key name.</param> /// <returns>The builder (so method calls can be chained).</returns> public static IndexKeysBuilder Hashed(string name) { return new IndexKeysBuilder().Hashed(name); } /// <summary> /// Sets one or more key names to include in the text index. /// </summary> /// <param name="names">List of key names to include in the text index.</param> /// <returns>The builder (so method calls can be chained).</returns> public static IndexKeysBuilder Text(params string[] names) { return new IndexKeysBuilder().Text(names); } /// <summary> /// Create a text index that indexes all text fields of a document. /// </summary> /// <returns>The builder (so method calls can be chained).</returns> public static IndexKeysBuilder TextAll() { return new IndexKeysBuilder().TextAll(); } /// <summary> /// Sets a wildcard key to the index. The method doesn't expect to specify a wildcard key explicitly. /// </summary> /// <param name="name">The wildcard key name. If the wildcard name is empty, the generated key will be `All field paths`, otherwise `A single field path`.</param> /// <returns>The builder (so method calls can be chained).</returns> public static IndexKeysBuilder Wildcard(string name = null) { return new IndexKeysBuilder().Wildcard(name); } } /// <summary> /// A builder for specifying the keys for an index. /// </summary> #if NET452 [Serializable] #endif [BsonSerializer(typeof(IndexKeysBuilder.Serializer))] public class IndexKeysBuilder : BuilderBase, IMongoIndexKeys { // private fields private BsonDocument _document; // constructors /// <summary> /// Initializes a new instance of the IndexKeysBuilder class. /// </summary> public IndexKeysBuilder() { _document = new BsonDocument(); } // public methods /// <summary> /// Sets one or more key names to index in ascending order. /// </summary> /// <param name="names">One or more key names.</param> /// <returns>The builder (so method calls can be chained).</returns> public IndexKeysBuilder Ascending(params string[] names) { foreach (var name in names) { _document.Add(name, 1); } return this; } /// <summary> /// Sets one or more key names to index in descending order. /// </summary> /// <param name="names">One or more key names.</param> /// <returns>The builder (so method calls can be chained).</returns> public IndexKeysBuilder Descending(params string[] names) { foreach (var name in names) { _document.Add(name, -1); } return this; } /// <summary> /// Sets the key name to create a geospatial index on. /// </summary> /// <param name="name">The key name.</param> /// <returns>The builder (so method calls can be chained).</returns> public IndexKeysBuilder GeoSpatial(string name) { _document.Add(name, "2d"); return this; } /// <summary> /// Sets the key name to create a geospatial haystack index on. /// </summary> /// <param name="name">The key name.</param> /// <returns>The builder (so method calls can be chained).</returns> public IndexKeysBuilder GeoSpatialHaystack(string name) { return GeoSpatialHaystack(name, null); } /// <summary> /// Sets the key name and additional field name to create a geospatial haystack index on. /// </summary> /// <param name="name">The key name.</param> /// <param name="additionalName">The name of an additional field to index.</param> /// <returns>The builder (so method calls can be chained).</returns> public IndexKeysBuilder GeoSpatialHaystack(string name, string additionalName) { _document.Add(name, "geoHaystack"); _document.Add(additionalName, 1, additionalName != null); return this; } /// <summary> /// Sets the key name to create a spherical geospatial index on. /// </summary> /// <param name="name">The key name.</param> /// <returns>The builder (so method calls can be chained).</returns> public IndexKeysBuilder GeoSpatialSpherical(string name) { _document.Add(name, "2dsphere"); return this; } /// <summary> /// Sets the key name to create a hashed index on. /// </summary> /// <param name="name">The key name.</param> /// <returns>The builder (so method calls can be chained).</returns> public IndexKeysBuilder Hashed(string name) { _document.Add(name, "hashed"); return this; } /// <summary> /// Sets one or more key names to include in the text index. /// </summary> /// <param name="names">List of key names to include in the text index.</param> /// <returns>The builder (so method calls can be chained).</returns> public IndexKeysBuilder Text(params string[] names) { foreach (var name in names) { _document.Add(name, "text"); } return this; } /// <summary> /// Create a text index that indexes all text fields of a document. /// </summary> /// <returns>The builder (so method calls can be chained).</returns> public IndexKeysBuilder TextAll() { _document.Add("$**", "text"); return this; } /// <summary> /// Returns the result of the builder as a BsonDocument. /// </summary> /// <returns>A BsonDocument.</returns> public override BsonDocument ToBsonDocument() { return _document; } /// <summary> /// Sets a wildcard key to the index. The method doesn't expect to specify a wildcard key explicitly. /// </summary> /// <param name="name">The wildcard key name. If the wildcard name is empty, the generated key will be `All field paths`, otherwise `A single field path`.</param> /// <returns>The builder (so method calls can be chained).</returns> public IndexKeysBuilder Wildcard(string name = null) { var wildcard = name; if (wildcard == null) { wildcard = "$**"; } else { wildcard += ".$**"; } _document.Add(wildcard, 1); return this; } // nested class new internal class Serializer : SerializerBase<IndexKeysBuilder> { public override void Serialize(BsonSerializationContext context, BsonSerializationArgs args, IndexKeysBuilder value) { BsonDocumentSerializer.Instance.Serialize(context, value._document); } } } /// <summary> /// A builder for specifying the keys for an index. /// </summary> /// <typeparam name="TDocument">The type of the document.</typeparam> public static class IndexKeys<TDocument> { // public static methods /// <summary> /// Sets one or more key names to index in ascending order. /// </summary> /// <param name="memberExpressions">The member expressions.</param> /// <returns> /// The builder (so method calls can be chained). /// </returns> public static IndexKeysBuilder<TDocument> Ascending(params Expression<Func<TDocument, object>>[] memberExpressions) { return new IndexKeysBuilder<TDocument>().Ascending(memberExpressions); } /// <summary> /// Sets one or more key names to index in descending order. /// </summary> /// <param name="memberExpressions">The member expressions.</param> /// <returns> /// The builder (so method calls can be chained). /// </returns> public static IndexKeysBuilder<TDocument> Descending(params Expression<Func<TDocument, object>>[] memberExpressions) { return new IndexKeysBuilder<TDocument>().Descending(memberExpressions); } /// <summary> /// Sets the key name to create a geospatial index on. /// </summary> /// <typeparam name="TMember">The type of the member.</typeparam> /// <param name="memberExpression">The member expression.</param> /// <returns> /// The builder (so method calls can be chained). /// </returns> public static IndexKeysBuilder<TDocument> GeoSpatial<TMember>(Expression<Func<TDocument, TMember>> memberExpression) { return new IndexKeysBuilder<TDocument>().GeoSpatial(memberExpression); } /// <summary> /// Sets the key name to create a geospatial haystack index on. /// </summary> /// <typeparam name="TMember">The type of the member.</typeparam> /// <param name="memberExpression">The member expression.</param> /// <returns> /// The builder (so method calls can be chained). /// </returns> public static IndexKeysBuilder<TDocument> GeoSpatialHaystack<TMember>(Expression<Func<TDocument, TMember>> memberExpression) { return new IndexKeysBuilder<TDocument>().GeoSpatialHaystack(memberExpression); } /// <summary> /// Sets the key name and additional field name to create a geospatial haystack index on. /// </summary> /// <typeparam name="TMember">The type of the member.</typeparam> /// <typeparam name="TAdditionalMember">The type of the additional member.</typeparam> /// <param name="memberExpression">The member expression.</param> /// <param name="additionalMemberExpression">The additional member expression.</param> /// <returns> /// The builder (so method calls can be chained). /// </returns> public static IndexKeysBuilder<TDocument> GeoSpatialHaystack<TMember, TAdditionalMember>(Expression<Func<TDocument, TMember>> memberExpression, Expression<Func<TDocument, TAdditionalMember>> additionalMemberExpression) { return new IndexKeysBuilder<TDocument>().GeoSpatialHaystack(memberExpression, additionalMemberExpression); } /// <summary> /// Sets the key name to create a spherical geospatial index on. /// </summary> /// <typeparam name="TMember">The type of the member.</typeparam> /// <param name="memberExpression">The member expression.</param> /// <returns> /// The builder (so method calls can be chained). /// </returns> public static IndexKeysBuilder<TDocument> GeoSpatialSpherical<TMember>(Expression<Func<TDocument, TMember>> memberExpression) { return new IndexKeysBuilder<TDocument>().GeoSpatialSpherical(memberExpression); } /// <summary> /// Sets the key name to create a hashed index on. /// </summary> /// <typeparam name="TMember">The type of the member.</typeparam> /// <param name="memberExpression">The member expression.</param> /// <returns> /// The builder (so method calls can be chained). /// </returns> public static IndexKeysBuilder<TDocument> Hashed<TMember>(Expression<Func<TDocument, TMember>> memberExpression) { return new IndexKeysBuilder<TDocument>().Hashed(memberExpression); } /// <summary> /// Sets one or more key names to include in the text index. /// </summary> /// <param name="memberExpressions">The member expressions.</param> /// <returns>The builder (so method calls can be chained).</returns> public static IndexKeysBuilder<TDocument> Text(params Expression<Func<TDocument, string>>[] memberExpressions) { return new IndexKeysBuilder<TDocument>().Text(memberExpressions); } /// <summary> /// Sets one or more key names to include in the text index. /// </summary> /// <param name="memberExpressions">The member expressions.</param> /// <returns>The builder (so method calls can be chained).</returns> public static IndexKeysBuilder<TDocument> Text(params Expression<Func<TDocument, IEnumerable<string>>>[] memberExpressions) { return new IndexKeysBuilder<TDocument>().Text(memberExpressions); } /// <summary> /// Create a text index that indexes all text fields of a document. /// </summary> /// <returns>The builder (so method calls can be chained).</returns> public static IndexKeysBuilder<TDocument> TextAll() { return new IndexKeysBuilder<TDocument>().TextAll(); } /// <summary> /// Sets a wildcard key to the index. /// </summary> /// <param name="memberExpression">The member expression representing the wildcard key name. If the wildcard name is empty, the generated key will be `All field paths`, otherwise `A single field path`.</param> /// <returns> /// The builder (so method calls can be chained). /// </returns> public static IndexKeysBuilder<TDocument> Wildcard(Expression<Func<TDocument, object>> memberExpression = null) { return new IndexKeysBuilder<TDocument>().Wildcard(memberExpression); } } /// <summary> /// A builder for specifying the keys for an index. /// </summary> /// <typeparam name="TDocument">The type of the document.</typeparam> #if NET452 [Serializable] #endif [BsonSerializer(typeof(IndexKeysBuilder<>.Serializer))] public class IndexKeysBuilder<TDocument> : BuilderBase, IMongoIndexKeys { // private fields private readonly BsonSerializationInfoHelper _serializationInfoHelper; private IndexKeysBuilder _indexKeysBuilder; // constructors /// <summary> /// Initializes a new instance of the IndexKeysBuilder class. /// </summary> public IndexKeysBuilder() { _serializationInfoHelper = new BsonSerializationInfoHelper(); _indexKeysBuilder = new IndexKeysBuilder(); } // public methods /// <summary> /// Sets one or more key names to index in ascending order. /// </summary> /// <param name="memberExpressions">One or more key names.</param> /// <returns> /// The builder (so method calls can be chained). /// </returns> public IndexKeysBuilder<TDocument> Ascending(params Expression<Func<TDocument, object>>[] memberExpressions) { _indexKeysBuilder = _indexKeysBuilder.Ascending(GetElementNames(memberExpressions).ToArray()); return this; } /// <summary> /// Sets one or more key names to index in descending order. /// </summary> /// <param name="memberExpressions">The member expressions.</param> /// <returns> /// The builder (so method calls can be chained). /// </returns> public IndexKeysBuilder<TDocument> Descending(params Expression<Func<TDocument, object>>[] memberExpressions) { _indexKeysBuilder = _indexKeysBuilder.Descending(GetElementNames(memberExpressions).ToArray()); return this; } /// <summary> /// Sets the key name to create a geospatial index on. /// </summary> /// <typeparam name="TMember">The type of the member.</typeparam> /// <param name="memberExpression">The member expression.</param> /// <returns> /// The builder (so method calls can be chained). /// </returns> public IndexKeysBuilder<TDocument> GeoSpatial<TMember>(Expression<Func<TDocument, TMember>> memberExpression) { _indexKeysBuilder = _indexKeysBuilder.GeoSpatial(GetElementName(memberExpression)); return this; } /// <summary> /// Sets the key name to create a geospatial haystack index on. /// </summary> /// <typeparam name="TMember">The type of the member.</typeparam> /// <param name="memberExpression">The member expression.</param> /// <returns> /// The builder (so method calls can be chained). /// </returns> public IndexKeysBuilder<TDocument> GeoSpatialHaystack<TMember>(Expression<Func<TDocument, TMember>> memberExpression) { _indexKeysBuilder = _indexKeysBuilder.GeoSpatialHaystack(GetElementName(memberExpression)); return this; } /// <summary> /// Sets the key name and additional field name to create a geospatial haystack index on. /// </summary> /// <typeparam name="TMember">The type of the member.</typeparam> /// <typeparam name="TAdditionalMember">The type of the additional member.</typeparam> /// <param name="memberExpression">The member expression.</param> /// <param name="additionalMemberExpression">The additional member expression.</param> /// <returns> /// The builder (so method calls can be chained). /// </returns> public IndexKeysBuilder<TDocument> GeoSpatialHaystack<TMember, TAdditionalMember>(Expression<Func<TDocument, TMember>> memberExpression, Expression<Func<TDocument, TAdditionalMember>> additionalMemberExpression) { _indexKeysBuilder = _indexKeysBuilder.GeoSpatialHaystack(GetElementName(memberExpression), GetElementName(additionalMemberExpression)); return this; } /// <summary> /// Sets the key name to create a spherical geospatial index on. /// </summary> /// <typeparam name="TMember">The type of the member.</typeparam> /// <param name="memberExpression">The member expression.</param> /// <returns> /// The builder (so method calls can be chained). /// </returns> public IndexKeysBuilder<TDocument> GeoSpatialSpherical<TMember>(Expression<Func<TDocument, TMember>> memberExpression) { _indexKeysBuilder = _indexKeysBuilder.GeoSpatialSpherical(GetElementName(memberExpression)); return this; } /// <summary> /// Sets the key name to create a hashed index on. /// </summary> /// <typeparam name="TMember">The type of the member.</typeparam> /// <param name="memberExpression">The member expression.</param> /// <returns> /// The builder (so method calls can be chained). /// </returns> public IndexKeysBuilder<TDocument> Hashed<TMember>(Expression<Func<TDocument, TMember>> memberExpression) { _indexKeysBuilder = _indexKeysBuilder.Hashed(GetElementName(memberExpression)); return this; } /// <summary> /// Sets one or more key names to include in the text index. /// </summary> /// <param name="memberExpressions">The member expressions.</param> /// <returns>The builder (so method calls can be chained).</returns> public IndexKeysBuilder<TDocument> Text(params Expression<Func<TDocument, string>>[] memberExpressions) { _indexKeysBuilder = _indexKeysBuilder.Text(GetElementNames(memberExpressions).ToArray()); return this; } /// <summary> /// Sets one or more key names to include in the text index. /// </summary> /// <param name="memberExpressions">The member expressions.</param> /// <returns>The builder (so method calls can be chained).</returns> public IndexKeysBuilder<TDocument> Text(params Expression<Func<TDocument, IEnumerable<string>>>[] memberExpressions) { _indexKeysBuilder = _indexKeysBuilder.Text(GetElementNames(memberExpressions).ToArray()); return this; } /// <summary> /// Create a text index that indexes all text fields of a document. /// </summary> /// <returns>The builder (so method calls can be chained).</returns> public IndexKeysBuilder<TDocument> TextAll() { _indexKeysBuilder = _indexKeysBuilder.TextAll(); return this; } /// <summary> /// Converts this object to a BsonDocument. /// </summary> /// <returns> /// A BsonDocument. /// </returns> public override BsonDocument ToBsonDocument() { return _indexKeysBuilder.ToBsonDocument(); } /// <summary> /// Sets a wildcard key to the index. /// </summary> /// <param name="memberExpression">The member expression representing the wildcard key name. If the wildcard name is empty, the generated key will be `All field paths`, otherwise `A single field path`.</param> /// <returns> /// The builder (so method calls can be chained). /// </returns> public IndexKeysBuilder<TDocument> Wildcard(Expression<Func<TDocument, object>> memberExpression = null) { var name = memberExpression != null ? GetElementName(memberExpression) : null; _indexKeysBuilder = _indexKeysBuilder.Wildcard(name); return this; } // private methods private string GetElementName<TMember>(Expression<Func<TDocument, TMember>> memberExpression) { return _serializationInfoHelper.GetSerializationInfo(memberExpression).ElementName; } private IEnumerable<string> GetElementNames<TMember>(IEnumerable<Expression<Func<TDocument, TMember>>> memberExpressions) { return memberExpressions.Select(x => GetElementName(x)); } // nested classes new internal class Serializer : SerializerBase<IndexKeysBuilder<TDocument>> { public override void Serialize(BsonSerializationContext context, BsonSerializationArgs args, IndexKeysBuilder<TDocument> value) { BsonDocumentSerializer.Instance.Serialize(context, value._indexKeysBuilder.ToBsonDocument()); } } } }
41.194745
226
0.60935
[ "Apache-2.0" ]
Bouke/mongo-csharp-driver
src/MongoDB.Driver.Legacy/Builders/IndexKeysBuilder.cs
26,653
C#
// <auto-generated/> #nullable enable namespace Omnius.Xeus.Engines.Storages.Internal.Models { internal sealed partial class MerkleTreeSection : global::Omnius.Core.RocketPack.IRocketPackObject<global::Omnius.Xeus.Engines.Storages.Internal.Models.MerkleTreeSection> { public static global::Omnius.Core.RocketPack.IRocketPackObjectFormatter<global::Omnius.Xeus.Engines.Storages.Internal.Models.MerkleTreeSection> Formatter => global::Omnius.Core.RocketPack.IRocketPackObject<global::Omnius.Xeus.Engines.Storages.Internal.Models.MerkleTreeSection>.Formatter; public static global::Omnius.Xeus.Engines.Storages.Internal.Models.MerkleTreeSection Empty => global::Omnius.Core.RocketPack.IRocketPackObject<global::Omnius.Xeus.Engines.Storages.Internal.Models.MerkleTreeSection>.Empty; static MerkleTreeSection() { global::Omnius.Core.RocketPack.IRocketPackObject<global::Omnius.Xeus.Engines.Storages.Internal.Models.MerkleTreeSection>.Formatter = new ___CustomFormatter(); global::Omnius.Core.RocketPack.IRocketPackObject<global::Omnius.Xeus.Engines.Storages.Internal.Models.MerkleTreeSection>.Empty = new global::Omnius.Xeus.Engines.Storages.Internal.Models.MerkleTreeSection(0, 0, 0, global::System.Array.Empty<global::Omnius.Core.Cryptography.OmniHash>()); } private readonly global::System.Lazy<int> ___hashCode; public static readonly int MaxHashesCount = 1073741824; public MerkleTreeSection(int depth, uint blockLength, ulong length, global::Omnius.Core.Cryptography.OmniHash[] hashes) { if (hashes is null) throw new global::System.ArgumentNullException("hashes"); if (hashes.Length > 1073741824) throw new global::System.ArgumentOutOfRangeException("hashes"); this.Depth = depth; this.BlockLength = blockLength; this.Length = length; this.Hashes = new global::Omnius.Core.Collections.ReadOnlyListSlim<global::Omnius.Core.Cryptography.OmniHash>(hashes); ___hashCode = new global::System.Lazy<int>(() => { var ___h = new global::System.HashCode(); if (depth != default) ___h.Add(depth.GetHashCode()); if (blockLength != default) ___h.Add(blockLength.GetHashCode()); if (length != default) ___h.Add(length.GetHashCode()); foreach (var n in hashes) { if (n != default) ___h.Add(n.GetHashCode()); } return ___h.ToHashCode(); }); } public int Depth { get; } public uint BlockLength { get; } public ulong Length { get; } public global::Omnius.Core.Collections.ReadOnlyListSlim<global::Omnius.Core.Cryptography.OmniHash> Hashes { get; } public static global::Omnius.Xeus.Engines.Storages.Internal.Models.MerkleTreeSection Import(global::System.Buffers.ReadOnlySequence<byte> sequence, global::Omnius.Core.IBytesPool bytesPool) { var reader = new global::Omnius.Core.RocketPack.RocketPackObjectReader(sequence, bytesPool); return Formatter.Deserialize(ref reader, 0); } public void Export(global::System.Buffers.IBufferWriter<byte> bufferWriter, global::Omnius.Core.IBytesPool bytesPool) { var writer = new global::Omnius.Core.RocketPack.RocketPackObjectWriter(bufferWriter, bytesPool); Formatter.Serialize(ref writer, this, 0); } public static bool operator ==(global::Omnius.Xeus.Engines.Storages.Internal.Models.MerkleTreeSection? left, global::Omnius.Xeus.Engines.Storages.Internal.Models.MerkleTreeSection? right) { return (right is null) ? (left is null) : right.Equals(left); } public static bool operator !=(global::Omnius.Xeus.Engines.Storages.Internal.Models.MerkleTreeSection? left, global::Omnius.Xeus.Engines.Storages.Internal.Models.MerkleTreeSection? right) { return !(left == right); } public override bool Equals(object? other) { if (other is not global::Omnius.Xeus.Engines.Storages.Internal.Models.MerkleTreeSection) return false; return this.Equals((global::Omnius.Xeus.Engines.Storages.Internal.Models.MerkleTreeSection)other); } public bool Equals(global::Omnius.Xeus.Engines.Storages.Internal.Models.MerkleTreeSection? target) { if (target is null) return false; if (object.ReferenceEquals(this, target)) return true; if (this.Depth != target.Depth) return false; if (this.BlockLength != target.BlockLength) return false; if (this.Length != target.Length) return false; if (!global::Omnius.Core.Helpers.CollectionHelper.Equals(this.Hashes, target.Hashes)) return false; return true; } public override int GetHashCode() => ___hashCode.Value; private sealed class ___CustomFormatter : global::Omnius.Core.RocketPack.IRocketPackObjectFormatter<global::Omnius.Xeus.Engines.Storages.Internal.Models.MerkleTreeSection> { public void Serialize(ref global::Omnius.Core.RocketPack.RocketPackObjectWriter w, in global::Omnius.Xeus.Engines.Storages.Internal.Models.MerkleTreeSection value, in int rank) { if (rank > 256) throw new global::System.FormatException(); if (value.Depth != 0) { w.Write((uint)1); w.Write(value.Depth); } if (value.BlockLength != 0) { w.Write((uint)2); w.Write(value.BlockLength); } if (value.Length != 0) { w.Write((uint)3); w.Write(value.Length); } if (value.Hashes.Count != 0) { w.Write((uint)4); w.Write((uint)value.Hashes.Count); foreach (var n in value.Hashes) { global::Omnius.Core.Cryptography.OmniHash.Formatter.Serialize(ref w, n, rank + 1); } } w.Write((uint)0); } public global::Omnius.Xeus.Engines.Storages.Internal.Models.MerkleTreeSection Deserialize(ref global::Omnius.Core.RocketPack.RocketPackObjectReader r, in int rank) { if (rank > 256) throw new global::System.FormatException(); int p_depth = 0; uint p_blockLength = 0; ulong p_length = 0; global::Omnius.Core.Cryptography.OmniHash[] p_hashes = global::System.Array.Empty<global::Omnius.Core.Cryptography.OmniHash>(); for (; ; ) { uint id = r.GetUInt32(); if (id == 0) break; switch (id) { case 1: { p_depth = r.GetInt32(); break; } case 2: { p_blockLength = r.GetUInt32(); break; } case 3: { p_length = r.GetUInt64(); break; } case 4: { var length = r.GetUInt32(); p_hashes = new global::Omnius.Core.Cryptography.OmniHash[length]; for (int i = 0; i < p_hashes.Length; i++) { p_hashes[i] = global::Omnius.Core.Cryptography.OmniHash.Formatter.Deserialize(ref r, rank + 1); } break; } } } return new global::Omnius.Xeus.Engines.Storages.Internal.Models.MerkleTreeSection(p_depth, p_blockLength, p_length, p_hashes); } } } }
50.461078
298
0.567343
[ "MIT" ]
KeitoTobi1/xeus
src/Omnius.Xeus.Engines.Implementations/Storages/Internal/Models/_RocketPack/_Generated.cs
8,427
C#
// Decompiled with JetBrains decompiler // Type: Functal.FnFunction_Cast_ToInt64_FromSByte // Assembly: Functal, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null // MVID: 47DC2DAE-D56F-4FC5-A0C3-CC69F2DF9A1F // Assembly location: \\WSE\Folder Redirection\JP\Downloads\Functal-1_0_0\Functal.dll namespace Functal { internal class FnFunction_Cast_ToInt64_FromSByte : FnFunction<long> { [FnArg] protected FnObject<sbyte> Value; public FnFunction_Cast_ToInt64_FromSByte() : base(new FnFunction<long>.CompileFlags[1] { FnFunction<long>.CompileFlags.IMPLICIT_CONVERSION }) { } public override long GetValue() { return (long) this.Value.GetValue(); } } }
25.964286
85
0.713893
[ "MIT" ]
jpdillingham/Functal
src/FnFunction_Cast_ToInt64_FromSByte.cs
729
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace WebApp.Totp.Interface { public interface ITotpGenerator { /// <summary> /// Generates a valid TOTP. /// </summary> /// <param name="accountSecretKey">User's secret key. Same as used to create the setup.</param> /// <returns>Creates a 6 digit one time password.</returns> int Generate(string accountSecretKey); int Generate(string accountSecretKey,long counter, int digit); /// <summary> /// Gets valid valid TOTPs. /// </summary> /// <param name="accountSecretKey">User's secret key. Same as used to create the setup.</param> /// <param name="timeTolerance">Time tolerance in seconds to acceppt before and after now.</param> /// <returns>List of valid totps.</returns> IEnumerable<int> GetValidTotps(string accountSecretKey, TimeSpan timeTolerance); long GetCurrentCounter(); } }
31.727273
106
0.651385
[ "MIT" ]
ratreraj/Totp.Core.POC
WebApp.Totp/Interface/ITotpGenerator.cs
1,049
C#
// ***************************************************************************** // // © Component Factory Pty Ltd 2012. All rights reserved. // The software and associated documentation supplied hereunder are the // proprietary information of Component Factory Pty Ltd, 17/267 Nepean Hwy, // Seaford, Vic 3198, Australia and are supplied subject to licence terms. // // Version 4.4.0.0 www.ComponentFactory.com // ***************************************************************************** using System; using System.Text; using System.Drawing; using System.Windows.Forms; using System.Diagnostics; using ComponentFactory.Krypton.Toolkit; namespace ComponentFactory.Krypton.Ribbon { /// <summary> /// Provide context title click functionality. /// </summary> internal class ContextTitleController : GlobalId, IMouseController { #region Instance Fields private KryptonRibbon _ribbon; private ContextTabSet _context; private bool _mouseOver; #endregion #region Identity /// <summary> /// Initialize a new instance of the ContextTitleController class. /// </summary> /// <param name="ribbon">Reference to owning ribbon instance.</param> public ContextTitleController(KryptonRibbon ribbon) { Debug.Assert(ribbon != null); _ribbon = ribbon; } #endregion #region ContextTabSet /// <summary> /// Gets and sets the associated context tab set. /// </summary> public ContextTabSet ContextTabSet { get { return _context; } set { _context = value; } } #endregion #region Mouse Notifications /// <summary> /// Mouse has entered the view. /// </summary> /// <param name="c">Reference to the source control instance.</param> public virtual void MouseEnter(Control c) { // Mouse is over the target _mouseOver = true; } /// <summary> /// Mouse has moved inside the view. /// </summary> /// <param name="c">Reference to the source control instance.</param> /// <param name="pt">Mouse position relative to control.</param> public virtual void MouseMove(Control c, Point pt) { } /// <summary> /// Mouse button has been pressed in the view. /// </summary> /// <param name="c">Reference to the source control instance.</param> /// <param name="pt">Mouse position relative to control.</param> /// <param name="button">Mouse button pressed down.</param> /// <returns>True if capturing input; otherwise false.</returns> public virtual bool MouseDown(Control c, Point pt, MouseButtons button) { // Only interested if the mouse is over the element if (_mouseOver) { // Only interested in left mouse pressing down if (button == MouseButtons.Left) { if (ContextTabSet != null) { // We do not operate the context selection at design time if (!_ribbon.InDesignMode && _ribbon.Enabled) { // Select the first tab in the context ContextTabSet.FirstTab.RibbonTab.Ribbon.SelectedTab = ContextTabSet.FirstTab.RibbonTab; } } } } return false; } /// <summary> /// Mouse button has been released in the view. /// </summary> /// <param name="c">Reference to the source control instance.</param> /// <param name="pt">Mouse position relative to control.</param> /// <param name="button">Mouse button released.</param> public virtual void MouseUp(Control c, Point pt, MouseButtons button) { } /// <summary> /// Mouse has left the view. /// </summary> /// <param name="c">Reference to the source control instance.</param> /// <param name="next">Reference to view that is next to have the mouse.</param> public virtual void MouseLeave(Control c, ViewBase next) { // Mouse is no longer over the target _mouseOver = false; } /// <summary> /// Left mouse button double click. /// </summary> /// <param name="pt">Mouse position relative to control.</param> public virtual void DoubleClick(Point pt) { } /// <summary> /// Should the left mouse down be ignored when present on a visual form border area. /// </summary> public virtual bool IgnoreVisualFormLeftButtonDown { get { return false; } } #endregion } }
34.791667
115
0.542315
[ "BSD-3-Clause" ]
ElektroStudios/Krypton
Source/Krypton Components/ComponentFactory.Krypton.Ribbon/Controller/ContextTitleController.cs
5,013
C#
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; using NuGet.Common; using NuGet.Packaging; using NuGet.ProjectModel; using NuGet.Versioning; namespace NuGet.Commands { public interface IProjectFactory { WarningProperties GetWarningPropertiesForProject(); Dictionary<string, string> GetProjectProperties(); void SetIncludeSymbols(bool includeSymbols); ILogger Logger { get; set; } PackageBuilder CreateBuilder(string basePath, NuGetVersion version, string suffix, bool buildIfNeeded, PackageBuilder builder = null); } }
33.636364
142
0.754054
[ "Apache-2.0" ]
0xced/NuGet.Client
src/NuGet.Core/NuGet.Commands/IProjectFactory.cs
740
C#
// Copyright (c) 2007-2018 Thong Nguyen (tumtumtum@gmail.com) using System; using Shaolinq.Persistence; namespace Shaolinq { [AttributeUsage(AttributeTargets.Class)] public class DataAccessTypeAttribute : Attribute { public string Name { get; set; } public DataAccessTypeAttribute() { } public DataAccessTypeAttribute(string name) { this.Name = name; } internal string GetName(TypeDescriptor type, string transformString = "") { return VariableSubstituter.SedTransform(VariableSubstituter.Substitute(this.Name ?? type.TypeName, type), transformString); } } }
21.586207
127
0.707668
[ "MIT" ]
asizikov/Shaolinq
src/Shaolinq/DataAccessTypeAttribute.cs
628
C#
using System; using NetRuntimeSystem = System; using System.ComponentModel; using NetOffice.Attributes; namespace NetOffice.MSHTMLApi { #region Delegates #pragma warning disable public delegate void HTMLFrameBase_onhelpEventHandler(); public delegate void HTMLFrameBase_onclickEventHandler(); public delegate void HTMLFrameBase_ondblclickEventHandler(); public delegate void HTMLFrameBase_onkeypressEventHandler(); public delegate void HTMLFrameBase_onkeydownEventHandler(); public delegate void HTMLFrameBase_onkeyupEventHandler(); public delegate void HTMLFrameBase_onmouseoutEventHandler(); public delegate void HTMLFrameBase_onmouseoverEventHandler(); public delegate void HTMLFrameBase_onmousemoveEventHandler(); public delegate void HTMLFrameBase_onmousedownEventHandler(); public delegate void HTMLFrameBase_onmouseupEventHandler(); public delegate void HTMLFrameBase_onselectstartEventHandler(); public delegate void HTMLFrameBase_onfilterchangeEventHandler(); public delegate void HTMLFrameBase_ondragstartEventHandler(); public delegate void HTMLFrameBase_onbeforeupdateEventHandler(); public delegate void HTMLFrameBase_onafterupdateEventHandler(); public delegate void HTMLFrameBase_onerrorupdateEventHandler(); public delegate void HTMLFrameBase_onrowexitEventHandler(); public delegate void HTMLFrameBase_onrowenterEventHandler(); public delegate void HTMLFrameBase_ondatasetchangedEventHandler(); public delegate void HTMLFrameBase_ondataavailableEventHandler(); public delegate void HTMLFrameBase_ondatasetcompleteEventHandler(); public delegate void HTMLFrameBase_onlosecaptureEventHandler(); public delegate void HTMLFrameBase_onpropertychangeEventHandler(); public delegate void HTMLFrameBase_onscrollEventHandler(); public delegate void HTMLFrameBase_onfocusEventHandler(); public delegate void HTMLFrameBase_onblurEventHandler(); public delegate void HTMLFrameBase_onresizeEventHandler(); public delegate void HTMLFrameBase_ondragEventHandler(); public delegate void HTMLFrameBase_ondragendEventHandler(); public delegate void HTMLFrameBase_ondragenterEventHandler(); public delegate void HTMLFrameBase_ondragoverEventHandler(); public delegate void HTMLFrameBase_ondragleaveEventHandler(); public delegate void HTMLFrameBase_ondropEventHandler(); public delegate void HTMLFrameBase_onbeforecutEventHandler(); public delegate void HTMLFrameBase_oncutEventHandler(); public delegate void HTMLFrameBase_onbeforecopyEventHandler(); public delegate void HTMLFrameBase_oncopyEventHandler(); public delegate void HTMLFrameBase_onbeforepasteEventHandler(); public delegate void HTMLFrameBase_onpasteEventHandler(); public delegate void HTMLFrameBase_oncontextmenuEventHandler(); public delegate void HTMLFrameBase_onrowsdeleteEventHandler(); public delegate void HTMLFrameBase_onrowsinsertedEventHandler(); public delegate void HTMLFrameBase_oncellchangeEventHandler(); public delegate void HTMLFrameBase_onreadystatechangeEventHandler(); public delegate void HTMLFrameBase_onbeforeeditfocusEventHandler(); public delegate void HTMLFrameBase_onlayoutcompleteEventHandler(); public delegate void HTMLFrameBase_onpageEventHandler(); public delegate void HTMLFrameBase_onbeforedeactivateEventHandler(); public delegate void HTMLFrameBase_onbeforeactivateEventHandler(); public delegate void HTMLFrameBase_onmoveEventHandler(); public delegate void HTMLFrameBase_oncontrolselectEventHandler(); public delegate void HTMLFrameBase_onmovestartEventHandler(); public delegate void HTMLFrameBase_onmoveendEventHandler(); public delegate void HTMLFrameBase_onresizestartEventHandler(); public delegate void HTMLFrameBase_onresizeendEventHandler(); public delegate void HTMLFrameBase_onmouseenterEventHandler(); public delegate void HTMLFrameBase_onmouseleaveEventHandler(); public delegate void HTMLFrameBase_onmousewheelEventHandler(); public delegate void HTMLFrameBase_onactivateEventHandler(); public delegate void HTMLFrameBase_ondeactivateEventHandler(); public delegate void HTMLFrameBase_onfocusinEventHandler(); public delegate void HTMLFrameBase_onfocusoutEventHandler(); #pragma warning restore #endregion /// <summary> /// CoClass HTMLFrameBase /// SupportByVersion MSHTML, 4 /// </summary> [SupportByVersion("MSHTML", 4)] [EntityType(EntityType.IsCoClass)] [ComEventContract(typeof(NetOffice.MSHTMLApi.EventContracts.HTMLControlElementEvents))] [TypeId("3050F312-98B5-11CF-BB82-00AA00BDCE0B")] public interface HTMLFrameBase : DispHTMLFrameBase, IEventBinding { #region Events /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onhelpEventHandler onhelpEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onclickEventHandler onclickEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_ondblclickEventHandler ondblclickEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onkeypressEventHandler onkeypressEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onkeydownEventHandler onkeydownEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onkeyupEventHandler onkeyupEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onmouseoutEventHandler onmouseoutEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onmouseoverEventHandler onmouseoverEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onmousemoveEventHandler onmousemoveEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onmousedownEventHandler onmousedownEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onmouseupEventHandler onmouseupEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onselectstartEventHandler onselectstartEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onfilterchangeEventHandler onfilterchangeEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_ondragstartEventHandler ondragstartEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onbeforeupdateEventHandler onbeforeupdateEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onafterupdateEventHandler onafterupdateEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onerrorupdateEventHandler onerrorupdateEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onrowexitEventHandler onrowexitEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onrowenterEventHandler onrowenterEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_ondatasetchangedEventHandler ondatasetchangedEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_ondataavailableEventHandler ondataavailableEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_ondatasetcompleteEventHandler ondatasetcompleteEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onlosecaptureEventHandler onlosecaptureEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onpropertychangeEventHandler onpropertychangeEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onscrollEventHandler onscrollEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onfocusEventHandler onfocusEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onblurEventHandler onblurEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onresizeEventHandler onresizeEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_ondragEventHandler ondragEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_ondragendEventHandler ondragendEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_ondragenterEventHandler ondragenterEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_ondragoverEventHandler ondragoverEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_ondragleaveEventHandler ondragleaveEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_ondropEventHandler ondropEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onbeforecutEventHandler onbeforecutEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_oncutEventHandler oncutEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onbeforecopyEventHandler onbeforecopyEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_oncopyEventHandler oncopyEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onbeforepasteEventHandler onbeforepasteEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onpasteEventHandler onpasteEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_oncontextmenuEventHandler oncontextmenuEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onrowsdeleteEventHandler onrowsdeleteEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onrowsinsertedEventHandler onrowsinsertedEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_oncellchangeEventHandler oncellchangeEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onreadystatechangeEventHandler onreadystatechangeEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onbeforeeditfocusEventHandler onbeforeeditfocusEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onlayoutcompleteEventHandler onlayoutcompleteEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onpageEventHandler onpageEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onbeforedeactivateEventHandler onbeforedeactivateEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onbeforeactivateEventHandler onbeforeactivateEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onmoveEventHandler onmoveEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_oncontrolselectEventHandler oncontrolselectEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onmovestartEventHandler onmovestartEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onmoveendEventHandler onmoveendEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onresizestartEventHandler onresizestartEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onresizeendEventHandler onresizeendEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onmouseenterEventHandler onmouseenterEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onmouseleaveEventHandler onmouseleaveEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onmousewheelEventHandler onmousewheelEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onactivateEventHandler onactivateEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_ondeactivateEventHandler ondeactivateEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onfocusinEventHandler onfocusinEvent; /// <summary> /// SupportByVersion MSHTML 4 /// </summary> [SupportByVersion("MSHTML", 4)] event HTMLFrameBase_onfocusoutEventHandler onfocusoutEvent; #endregion } }
31.719745
91
0.762182
[ "MIT" ]
igoreksiz/NetOffice
Source/MSHTML/Classes/HTMLFrameBase.cs
14,942
C#
using Rebus.Configuration; namespace Rebus.MongoDb2 { /// <summary> /// Configuration extensions to allow for fluently configuring Rebus with MongoDB /// </summary> public static class MongoDbExtensions { /// <summary> /// Configures Rebus to store subscriptions in the given collection in MongoDB, in the database specified by the connection string /// </summary> public static void StoreInMongoDb(this RebusSubscriptionsConfigurer configurer, string connectionString, string collectionName) { configurer.Use(new MongoDbSubscriptionStorage(connectionString, collectionName)); } /// <summary> /// Configures Rebus to store saga data in MongoDB, in the database specified by the connection string /// </summary> public static MongoDbSagaPersisterConfigurationBuilder StoreInMongoDb(this RebusSagasConfigurer configurer, string connectionString) { var persister = new MongoDbSagaPersister(connectionString); configurer.Use(persister); return new MongoDbSagaPersisterConfigurationBuilder(persister); } /// <summary> /// Configures Rebus to store timeouts internally in the given collection in MongoDB, in the database specified by the connection string /// </summary> public static void StoreInMongoDb(this RebusTimeoutsConfigurer configurer, string connectionString, string collectionName) { configurer.Use(new MongoDbTimeoutStorage(connectionString, collectionName)); } /// <summary> /// Fluent builder class that forwards calls to the configured saga persister instance /// </summary> public class MongoDbSagaPersisterConfigurationBuilder { readonly MongoDbSagaPersister mongoDbSagaPersister; internal MongoDbSagaPersisterConfigurationBuilder(MongoDbSagaPersister mongoDbSagaPersister) { this.mongoDbSagaPersister = mongoDbSagaPersister; } /// <summary> /// Configures the saga persister to store saga data of the given type in the specified collection /// </summary> public MongoDbSagaPersister SetCollectionName<TSagaData>(string collectionName) where TSagaData : ISagaData { return mongoDbSagaPersister.SetCollectionName<TSagaData>(collectionName); } /// <summary> /// Turns on automatic saga collection name generation - will kick in for all saga data types that have /// not had a collection name explicitly configured /// </summary> public MongoDbSagaPersister AllowAutomaticSagaCollectionNames() { return mongoDbSagaPersister.AllowAutomaticSagaCollectionNames(); } } } }
44.104478
144
0.65753
[ "Apache-2.0" ]
dbuenor/Rebus.MongoDb2
Rebus.MongoDb2/MongoDbExtensions.cs
2,957
C#
namespace Angular.Server.WebAPI.Models.ElectricalDeviceModel { public class ElectricalDeviceModelListModel { public string ModelName { get; set; } public string Description { get; set; } public string MeasuringUnit { get; set; } public double MinValue { get; set; } public double MaxValue { get; set; } public double Step { get; set; } public double PowerPerStep { get; set; } public double PowerAtLowestUnitLevel { get; set; } public string ManufacturerName { get; set; } public int ManufacturerId { get; set; } public string ElectricalDeviceTypeName { get; set; } } }
25.285714
62
0.610169
[ "MIT" ]
JediKnights/TelerikAcademy-Angular-Course-Server
src/Angular.Server.WebAPI/Models/ElectricalDeviceModel/ElectricalDeviceModelListModel.cs
710
C#
using Amazon.JSII.Runtime.Deputy; #pragma warning disable CS0672,CS0809,CS1591 namespace aws { [JsiiByValue(fqn: "aws.Wafv2WebAclRuleStatementRateBasedStatementScopeDownStatementXssMatchStatementFieldToMatchMethod")] public class Wafv2WebAclRuleStatementRateBasedStatementScopeDownStatementXssMatchStatementFieldToMatchMethod : aws.IWafv2WebAclRuleStatementRateBasedStatementScopeDownStatementXssMatchStatementFieldToMatchMethod { } }
37.75
215
0.871965
[ "MIT" ]
scottenriquez/cdktf-alpha-csharp-testing
resources/.gen/aws/aws/Wafv2WebAclRuleStatementRateBasedStatementScopeDownStatementXssMatchStatementFieldToMatchMethod.cs
453
C#
// // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. // namespace Microsoft.Azure.Functions.PowerShellWorker.DependencyManagement { using System; using System.IO; using System.Linq; using System.Threading; using Microsoft.Azure.Functions.PowerShellWorker.Utility; using LogLevel = Microsoft.Azure.WebJobs.Script.Grpc.Messages.RpcLog.Types.Level; internal class DependencySnapshotPurger : IDependencySnapshotPurger, IDisposable { private readonly IDependencyManagerStorage _storage; private readonly TimeSpan _heartbeatPeriod; private readonly TimeSpan _oldHeartbeatAgeMargin; private readonly int _minNumberOfSnapshotsToKeep; private string _currentlyUsedSnapshotPath; private Timer _heartbeat; public DependencySnapshotPurger( IDependencyManagerStorage storage, TimeSpan? heartbeatPeriod = null, TimeSpan? oldHeartbeatAgeMargin = null, int? minNumberOfSnapshotsToKeep = null) { _storage = storage; _heartbeatPeriod = heartbeatPeriod ?? GetHeartbeatPeriod(); _oldHeartbeatAgeMargin = oldHeartbeatAgeMargin ?? GetOldHeartbeatAgeMargin(); _minNumberOfSnapshotsToKeep = minNumberOfSnapshotsToKeep ?? GetMinNumberOfSnapshotsToKeep(); } /// <summary> /// Set the path to the snapshot currently used by the current worker. /// As long as there is any live worker that declared this snapshot as /// being in use, this snapshot should not be purged by any worker. /// </summary> public void SetCurrentlyUsedSnapshot(string path, ILogger logger) { _currentlyUsedSnapshotPath = path; Heartbeat(path, logger); _heartbeat = new Timer( _ => Heartbeat(path, logger), state: null, dueTime: _heartbeatPeriod, period: _heartbeatPeriod); } /// <summary> /// Remove unused snapshots. /// A snapshot is considered unused if it has not been accessed for at least /// (MDHeartbeatPeriod + MDOldSnapshotHeartbeatMargin) minutes. /// However, the last MDMinNumberOfSnapshotsToKeep snapshots will be kept regardless /// of the access time. /// </summary> public void Purge(ILogger logger) { var allSnapshotPaths = _storage.GetInstalledAndInstallingSnapshots(); var threshold = DateTime.UtcNow - _heartbeatPeriod - _oldHeartbeatAgeMargin; var pathSortedByAccessTime = allSnapshotPaths .Where(path => string.CompareOrdinal(path, _currentlyUsedSnapshotPath) != 0) .Select(path => Tuple.Create(path, GetSnapshotAccessTimeUtc(path, logger))) .OrderBy(entry => entry.Item2) .ToArray(); var snapshotsLogmessage = string.Format( PowerShellWorkerStrings.LogDependencySnapshotsInstalledAndSnapshotsToKeep, pathSortedByAccessTime.Length, _minNumberOfSnapshotsToKeep); logger.Log(isUserOnlyLog: false, LogLevel.Trace, snapshotsLogmessage); for (var i = 0; i < pathSortedByAccessTime.Length - _minNumberOfSnapshotsToKeep; ++i) { var creationTime = pathSortedByAccessTime[i].Item2; if (creationTime > threshold) { break; } var pathToRemove = pathSortedByAccessTime[i].Item1; try { var message = string.Format(PowerShellWorkerStrings.RemovingDependenciesFolder, pathToRemove); logger.Log(isUserOnlyLog: false, LogLevel.Trace, message); _storage.RemoveSnapshot(pathToRemove); } catch (IOException e) { var message = string.Format(PowerShellWorkerStrings.FailedToRemoveDependenciesFolder, pathToRemove, e.Message); logger.Log(isUserOnlyLog: false, LogLevel.Warning, message, e); } } } public void Dispose() { _heartbeat?.Dispose(); } internal void Heartbeat(string path, ILogger logger) { logger.Log( isUserOnlyLog: false, LogLevel.Trace, string.Format(PowerShellWorkerStrings.UpdatingManagedDependencySnapshotHeartbeat, path)); if (_storage.SnapshotExists(path)) { try { _storage.SetSnapshotAccessTimeToUtcNow(path); } // The files in the snapshot may be read-only in some scenarios, so updating // the timestamp may fail. However, the snapshot can still be used, and // we should not prevent function executions because of that. // So, just log and move on. catch (IOException e) { LogHeartbeatUpdateFailure(logger, path, e); } catch (UnauthorizedAccessException e) { LogHeartbeatUpdateFailure(logger, path, e); } } } private DateTime GetSnapshotAccessTimeUtc(string path, ILogger logger) { try { return _storage.GetSnapshotAccessTimeUtc(path); } catch (Exception e) when (e is IOException || e is UnauthorizedAccessException) { var message = string.Format(PowerShellWorkerStrings.FailedToRetrieveDependenciesFolderAccessTime, path, e.Message); logger.Log(isUserOnlyLog: false, LogLevel.Warning, message, e); return DateTime.MaxValue; } } private static TimeSpan GetHeartbeatPeriod() { return PowerShellWorkerConfiguration.GetTimeSpan("MDHeartbeatPeriod") ?? TimeSpan.FromMinutes(60); } private static TimeSpan GetOldHeartbeatAgeMargin() { return PowerShellWorkerConfiguration.GetTimeSpan("MDOldSnapshotHeartbeatMargin") ?? TimeSpan.FromMinutes(90); } private static int GetMinNumberOfSnapshotsToKeep() { return PowerShellWorkerConfiguration.GetInt("MDMinNumberOfSnapshotsToKeep") ?? 1; } private static void LogHeartbeatUpdateFailure(ILogger logger, string path, Exception exception) { var message = string.Format( PowerShellWorkerStrings.FailedToUpdateManagedDependencySnapshotHeartbeat, path, exception.GetType().FullName, exception.Message); logger.Log(isUserOnlyLog: false, LogLevel.Warning, message); } } }
40.712707
131
0.580676
[ "MIT" ]
AnatoliB/azure-functions-powershell-worker
src/DependencyManagement/DependencySnapshotPurger.cs
7,371
C#
#pragma checksum "D:\Diplom\PrintStore\Views\ShoppingCart\CartView.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "e8a25f77e3feed469afb5622036e0b6cc813c6c3" // <auto-generated/> #pragma warning disable 1591 [assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.Views_ShoppingCart_CartView), @"mvc.1.0.view", @"/Views/ShoppingCart/CartView.cshtml")] [assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(@"/Views/ShoppingCart/CartView.cshtml", typeof(AspNetCore.Views_ShoppingCart_CartView))] namespace AspNetCore { #line hidden using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; using Microsoft.AspNetCore.Mvc.ViewFeatures; #line 1 "D:\Diplom\PrintStore\Views\_ViewImports.cshtml" using PrintStore; #line default #line hidden #line 2 "D:\Diplom\PrintStore\Views\_ViewImports.cshtml" using PrintStore.Models; #line default #line hidden [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"e8a25f77e3feed469afb5622036e0b6cc813c6c3", @"/Views/ShoppingCart/CartView.cshtml")] [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"70f983ffae960d41f9afeb306e0a10f6e766ec90", @"/Views/_ViewImports.cshtml")] public class Views_ShoppingCart_CartView : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<PrintStore.ViewModel.ShoppingCartViewModel> { #line hidden #pragma warning disable 0169 private string __tagHelperStringValueBuffer; #pragma warning restore 0169 private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext __tagHelperExecutionContext; private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner __tagHelperRunner = new global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner(); private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager __backed__tagHelperScopeManager = null; private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager __tagHelperScopeManager { get { if (__backed__tagHelperScopeManager == null) { __backed__tagHelperScopeManager = new global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager(StartTagHelperWritingScope, EndTagHelperWritingScope); } return __backed__tagHelperScopeManager; } } private global::Microsoft.AspNetCore.Mvc.TagHelpers.OptionTagHelper __Microsoft_AspNetCore_Mvc_TagHelpers_OptionTagHelper; #pragma warning disable 1998 public async override global::System.Threading.Tasks.Task ExecuteAsync() { #line 2 "D:\Diplom\PrintStore\Views\ShoppingCart\CartView.cshtml" ViewData["Title"] = "CartView"; #line default #line hidden #line 5 "D:\Diplom\PrintStore\Views\ShoppingCart\CartView.cshtml" List<string> th = new List<string> { "", "Тип бумаги","Плотность бумаги", "Количество","Сроки","Цена за шт.","Всего"}; List<string> paperType = new List<string> { "Офсетная", "Цифровая печать", "Мелованная офсетная", "Мелованная для цифровой печати" }; List<string> paperP = new List<string> { "90 г/м2", "130 г/м2", "170 г/м2", "250 г/м2", "300 г/м2" }; List<string> Count = new List<string> { "10", "100", "500", "1000", "5000" }; List<string> deadline = new List<string> { "5-7 дней", "3-4 дня", "1-2 дня", "24 часа", "12 часов", "6 часов", "14-20 дней" }; #line default #line hidden BeginContext(687, 81, true); WriteLiteral("<table class=\"CartData\" width=\"100%\" border=\"1\">\r\n <tr style=\"height:35px;\">\r\n"); EndContext(); #line 15 "D:\Diplom\PrintStore\Views\ShoppingCart\CartView.cshtml" foreach (var item in th) { #line default #line hidden BeginContext(814, 16, true); WriteLiteral(" <th>"); EndContext(); BeginContext(831, 4, false); #line 17 "D:\Diplom\PrintStore\Views\ShoppingCart\CartView.cshtml" Write(item); #line default #line hidden EndContext(); BeginContext(835, 7, true); WriteLiteral("</th>\r\n"); EndContext(); #line 18 "D:\Diplom\PrintStore\Views\ShoppingCart\CartView.cshtml" } #line default #line hidden BeginContext(853, 11, true); WriteLiteral(" </tr>\r\n"); EndContext(); #line 20 "D:\Diplom\PrintStore\Views\ShoppingCart\CartView.cshtml" foreach (var item in Model.CartItems) { #line default #line hidden BeginContext(915, 11, true); WriteLiteral(" <tr"); EndContext(); BeginWriteAttribute("id", " id=\"", 926, "\"", 947, 1); #line 22 "D:\Diplom\PrintStore\Views\ShoppingCart\CartView.cshtml" WriteAttributeValue("", 931, item.product.Id, 931, 16, false); #line default #line hidden EndWriteAttribute(); BeginContext(948, 48, true); WriteLiteral(">\r\n <td width=\"200px\" height=\"200px\">"); EndContext(); BeginContext(997, 17, false); #line 23 "D:\Diplom\PrintStore\Views\ShoppingCart\CartView.cshtml" Write(item.product.Name); #line default #line hidden EndContext(); BeginContext(1014, 20, true); WriteLiteral("<img class=\"CartImg\""); EndContext(); BeginWriteAttribute("src", " src=\"", 1034, "\"", 1108, 2); WriteAttributeValue("", 1040, "data:image/jpeg;base64,", 1040, 23, true); #line 23 "D:\Diplom\PrintStore\Views\ShoppingCart\CartView.cshtml" WriteAttributeValue("", 1063, Convert.ToBase64String(item.product.Picture), 1063, 45, false); #line default #line hidden EndWriteAttribute(); BeginContext(1109, 10, true); WriteLiteral(" /></td>\r\n"); EndContext(); BeginContext(1164, 41, true); WriteLiteral(" <td>\r\n <select"); EndContext(); BeginWriteAttribute("id", " id=\"", 1205, "\"", 1235, 2); WriteAttributeValue("", 1210, "PaperType-", 1210, 10, true); #line 26 "D:\Diplom\PrintStore\Views\ShoppingCart\CartView.cshtml" WriteAttributeValue("", 1220, item.productId, 1220, 15, false); #line default #line hidden EndWriteAttribute(); BeginContext(1236, 87, true); WriteLiteral(" name=\"PaperType\" class=\"form-control\" onchange=\"Price(this.id)\">\r\n "); EndContext(); BeginContext(1323, 54, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("option", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "f0e00d9f803c405d92792340bbdcc5a1", async() => { BeginContext(1349, 19, true); WriteLiteral("Выберите тип бумаги"); EndContext(); } ); __Microsoft_AspNetCore_Mvc_TagHelpers_OptionTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.OptionTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_OptionTagHelper); BeginWriteTagHelperAttribute(); __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); __tagHelperExecutionContext.AddHtmlAttribute("disabled", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.Minimized); BeginWriteTagHelperAttribute(); __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); __tagHelperExecutionContext.AddHtmlAttribute("selected", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.Minimized); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(1377, 2, true); WriteLiteral("\r\n"); EndContext(); #line 28 "D:\Diplom\PrintStore\Views\ShoppingCart\CartView.cshtml" foreach (var pT in paperType) { #line default #line hidden BeginContext(1454, 24, true); WriteLiteral(" "); EndContext(); BeginContext(1478, 32, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("option", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "cde3455049504f7dbd7a8ceee2d549d1", async() => { BeginContext(1499, 2, false); #line 30 "D:\Diplom\PrintStore\Views\ShoppingCart\CartView.cshtml" Write(pT); #line default #line hidden EndContext(); } ); __Microsoft_AspNetCore_Mvc_TagHelpers_OptionTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.OptionTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_OptionTagHelper); BeginWriteTagHelperAttribute(); #line 30 "D:\Diplom\PrintStore\Views\ShoppingCart\CartView.cshtml" WriteLiteral(pT); #line default #line hidden __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); __Microsoft_AspNetCore_Mvc_TagHelpers_OptionTagHelper.Value = __tagHelperStringValueBuffer; __tagHelperExecutionContext.AddTagHelperAttribute("value", __Microsoft_AspNetCore_Mvc_TagHelpers_OptionTagHelper.Value, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(1510, 2, true); WriteLiteral("\r\n"); EndContext(); #line 31 "D:\Diplom\PrintStore\Views\ShoppingCart\CartView.cshtml" } #line default #line hidden BeginContext(1535, 87, true); WriteLiteral(" </select>\r\n </td>\r\n <td>\r\n <select"); EndContext(); BeginWriteAttribute("id", " id=\"", 1622, "\"", 1649, 2); WriteAttributeValue("", 1627, "PaperP-", 1627, 7, true); #line 35 "D:\Diplom\PrintStore\Views\ShoppingCart\CartView.cshtml" WriteAttributeValue("", 1634, item.productId, 1634, 15, false); #line default #line hidden EndWriteAttribute(); BeginContext(1650, 84, true); WriteLiteral(" name=\"PaperP\" class=\"form-control\" onchange=\"Price(this.id)\">\r\n "); EndContext(); BeginContext(1734, 53, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("option", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "7b6a9fe517d14faf99797bf4554b5b0e", async() => { BeginContext(1760, 18, true); WriteLiteral("Выберите плотность"); EndContext(); } ); __Microsoft_AspNetCore_Mvc_TagHelpers_OptionTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.OptionTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_OptionTagHelper); BeginWriteTagHelperAttribute(); __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); __tagHelperExecutionContext.AddHtmlAttribute("disabled", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.Minimized); BeginWriteTagHelperAttribute(); __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); __tagHelperExecutionContext.AddHtmlAttribute("selected", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.Minimized); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(1787, 2, true); WriteLiteral("\r\n"); EndContext(); #line 37 "D:\Diplom\PrintStore\Views\ShoppingCart\CartView.cshtml" foreach (var pp in paperP) { #line default #line hidden BeginContext(1861, 24, true); WriteLiteral(" "); EndContext(); BeginContext(1885, 32, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("option", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "bf16506d6e5f4370a4561c051f5f2cf9", async() => { BeginContext(1906, 2, false); #line 39 "D:\Diplom\PrintStore\Views\ShoppingCart\CartView.cshtml" Write(pp); #line default #line hidden EndContext(); } ); __Microsoft_AspNetCore_Mvc_TagHelpers_OptionTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.OptionTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_OptionTagHelper); BeginWriteTagHelperAttribute(); #line 39 "D:\Diplom\PrintStore\Views\ShoppingCart\CartView.cshtml" WriteLiteral(pp); #line default #line hidden __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); __Microsoft_AspNetCore_Mvc_TagHelpers_OptionTagHelper.Value = __tagHelperStringValueBuffer; __tagHelperExecutionContext.AddTagHelperAttribute("value", __Microsoft_AspNetCore_Mvc_TagHelpers_OptionTagHelper.Value, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(1917, 2, true); WriteLiteral("\r\n"); EndContext(); #line 40 "D:\Diplom\PrintStore\Views\ShoppingCart\CartView.cshtml" } #line default #line hidden BeginContext(1942, 87, true); WriteLiteral(" </select>\r\n </td>\r\n <td>\r\n <select"); EndContext(); BeginWriteAttribute("id", " id=\"", 2029, "\"", 2055, 2); WriteAttributeValue("", 2034, "Count-", 2034, 6, true); #line 44 "D:\Diplom\PrintStore\Views\ShoppingCart\CartView.cshtml" WriteAttributeValue("", 2040, item.productId, 2040, 15, false); #line default #line hidden EndWriteAttribute(); BeginContext(2056, 83, true); WriteLiteral(" name=\"Count\" class=\"form-control\" onchange=\"Price(this.id)\">\r\n "); EndContext(); BeginContext(2139, 45, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("option", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "58fd473624d84f7097736fab14c92fcf", async() => { BeginContext(2165, 10, true); WriteLiteral("Количество"); EndContext(); } ); __Microsoft_AspNetCore_Mvc_TagHelpers_OptionTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.OptionTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_OptionTagHelper); BeginWriteTagHelperAttribute(); __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); __tagHelperExecutionContext.AddHtmlAttribute("disabled", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.Minimized); BeginWriteTagHelperAttribute(); __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); __tagHelperExecutionContext.AddHtmlAttribute("selected", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.Minimized); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(2184, 2, true); WriteLiteral("\r\n"); EndContext(); #line 46 "D:\Diplom\PrintStore\Views\ShoppingCart\CartView.cshtml" foreach (var c in Count) { #line default #line hidden BeginContext(2256, 24, true); WriteLiteral(" "); EndContext(); BeginContext(2280, 30, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("option", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "0f45b8afa6b94a8ba004c86cc144a6f8", async() => { BeginContext(2300, 1, false); #line 48 "D:\Diplom\PrintStore\Views\ShoppingCart\CartView.cshtml" Write(c); #line default #line hidden EndContext(); } ); __Microsoft_AspNetCore_Mvc_TagHelpers_OptionTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.OptionTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_OptionTagHelper); BeginWriteTagHelperAttribute(); #line 48 "D:\Diplom\PrintStore\Views\ShoppingCart\CartView.cshtml" WriteLiteral(c); #line default #line hidden __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); __Microsoft_AspNetCore_Mvc_TagHelpers_OptionTagHelper.Value = __tagHelperStringValueBuffer; __tagHelperExecutionContext.AddTagHelperAttribute("value", __Microsoft_AspNetCore_Mvc_TagHelpers_OptionTagHelper.Value, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(2310, 2, true); WriteLiteral("\r\n"); EndContext(); #line 49 "D:\Diplom\PrintStore\Views\ShoppingCart\CartView.cshtml" } #line default #line hidden BeginContext(2335, 87, true); WriteLiteral(" </select>\r\n </td>\r\n <td>\r\n <select"); EndContext(); BeginWriteAttribute("id", " id=\"", 2422, "\"", 2451, 2); WriteAttributeValue("", 2427, "deadline-", 2427, 9, true); #line 53 "D:\Diplom\PrintStore\Views\ShoppingCart\CartView.cshtml" WriteAttributeValue("", 2436, item.productId, 2436, 15, false); #line default #line hidden EndWriteAttribute(); BeginContext(2452, 86, true); WriteLiteral(" name=\"deadline\" class=\"form-control\" onchange=\"Price(this.id)\">\r\n "); EndContext(); BeginContext(2538, 39, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("option", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "ce235b2d02c4405389f8bc18993edfaf", async() => { BeginContext(2564, 4, true); WriteLiteral("Срок"); EndContext(); } ); __Microsoft_AspNetCore_Mvc_TagHelpers_OptionTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.OptionTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_OptionTagHelper); BeginWriteTagHelperAttribute(); __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); __tagHelperExecutionContext.AddHtmlAttribute("disabled", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.Minimized); BeginWriteTagHelperAttribute(); __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); __tagHelperExecutionContext.AddHtmlAttribute("selected", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.Minimized); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(2577, 2, true); WriteLiteral("\r\n"); EndContext(); #line 55 "D:\Diplom\PrintStore\Views\ShoppingCart\CartView.cshtml" foreach (var d in deadline) { #line default #line hidden BeginContext(2652, 24, true); WriteLiteral(" "); EndContext(); BeginContext(2676, 30, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("option", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "768536c59525435b924bc13b6d1fc082", async() => { BeginContext(2696, 1, false); #line 57 "D:\Diplom\PrintStore\Views\ShoppingCart\CartView.cshtml" Write(d); #line default #line hidden EndContext(); } ); __Microsoft_AspNetCore_Mvc_TagHelpers_OptionTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.OptionTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_OptionTagHelper); BeginWriteTagHelperAttribute(); #line 57 "D:\Diplom\PrintStore\Views\ShoppingCart\CartView.cshtml" WriteLiteral(d); #line default #line hidden __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); __Microsoft_AspNetCore_Mvc_TagHelpers_OptionTagHelper.Value = __tagHelperStringValueBuffer; __tagHelperExecutionContext.AddTagHelperAttribute("value", __Microsoft_AspNetCore_Mvc_TagHelpers_OptionTagHelper.Value, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(2706, 2, true); WriteLiteral("\r\n"); EndContext(); #line 58 "D:\Diplom\PrintStore\Views\ShoppingCart\CartView.cshtml" } #line default #line hidden BeginContext(2731, 61, true); WriteLiteral(" </select>\r\n </td>\r\n <td"); EndContext(); BeginWriteAttribute("id", " id=\"", 2792, "\"", 2822, 2); WriteAttributeValue("", 2797, "UnitPrice-", 2797, 10, true); #line 61 "D:\Diplom\PrintStore\Views\ShoppingCart\CartView.cshtml" WriteAttributeValue("", 2807, item.productId, 2807, 15, false); #line default #line hidden EndWriteAttribute(); BeginContext(2823, 35, true); WriteLiteral(">Не расчитано</td>\r\n <td"); EndContext(); BeginWriteAttribute("id", " id=\"", 2858, "\"", 2884, 2); WriteAttributeValue("", 2863, "Price-", 2863, 6, true); #line 62 "D:\Diplom\PrintStore\Views\ShoppingCart\CartView.cshtml" WriteAttributeValue("", 2869, item.productId, 2869, 15, false); #line default #line hidden EndWriteAttribute(); BeginContext(2885, 1, true); WriteLiteral(">"); EndContext(); BeginContext(2887, 10, false); #line 62 "D:\Diplom\PrintStore\Views\ShoppingCart\CartView.cshtml" Write(item.Price); #line default #line hidden EndContext(); BeginContext(2897, 48, true); WriteLiteral("</td>\r\n <td>\r\n <button"); EndContext(); BeginWriteAttribute("id", " id=\"", 2945, "\"", 2966, 1); #line 64 "D:\Diplom\PrintStore\Views\ShoppingCart\CartView.cshtml" WriteAttributeValue("", 2950, item.product.Id, 2950, 16, false); #line default #line hidden EndWriteAttribute(); BeginContext(2967, 115, true); WriteLiteral(" class=\"btn btn-default\" onclick=\"RemoveFromCart(this.id)\">Удалить</button>\r\n\r\n </td>\r\n\r\n </tr>\r\n"); EndContext(); #line 69 "D:\Diplom\PrintStore\Views\ShoppingCart\CartView.cshtml" } #line default #line hidden BeginContext(3089, 54, true); WriteLiteral("</table>\r\n<div id=\"Total\">\r\n Итого:0 руб.\r\n</div>\r\n"); EndContext(); BeginContext(3144, 85, false); #line 74 "D:\Diplom\PrintStore\Views\ShoppingCart\CartView.cshtml" Write(Html.ActionLink("Заказать", "Buy", "Buy", new { },new { @class = "btn btn-default" })); #line default #line hidden EndContext(); BeginContext(3229, 990, true); WriteLiteral(@" <script> function Price(id) { var id = id.split('-')[1]; var PaperType = $(""#PaperType-"" + id).val(); var PaperP = $(""#PaperP-"" + id).val(); var Count = $(""#Count-"" + id).val(); var deadline = $(""#deadline-"" + id).val(); $('#update-message').removeClass('showMessage'); $.post(""/ShoppingCart/Calculate"", { ""id"": id, ""PaperType"": PaperType, ""PaperP"": PaperP, ""Count"": Count, ""deadline"": deadline }, function (data) { if (data.price != 0) { console.log(data.Price); $(""#Price-"" + id).text(data.price + "" руб.""); $(""#UnitPrice-"" + id).text(data.price / Count + "" руб.""); $(""#Total"").text(""Итого:"" + data.total + "" руб.""); $('#update-message').addClass('showMessage'); $('#update-message').text(""Данные записаны""); } }); } </script>"); EndContext(); } #pragma warning restore 1998 [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<PrintStore.ViewModel.ShoppingCartViewModel> Html { get; private set; } } } #pragma warning restore 1591
50.421502
216
0.644025
[ "MIT" ]
kostya19980/PrintStore
obj/Release/netcoreapp2.1/Razor/Views/ShoppingCart/CartView.cshtml.g.cs
29,814
C#
using System; namespace GithubActionsLab { public class Program { static void Main(string[] args) { Console.WriteLine("The Quick Calculator"); var loop = true; while (loop) { try { Func<string, string, double> operation = null; Console.WriteLine("1) Add (x+y)"); Console.WriteLine("2) Subtract (x-y)"); Console.WriteLine("3) Multiply (x*y)"); Console.WriteLine("4) Divide (x/y)"); Console.WriteLine("5) Power (x^y)"); Console.WriteLine("6) Quit"); var operationSelection = GetInput("Select your operation: "); switch (operationSelection) { case "1": operation = Add; break; case "2": operation = Subtract; break; case "3": operation = Multiply; break; case "4": operation = Divide; break; case "5": operation = Power; break; case "6": loop = false; continue; default: throw new ArgumentException("You did not select a valid option!"); } var x = GetInput("Enter x: "); var y = GetInput("Enter y: "); var result = operation(x, y); Console.WriteLine($"Result: {result}"); } catch (Exception e) { Console.WriteLine(e.Message); } } } public static string GetInput(string prompt) { Console.Write(prompt); return Console.ReadLine().Trim(); } public static double Add(string x, string y) { return double.Parse(x) + double.Parse(y); } public static double Subtract(string x, string y) { return double.Parse(x) - double.Parse(y); } public static double Multiply(string x, string y) { return double.Parse(x) * double.Parse(y); } public static double Divide(string x, string y) { return double.Parse(x) / double.Parse(y); } // Implement this method following a similar pattern as above public static double Power(string x, string y) { return Math.Pow(double.Parse(x), double.Parse(y)); //Commit to test branch } } }
31.652632
94
0.403392
[ "MIT" ]
matthotovy17/GithubActions
Console/Program.cs
3,009
C#
using Graft.Default; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Graft.Tests { [TestClass] public class DefaultVertexTests { [TestMethod] public void VertexInitialization() { Vertex<int> intVertex = new Vertex<int>(1); Assert.AreEqual(1, intVertex.Value); Vertex<double> doubleVertex = new Vertex<double>(3.16); Assert.AreEqual(3.16, doubleVertex.Value); Vertex<string> stringVertex = new Vertex<string>("test"); Assert.AreEqual("test", stringVertex.Value); } } }
27.454545
69
0.619205
[ "Apache-2.0" ]
alex-c/Graft
test/Graft.Tests/DefaultVertexTests.cs
604
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. // // Generated on 2020 October 09 04:53:22 UTC // </auto-generated> //--------------------------------------------------------- using System.CodeDom.Compiler; using System.Runtime.CompilerServices; using go; #nullable enable namespace go { namespace math { public static partial class big_package { [GeneratedCode("go2cs", "0.1.0.0")] public partial struct Accuracy { // Value of the Accuracy struct private readonly sbyte m_value; public Accuracy(sbyte value) => m_value = value; // Enable implicit conversions between sbyte and Accuracy struct [MethodImpl(MethodImplOptions.AggressiveInlining)] public static implicit operator Accuracy(sbyte value) => new Accuracy(value); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static implicit operator sbyte(Accuracy value) => value.m_value; // Enable comparisons between nil and Accuracy struct [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool operator ==(Accuracy value, NilType nil) => value.Equals(default(Accuracy)); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool operator !=(Accuracy value, NilType nil) => !(value == nil); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool operator ==(NilType nil, Accuracy value) => value == nil; [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool operator !=(NilType nil, Accuracy value) => value != nil; [MethodImpl(MethodImplOptions.AggressiveInlining)] public static implicit operator Accuracy(NilType nil) => default(Accuracy); } } }}
38.185185
107
0.616392
[ "MIT" ]
GridProtectionAlliance/go2cs
src/go-src-converted/math/big/float_AccuracyStructOf(sbyte).cs
2,062
C#
// <auto-generated> // automatically generated by the FlatBuffers compiler, do not modify // </auto-generated> using global::System; using global::FlatBuffers; public struct Rapunzel : IFlatbufferObject { private Struct __p; public ByteBuffer ByteBuffer { get { return __p.bb; } } public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; } public Rapunzel __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; } public int HairLength { get { return __p.bb.GetInt(__p.bb_pos + 0); } } public static Offset<Rapunzel> CreateRapunzel(FlatBufferBuilder builder, int HairLength) { builder.Prep(4, 4); builder.PutInt(HairLength); return new Offset<Rapunzel>(builder.Offset); } };
30.625
92
0.717007
[ "Apache-2.0" ]
AlexMihalev/flatbuffers
tests/union_vector/Rapunzel.cs
735
C#
using System; using System.Collections.Generic; using System.Text; namespace RawData { public class Tire { public Tire(double pressure, int age) { Pressure = pressure; Age = age; } public int Age { get; set; } public double Pressure { get; set; } } }
16.55
45
0.549849
[ "MIT" ]
IvanIvTodorov/SoftUniEducation
C#Advanced/5.DefiningClasses/DefiningClassesExercise/RawData/RawData/Tire.cs
333
C#
using ExcelDna.Integration; namespace TestExcelDna { public static class Functions { [ExcelFunction(Description = "My first .NET function")] public static string HelloDna(string name) { return "Hello " + name; } } }
19.571429
63
0.59854
[ "MIT" ]
ilgnv88/TestExcelDna
TestExcelDnaSolution/TestExcelDna/Functions.cs
276
C#
#region License // Copyright (c) 2012, ClearCanvas Inc. // All rights reserved. // http://www.clearcanvas.ca // // This software is licensed under the Open Software License v3.0. // For the complete license, see http://www.clearcanvas.ca/OSLv3.0 #endregion using ClearCanvas.Common; using ClearCanvas.ImageViewer.Common.WorkItem; using ClearCanvas.ImageViewer.StudyManagement.Core.WorkItemProcessor; namespace ClearCanvas.ImageViewer.Shreds.WorkItemService.DeleteStudy { [ExtensionOf(typeof (WorkItemProcessorFactoryExtensionPoint))] public class DeleteStudyFactory : IWorkItemProcessorFactory { public string GetWorkQueueType() { return DeleteStudyRequest.WorkItemTypeString; } public IWorkItemProcessor GetItemProcessor() { return new DeleteStudyItemProcessor(); } } }
28
70
0.703125
[ "Apache-2.0" ]
SNBnani/Xian
ImageViewer/Shreds/WorkItemService/DeleteStudy/DeleteStudyFactory.cs
898
C#
namespace SKIT.FlurlHttpClient.Wechat.Api.Models { /// <summary> /// <para>表示 [POST] /product/brand/get 接口的请求。</para> /// </summary> public class ProductBrandGetRequest : WechatApiRequest, IInferable<ProductBrandGetRequest, ProductBrandGetResponse> { } }
28
119
0.696429
[ "MIT" ]
OrchesAdam/DotNetCore.SKIT.FlurlHttpClient.Wechat
src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Brand/ProductBrandGetRequest.cs
298
C#
using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading.Tasks; namespace QDMarketPlace.Models.AccountViewModels { public class LoginWithRecoveryCodeViewModel { [Required] [DataType(DataType.Text)] [Display(Name = "Recovery Code")] public string RecoveryCode { get; set; } } }
24.529412
52
0.688249
[ "MIT" ]
quocitspkt/QDMarketPlaceFinal
QDMarketPlace/Models/AccountViewModels/LoginWithRecoveryCodeViewModel.cs
419
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Text.RegularExpressions; using ServerShared.Player; namespace Pyratron.Frameworks.Commands.Parser { /// <summary> /// Handles and parses commands and their arguments. /// </summary> /// <example> /// Create a new parser with: /// Parser = CommandParser.CreateNew().UsePrefix("/").OnError(OnParseError); /// Send commands to the parser with: /// Parser.Parse(input); /// </example> public class CommandParser { #region Delegates /// <summary> /// Contains details on errors encountered during parsing, such as incorrect arguments, failed validation, etc. /// </summary> /// <param name="sender">The parser object that delivered the error.</param> /// <param name="error">An error message describing the error. This should be outputted as a log, chat message, etc.</param> public delegate void ParseErrorHandler(object sender, string error); #endregion /// <summary> /// All of the commands in the parser. /// </summary> public List<Command> Commands { get; set; } /// <summary> /// Fired when an error occurs during parsing. Details on the error are returned such as incorrect arguments, failed validation, etc. /// </summary> public ParseErrorHandler ParseError { get; private set; } /// <summary> /// The prefix, "/" by default, that all commands must be prefixed with. /// Prefix is case-insensitive. /// </summary> public string Prefix { get; set; } private CommandParser() { Commands = new List<Command>(); } private void OnParseError(object sender, string error) { var handler = ParseError; if (handler != null) handler(sender, error); } /// <summary> /// Creates a new command parser for handling commands. /// </summary> public static CommandParser CreateNew(string prefix = "/") { return new CommandParser { Prefix = prefix }; } /// <summary> /// Executes the command with the specified arguments. /// </summary> public CommandParser Execute(Command command, Argument[] arguments, string[] rawArgs) { command.Execute(arguments, rawArgs); return this; } /// <summary> /// Adds a predefined command to the parser. /// </summary> /// <param name="command">The command to execute. Use <c>Command.Create()</c> to create a command.</param> public CommandParser AddCommand(Command command) { Commands.Add(command); return this; } /// <summary> /// Sets the prefix that the parser will use to identity commands. Defaults to "/". /// </summary> public CommandParser UsePrefix(string prefix = "/") { Prefix = prefix; return this; } /// <summary> /// Sets an action to be ran when an error is encountered during parsing. /// Details on the error are returned by the callback. /// </summary> /// <remarks> /// Ideally used to display an error message if the command entered encounters an error. /// </remarks> public CommandParser OnError(Action<object, string> callback) { ParseError += new ParseErrorHandler(callback); return this; } /// <summary> /// Parses text in search of a command (with prefix), and runs it accordingly. /// </summary> /// <remarks> /// Data does not need to be formatted in any way before parsing. Simply pass your input to the function and /// it will determine if it is a valid command, check the command's <c>Command.CanExecute</c> function, and run the /// command. /// Use <c>Arguments[].FromName(...)</c> to get the values of the parsed arguments in the command action. /// </remarks> /// <param name="input">A string inputted by a user. If the string does not start with the parser prefix, it will return false, otherwise it will parse the command.</param> /// <param name="accessLevel">An optional level to limit executing commands if the user doesn't have permission.</param> /// <returns> /// True if the input is non-empty and starts with the <c>Prefix</c>. /// If the input does not start with a prefix, it returns false so the message can be processed further. (As a chat message, for example) /// </returns> public bool Parse(string input, int accessLevel = 0) { return Parse(input, null, accessLevel); } /// <summary> /// Parses text in search of a command (with prefix), and runs it accordingly. /// </summary> /// <remarks> /// Data does not need to be formatted in any way before parsing. Simply pass your input to the function and /// it will determine if it is a valid command, check the command's <c>Command.CanExecute</c> function, and run the /// command. /// Use <c>Arguments[].FromName(...)</c> to get the values of the parsed arguments in the command action. /// </remarks> /// <param name="data">Data to pass to the command. This data can be used by the command when it is executed.</param> /// <param name="input">A string inputted by a user. If the string does not start with the parser prefix, it will return false, otherwise it will parse the command.</param> /// <param name="accessLevel">An optional level to limit executing commands if the user doesn't have permission.</param> /// <returns> /// True if the input is non-empty and starts with the <c>Prefix</c>. /// If the input does not start with a prefix, it returns false so the message can be processed further. (As a chat message, for example) /// </returns> public bool Parse(string input, object data, int accessLevel = 0) { if (string.IsNullOrEmpty(input)) return false; //Remove the prefix from the input and trim it just in case. input = input.Trim(); if (!string.IsNullOrEmpty(Prefix)) { var index = input.IndexOf(Prefix, StringComparison.OrdinalIgnoreCase); if (index != 0) return false; input = input.Remove(0, Prefix.Length); } if (string.IsNullOrEmpty(input)) return false; //Now we are ready to go. //Split the string into arguments ignoring spaces between quotes. var inputArgs = Regex .Matches(input, "(?<match>[^\\s\"]+)|(?<match>\"[^\"]*\")") .Cast<Match>() .Select(m => m.Groups["match"].Value) .ToList(); //Search the commands for a matching command. var commands = Commands.Where(cmd => cmd.Aliases.Any(alias => alias.Equals(inputArgs[0]))).ToList(); if (commands.Count == 0) //If no commands found found. NoCommandsFound(inputArgs, data as NetPlayer); else { var command = commands.First(); //Find command. // Verify that the command can be executed in the current context. if (command.RequireCaller && !(data is NetPlayer)) { OnParseError(this, $"Command '{command.Name}' can not be executed in the current context."); return true; } //Verify that the sender/user has permission to run this command. if (command.AccessLevel > accessLevel) { OnParseError(this, string.Format("Command '{0}' requires permission level {1}. (Currently only {2})", command.Name, command.AccessLevel, accessLevel)); return true; } //Verify the command can be run. var canExecute = command.CanExecute(command); if (!string.IsNullOrEmpty(canExecute)) { OnParseError(this, canExecute); return true; } var returnArgs = new List<Argument>(); //Validate each argument. var alias = inputArgs.ElementAt(0).ToLower(); //Preserve the alias typed in. inputArgs.RemoveAt(0); //Remove the command name. if (!ParseArguments(false, alias, command, command, inputArgs, returnArgs)) command.Execute(returnArgs.ToArray(), inputArgs.ToArray(), data); //Execute the command. //Return argument values back to default. ResetArgs(command); } return true; } /// <summary> /// Ran when no commands are found. Will create an error detailing what went wrong. /// </summary> private void NoCommandsFound(List<string> inputArgs, NetPlayer caller) { OnParseError(this, string.Format("Command '{0}' not found.", inputArgs[0])); //Find related commands (Did you mean?) var related = FindRelatedCommands(inputArgs[0], caller); if (related.Count > 0) { var message = FormatRelatedCommands(related); OnParseError(this, string.Format("Did you mean: {0}?", message)); } } /// <summary> /// Takes input from <c>FindRelatedCommands</c> and generates a readable string. /// </summary> private string FormatRelatedCommands(List<string> related) { var sb = new StringBuilder(); for (var i = 0; i < related.Count; i++) { sb.Append('\'').Append(related[i]).Append('\''); if (related.Count > 1) { if (i == related.Count - 2) sb.Append(", or "); else if (i < related.Count - 1) sb.Append(", "); } } return sb.ToString(); } /// <summary> /// Finds command aliases related to the input command that may have been spelled incorrectly. /// </summary> private List<string> FindRelatedCommands(string input, NetPlayer caller) { var related = new List<string>(); foreach (var command in Commands) { if (caller == null && command.RequireCaller) continue; if (caller != null && (int) caller.AccessLevel < command.AccessLevel) continue; foreach (var alias in command.Aliases) { if ((alias.StartsWith(input)) //If the user did not complete the command. //If the user missed the last few letters. || (input.Length >= 2 && alias.StartsWith(input.Substring(0, 2))) //If user missed last few letters. || (input.Length > 2 && alias.EndsWith(input.Substring(input.Length - 2, 2))) //If user misspelled middle characters. || (alias.StartsWith(input.Substring(0, 1)) && alias.EndsWith(input.Substring(input.Length - 1, 1)))) { //Add related command to the "Did you mean?" list. related.Add(alias); break; } } } return related; } /// <summary> /// Resets the command's arguments back to their default values. /// </summary> private void ResetArgs(IArguable command) { foreach (var arg in command.Arguments) { arg.ResetValue(); if (arg.Arguments.Count > 0) ResetArgs(arg); } } /// <summary> /// Parses the command's arguments or nested argument and recursively parses their children. /// </summary> /// <returns>True if an error has occurred during parsing and the calling loop should break.</returns> private bool ParseArguments(bool recursive, string commandText, Command command, IArguable comArgs, List<string> inputArgs, List<Argument> returnArgs) { //For each argument for (var i = 0; i < comArgs.Arguments.Count; i++) { //If the arguments are longer than they should be, merge them into the last one. //This way a user does not need quotes for a chat message for example. MergeLastArguments(recursive, command, comArgs, inputArgs, i); //If there are not enough arguments supplied, handle accordingly. if (i >= inputArgs.Count) { if (comArgs.Arguments[i].Optional) //If optional, we can quit and set a default value. { returnArgs.Add(comArgs.Arguments[i].SetValue(string.Empty)); continue; } //If not optional, show an error with the correct form. if (comArgs.Arguments[i].Enum) //Show list of types if enum (instead of argument name). OnParseError(this, string.Format("Invalid arguments, {0} required. Usage: {1}", GenerateEnumArguments(comArgs.Arguments[i]), command.GenerateUsage(commandText))); else OnParseError(this, string.Format("Invalid arguments, '{0}' required. Usage: {1}", comArgs.Arguments[i].Name, command.GenerateUsage(commandText))); return true; } //If argument is an "enum" (Restricted to certain values), validate it. if (comArgs.Arguments[i].Enum) { //Check if passed value is a match for any of the possible values. var passed = comArgs.Arguments[i].Arguments.Any( arg => string.Equals(arg.Name, inputArgs[i], StringComparison.OrdinalIgnoreCase)); if (!passed) //If it was not found, alert the user, unless it is optional. { if (comArgs.Arguments[i].Optional && comArgs.Arguments[i].Default == string.Empty) { if (i != comArgs.Arguments.Count - 1) { continue; } } else if (comArgs.Arguments[i].Default != string.Empty && comArgs.Arguments[i].Arguments.Count > 0) //For enum arguments with default values, add the default value and then parse the children. { returnArgs.Add(comArgs.Arguments[i].SetValue(string.Empty)); //Find the argument that matches the default value. var argument = comArgs.Arguments[i].Arguments.FirstOrDefault( arg => string.Equals(arg.Name, comArgs.Arguments[i].Default, StringComparison.OrdinalIgnoreCase)); if (argument != null && argument.Arguments.Count > 0) { if (ParseArguments(true, commandText, command, argument, inputArgs, returnArgs)) return true; if (i == comArgs.Arguments.Count - 1) //If last argument, break, as no more input is expected break; inputArgs.Insert(0, string.Empty); //Insert dummy data to fill inputArgs } else { OnParseError(this, string.Format("Argument '{0}' not recognized. Must be {1}", inputArgs[i].ToLower(), GenerateEnumArguments(comArgs.Arguments[i]))); return true; } continue; } OnParseError(this, string.Format("Argument '{0}' not recognized. Must be {1}", inputArgs[i].ToLower(), GenerateEnumArguments(comArgs.Arguments[i]))); return true; } //Set the argument to the selected "enum" value. returnArgs.Add(comArgs.Arguments[i].SetValue(inputArgs[i])); if (comArgs.Arguments[i].Arguments.Count > 0) //Parse its children. { //Find the nested arguments. var argument = comArgs.Arguments[i].Arguments.FirstOrDefault( arg => string.Equals(arg.Name, inputArgs[i], StringComparison.OrdinalIgnoreCase)); if (argument != null) { inputArgs.RemoveAt(0); //Remove the type we parsed. //Parse the value, to validate it if (ParseArguments(true, commandText, command, argument, inputArgs, returnArgs)) return true; if (i == comArgs.Arguments.Count - 1) //If last argument, break, as no more input is expected break; inputArgs.Insert(0, string.Empty); //Insert dummy data to fill inputArgs //Now that the enum arg has been parsed, parse the remaining input, if any. } } continue; } //Check for validation rule. if (CheckArgumentValidation(comArgs, inputArgs, i)) return true; //Set the value from the input argument if no errors were detected. returnArgs.Add(comArgs.Arguments[i].SetValue(inputArgs[i])); //If the next child argument is an "enum" (Only certain values allowed), then remove the current input argument. if ((comArgs.Arguments[i].Optional && comArgs.Arguments[i].Arguments.Count > 0 && !comArgs.Arguments[i].Arguments[0].Enum) || (comArgs.Arguments[i].Arguments.Count > 0 && comArgs.Arguments[i].Arguments[0].Enum)) inputArgs.RemoveAt(0); //If the argument has nested arguments, parse them recursively. if (comArgs.Arguments[i].Arguments.Count > 0) return ParseArguments(true, commandText, command, comArgs.Arguments[i], inputArgs, returnArgs); } return false; } /// <summary> /// Checks the validation of arguments at the specified index. /// </summary> private bool CheckArgumentValidation(IArguable comArgs, List<string> inputArgs, int index) { if (!string.IsNullOrEmpty(inputArgs[index]) && !comArgs.Arguments[index].IsValid(inputArgs[index])) { OnParseError(this, string.Format("Argument '{0}' is invalid. Must be a valid {1}.", comArgs.Arguments[index].Name, comArgs.Arguments[index].Rule.GetError())); return true; } return false; } /// <summary> /// If the arguments are longer than they should be, merge them into the last one. /// This way a user does not need quotes for a chat message for example. /// </summary> private static void MergeLastArguments(bool recursive, Command command, IArguable comArgs, List<string> inputArgs, int i) { if ((i > 0 || i == comArgs.Arguments.Count - 1) && inputArgs.Count > command.Arguments.Count) { if (comArgs.Arguments.Count >= 1 + comArgs.Arguments[comArgs.Arguments.Count - 1].Arguments.Count && ((!recursive && !comArgs.Arguments[comArgs.Arguments.Count - 1].Enum) || recursive)) { var sb = new StringBuilder(); for (var j = command.Arguments.Count + (recursive && comArgs.Arguments.Count > 1 ? 1 : 0); j < inputArgs.Count; j++) sb.Append(' ').Append(inputArgs[j]); inputArgs[command.Arguments.Count - (recursive && comArgs.Arguments.Count > 1 ? 0 : 1)] += sb.ToString(); } } } /// <summary> /// Returns a list of possible values for an enum (type) argument in a readable format. /// </summary> private static string GenerateEnumArguments(Argument argument) { if (!argument.Enum) throw new ArgumentException("Argument must be an enum style argument."); var sb = new StringBuilder(); for (var i = 0; i < argument.Arguments.Count; i++) { var arg = argument.Arguments[i]; //Write name sb.Append("'"); sb.Append(arg.Name); sb.Append("'"); //Indicate default argument if (arg.Name == argument.Default) sb.Append(" (default)"); //Add comma and "or" if needed if (argument.Arguments.Count > 1) { if (i == argument.Arguments.Count - 2) sb.Append(", or "); else if (i < argument.Arguments.Count - 1) sb.Append(", "); } } return sb.ToString(); } } }
45.538922
227
0.518387
[ "MIT" ]
Skippeh/Oxide.GettingOverItMP
ServerShared/CommandParser/CommandParser.cs
22,817
C#
using System; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Web.DynamicData; namespace CorporateCalendarAdmin { public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { var visibleTables = Gcpe.Hub.Global.DefaultModel.VisibleTables; if (visibleTables.Count == 0) { throw new InvalidOperationException("There are no accessible tables. Make sure that at least one data model is registered in Global.asax and scaffolding is enabled or implement custom pages."); } Menu1.DataSource = visibleTables.Where(t => t.Scaffold); Menu1.DataBind(); } } }
32.652174
209
0.661784
[ "Apache-2.0" ]
AlessiaYChen/gcpe-hub
Hub.Legacy/Gcpe.Hub.Legacy.Website/Calendar/Admin/Default.aspx.cs
753
C#
using Bermuda.AdminLibrary.Utility; using Microsoft.VisualStudio.TestTools.UnitTesting; using System; using Microsoft.WindowsAzure.StorageClient; using System.Collections.Generic; namespace AzureStorageUtilityTests { /// <summary> ///This is a test class for AzureStorageUtilityTest and is intended ///to contain all AzureStorageUtilityTest Unit Tests ///</summary> [TestClass()] public class AzureStorageUtilityTest { private TestContext testContextInstance; /// <summary> ///Gets or sets the test context which provides ///information about and functionality for the current test run. ///</summary> public TestContext TestContext { get { return testContextInstance; } set { testContextInstance = value; } } #region Additional test attributes // //You can use the following additional attributes as you write your tests: // //Use ClassInitialize to run code before running the first test in the class //[ClassInitialize()] //public static void MyClassInitialize(TestContext testContext) //{ //} // //Use ClassCleanup to run code after all tests in a class have run //[ClassCleanup()] //public static void MyClassCleanup() //{ //} // //Use TestInitialize to run code before running each test //[TestInitialize()] //public void MyTestInitialize() //{ //} // //Use TestCleanup to run code after each test has run //[TestCleanup()] //public void MyTestCleanup() //{ //} // #endregion /// <summary> ///A test for ReadBlobFile ///</summary> [TestMethod()] public void ReadBlobFileTest() { string fileName = "Bermuda/Bermuda.Azure.cspkg"; string expected = null; string actual; actual = AzureStorageUtility.ReadBlobFile(fileName); // AzureStorageUtility.UploadBlobFile(actual, "Bermuda/Test.cspkg"); Assert.AreEqual(expected, actual); } /// <summary> ///A test for ListBlobs ///</summary> [TestMethod()] public void ListBlobsTest() { IEnumerable<IListBlobItem> expected = null; IEnumerable<IListBlobItem> actual; actual = AzureStorageUtility.ListBlobs(); Assert.AreEqual(expected, actual); } } }
28.343434
85
0.539558
[ "MIT" ]
melnx/Bermuda
BermudaAdmin/AzureStorageUtilityTests/AzureStorageUtilityTest.cs
2,808
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data.SqlServerCe; using System.IO; namespace WindowsFormsApp1 { static class sql_funcoes { public static string base_dados; public static string pasta_dados; public static void deletar_dados() { SqlCeConnection ligacao = new SqlCeConnection(); ligacao.ConnectionString = "DATA source=" + base_dados; ligacao.Open(); SqlCeCommand operario = new SqlCeCommand("DELETE FROM clientes WHERE id_clientes=" + lista_clientes.id_clientes , ligacao); operario.ExecuteNonQuery(); ligacao.Dispose(); } public static void buscar_dados() { SqlCeConnection ligacao = new SqlCeConnection(); ligacao.ConnectionString = ("DATA source = " + base_dados ); ligacao.Open(); SqlCeCommand operario = new SqlCeCommand(); operario.CommandText = "CREATE TABLE clientes(" + "id_clientes int not null primary key," + "nome nvarchar(30)," + "numero nvarchar(20)," + "endereço nvarchar(100))"; operario.Connection = ligacao; operario.ExecuteNonQuery(); operario.Dispose(); ligacao.Dispose(); } public static void inserir_dados(int id , string nome,string endereco,string numero) { SqlCeConnection ligacao = new SqlCeConnection(); ligacao.ConnectionString = "DATA source="+base_dados; ligacao.Open(); SqlCeCommand operario = new SqlCeCommand(); operario.Connection = ligacao; operario.Parameters.AddWithValue("@id", id); operario.Parameters.AddWithValue("@nome", nome); operario.Parameters.AddWithValue("@endereco", endereco); operario.Parameters.AddWithValue("@numero", numero); operario.CommandText = "INSERT INTO clientes VALUES(@id,@nome,@endereco,@numero)"; operario.ExecuteNonQuery(); ligacao.Close(); operario.Dispose(); } public static void inicia_aplicacao() { pasta_dados = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)+@"\agendaSql"; if (!Directory.Exists(pasta_dados)) { Directory.CreateDirectory(pasta_dados); } base_dados = pasta_dados + "\\dados.sdf"; if (!File.Exists(base_dados)) { criar_base_dados(); } } public static void criar_base_dados() { SqlCeEngine motor = new SqlCeEngine("DATA source = " + base_dados); motor.CreateDatabase(); buscar_dados(); } } }
38.74359
135
0.554931
[ "MIT" ]
KevenyLima/agendaSql
agenda_sql/WindowsFormsApp1/sql_funcoes.cs
3,025
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace _08.TravelingAtLightSpeed { class TravelingAtLightSpeed { static void Main(string[] args) { decimal numerOfLightYears = decimal.Parse(Console.ReadLine()); decimal distanceInKilometers = numerOfLightYears * 945e+10m; decimal speed = 3e+5m; decimal distanceForOneWeek = 7m * 24m * 60m * 60m * speed; decimal distanceForOneDay = 24m * 60m * 60m * speed; decimal distanceForOneHour = 60m * 60m * speed; decimal distanceForOneMinute = 60m * speed; decimal distanceForOneSecond = speed; decimal totalWeeks = distanceInKilometers / distanceForOneWeek; decimal totalDays = distanceInKilometers / distanceForOneDay; decimal totalHours = distanceInKilometers / distanceForOneHour; decimal totalMinutes = distanceInKilometers / distanceForOneMinute; decimal totalSeconds = distanceInKilometers / distanceForOneSecond; Console.WriteLine("{0:f0} weeks", Math.Floor(totalWeeks)); decimal integerWeeks = Math.Floor(totalWeeks); Console.WriteLine("{0:f0} days",Math.Floor( totalDays - integerWeeks * 7)); decimal integerDays = Math.Floor(totalDays); Console.WriteLine("{0:f0} hours", Math.Floor(totalHours - integerDays * 24)); decimal integerHours = Math.Floor(totalHours); Console.WriteLine("{0:F0} minutes", Math.Floor(totalMinutes - integerHours * 60)); decimal integerMinutes = Math.Floor(totalMinutes); Console.WriteLine("{0:f0} seconds", Math.Floor(totalSeconds - integerMinutes * 60)); } } }
45.35
96
0.656009
[ "MIT" ]
yvelikov/Programming-Fundamentals
Data Types and Variables - Exercises Extended/Data Types and Variables - Exercises/08.TravelingAtLightSpeed/TravelingAtLightSpeed.cs
1,816
C#
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace IdentityServerSample3.Controllers { public class HomeController : Controller { public ActionResult Index() { return View(); } public ActionResult About() { ViewBag.Message = "Your application description page."; return View(); } public ActionResult Contact() { ViewBag.Message = "Your contact page."; return View(); } } }
19.6
67
0.571429
[ "MIT" ]
kuaidaoyanglang/IdentityServerSample
IdentityServerSample3/Controllers/HomeController.cs
590
C#
using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Windows; // As informações gerais sobre um assembly são controladas por // conjunto de atributos. Altere estes valores de atributo para modificar as informações // associada a um assembly. [assembly: AssemblyTitle("PessoaExercicio")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("PessoaExercicio")] [assembly: AssemblyCopyright("Copyright © 2019")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Definir ComVisible como false torna os tipos neste assembly invisíveis // para componentes COM. Caso precise acessar um tipo neste assembly de // COM, defina o atributo ComVisible como true nesse tipo. [assembly: ComVisible(false)] //Para começar a compilar aplicativos localizáveis, configure //<UICulture>CultureYouAreCodingWith</UICulture> no seu arquivo .csproj //dentro de um <Grupo de Propriedade>. Por exemplo, se você está usando o idioma inglês //nos seus arquivos de origem, configure o <UICulture> para en-US. Em seguida, descomente //o atributo NeutralResourceLanguage abaixo. Atualize o "en-US" na //linha abaixo para coincidir com a configuração do UICulture no arquivo do projeto. //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] [assembly: ThemeInfo( ResourceDictionaryLocation.None, //onde os dicionários de recursos de temas específicos estão localizados //(usado se algum recurso não for encontrado na página, // ou dicionários de recursos do aplicativo) ResourceDictionaryLocation.SourceAssembly //onde o dicionário de recursos genéricos está localizado //(usado se algum recurso não for encontrado na página, // app, ou qualquer outro dicionário de recursos de tema específico) )] // As informações da versão de um assembly consistem nos quatro valores a seguir: // // Versão Principal // Versão Secundária // Número da Versão // Revisão // // É possível especificar todos os valores ou usar como padrão os Números de Build e da Revisão // usando o "*" como mostrado abaixo: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
44.892857
114
0.721161
[ "MIT" ]
RafaReinert94/Aula483
PessoaExercicio/PessoaExercicio/Properties/AssemblyInfo.cs
2,557
C#
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Runtime.InteropServices.WindowsRuntime; using Windows.ApplicationModel; using Windows.ApplicationModel.Activation; using Windows.Foundation; using Windows.Foundation.Collections; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Controls.Primitives; using Windows.UI.Xaml.Data; using Windows.UI.Xaml.Input; using Windows.UI.Xaml.Media; using Windows.UI.Xaml.Navigation; namespace SQLiteBasic.UWP { /// <summary> /// Provides application-specific behavior to supplement the default Application class. /// </summary> sealed partial class App : Application { /// <summary> /// Initializes the singleton application object. This is the first line of authored code /// executed, and as such is the logical equivalent of main() or WinMain(). /// </summary> public App() { this.InitializeComponent(); this.Suspending += OnSuspending; } /// <summary> /// Invoked when the application is launched normally by the end user. Other entry points /// will be used such as when the application is launched to open a specific file. /// </summary> /// <param name="e">Details about the launch request and process.</param> protected override void OnLaunched(LaunchActivatedEventArgs e) { Frame rootFrame = Window.Current.Content as Frame; // Do not repeat app initialization when the Window already has content, // just ensure that the window is active if (rootFrame == null) { // Create a Frame to act as the navigation context and navigate to the first page rootFrame = new Frame(); rootFrame.NavigationFailed += OnNavigationFailed; Xamarin.Forms.Forms.Init(e); if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) { //TODO: Load state from previously suspended application } // Place the frame in the current Window Window.Current.Content = rootFrame; } if (rootFrame.Content == null) { // When the navigation stack isn't restored navigate to the first page, // configuring the new page by passing required information as a navigation // parameter rootFrame.Navigate(typeof(MainPage), e.Arguments); } // Ensure the current window is active Window.Current.Activate(); } /// <summary> /// Invoked when Navigation to a certain page fails /// </summary> /// <param name="sender">The Frame which failed navigation</param> /// <param name="e">Details about the navigation failure</param> void OnNavigationFailed(object sender, NavigationFailedEventArgs e) { throw new Exception("Failed to load Page " + e.SourcePageType.FullName); } /// <summary> /// Invoked when application execution is being suspended. Application state is saved /// without knowing whether the application will be terminated or resumed with the contents /// of memory still intact. /// </summary> /// <param name="sender">The source of the suspend request.</param> /// <param name="e">Details about the suspend request.</param> private void OnSuspending(object sender, SuspendingEventArgs e) { var deferral = e.SuspendingOperation.GetDeferral(); //TODO: Save application state and stop any background activity deferral.Complete(); } } }
38.872549
100
0.607566
[ "MIT" ]
prohimanshu/Basic-MAD
25 SQLiteBasic/SQLiteBasic/SQLiteBasic.UWP/App.xaml.cs
3,967
C#
using System.ComponentModel.DataAnnotations; namespace DataBox.Models.Authentication { public class AuthenticateRequest { [Required] public string Name { get; set; } [Required] public string Password { get; set; } } }
18.928571
45
0.641509
[ "MIT" ]
PredProfAccount/DataBox
src/Models/Authentication/AuthenticateRequest.cs
267
C#
// Copyright 2014 Google Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. using UnityEngine; using System.Collections; ///This becomes the target public class Reticle3D : MonoBehaviour { float currentFocalDepth = 5; float targetFocalDepth = 5; float focalDepthSpeed = 0; bool visualDisplay; public MeshRenderer meshRenderer; Color targetColor = Color.white; Color currentColor = Color.white; Vector4 colorSpeed; float minReticleDistance = 0.75f; float maxReticleDistance = 5; //float timeSinceClick public void SetColor(Color c){ //Debug.Log("setcolor" + c); targetColor = c; } public void SetAndApplyColor(Color c){ //Debug.Log("setapplycolor" + c); currentColor = c; meshRenderer.material.color = currentColor; } void Start(){ meshRenderer.material.color = currentColor; } public float MaxReticleDistance{ get{ return maxReticleDistance; } set{ maxReticleDistance = value; } } void Update(){ if(currentColor != targetColor){ currentColor.r = Smoothing.SpringSmooth(currentColor.r, targetColor.r, ref colorSpeed.x, 0.1f, Time.deltaTime); currentColor.g = Smoothing.SpringSmooth(currentColor.g, targetColor.g, ref colorSpeed.y, 0.1f, Time.deltaTime); currentColor.b = Smoothing.SpringSmooth(currentColor.b, targetColor.b, ref colorSpeed.z, 0.1f, Time.deltaTime); currentColor.a = Smoothing.SpringSmooth(currentColor.a, targetColor.a, ref colorSpeed.w, 0.1f, Time.deltaTime); meshRenderer.material.color = currentColor; } } public void SetTarget(Vector3 worldPosition){ Vector3 localPosition = transform.parent.InverseTransformPoint(worldPosition); targetFocalDepth = Mathf.Clamp(localPosition.z,minReticleDistance,maxReticleDistance); //Debug.Log(worldPosition + ":" + localPosition); } public void SetDistance(float distance){ targetFocalDepth = Mathf.Clamp(distance,minReticleDistance,maxReticleDistance); } public void UpdateReticlePosition(){ float springSpeed = 0.05f; if(targetFocalDepth < currentFocalDepth){ springSpeed = 0.05f; } else{ springSpeed = .5f; } currentFocalDepth = Smoothing.SpringSmooth(currentFocalDepth, targetFocalDepth, ref focalDepthSpeed, springSpeed, Time.deltaTime); //currentFocalDepth = targetFocalDepth; transform.localPosition = new Vector3(0,0, currentFocalDepth); } }
27.834951
132
0.749564
[ "Apache-2.0" ]
Allenhan123/gvr-unity-sdk
Samples/CardboardDesignLab/ustwo-cardboard-unity/Assets/Source/UI/Reticle3D.cs
2,867
C#
using System; using System.Collections.Generic; class Program { static void Main(string[] args) { long health = long.Parse(Console.ReadLine()); long startHealth = health; List<string> viruses = new List<string>(); while (true) { string input = Console.ReadLine(); if (input == "end") { break; } input.ToCharArray(); int virusStrenght = 0; int timeToDefeat = 0; foreach (char symbol in input) { virusStrenght += symbol; } virusStrenght /= 3; timeToDefeat = virusStrenght * input.Length; if (viruses.Contains(input)) { timeToDefeat /= 3; } viruses.Add(input); health -= timeToDefeat; var min = timeToDefeat / 60; var seconds = timeToDefeat - min * 60; Console.WriteLine($"Virus {input}: {virusStrenght} => {timeToDefeat} seconds"); if (health<=0) { break; } Console.WriteLine($"{input} defeated in {min}m {seconds}s."); Console.WriteLine($"Remaining health: {health}"); health += health * 20 / 100; if (health > startHealth) { health = startHealth; } } if (health > 0) { Console.WriteLine($"Final Health: {health}"); } else { Console.WriteLine($"Immune System Defeated."); } } }
23.43662
95
0.453726
[ "MIT" ]
MomchilSt/SoftUni
02-Programming-Fundamentals/Exercises/14. Dictionaries and Lists - More Exercises/Immune System/Program.cs
1,666
C#
using Microsoft.EntityFrameworkCore; namespace GeekShopping.Email.Model.Context; public class MySQLContext : DbContext { public MySQLContext(DbContextOptions<MySQLContext> options) : base(options) { } public DbSet<EmailLog> Emails { get; set; } }
16.75
83
0.738806
[ "Apache-2.0" ]
angelicafranca94/erudio-microservices-dotnet6
S23_ErudioMicroservices.NET6-TrabalhandoComExchangesNoRabbitMQ/GeekShopping/GeekShopping.Email/Model/Context/MySQLContext.cs
270
C#
/* * Copyright 2010-2014 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 sns-2010-03-31.normal.json service model. */ using System; using System.Net; using Amazon.Runtime; namespace Amazon.SimpleNotificationService.Model { ///<summary> /// SimpleNotificationService exception /// </summary> #if !PCL [Serializable] #endif public class NotFoundException : AmazonSimpleNotificationServiceException { /// <summary> /// Constructs a new NotFoundException with the specified error /// message. /// </summary> /// <param name="message"> /// Describes the error encountered. /// </param> public NotFoundException(string message) : base(message) {} /// <summary> /// Construct instance of NotFoundException /// </summary> /// <param name="message"></param> /// <param name="innerException"></param> public NotFoundException(string message, Exception innerException) : base(message, innerException) {} /// <summary> /// Construct instance of NotFoundException /// </summary> /// <param name="innerException"></param> public NotFoundException(Exception innerException) : base(innerException) {} /// <summary> /// Construct instance of NotFoundException /// </summary> /// <param name="message"></param> /// <param name="innerException"></param> /// <param name="errorType"></param> /// <param name="errorCode"></param> /// <param name="requestId"></param> /// <param name="statusCode"></param> public NotFoundException(string message, Exception innerException, ErrorType errorType, string errorCode, string requestId, HttpStatusCode statusCode) : base(message, innerException, errorType, errorCode, requestId, statusCode) {} /// <summary> /// Construct instance of NotFoundException /// </summary> /// <param name="message"></param> /// <param name="errorType"></param> /// <param name="errorCode"></param> /// <param name="requestId"></param> /// <param name="statusCode"></param> public NotFoundException(string message, ErrorType errorType, string errorCode, string requestId, HttpStatusCode statusCode) : base(message, errorType, errorCode, requestId, statusCode) {} #if !PCL /// <summary> /// Constructs a new instance of the NotFoundException class with serialized data. /// </summary> /// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param> /// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext" /> that contains contextual information about the source or destination.</param> /// <exception cref="T:System.ArgumentNullException">The <paramref name="info" /> parameter is null. </exception> /// <exception cref="T:System.Runtime.Serialization.SerializationException">The class name is null or <see cref="P:System.Exception.HResult" /> is zero (0). </exception> protected NotFoundException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { } #endif } }
42.185567
178
0.644673
[ "Apache-2.0" ]
SaschaHaertel/AmazonAWS
sdk/src/Services/SimpleNotificationService/Generated/Model/NotFoundException.cs
4,092
C#
using Omnikeeper.Base.Utils.ModelContext; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace Omnikeeper.Base.Model { public interface IUsageDataAccumulator { void Add(string username, DateTimeOffset timestamp, IEnumerable<(string elementType, string elementName)> elements); void Flush(IModelContext trans); Task<int> DeleteOlderThan(DateTimeOffset deleteThreshold, IModelContext trans); } }
31.133333
124
0.766595
[ "Apache-2.0" ]
max-bytes/omnikeeper
backend/Omnikeeper.Base/Model/IUsageDataAccumulator.cs
469
C#
namespace NewPlatform.Flexberry.ServiceBus.Controllers { using System; using System.Web.Http.Dependencies; using Components; public class RestDependencyResolver : RestDependencyScope, IDependencyResolver { private readonly ISendingManager _sendingManager; private readonly IReceivingManager _receivingManager; public RestDependencyResolver(ISendingManager sendingManager, IReceivingManager receivingManager) : base(sendingManager, receivingManager) { if (sendingManager == null) throw new ArgumentNullException(nameof(sendingManager)); if (receivingManager == null) throw new ArgumentNullException(nameof(receivingManager)); _sendingManager = sendingManager; _receivingManager = receivingManager; } public IDependencyScope BeginScope() { return new RestDependencyScope(_sendingManager, _receivingManager); } } }
32.5625
106
0.663148
[ "MIT" ]
archaim/NewPlatform.Flexberry.ServiceBus
NewPlatform.Flexberry.ServiceBus/Controllers/RestDependencyResolver.cs
1,044
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 HotelManager.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.6.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.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)] [global::System.Configuration.DefaultSettingValueAttribute("Data Source=ndc07;Initial Catalog=HotelManagement;Persist Security Info=True;User" + " ID=sa;Password=123456")] public string HotelManagementConnectionString { get { return ((string)(this["HotelManagementConnectionString"])); } } } }
45.973684
153
0.611334
[ "MIT" ]
BMOTech/hotel-management
HotelManager/Properties/Settings.Designer.cs
1,749
C#
using System.Collections.Generic; using FortBlast.Extras; using FortBlast.Structs; using FortBlast.UI; using UnityEngine; using UnityEngine.Analytics; namespace FortBlast.Resources { public class CollectCollectibles : MonoBehaviour { [Header("Collectible Stats")] public GameObject collectionCompletedExplosion; public float maxInteractionTime; public List<InventoryItemStats> collectibles; private bool _collectibleCollected; private float _currentInteractionTime; private bool _isPlayerLooking; private bool _isPlayerNearby; private void Start() { _currentInteractionTime = 0; _collectibleCollected = false; _isPlayerNearby = false; _isPlayerLooking = false; } private void OnTriggerEnter(Collider other) { if (other.CompareTag(TagManager.Player)) _isPlayerNearby = true; if (other.CompareTag(TagManager.VisibleCollider)) _isPlayerLooking = true; } private void OnTriggerExit(Collider other) { if (other.CompareTag(TagManager.Player)) { _isPlayerNearby = false; UniSlider.instance.DiscardSlider(gameObject); } else if (other.CompareTag(TagManager.VisibleCollider)) { _isPlayerLooking = false; UniSlider.instance.DiscardSlider(gameObject); } } private void Update() { if (_collectibleCollected) return; if (_isPlayerNearby && _isPlayerLooking) CheckInteractionTime(); else _currentInteractionTime = 0; if (_currentInteractionTime > 0) { var interactionRatio = _currentInteractionTime / maxInteractionTime; UniSlider.instance.UpdateSliderValue(interactionRatio, gameObject); } } private void CheckInteractionTime() { if (Input.GetKeyDown(Controls.InteractionKey)) UniSlider.instance.InitSlider(gameObject); else if (Input.GetKeyUp(Controls.InteractionKey)) UniSlider.instance.DiscardSlider(gameObject); else if (Input.GetKey(Controls.InteractionKey)) _currentInteractionTime += Time.deltaTime; else _currentInteractionTime = 0; if (_currentInteractionTime >= maxInteractionTime) { _collectibleCollected = true; UniSlider.instance.DiscardSlider(gameObject); var collectionItems = new List<InventoryItemStats>(); for (var i = 0; i < collectibles.Count; i++) { var inventoryItemStats = collectibles[i]; var randomValue = Random.Range(0, 1000) % inventoryItemStats.itemCount; if (inventoryItemStats.itemCount <= 1) randomValue = inventoryItemStats.itemCount; if (randomValue <= 0) randomValue = 1; var newCollectionItem = new InventoryItemStats { itemCount = randomValue, inventoryItem = inventoryItemStats.inventoryItem }; collectionItems.Add(newCollectionItem); } ResourceManager.instance.AddResources(collectionItems); DestroyCollectible(); } } private void DestroyCollectible() { Instantiate(collectionCompletedExplosion, transform.position, Quaternion.identity); Destroy(gameObject); } } }
33.068376
95
0.569398
[ "MIT" ]
Rud156/FortBlast
Assets/Scripts/Resources/CollectCollectibles.cs
3,871
C#
namespace Chronic.Core.Tags.Repeaters { public enum UnitName { Year, Season, Month, Fortnight, Week, Weekend, Day, Hour, Minute, Second } }
14.4375
37
0.454545
[ "MIT" ]
chadbengen/nChronic.Core
src/Chronic.Core/Tags/Repeaters/UnitName.cs
231
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 glue-2017-03-31.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.Glue.Model { /// <summary> /// An internal service error occurred. /// </summary> #if !NETSTANDARD [Serializable] #endif public partial class InternalServiceException : AmazonGlueException { /// <summary> /// Constructs a new InternalServiceException with the specified error /// message. /// </summary> /// <param name="message"> /// Describes the error encountered. /// </param> public InternalServiceException(string message) : base(message) {} /// <summary> /// Construct instance of InternalServiceException /// </summary> /// <param name="message"></param> /// <param name="innerException"></param> public InternalServiceException(string message, Exception innerException) : base(message, innerException) {} /// <summary> /// Construct instance of InternalServiceException /// </summary> /// <param name="innerException"></param> public InternalServiceException(Exception innerException) : base(innerException) {} /// <summary> /// Construct instance of InternalServiceException /// </summary> /// <param name="message"></param> /// <param name="innerException"></param> /// <param name="errorType"></param> /// <param name="errorCode"></param> /// <param name="requestId"></param> /// <param name="statusCode"></param> public InternalServiceException(string message, Exception innerException, ErrorType errorType, string errorCode, string requestId, HttpStatusCode statusCode) : base(message, innerException, errorType, errorCode, requestId, statusCode) {} /// <summary> /// Construct instance of InternalServiceException /// </summary> /// <param name="message"></param> /// <param name="errorType"></param> /// <param name="errorCode"></param> /// <param name="requestId"></param> /// <param name="statusCode"></param> public InternalServiceException(string message, ErrorType errorType, string errorCode, string requestId, HttpStatusCode statusCode) : base(message, errorType, errorCode, requestId, statusCode) {} #if !NETSTANDARD /// <summary> /// Constructs a new instance of the InternalServiceException class with serialized data. /// </summary> /// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param> /// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext" /> that contains contextual information about the source or destination.</param> /// <exception cref="T:System.ArgumentNullException">The <paramref name="info" /> parameter is null. </exception> /// <exception cref="T:System.Runtime.Serialization.SerializationException">The class name is null or <see cref="P:System.Exception.HResult" /> is zero (0). </exception> protected InternalServiceException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { } /// <summary> /// Sets the <see cref="T:System.Runtime.Serialization.SerializationInfo" /> with information about the exception. /// </summary> /// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param> /// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext" /> that contains contextual information about the source or destination.</param> /// <exception cref="T:System.ArgumentNullException">The <paramref name="info" /> parameter is a null reference (Nothing in Visual Basic). </exception> #if BCL35 [System.Security.Permissions.SecurityPermission( System.Security.Permissions.SecurityAction.LinkDemand, Flags = System.Security.Permissions.SecurityPermissionFlag.SerializationFormatter)] #endif [System.Security.SecurityCritical] // These FxCop rules are giving false-positives for this method [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")] [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2134:MethodsMustOverrideWithConsistentTransparencyFxCopRule")] public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { base.GetObjectData(info, context); } #endif } }
47.766129
179
0.664697
[ "Apache-2.0" ]
philasmar/aws-sdk-net
sdk/src/Services/Glue/Generated/Model/InternalServiceException.cs
5,923
C#
using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Zhongli.Data.Migrations { public partial class ReprimandHistory : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_Warning_Guilds_GuildId", table: "Warning"); migrationBuilder.AlterColumn<decimal>( name: "GuildId", table: "Warning", type: "numeric(20,0)", nullable: true, oldClrType: typeof(decimal), oldType: "numeric(20,0)"); migrationBuilder.CreateTable( name: "ReprimandAction", columns: table => new { Id = table.Column<Guid>(type: "uuid", nullable: false), Reprimand = table.Column<int>(type: "integer", nullable: false), Date = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false), GuildId = table.Column<decimal>(type: "numeric(20,0)", nullable: true), ModeratorId = table.Column<decimal>(type: "numeric(20,0)", nullable: true), UserId = table.Column<decimal>(type: "numeric(20,0)", nullable: true), Reason = table.Column<string>(type: "text", nullable: true), GuildUserEntityId = table.Column<decimal>(type: "numeric(20,0)", nullable: true) }, constraints: table => { table.PrimaryKey("PK_ReprimandAction", x => x.Id); table.ForeignKey( name: "FK_ReprimandAction_Guilds_GuildId", column: x => x.GuildId, principalTable: "Guilds", principalColumn: "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_ReprimandAction_Users_GuildUserEntityId", column: x => x.GuildUserEntityId, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_ReprimandAction_Users_ModeratorId", column: x => x.ModeratorId, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_ReprimandAction_Users_UserId", column: x => x.UserId, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateIndex( name: "IX_ReprimandAction_GuildId", table: "ReprimandAction", column: "GuildId"); migrationBuilder.CreateIndex( name: "IX_ReprimandAction_GuildUserEntityId", table: "ReprimandAction", column: "GuildUserEntityId"); migrationBuilder.CreateIndex( name: "IX_ReprimandAction_ModeratorId", table: "ReprimandAction", column: "ModeratorId"); migrationBuilder.CreateIndex( name: "IX_ReprimandAction_UserId", table: "ReprimandAction", column: "UserId"); migrationBuilder.AddForeignKey( name: "FK_Warning_Guilds_GuildId", table: "Warning", column: "GuildId", principalTable: "Guilds", principalColumn: "Id", onDelete: ReferentialAction.Restrict); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_Warning_Guilds_GuildId", table: "Warning"); migrationBuilder.DropTable( name: "ReprimandAction"); migrationBuilder.AlterColumn<decimal>( name: "GuildId", table: "Warning", type: "numeric(20,0)", nullable: false, defaultValue: 0m, oldClrType: typeof(decimal), oldType: "numeric(20,0)", oldNullable: true); migrationBuilder.AddForeignKey( name: "FK_Warning_Guilds_GuildId", table: "Warning", column: "GuildId", principalTable: "Guilds", principalColumn: "Id", onDelete: ReferentialAction.Cascade); } } }
40.565574
107
0.502324
[ "MIT" ]
WFP-Doobelepers/Zhongli
Zhongli.Data/Migrations/20210613095659_ReprimandHistory.cs
4,951
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 Sage.CA.SBS.ERP.Sage300.IC.Resources.Forms { 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", "15.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] public class UpdateBillsOfMaterialResx { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal UpdateBillsOfMaterialResx() { } /// <summary> /// Returns the cached ResourceManager instance used by this class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] public static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Sage.CA.SBS.ERP.Sage300.IC.Resources.Forms.UpdateBillsOfMaterialResx", typeof(UpdateBillsOfMaterialResx).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)] public static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } /// <summary> /// Looks up a localized string similar to Add. /// </summary> public static string Add { get { return ResourceManager.GetString("Add", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Amount. /// </summary> public static string Amount { get { return ResourceManager.GetString("Amount", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Base. /// </summary> public static string Base { get { return ResourceManager.GetString("Base", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Component Item Number Description. /// </summary> public static string ComponentItemNumberDesc { get { return ResourceManager.GetString("ComponentItemNumberDesc", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Components. /// </summary> public static string Components { get { return ResourceManager.GetString("Components", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Cost. /// </summary> public static string Cost { get { return ResourceManager.GetString("Cost", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Decrease. /// </summary> public static string Decrease { get { return ResourceManager.GetString("Decrease", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Delete Bill of Material {0} for Item {1}?. /// </summary> public static string DeleteBOM { get { return ResourceManager.GetString("DeleteBOM", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Delete this item from the bill of material?. /// </summary> public static string DeleteDetailLine { get { return ResourceManager.GetString("DeleteDetailLine", resourceCulture); } } /// <summary> /// Looks up a localized string similar to I/C Update Bills of Material. /// </summary> public static string Entity { get { return ResourceManager.GetString("Entity", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Fixed Cost. /// </summary> public static string FixedCost { get { return ResourceManager.GetString("FixedCost", resourceCulture); } } /// <summary> /// Looks up a localized string similar to From BOM Number. /// </summary> public static string FromBomNo { get { return ResourceManager.GetString("FromBomNo", resourceCulture); } } /// <summary> /// Looks up a localized string similar to From Master Item Number. /// </summary> public static string FromItemNo { get { return ResourceManager.GetString("FromItemNo", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Increase. /// </summary> public static string Increase { get { return ResourceManager.GetString("Increase", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Percentage. /// </summary> public static string Percentage { get { return ResourceManager.GetString("Percentage", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Remove. /// </summary> public static string Remove { get { return ResourceManager.GetString("Remove", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Replace. /// </summary> public static string Replace { get { return ResourceManager.GetString("Replace", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Replace by Item Number. /// </summary> public static string RplByItemNo { get { return ResourceManager.GetString("RplByItemNo", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Using. /// </summary> public static string Using { get { return ResourceManager.GetString("Using", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Variable Cost. /// </summary> public static string VariableCost { get { return ResourceManager.GetString("VariableCost", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Unit Cost is zero. Do you want to proceed?. /// </summary> public static string ZeroUnitcostPrompt { get { return ResourceManager.GetString("ZeroUnitcostPrompt", resourceCulture); } } } }
35.363636
229
0.539622
[ "MIT" ]
PeterSorokac/Sage300-SDK
resources/Sage300Resources/Sage.CA.SBS.ERP.Sage300.IC.Resources/Forms/UpdateBillsOfMaterialResx1.Designer.cs
8,949
C#
using System; using System.Net; namespace HttpRemoting.Data { public class HttpRemotingException: Exception, IHttpRemotingError { private const string UnknownError = "Unknown error"; public HttpStatusCode StatusCode { get; } public string? ErrorCode { get; } public HttpRemotingException( HttpStatusCode statusCode, string? errorCode, string? message): base(message ?? UnknownError) { StatusCode = statusCode; ErrorCode = errorCode; } public HttpRemotingException( HttpStatusCode statusCode, string? errorCode, string? message, Exception innerException): base(message ?? UnknownError, innerException) { StatusCode = statusCode; ErrorCode = errorCode; } public HttpRemotingException(IHttpRemotingError error): this(error.StatusCode, error.ErrorCode, error.Message) { } } }
24.529412
66
0.743405
[ "MIT" ]
MiloszKrajewski/TooMany
src/HttpRemoting.Data/HttpRemotingException.cs
834
C#
using System; using System.Collections.Generic; using System.Net.WebSockets; using System.Threading; using System.Threading.Tasks; namespace SocialApis.Core { /// <summary> /// WebSocketクライアント /// </summary> internal abstract class WebSocketClient : IWebSocketClient, IDisposable { /// <summary> /// データ受信時のバッファサイズ /// </summary> private const int BufferSize = 2048; private CancellationToken _cancellationToken; private readonly SemaphoreSlim _semaphore = new SemaphoreSlim(1, 1); /// <summary> /// WebSocketクライアント /// </summary> protected ClientWebSocket Connection { get; } /// <summary> /// 接続中かどうか取得する。 /// </summary> public bool IsConnecting { get; private set; } = false; /// <summary> /// <see cref="WebSocketClient"/>を生成する。 /// </summary> protected WebSocketClient() { this.Connection = WebFactory.CreateWebSocketClient(); } /// <summary> /// 接続を開始する。 /// </summary> /// <returns></returns> public Task Connect() => this.Connect(CancellationToken.None); /// <summary> /// 接続を開始する。 /// </summary> public async Task Connect(CancellationToken cancellationToken) { var sem = this._semaphore; await sem.WaitAsync().ConfigureAwait(false); if (this.IsConnecting) { throw new InvalidOperationException(); } this.IsConnecting = true; this._cancellationToken = cancellationToken; sem.Release(); var result = await this.TryConnect(cancellationToken).ConfigureAwait(false); if (!result) { return; } this.StartPooling(cancellationToken); } /// <summary> /// 接続先を取得する /// </summary> /// <returns></returns> protected abstract Uri GetConnectUri(); /// <summary> /// 接続を開始する /// </summary> /// <param name="token"></param> /// <returns></returns> protected async Task<bool> TryConnect(CancellationToken token) { var wss = this.Connection; try { await wss.ConnectAsync(this.GetConnectUri(), token).ConfigureAwait(false); } catch (TaskCanceledException tcex) { // TODO: LOG return false; } return true; } /// <summary> /// 受信処理を開始する /// </summary> /// <returns></returns> private void StartPooling(CancellationToken cancellationToken) => Task.Run(async () => { var buffer = new byte[BufferSize].AsMemory(); var wss = this.Connection; try { while (this.Connection.State == WebSocketState.Open) { cancellationToken.ThrowIfCancellationRequested(); var dataCollection = new LinkedList<byte[]>(); int dataLength = 0; bool endOfMessage = false; WebSocketMessageType messageType; do { var result = await wss.ReceiveAsync(buffer, cancellationToken).ConfigureAwait(false); if (result.MessageType == WebSocketMessageType.Close) { await this.Close().ConfigureAwait(false); return; } int dataCount = result.Count; dataCollection.AddLast(buffer[0..dataCount].ToArray()); dataLength += dataCount; messageType = result.MessageType; endOfMessage = result.EndOfMessage; } while (!endOfMessage); cancellationToken.ThrowIfCancellationRequested(); var dest = ConcatBytes(dataCollection, dataLength); switch (messageType) { case WebSocketMessageType.Text: this.OnReceiveText(dest); break; case WebSocketMessageType.Binary: this.OnReceiveBinary(dest); break; } } } catch (TaskCanceledException tcex) { // TODO: LOG await this.Close().ConfigureAwait(false); } }); /// <summary> /// 接続を終了する。 /// </summary> /// <returns></returns> public async Task Close() { var connection = this.Connection; var waltHandler = this._semaphore; await waltHandler.WaitAsync().ConfigureAwait(false); if (!this.IsConnecting) { return; } await connection.CloseAsync(WebSocketCloseStatus.NormalClosure, string.Empty, CancellationToken.None) .ConfigureAwait(false); this.IsConnecting = false; waltHandler.Release(); this.OnClosed(); } /// <summary> /// テキストデータ受取時 /// </summary> /// <param name="data">受信したデータ</param> protected virtual void OnReceiveText(byte[] data) { } /// <summary> /// バイナリデータ受取時 /// </summary> /// <param name="data">受信したデータ</param> protected virtual void OnReceiveBinary(byte[] data) { } /// <summary> /// 接続終了時 /// </summary> protected virtual void OnClosed() { } /// <summary> /// 複数のバイト配列を結合する。 /// </summary> /// <param name="dataCollection">バイト配列</param> /// <param name="dataCount">コピー先配列のバイト数</param> /// <returns></returns> private static byte[] ConcatBytes(LinkedList<byte[]> dataCollection, int dataCount) { byte[] dest = new byte[dataCount]; int offset = 0; foreach (var src in dataCollection) { int length = src.Length; Buffer.BlockCopy(src, 0, dest, offset, length); offset += length; } return dest; } /// <summary> /// インスタンスを破棄する。 /// </summary> protected virtual void Dispose() { this.Connection.Dispose(); this._semaphore.Dispose(); } /// <summary> /// インスタンスを破棄する。 /// </summary> void IDisposable.Dispose() => this.Dispose(); } }
28.060241
113
0.482754
[ "MIT" ]
atst1996/Liberfy.SocialApis
SocialApis/Core/WebSocketClient.cs
7,359
C#
// Copyright (c) Philipp Wagner and Joel Mueller. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using NUnit.Framework; using System; using System.Globalization; using CoreCsvParser.TypeConverter; namespace CoreCsvParser.Test.TypeConverter { [TestFixture] public class NullableTimeSpanConverterTest : BaseConverterTest<TimeSpan?> { protected override ITypeConverter<TimeSpan?> Converter { get { return new NullableTimeSpanConverter(); } } protected override (string, TimeSpan?)[] SuccessTestData { get { return new[] { (TimeSpan.MinValue.ToString(), TimeSpan.MinValue), ("14", TimeSpan.FromDays(14)), ("1:2:3", TimeSpan.FromHours(1).Add(TimeSpan.FromMinutes(2)).Add(TimeSpan.FromSeconds(3))), (" ", default(TimeSpan?)), (null, default(TimeSpan?)), (string.Empty, default(TimeSpan?)) }; } } protected override string[] FailTestData { get { return new[] { "a" }; } } } [TestFixture] public class NullableTimeSpanConverterWithFormatProviderTest : NullableTimeSpanConverterTest { protected override ITypeConverter<TimeSpan?> Converter { get { return new NullableTimeSpanConverter(string.Empty); } } } [TestFixture] public class NullableTimeSpanConverterWithFormatAndFormatProviderTest : NullableTimeSpanConverterTest { protected override ITypeConverter<TimeSpan?> Converter { get { return new NullableTimeSpanConverter(string.Empty, CultureInfo.InvariantCulture); } } } [TestFixture] public class NullableTimeSpanConverterWithFormatAndFormatProviderAndTimeSpanStyleTest : NullableTimeSpanConverterTest { protected override ITypeConverter<TimeSpan?> Converter { get { return new NullableTimeSpanConverter(string.Empty, CultureInfo.InvariantCulture, TimeSpanStyles.None); } } } }
32.573529
122
0.632506
[ "MIT" ]
jtmueller/CoreCsvParser
CoreCsvParser/CoreCsvParser.Test/TypeConverter/NullableTimeSpanConverterTest.cs
2,217
C#
//------------------------------------------------------------------------------ // <copyright file="ResourcePermissionBaseEntry.cs" company="Microsoft"> // Copyright (c) Microsoft Corporation. All rights reserved. // </copyright> //------------------------------------------------------------------------------ namespace System.Security.Permissions { /// <include file='doc\ResourcePermissionBaseEntry.uex' path='docs/doc[@for="ResourcePermissionBaseEntry"]/*' /> [ Serializable() ] public class ResourcePermissionBaseEntry { private string[] accessPath; private int permissionAccess; /// <include file='doc\ResourcePermissionBaseEntry.uex' path='docs/doc[@for="ResourcePermissionBaseEntry.ResourcePermissionBaseEntry"]/*' /> public ResourcePermissionBaseEntry() { this.permissionAccess = 0; this.accessPath = new string[0]; } /// <include file='doc\ResourcePermissionBaseEntry.uex' path='docs/doc[@for="ResourcePermissionBaseEntry.ResourcePermissionBaseEntry1"]/*' /> public ResourcePermissionBaseEntry(int permissionAccess, string[] permissionAccessPath) { if (permissionAccessPath == null) throw new ArgumentNullException("permissionAccessPath"); this.permissionAccess = permissionAccess; this.accessPath = permissionAccessPath; } /// <include file='doc\ResourcePermissionBaseEntry.uex' path='docs/doc[@for="ResourcePermissionBaseEntry.PermissionAccess"]/*' /> public int PermissionAccess { get { return this.permissionAccess; } } /// <include file='doc\ResourcePermissionBaseEntry.uex' path='docs/doc[@for="ResourcePermissionBaseEntry.PermissionAccessPath"]/*' /> public string[] PermissionAccessPath { get { return this.accessPath; } } } }
45.877551
178
0.521797
[ "Unlicense" ]
bestbat/Windows-Server
com/netfx/src/framework/compmod/system/security/permissions/resourcepermissionbaseentry.cs
2,248
C#
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; using System.Dynamic; using System.Linq; using Microsoft.TestCommon; using Moq; namespace System.Web.Mvc.Test { public class DynamicViewDataDictionaryTest { [Fact] public void Get_OnExistingProperty_ReturnsValue() { // Arrange ViewDataDictionary vd = new ViewDataDictionary() { { "Prop", "Value" } }; dynamic dynamicVD = new DynamicViewDataDictionary(() => vd); // Act object value = dynamicVD.Prop; // Assert Assert.IsType<string>(value); Assert.Equal("Value", value); } [Fact] public void Get_OnNonExistentProperty_ReturnsNull() { // Arrange ViewDataDictionary vd = new ViewDataDictionary(); dynamic dynamicVD = new DynamicViewDataDictionary(() => vd); // Act object value = dynamicVD.Prop; // Assert Assert.Null(value); } [Fact] public void Set_OnExistingProperty_OverridesValue() { // Arrange ViewDataDictionary vd = new ViewDataDictionary() { { "Prop", "Value" } }; dynamic dynamicVD = new DynamicViewDataDictionary(() => vd); // Act dynamicVD.Prop = "NewValue"; // Assert Assert.Equal("NewValue", dynamicVD.Prop); Assert.Equal("NewValue", vd["Prop"]); } [Fact] public void Set_OnNonExistentProperty_SetsValue() { // Arrange ViewDataDictionary vd = new ViewDataDictionary(); dynamic dynamicVD = new DynamicViewDataDictionary(() => vd); // Act dynamicVD.Prop = "NewValue"; // Assert Assert.Equal("NewValue", dynamicVD.Prop); Assert.Equal("NewValue", vd["Prop"]); } [Fact] public void TryGetMember_OnExistingProperty_ReturnsValueAndSucceeds() { // Arrange object result = null; ViewDataDictionary vd = new ViewDataDictionary() { { "Prop", "Value" } }; DynamicViewDataDictionary dynamicVD = new DynamicViewDataDictionary(() => vd); Mock<GetMemberBinder> binderMock = new Mock<GetMemberBinder>( "Prop", /* ignoreCase */ false ); // Act bool success = dynamicVD.TryGetMember(binderMock.Object, out result); // Assert Assert.True(success); Assert.Equal("Value", result); } [Fact] public void TryGetMember_OnNonExistentProperty_ReturnsNullAndSucceeds() { // Arrange object result = null; ViewDataDictionary vd = new ViewDataDictionary(); DynamicViewDataDictionary dynamicVD = new DynamicViewDataDictionary(() => vd); Mock<GetMemberBinder> binderMock = new Mock<GetMemberBinder>( "Prop", /* ignoreCase */ false ); // Act bool success = dynamicVD.TryGetMember(binderMock.Object, out result); // Assert Assert.True(success); Assert.Null(result); } [Fact] public void TrySetMember_OnExistingProperty_OverridesValueAndSucceeds() { // Arrange ViewDataDictionary vd = new ViewDataDictionary() { { "Prop", "Value" } }; DynamicViewDataDictionary dynamicVD = new DynamicViewDataDictionary(() => vd); Mock<SetMemberBinder> binderMock = new Mock<SetMemberBinder>( "Prop", /* ignoreCase */ false ); // Act bool success = dynamicVD.TrySetMember(binderMock.Object, "NewValue"); // Assert Assert.True(success); Assert.Equal("NewValue", ((dynamic)dynamicVD).Prop); Assert.Equal("NewValue", vd["Prop"]); } [Fact] public void TrySetMember_OnNonExistentProperty_SetsValueAndSucceeds() { // Arrange ViewDataDictionary vd = new ViewDataDictionary(); DynamicViewDataDictionary dynamicVD = new DynamicViewDataDictionary(() => vd); Mock<SetMemberBinder> binderMock = new Mock<SetMemberBinder>( "Prop", /* ignoreCase */ false ); // Act bool success = dynamicVD.TrySetMember(binderMock.Object, "NewValue"); // Assert Assert.True(success); Assert.Equal("NewValue", ((dynamic)dynamicVD).Prop); Assert.Equal("NewValue", vd["Prop"]); } [Fact] public void GetDynamicMemberNames_ReturnsEmptyListForEmptyViewDataDictionary() { // Arrange ViewDataDictionary vd = new ViewDataDictionary(); DynamicViewDataDictionary dvd = new DynamicViewDataDictionary(() => vd); // Act IEnumerable<string> result = dvd.GetDynamicMemberNames(); // Assert Assert.Empty(result); } [Fact] public void GetDynamicMemberNames_ReturnsKeyNamesForFilledViewDataDictionary() { // Arrange ViewDataDictionary vd = new ViewDataDictionary() { { "Prop1", 1 }, { "Prop2", 2 } }; DynamicViewDataDictionary dvd = new DynamicViewDataDictionary(() => vd); // Act var result = dvd.GetDynamicMemberNames(); // Assert Assert.Equal(new[] { "Prop1", "Prop2" }, result.OrderBy(s => s).ToArray()); } [Fact] public void GetDynamicMemberNames_ReflectsChangesToUnderlyingViewDataDictionary() { // Arrange ViewDataDictionary vd = new ViewDataDictionary(); vd["OldProp"] = 123; DynamicViewDataDictionary dvd = new DynamicViewDataDictionary(() => vd); vd["NewProp"] = "somevalue"; // Act var result = dvd.GetDynamicMemberNames(); // Assert Assert.Equal(new[] { "NewProp", "OldProp" }, result.OrderBy(s => s).ToArray()); } [Fact] public void GetDynamicMemberNames_ReflectsChangesToDynamicObject() { // Arrange ViewDataDictionary vd = new ViewDataDictionary(); vd["OldProp"] = 123; DynamicViewDataDictionary dvd = new DynamicViewDataDictionary(() => vd); ((dynamic)dvd).NewProp = "foo"; // Act var result = dvd.GetDynamicMemberNames(); // Assert Assert.Equal(new[] { "NewProp", "OldProp" }, result.OrderBy(s => s).ToArray()); } } }
32.658879
111
0.555158
[ "Apache-2.0" ]
belav/AspNetWebStack
test/System.Web.Mvc.Test/Test/DynamicViewDataDictionaryTest.cs
6,991
C#
/* MIT License Copyright (c) 2012-present Digital Ruby, LLC - https://www.digitalruby.com Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; using System.Collections.Generic; using System.Globalization; using System.Security; using System.Security.Cryptography; using System.Text; using System.Threading.Tasks; namespace DigitalRuby.IPBanCore { /// <summary> /// Handler interface for banned ip addresses /// </summary> public interface IBannedIPAddressHandler { /// <summary> /// Handle a banned ip address /// </summary> /// <param name="ipAddress">Banned ip address</param> /// <param name="source">Source</param> /// <param name="userName">User name</param> /// <param name="osName">OS name</param> /// <param name="osVersion">OS version</param> /// <param name="assemblyVersion">Assembly version</param> /// <param name="requestMaker">Request maker if needed, null otherwise</param> /// <returns>Task</returns> System.Threading.Tasks.Task HandleBannedIPAddress(string ipAddress, string source, string userName, string osName, string osVersion, string assemblyVersion, IHttpRequestMaker requestMaker); /// <summary> /// Base url for any http requests that need to be made /// </summary> string BaseUrl { get; set; } /// <summary> /// Public API key /// </summary> SecureString PublicAPIKey { get; set; } } /// <summary> /// Default banned ip address handler /// </summary> public class DefaultBannedIPAddressHandler : IBannedIPAddressHandler { /// <summary> /// Base url /// </summary> public string BaseUrl { get; set; } = "https://api.ipban.com"; /// <inheritdoc /> public async Task HandleBannedIPAddress(string ipAddress, string source, string userName, string osName, string osVersion, string assemblyVersion, IHttpRequestMaker requestMaker) { if (requestMaker is null) { return; } try { if (!System.Net.IPAddress.TryParse(ipAddress, out System.Net.IPAddress ipAddressObj) || ipAddressObj.IsInternal()) { return; } // submit url to ipban public database so that everyone can benefit from an aggregated list of banned ip addresses DateTime now = IPBanService.UtcNow; string timestamp = now.ToString("o"); string url = $"/IPSubmitBanned?ip={ipAddress.UrlEncode()}&osname={osName.UrlEncode()}&osversion={osVersion.UrlEncode()}&source={source.UrlEncode()}&timestamp={timestamp.UrlEncode()}&userName={userName.UrlEncode()}&version={assemblyVersion.UrlEncode()}"; string hash = Convert.ToBase64String(new SHA256Managed().ComputeHash(Encoding.UTF8.GetBytes(url + IPBanResources.IPBanKey1))); url += "&hash=" + hash.UrlEncode(); url = BaseUrl + url; string timestampUnix = now.ToUnixMillisecondsLong().ToString(CultureInfo.InvariantCulture); List<KeyValuePair<string, object>> headers; if (PublicAPIKey != null && PublicAPIKey.Length != 0) { // send api key and timestamp headers = new List<KeyValuePair<string, object>> { new KeyValuePair<string, object>("X-IPBAN-API-KEY", PublicAPIKey.ToUnsecureString()), new KeyValuePair<string, object>("X-IPBAN-TIMESTAMP", timestampUnix) }; } else { headers = null; } await requestMaker.MakeRequestAsync(new Uri(url), headers: headers); } catch { // don't care, this is not fatal } } /// <summary> /// Public API key /// </summary> public SecureString PublicAPIKey { get; set; } } /// <summary> /// Null banned ip address handler, does nothing /// </summary> public class NullBannedIPAddressHandler : IBannedIPAddressHandler { /// <summary> /// Not implemented /// </summary> string IBannedIPAddressHandler.BaseUrl { get; set; } /// <summary> /// Not implemented /// </summary> SecureString IBannedIPAddressHandler.PublicAPIKey { get; set; } /// <summary> /// Does nothing /// </summary> /// <param name="ipAddress">N/A</param> /// <param name="source">N/A</param> /// <param name="userName">N/A</param> /// <param name="osName">N/A</param> /// <param name="osVersion">N/A</param> /// <param name="assemblyVersion">N/A</param> /// <param name="requestMaker">N/A</param> /// <returns>Completed task</returns> Task IBannedIPAddressHandler.HandleBannedIPAddress(string ipAddress, string source, string userName, string osName, string osVersion, string assemblyVersion, IHttpRequestMaker requestMaker) { // do nothing return Task.CompletedTask; } /// <summary> /// Singleton instance /// </summary> public static NullBannedIPAddressHandler Instance { get; } = new NullBannedIPAddressHandler(); } }
39.660606
269
0.610789
[ "MIT" ]
OsamahGhadheb/IPBan
IPBanCore/Core/Interfaces/IBannedIPAddressHandler.cs
6,546
C#
using CienciaArgentina.Microservices.Entities.Identity; using CienciaArgentina.Microservices.Entities.Models.Addresses; using CienciaArgentina.Microservices.Entities.Models.Commons; using CienciaArgentina.Microservices.Entities.Models.JobOffer; using CienciaArgentina.Microservices.Entities.Models.Organizations; using CienciaArgentina.Microservices.Entities.Models.User; using Microsoft.AspNetCore.Identity.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; namespace CienciaArgentina.Microservices.Persistence { public class CienciaArgentinaDbContext : IdentityDbContext<ApplicationUser> { public CienciaArgentinaDbContext(DbContextOptions<CienciaArgentinaDbContext> options) : base(options) { } public DbSet<Address> Addresses { get; set; } public DbSet<WorkExperience> WorkExperience { get; set; } public DbSet<UserProfile> UserProfiles { get; set; } public DbSet<Sex> Sex { get; set; } public DbSet<Position> Positions { get; set; } public DbSet<Organization> Organizations { get; set; } public DbSet<SocialNetwork> SocialNetworks { get; set; } public DbSet<Country> Countries { get; set; } public DbSet<University> Universities { get; set; } public DbSet<UserStudyType> UserStudyTypes { get; set; } public DbSet<UserStudy> UserStudies { get; set; } public DbSet<Department> Departments { get; set; } public DbSet<UserDepartment> UserDepartments { get; set; } public DbSet<UserOrganization> UserOrganizations { get; set; } public DbSet<State> States { get; set; } public DbSet<City> Cities { get; set; } public DbSet<UserStudyCompletion> UserStudiesCompletion { get; set; } public DbSet<Locality> Localities { get; set; } public DbSet<OrganizationProject> OrganizationProjects { get; set; } public DbSet<DepartmentProject> DepartmentProjects { get; set; } public DbSet<JobOffer> JobOffer { get; set; } public DbSet<JobReferral> JobReferrals { get; set; } public DbSet<JobOfferCandidateReferral> JobOfferCandidateReferrals { get; set; } public DbSet<JobOfferCandidate> JobOfferCandidates { get; set; } //public DbSet<JobOfferDescriptionTag> JobOfferDescriptionTags { get; set; } public DbSet<JobType> JobTypes { get; set; } public DbSet<Tag> Tags { get; set; } public DbSet<JobOfferUserLanguajeKnoweldge> JobOfferUserLanguajeKnoweldge { get; set; } public DbSet<UserLanguage> UserLanguages { get; set; } public DbSet<UserLanguageKnowledge> UserLanguagesKnowledge { get; set; } public DbSet<UserLanguageSkill> UserLanguagesSkill { get; set; } public DbSet<Telephone> Telephones { get; set; } public DbSet<OrganizationType> OrganizationTypes { get; set; } public DbSet<Paper> Papers { get; set; } } }
53.345455
109
0.708589
[ "MIT" ]
lucaslopezf/CienciaArgentina.Microservices
CienciaArgentina.Microservices.Persistence/CienciaArgentinaDbContext.cs
2,936
C#
using System.Collections; using System.Collections.Generic; using UnityEngine; public class Cell_Cube3D : Cell { public Cell_Cube3D[] m_faces = new Cell_Cube3D[6]; public Cell_Cube3D[] m_edges = new Cell_Cube3D[12]; public Cell_Cube3D[] m_corners = new Cell_Cube3D[8]; int m_activeFaces = 0; int m_activeEdges = 0; int m_activeCorners = 0; public int GetActiveFaces() { return m_activeFaces; } public void SetActiveFaces(int _faces) { m_activeFaces = _faces; } public int GetActiveEdges() { return m_activeEdges; } public void SetActiveEdges(int _edges) { m_activeEdges = _edges; } public int GetActiveCorners() { return m_activeCorners; } public void SetActiveCorners(int _corners) { m_activeCorners = _corners; } override public void Reset() { DestroyMesh(); ResetNeighbours(); SetAlive(false); SetDrawn(false); } public void ResetNeighbours() { m_faces = new Cell_Cube3D[6]; m_edges = new Cell_Cube3D[12]; m_corners = new Cell_Cube3D[8]; m_activeFaces = 0; m_activeEdges = 0; m_activeCorners = 0; } };
29.769231
78
0.665805
[ "MIT" ]
JoshhhBailey/crystal-growth
Assets/Scripts/Cells/Cell_Cube3D.cs
1,161
C#
using System; using System.Diagnostics; using System.Windows; using System.IO; using System.Windows.Input; using SICore; using SIGame.ViewModel.PlatformSpecific; using SIGame.ViewModel.Properties; namespace SIGame.ViewModel { /// <summary> /// Глобальные команды игры /// </summary> public static class GameCommands { public static ICommand OpenLogs { get; private set; } public static ICommand Comment { get; private set; } public static ICommand Donate { get; private set; } public static ICommand Help { get; private set; } public static ICommand ChangeSound { get; private set; } public static ICommand ChangeFullScreen { get; private set; } public static ICommand ChangeSearchForUpdates { get; private set; } public static ICommand ChangeSendReport { get; private set; } static GameCommands() { OpenLogs = new CustomCommand(OpenLogs_Executed); Comment = new CustomCommand(Comment_Executed); Donate = new CustomCommand(Donate_Executed); Help = new CustomCommand(Help_Executed); // Для таскбара Windows 7 ChangeSound = new CustomCommand(arg => UserSettings.Default.Sound = !UserSettings.Default.Sound); ChangeFullScreen = new CustomCommand(arg => UserSettings.Default.FullScreen = !UserSettings.Default.FullScreen); ChangeSearchForUpdates = new CustomCommand(arg => UserSettings.Default.SearchForUpdates = !UserSettings.Default.SearchForUpdates); ChangeSendReport = new CustomCommand(arg => UserSettings.Default.SendReport = !UserSettings.Default.SendReport); } private static void OpenLogs_Executed(object arg) { var logsFolder = UserSettings.Default.GameSettings.AppSettings.LogsFolder; if (!Directory.Exists(logsFolder)) { PlatformManager.Instance.ShowMessage(Resources.NoLogsFolder, MessageType.Warning); return; } try { Process.Start(new ProcessStartInfo(logsFolder)); } catch (Exception exc) { PlatformManager.Instance.ShowMessage(string.Format(Resources.OpenLogsError, exc.Message), MessageType.Error); } } private static void Comment_Executed(object arg) { try { var commentUri = Uri.EscapeUriString(Resources.FeedbackLink); Process.Start(commentUri); } catch (Exception exc) { PlatformManager.Instance.ShowMessage(string.Format(Resources.CommentSiteError + "\r\n{0}", exc.Message), MessageType.Error); } } private static void Donate_Executed(object arg) { try { var donateUri = "https://money.yandex.ru/embed/shop.xml?account=410012283941753&quickpay=shop&payment-type-choice=on&writer=seller&targets=%D0%9F%D0%BE%D0%B4%D0%B4%D0%B5%D1%80%D0%B6%D0%BA%D0%B0+%D0%B0%D0%B2%D1%82%D0%BE%D1%80%D0%B0&targets-hint=&default-sum=100&button-text=03&comment=on&hint=%D0%92%D0%B0%D1%88+%D0%BA%D0%BE%D0%BC%D0%BC%D0%B5%D0%BD%D1%82%D0%B0%D1%80%D0%B8%D0%B9"; Process.Start(donateUri); } catch (Exception exc) { PlatformManager.Instance.ShowMessage(string.Format(Resources.LinkError + "\r\n{0}", exc.Message), MessageType.Error); } } private static void Help_Executed(object arg) { try { PlatformManager.Instance.ShowHelp(arg != null); } catch (Exception exc) { PlatformManager.Instance.ShowMessage(exc.Message, MessageType.Error, true); } } } }
39.333333
395
0.613251
[ "MIT" ]
VladimirKhil/SI
src/SIGame/SIGame.ViewModel/ViewModel/GameCommands.cs
3,928
C#
// Copyright (c) Microsoft Corporation // // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 // // THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER // EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, // FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. // // See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. namespace Microsoft.Spectrum.Import.Service { using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Configuration; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Net; using System.ServiceModel; using System.Text; using System.Threading; using System.Threading.Tasks; using System.Timers; using System.Transactions; using Microsoft.Spectrum.Common; using Microsoft.Spectrum.Common.Azure; using Microsoft.Spectrum.IO.MeasurementStationSettings; using Microsoft.Spectrum.MeasurementStation.Client; using Microsoft.Spectrum.Storage.Blob; using Microsoft.WindowsAzure; using Microsoft.WindowsAzure.Storage; using Microsoft.WindowsAzure.Storage.Blob; using WindowsAzure.Storage.Auth; internal class ImporterAgent : IDisposable { private readonly ILogger logger; private readonly IConfigurationSource configurationSource; private HealthReporter healthReport; private DirectoryWatcherConfiguration configuration; private MeasurementStationConfigurationEndToEnd measurementStationConfiguration = null; private SettingsConfigurationSection settingsConfiguration; private bool continueMonitoring = true; private Task importerThread; private Task healthReportThread; public ImporterAgent(ILogger logger, IConfigurationSource configurationSource) { if (logger == null) { throw new ArgumentNullException("logger"); } if (configurationSource == null) { throw new ArgumentNullException("configurationSource"); } this.logger = logger; this.configurationSource = configurationSource; this.settingsConfiguration = (SettingsConfigurationSection)ConfigurationManager.GetSection("SettingsConfiguration"); if (File.Exists(this.settingsConfiguration.MeasurementStationConfigurationFileFullPath)) { try { using (Stream input = File.OpenRead(this.settingsConfiguration.MeasurementStationConfigurationFileFullPath)) { this.measurementStationConfiguration = MeasurementStationConfigurationEndToEnd.Read(input); } } catch { // There is an issue with the configuration file, so delete it and we can rewrite another one File.Delete(this.settingsConfiguration.MeasurementStationConfigurationFileFullPath); this.measurementStationConfiguration = null; } } } #region IImporterAgent Implemenation public void StartMonitoring() { // Read the configuration and make sure that it is correct. We should fail fast if there are problems. this.configuration = this.configurationSource.GetConfiguration(); IList<ValidationResult> validationResults = ValidationHelper.Validate(this.configuration); if (validationResults.Any()) { throw new ImporterConfigurationException("There was a problem with the specified configuration file.", validationResults); } this.logger.Log(TraceEventType.Information, LoggingMessageId.ImporterAgent, "Configuration validated successfully."); this.logger.Log(TraceEventType.Information, LoggingMessageId.ImporterAgent, "Importer Starting"); this.healthReport = new HealthReporter(configuration, settingsConfiguration, logger); Action action = null; action = this.UploadWatchFiles; Action healthReportAction = null; healthReportAction = healthReport.AutoHealthReporterThread; this.importerThread = Task.Factory.StartNew(action); this.healthReportThread = Task.Factory.StartNew(healthReportAction); } public void StopMonitoring() { try { this.continueMonitoring = false; this.importerThread.Wait(); this.healthReport.ShutDown(); this.healthReportThread.Wait(); } catch (Exception ex) { this.logger.Log(TraceEventType.Error, LoggingMessageId.ImporterAgent, ex.ToString()); } this.logger.Log(TraceEventType.Information, LoggingMessageId.ImporterAgent, "Importer Stopped"); } #endregion private void UploadWatchFiles() { while (this.continueMonitoring) { try { using (MeasurementStationServiceChannelFactory channelFactory = new MeasurementStationServiceChannelFactory()) { IMeasurementStationServiceChannel channel = channelFactory.CreateChannel(this.configuration.MeasurementStationServiceUri); int stationAvailability = channel.GetStationAvailability(this.configuration.StationAccessId); // NOTE: Following is to prevent data uploading for the decommissioned station. if (Microsoft.Spectrum.Storage.Enums.StationAvailability.Decommissioned == (Microsoft.Spectrum.Storage.Enums.StationAvailability)stationAvailability) { string message = string.Format("Station {0} has been decomissioned. With the decomissioned status no data files will be pushed to Cloud.", this.configuration.StationAccessId); this.logger.Log(TraceEventType.Information, LoggingMessageId.ImporterAgent, message); continue; } // Get the list of pathnames for all existing files that need to be processed string[] existingWatchFiles = Directory.GetFiles(this.configuration.WatchDirectory, this.configuration.WatchDirectoryFileExtension, SearchOption.TopDirectoryOnly); bool gotUpdatedSettings; foreach (string watchFile in existingWatchFiles) { bool fileWritten = false; try { // This call will throw an IOException if the file is current being written to using (var file = File.Open(watchFile, FileMode.Open, FileAccess.Read, FileShare.None)) { fileWritten = true; } } catch (IOException) { // We couldn't write to this file, so it must still be open by someone else } if (!fileWritten) { // skip this file until file it is completely available continue; } Stream scanFileStream = null; bool uploadSuccess = true; bool notifySuccess = false; string blobUri = string.Empty; string error = string.Empty; try { string filename = Path.GetFileName(watchFile); scanFileStream = File.OpenRead(watchFile); // Check to see if there is any changes to the settings string storageAccountName = string.Empty; string storageAccessKey = string.Empty; byte[] measurementStationConfigurationUpdate = null; gotUpdatedSettings = false; while (!gotUpdatedSettings) { try { channel.GetUpdatedSettings(this.configuration.StationAccessId, out storageAccountName, out storageAccessKey, out measurementStationConfigurationUpdate); gotUpdatedSettings = true; } catch (WebException ex) { this.logger.Log(TraceEventType.Error, LoggingMessageId.ImporterAgent, ex.ToString()); } } MeasurementStationConfigurationEndToEnd settingsUpdated; using (MemoryStream stream = new MemoryStream(measurementStationConfigurationUpdate)) { settingsUpdated = MeasurementStationConfigurationEndToEnd.Read(stream); } // if the configuration has been updated, then update the setting file if (this.measurementStationConfiguration == null || this.measurementStationConfiguration.LastModifiedTime < settingsUpdated.LastModifiedTime || !File.Exists(this.settingsConfiguration.MeasurementStationConfigurationFileFullPath)) { this.measurementStationConfiguration = settingsUpdated; // Write out to a file so that the scanner can get the updated settings as well using (Stream output = File.OpenWrite(this.settingsConfiguration.MeasurementStationConfigurationFileFullPath)) { this.measurementStationConfiguration.Write(output); if (this.healthReport != null) { this.healthReport.UsrpScannerConfigurationChanged(this.measurementStationConfiguration); } } } AzureSpectrumBlobStorage cloudStorage = new AzureSpectrumBlobStorage(null, null, storageAccountName + storageAccessKey); blobUri = cloudStorage.UploadFile(scanFileStream, filename, this.configuration.UploadRetryCount, this.configuration.ServerUploadTimeout, this.configuration.RetryDeltaBackoff); } catch (Exception e) { uploadSuccess = false; this.logger.Log(TraceEventType.Error, LoggingMessageId.ImporterAgent, e.ToString()); } finally { if (scanFileStream != null) { scanFileStream.Dispose(); } } Exception mostRecentEx = null; for (int i = 0; (i < this.configuration.UploadRetryCount) && (notifySuccess == false); i++) { // Do the notification on success or failure mostRecentEx = null; try { channel.ScanFileUploaded(this.configuration.StationAccessId, blobUri, uploadSuccess); notifySuccess = true; } catch (ChannelTerminatedException cte) { mostRecentEx = cte; System.Threading.Thread.Sleep(TimeSpan.FromMinutes(this.configuration.RetryDeltaBackoff)); } catch (EndpointNotFoundException enfe) { mostRecentEx = enfe; System.Threading.Thread.Sleep(TimeSpan.FromMinutes(this.configuration.RetryDeltaBackoff)); } catch (ServerTooBusyException stbe) { mostRecentEx = stbe; System.Threading.Thread.Sleep(TimeSpan.FromMinutes(this.configuration.RetryDeltaBackoff)); } catch (Exception ex) { mostRecentEx = ex; System.Threading.Thread.Sleep(TimeSpan.FromMinutes(this.configuration.RetryDeltaBackoff)); } } if (mostRecentEx != null) { this.logger.Log(TraceEventType.Error, LoggingMessageId.ImporterAgent, mostRecentEx.ToString()); } if (uploadSuccess && notifySuccess) { this.OnFileInJobCompleted(watchFile, blobUri); } else { this.OnFileInJobFailed(watchFile, error); } } if (channel != null) { channel.CloseOrAbort(); } } Thread.Sleep(5000); } catch (Exception ex) { // make sure that an exception doesn't cause us to stop uploading files, we need to keep trying this.logger.Log(TraceEventType.Error, LoggingMessageId.ImporterAgent, ex.ToString()); } } } private void OnFileInJobFailed(string failedFilePath, string error) { if (!string.IsNullOrWhiteSpace(failedFilePath) && File.Exists(failedFilePath)) { string errorPath = FileHelper.GetUniqueFileName(this.configuration.InvalidFilesDirectory, failedFilePath); this.logger.Log(TraceEventType.Error, LoggingMessageId.MessageBufferEventId, string.Format(CultureInfo.InvariantCulture, "Error occurred while uploading the file {0} {1} Exception Details: {2}", errorPath, Environment.NewLine, error)); using (TransactionScope scope = new TransactionScope()) { TransactedFileHelper.MoveFileTransacted(failedFilePath, errorPath); scope.Complete(); } } } private void OnFileInJobCompleted(string scanFilePath, string uploadedFilePath) { if (!string.IsNullOrWhiteSpace(uploadedFilePath) && File.Exists(scanFilePath)) { try { File.Delete(scanFilePath); } catch (IOException exception) { this.logger.Log(TraceEventType.Error, LoggingMessageId.ImporterAgent, exception.ToString()); } } } public void Dispose() { this.Dispose(true); GC.SuppressFinalize(this); } protected void Dispose(bool isDisposing) { if (isDisposing) { if (this.healthReport != null) { this.healthReport.Dispose(); } } } } }
47.369863
251
0.516136
[ "Apache-2.0" ]
cityscapesc/specobs
main/external/dev/Client/MS.Import.Service/ImporterAgent.cs
17,290
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 System.Collections.Generic; using Aliyun.Acs.Core.Transform; using Aliyun.Acs.Green.Model.V20170823; namespace Aliyun.Acs.Green.Transform.V20170823 { public class VerifyPhoneResponseUnmarshaller { public static VerifyPhoneResponse Unmarshall(UnmarshallerContext context) { VerifyPhoneResponse verifyPhoneResponse = new VerifyPhoneResponse(); verifyPhoneResponse.HttpResponse = context.HttpResponse; verifyPhoneResponse.RequestId = context.StringValue("VerifyPhone.RequestId"); return verifyPhoneResponse; } } }
35.125
81
0.753025
[ "Apache-2.0" ]
bbs168/aliyun-openapi-net-sdk
aliyun-net-sdk-green/Green/Transform/V20170823/VerifyPhoneResponseUnmarshaller.cs
1,405
C#
using Microsoft.Azure.Cosmos; using Project.Zap.Library.Models; using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Threading.Tasks; namespace Project.Zap.Library.Services { public class PartnerRepository : IRepository<PartnerOrganization> { private readonly Container cosmosContainer; public PartnerRepository(Database cosmosDatabase) { this.cosmosContainer = cosmosDatabase.CreateContainerIfNotExistsAsync("partner", "/Name").Result; } public async Task Add(PartnerOrganization item) { await this.cosmosContainer.CreateItemAsync<PartnerOrganization>(item, new PartitionKey(item.Name)); } public async Task Delete(Expression<Func<PartnerOrganization, bool>> query) { IEnumerable<dynamic> results = this.cosmosContainer.GetItemLinqQueryable<PartnerOrganization>(true).Where(query).Select(x => new { id = x.id, Name = x.Name }).AsEnumerable(); foreach(dynamic result in results) { await this.cosmosContainer.DeleteItemAsync<PartnerOrganization>(result.id, new PartitionKey(result.Name)); } } public async Task<IEnumerable<PartnerOrganization>> Get() { return await this.Get("SELECT * FROM c"); } public async Task<IEnumerable<PartnerOrganization>> Get(string sql, IDictionary<string, object> parameters = null, string partitionKey = null) { QueryDefinition query = new QueryDefinition(sql); if (parameters != null) { foreach (var parameter in parameters) { query.WithParameter(parameter.Key, parameter.Value); } } QueryRequestOptions options = new QueryRequestOptions() { MaxBufferedItemCount = 100, MaxConcurrency = 10 }; if (partitionKey != null) options.PartitionKey = new PartitionKey(partitionKey); List<PartnerOrganization> results = new List<PartnerOrganization>(); FeedIterator<PartnerOrganization> iterator = this.cosmosContainer.GetItemQueryIterator<PartnerOrganization>(query, requestOptions: options); while (iterator.HasMoreResults) { FeedResponse<PartnerOrganization> response = await iterator.ReadNextAsync(); results.AddRange(response); } return results; } public Task<PartnerOrganization> Replace(PartnerOrganization item) { throw new NotImplementedException(); } public Task<PartnerOrganization> Update(PartnerOrganization item) { throw new NotImplementedException(); } } }
37.573333
186
0.645848
[ "MIT" ]
microsoft/Project-Zap
Project.Zap.Library/Services/PartnerRepository.cs
2,820
C#
using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.IO; using System.Reflection; namespace OMF { /// <summary> /// OMF Project for serializing to .omf file /// </summary> public class Project : ContentModel, IObject { public Project() { try { author = System.Security.Principal.WindowsIdentity.GetCurrent().Name; } catch { //not being on the domain could cause problems author = ""; } SurfaceElements = new List<OMF.SurfaceElement>(); PointSetElements = new List<OMF.PointSetElement>(); VolumeElements = new List<OMF.VolumeElement>(); LineSetElements = new List<OMF.LineSetElement>(); elements = new List<string>(); units = "m"; origin = new double[] { 0, 0, 0 }; date = DateTime.Now; revision = "1"; } /// <summary> /// Author /// </summary> public string author { get; set; } /// <summary> /// Revision /// </summary> public string revision { get; set; } /// <summary> /// Date associated with the project data /// </summary> [JsonConverter(typeof(OMFDateTimeConverter))] public DateTime date { get; set; } /// <summary> /// Spatial units of project /// </summary> public string units { get; set; } /// <summary> /// Origin point for all elements in the project /// </summary> public double[] origin { get; set; } /// <summary> /// Project Elements /// </summary> public List<String> elements { get; set; } [JsonIgnore] public List<SurfaceElement> SurfaceElements { get; set; } [JsonIgnore] public List<PointSetElement> PointSetElements { get; set; } [JsonIgnore] public List<VolumeElement> VolumeElements { get; set; } [JsonIgnore] public List<LineSetElement> LineSetElements { get; set; } public void Deserialize(Dictionary<string, object> json, BinaryReader br) { SurfaceElements = new List<SurfaceElement>(); PointSetElements = new List<PointSetElement>(); VolumeElements = new List<VolumeElement>(); LineSetElements = new List<LineSetElement>(); foreach (string id in json.Keys) { string data = json[id].ToString(); Dictionary<string, object> thisDict = JsonConvert.DeserializeObject<Dictionary<string, object>>(data); if (thisDict.ContainsKey("__class__")) { switch (thisDict["__class__"].ToString().ToUpper()) { case "SURFACEELEMENT": { SurfaceElement obj = (SurfaceElement)ObjectFactory.GetObjectFromData(json, br, data); if (obj != null) { SurfaceElements.Add(obj); } } break; case "POINTSETELEMENT": { PointSetElement obj = (PointSetElement)ObjectFactory.GetObjectFromData(json, br, data); if (obj != null) { PointSetElements.Add(obj); } } break; case "VOLUMEELEMENT": { VolumeElement obj = (VolumeElement)ObjectFactory.GetObjectFromData(json, br, data); if (obj != null) { VolumeElements.Add(obj); } } break; case "LINESETELEMENT": { LineSetElement obj = (LineSetElement)ObjectFactory.GetObjectFromData(json, br, data); if (obj != null) { LineSetElements.Add(obj); } } break; default: break; } } } } public void Serialize(Dictionary<string, object> json, BinaryWriter bw) { elements = new List<string>(); if (PointSetElements != null) foreach (var PointSet in PointSetElements) { PointSet.Serialize(json, bw); elements.Add(PointSet.uid.ToString()); } if (LineSetElements != null) foreach (var LineSet in LineSetElements) { LineSet.Serialize(json, bw); elements.Add(LineSet.uid.ToString()); } if (SurfaceElements != null) foreach (var Surface in SurfaceElements) { Surface.Serialize(json, bw); elements.Add(Surface.uid.ToString()); } if (VolumeElements != null) foreach (var VolumeElement in VolumeElements) { VolumeElement.Serialize(json, bw); elements.Add(VolumeElement.uid.ToString()); } } } public class ProjectDictionary : Dictionary<string, JRaw> { public ProjectDictionary(Dictionary<string, object> project) : base(FromStringDict(project)) { } private static Dictionary<string, JRaw> FromStringDict(Dictionary<string, object> project) { Dictionary<string, JRaw> base_dict = new Dictionary<string, JRaw>(); foreach (KeyValuePair<string, object> kvp in project) { base_dict.Add(kvp.Key, new JRaw(kvp.Value)); } return base_dict; } } }
34.426316
119
0.451766
[ "MIT" ]
gmggroup/omf_csharp
OMF/base/Project.cs
6,543
C#
using System; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Text; using System.Linq; using static PragmaScript.SSA; namespace PragmaScript { partial class Backend { // http://eli.thegreenplace.net/2012/12/17/dumping-a-c-objects-memory-layout-with-clang/ Dictionary<string, int> debugInfoNodeLookup = new Dictionary<string, int>(); Dictionary<AST.Node, int> debugInfoScopeLookup = new Dictionary<AST.Node, int>(); Dictionary<string, int> debugInfoFileLookup = new Dictionary<string, int>(); Dictionary<FrontendType, int> debugInfoTypeLookup = new Dictionary<FrontendType, int>(); List<int> debugGlobalVariableExperssionIndices = new List<int>(); int debugInfoCompileUnitIdx = -1; string debugGlobalVariableArrayPlaceholder; List<int> debugInfoModuleFlags = new List<int>(); int debugInfoIdentFlag = -1; AST.ProgramRoot debugRootNode; void AppendDebugInfo(Value v) { if (!CompilerOptionsBuild._i.debugInfo) { return; } if (debugCurrentEmitBlock.name == "%vars") { return; } var locIdx = GetDILocation(v); if (locIdx >= 0) { AP($", !dbg !{locIdx}"); } } void AppendFunctionDebugInfo(Value value) { if (!CompilerOptionsBuild._i.debugInfo) { return; } if (value.debugContextNode != null) { if (debugRootNode == null) { GetDICompileUnit((AST.ProgramRoot)value.debugContextNode.parent.parent); } var fd = (AST.FunctionDefinition)value.debugContextNode; var subprogramIdx = GetDISubprogram(fd); if (subprogramIdx >= 0) { AP($" !dbg !{subprogramIdx}"); } } } void AppendFunctionArgumentsDebugInfo(Value value) { #if false if (!CompilerOptions._i.debugInfo) { return; } var f = (Function)value; var n = value.debugContextNode; if (n != null) { var fft = (FrontendFunctionType)typeChecker.GetNodeType(n); var scopeIdx = GetDIScope(value.debugContextNode); // TODO(pragma): make a copy of function arguments to stack to be able to debug them for (int paramIdx = 0; paramIdx < fft.parameters.Count; ++paramIdx) { var arg = (FunctionArgument)f.args[paramIdx]; var name = fft.parameters[paramIdx].name; var param_ft = fft.parameters[paramIdx].type; var nodeString = $"!DILocalVariable(name: \"{name}\", arg: {paramIdx+1}, scope: !{GetDIScope(n)}, file: !{GetDIFile(n)}, line: {n.token.Line}, type: !{GetDIType(param_ft)})"; var localVarIdx = AddDebugInfoNode(nodeString); var locIdx = GetDILocation(value); AP(" call void @llvm.dbg.declare(metadata "); AppendType(arg.type); AP(" "); AP(arg.name); AP($", metadata !{localVarIdx}, metadata !DIExpression()), !dbg !{locIdx}"); AL(); } } #endif } void AppendDebugDeclareLocalVariable(Value value) { if (!CompilerOptionsBuild._i.debugInfo) { return; } var ft = typeChecker.GetNodeType(value.debugContextNode); // switch (ft) { // case FrontendSliceType str when ft.name == "string": // break; // case var _ when FrontendType.IsIntegerType(ft): // break; // } var n = value.debugContextNode; string name = null; switch (n) { case AST.VariableDefinition vd: name = vd.variable.name; break; case AST.CompoundLiteral sc: { if (sc.parent is AST.VariableDefinition vdd) { name = vdd.variable.name; } } break; case AST.ArrayConstructor ac: { if (ac.parent is AST.VariableDefinition vdd) { name = vdd.variable.name; } } break; default: return; } if (name == null) { return; } var nodeString = $"!DILocalVariable(name: \"{name}\", scope: !{GetDIScope(n.scope.owner)}, file: !{GetDIFile(n)}, line: {n.token.Line}, type: !{GetDIType(ft)})"; var localVarIdx = AddDebugInfoNode(nodeString); var locIdx = GetDILocation(value); AP(" call void @llvm.dbg.declare(metadata "); AppendType(value.type); AP(" "); AP(value.name); AP($", metadata !{localVarIdx}, metadata !DIExpression()), !dbg !{locIdx}"); AL(); } void AppendGlobalVariableDebugInfo(GlobalVariable gv) { if (!CompilerOptionsBuild._i.debugInfo) { return; } var rootScope = gv.debugContextNode.scope.GetRootScope(); var rootNode = rootScope.owner; var n = gv.debugContextNode; var ft = typeChecker.GetNodeType(n); string name = null; if (n is AST.VariableDefinition vd) { name = vd.variable.name; } else if (n.parent is AST.VariableDefinition parent_vd) { name = parent_vd.variable.name; } if (name != null) { var globalVariableNodeString = $"distinct !DIGlobalVariable(name: \"{name}\", scope: !{GetDIScope(rootNode)}, file: !{GetDIFile(n)}, line: {n.token.Line}, type: !{GetDIType(ft)}, isLocal: true, isDefinition: true)"; var globalVariableIdx = AddDebugInfoNode(globalVariableNodeString); var nodeString = $"!DIGlobalVariableExpression(var: !{globalVariableIdx}, expr: !DIExpression())"; var globalVariableExpressionIdx = AddDebugInfoNode(nodeString); debugGlobalVariableExperssionIndices.Add(globalVariableExpressionIdx); if (globalVariableExpressionIdx >= 0) { AP($", !dbg !{globalVariableExpressionIdx}"); } } } int AddDebugInfoNode(string info) { if (!debugInfoNodeLookup.TryGetValue(info, out int result)) { result = debugInfoNodeLookup.Count; debugInfoNodeLookup.Add(info, result); } return result; } int GetDIScope(AST.Node scopeRoot) { int scopeIdx = -1; if (scopeRoot != null && !debugInfoScopeLookup.TryGetValue(scopeRoot, out scopeIdx)) { switch (scopeRoot) { case AST.ProgramRoot programRoot: scopeIdx = GetDICompileUnit(programRoot); break; case AST.FunctionDefinition fun: scopeIdx = GetDISubprogram(fun); break; case AST.Block block: if (block.parent is AST.FunctionDefinition fd) { scopeIdx = GetDISubprogram(fd); } else { scopeIdx = GetDILexicalBlock(block); } break; case AST.Module ns: // TODO(pragma): NAMESPACES scopeIdx = GetDIScope(debugRootNode); break; default: scopeIdx = -1; break; } } return scopeIdx; } int GetDILocation(Value v) { var n = v.debugContextNode; if (n == null) { return -1; } var scopeRoot = n?.scope?.owner; // TODO(pragma): HACK if (scopeRoot is AST.ProgramRoot || scopeRoot is AST.Module) { if (debugCurrentEmitFunction != null) { scopeRoot = debugCurrentEmitFunction.debugContextNode; if (scopeRoot is AST.ProgramRoot || scopeRoot is AST.Module) { return -1; } } else { return -1; } } var scopeIdx = GetDIScope(scopeRoot); var locationIdx = -1; if (scopeIdx >= 0) { string nodeString = $"!DILocation(line: {n.token.Line}, column: {n.token.Pos}, scope: !{scopeIdx})"; locationIdx = AddDebugInfoNode(nodeString); } return locationIdx; } int GetDILexicalBlock(AST.Block block) { if (!debugInfoScopeLookup.TryGetValue(block, out int lexicalBlockIdx)) { var scopeIdx = GetDIScope(block.scope.parent.owner); var nodeString = $"distinct !DILexicalBlock(scope: !{scopeIdx}, file: !{GetDIFile(block)}, line: {block.token.Line}, column: {block.token.Pos})"; lexicalBlockIdx = AddDebugInfoNode(nodeString); } return lexicalBlockIdx; } int GetDISubprogram(AST.FunctionDefinition fd) { if (fd.body == null) { return -1; } if (!debugInfoScopeLookup.TryGetValue(fd, out int subprogramIdx)) { AST.Block block = (AST.Block)fd.body; var ft = typeChecker.GetNodeType(fd); var variablesIdx = AddDebugInfoNode("!{}"); string nodeString = $"distinct !DISubprogram(name: \"{fd.funName}\", linkageName: \"{fd.funName}\", file: !{GetDIFile(block)}, line: {fd.token.Line}, type: !{GetDIType(ft, true)}, isLocal: true, isDefinition: true, scopeLine: {block.token.Line}, flags: DIFlagPrototyped, isOptimized: false, unit: !{debugInfoCompileUnitIdx}, retainedNodes: !{variablesIdx})"; subprogramIdx = AddDebugInfoNode(nodeString); debugInfoScopeLookup.Add(fd, subprogramIdx); } return subprogramIdx; } int GetDICompileUnit(AST.ProgramRoot root) { if (!debugInfoScopeLookup.TryGetValue(root, out int compileUnitIdx)) { string emptyArray = "!{}"; var emptyArrayIdx = AddDebugInfoNode(emptyArray); // HACK: TODO(pragma): remove var placeholder = System.Guid.NewGuid().ToString(); var debugGlobalVariableArrayIdx = AddDebugInfoNode(placeholder); debugGlobalVariableArrayPlaceholder = placeholder; string producer = "\"pragma version 0.2 (build 8)\""; string nodeString = $"distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !{GetDIFile(root)}, producer: {producer}, isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, retainedTypes: !{emptyArrayIdx}, enums: !{emptyArrayIdx}, globals: !{debugGlobalVariableArrayIdx}, imports: !{emptyArrayIdx})"; compileUnitIdx = AddDebugInfoNode(nodeString); debugInfoScopeLookup.Add(root, compileUnitIdx); debugInfoCompileUnitIdx = compileUnitIdx; if (platform == Platform.WindowsX64) { string debugInfoVersion = "!{i32 2, !\"Debug Info Version\", i32 3}"; var debugInfoVersionIdx = AddDebugInfoNode(debugInfoVersion); debugInfoModuleFlags.Add(debugInfoVersionIdx); string codeViewVersion = "!{i32 2, !\"CodeView\", i32 1}"; var codeViewVersionIdx = AddDebugInfoNode(codeViewVersion); debugInfoModuleFlags.Add(codeViewVersionIdx); string wcharSize = "!{i32 1, !\"wchar_size\", i32 2}"; var wcharSizeIdx = AddDebugInfoNode(wcharSize); debugInfoModuleFlags.Add(wcharSizeIdx); string picLevel = "!{i32 7, !\"PIC Level\", i32 2}"; var picLevelIdx = AddDebugInfoNode(picLevel); debugInfoModuleFlags.Add(picLevelIdx); } else if (platform == Platform.LinuxX64) { string debugInfoVersion = "!{i32 2, !\"Debug Info Version\", i32 3}"; var debugInfoVersionIdx = AddDebugInfoNode(debugInfoVersion); debugInfoModuleFlags.Add(debugInfoVersionIdx); string codeViewVersion = "!{i32 7, !\"Dwarf Version\", i32 4}"; var codeViewVersionIdx = AddDebugInfoNode(codeViewVersion); debugInfoModuleFlags.Add(codeViewVersionIdx); string wcharSize = "!{i32 1, !\"wchar_size\", i32 2}"; var wcharSizeIdx = AddDebugInfoNode(wcharSize); debugInfoModuleFlags.Add(wcharSizeIdx); } // TODO(pragma): versions?? string ident = $"!{{!{producer}}}"; debugInfoIdentFlag = AddDebugInfoNode(ident); debugRootNode = root; } return compileUnitIdx; } void FixUpGlobalVariableDebugInfoList() { var palceholderIdx = debugInfoNodeLookup[debugGlobalVariableArrayPlaceholder]; debugInfoNodeLookup.Remove(debugGlobalVariableArrayPlaceholder); var indexStrings = debugGlobalVariableExperssionIndices.Select(idx => "!" + idx.ToString()); var nodeString = $"!{{{string.Join(", ", indexStrings)}}}"; debugInfoNodeLookup.Add(nodeString, palceholderIdx); } public string ByteArrayToString(byte[] bytes) { StringBuilder result = new StringBuilder(bytes.Length * 2); foreach (byte b in bytes) { result.AppendFormat("{0:x2}", b); } return result.ToString(); } int GetDIFile(AST.Node node) { if (!debugInfoFileLookup.TryGetValue(node.token.filename, out int fileIdx)) { var fn = Backend.EscapeString(System.IO.Path.GetFileName(node.token.filename)); var dir = Backend.EscapeString(System.IO.Path.GetDirectoryName(node.token.filename)); string checksum; using (var md5 = System.Security.Cryptography.MD5.Create()) { using (var stream = File.OpenRead(node.token.filename)) { checksum = ByteArrayToString(md5.ComputeHash(stream)); } } var nodeString = $"!DIFile(filename: \"{fn}\", directory: \"{dir}\", checksumkind: CSK_MD5, checksum: \"{checksum}\")"; fileIdx = AddDebugInfoNode(nodeString); debugInfoFileLookup.Add(node.token.filename, fileIdx); } return fileIdx; } // http://www.catb.org/esr/structure-packing/ int GetDIType(FrontendType ft, bool noFunctionPointer = false) { if (!debugInfoTypeLookup.TryGetValue(ft, out int typeIdx)) { string nodeString = null; if (FrontendType.IsIntegerType(ft)) { nodeString = $"!DIBasicType(name: \"{ft.name}\", size: {8 * GetSizeOfFrontendType(ft)}, encoding: DW_ATE_signed)"; } else if (FrontendType.IsFloatType(ft)) { nodeString = $"!DIBasicType(name: \"{ft.name}\", size: {8 * GetSizeOfFrontendType(ft)}, encoding: DW_ATE_float)"; } else if (FrontendType.IsBoolType(ft)) { nodeString = $"!DIBasicType(name: \"bool\", size: {8 * GetSizeOfFrontendType(ft)}, encoding: DW_ATE_boolean)"; } else if (ft is FrontendFunctionType fft) { string tl; if (FrontendType.IsVoidType(fft.returnType)) { if (fft.parameters.Count > 0) { tl = "null, " + String.Join(", ", fft.parameters.Select(p => { return "!" + GetDIType(p.type).ToString(); })); } else { tl = "null"; } } else { var types = new List<FrontendType>(); types.Add(fft.returnType); types.AddRange(fft.parameters.Select(p => p.type)); tl = String.Join(", ", types.Select(t => { return "!" + GetDIType(t).ToString(); })); } var typeListNodeString = $"!{{{tl}}}"; var typeListIdx = AddDebugInfoNode(typeListNodeString); var functionNodeString = $"!DISubroutineType(types: !{typeListIdx})"; if (noFunctionPointer) { nodeString = functionNodeString; } else { var functionTypeIdx = AddDebugInfoNode(functionNodeString); nodeString = $"!DIDerivedType(tag: DW_TAG_pointer_type, baseType: !{functionTypeIdx}, size: {8 * GetSizeOfFrontendType(FrontendType.ptr)})"; } } else if (ft is FrontendStructType fst) { // reserve slot for new struct type // if recursive calls want same type use reserved slot idx // to avoid stack overflow // assumes that struct has not already been defined. We _really_ need our type system to have exactly one // frontendtype class per type so we can use it as keys in dict var placeholder = System.Guid.NewGuid().ToString(); var structIdx = AddDebugInfoNode(placeholder); debugInfoTypeLookup.Add(ft, structIdx); var node = (AST.StructDeclaration)typeChecker.GetTypeRoot(fst); var memberListIndices = new List<int>(); var offsets = GetOffsetsOfStruct(fst); for (int idx = 0; idx < fst.fields.Count; ++idx) { var f = fst.fields[idx]; string memberNodeString; if (node != null) { var ts = node.fields[idx].typeString; memberNodeString = $"!DIDerivedType(tag: DW_TAG_member, name: \"{f.name}\", scope: !{structIdx}, file: !{GetDIFile(ts)}, line: {ts.token.Line}, baseType: !{GetDIType(f.type)}, size: {8 * GetSizeOfFrontendType(f.type)}, offset: {8 * offsets[idx]})"; } else { memberNodeString = $"!DIDerivedType(tag: DW_TAG_member, name: \"{f.name}\", scope: !{structIdx}, baseType: !{GetDIType(f.type)}, size: {8 * GetSizeOfFrontendType(f.type)}, offset: {8 * offsets[idx]})"; } memberListIndices.Add(AddDebugInfoNode(memberNodeString)); // token is in node.fields.typeString.token } var memberListNodeString = $"!{{{String.Join(", ", memberListIndices.Select(t_idx => "!" + t_idx))}}}"; var memberListIdx = AddDebugInfoNode(memberListNodeString); nodeString = $"distinct !DICompositeType(tag: DW_TAG_structure_type, name: \"{fst}\", size: {8 * GetDISizeOfStruct(fst)}, elements: !{memberListIdx})"; debugInfoNodeLookup.Remove(placeholder); debugInfoNodeLookup.Add(nodeString, structIdx); return structIdx; } else if (ft is FrontendPointerType fpt) { nodeString = $"!DIDerivedType(tag: DW_TAG_pointer_type, baseType: !{GetDIType(fpt.elementType)}, size: {8 * GetSizeOfFrontendType(fpt)})"; } else if (ft is FrontendArrayType fat) { var subranges = new List<string>(); for (int i = 0; i < fat.dims.Count; ++i) { var subrangeNodeString = $"!DISubrange(count: {fat.dims[i]})"; var subrangeIdx = AddDebugInfoNode(subrangeNodeString); subranges.Add("!" + subrangeIdx.ToString()); } var elementsIdx = AddDebugInfoNode($"!{{{string.Join(", ", subranges)}}}"); nodeString = $"!DICompositeType(tag: DW_TAG_array_type, baseType: !{GetDIType(fat.elementType)}, size: {SizeOfArrayType(fat)}, elements: !{elementsIdx})"; } else if (ft is FrontendEnumType fet) { var node = (AST.EnumDeclaration)typeChecker.GetTypeRoot(fet); var elementIndices = new List<int>(node.entries.Count); for (int entryIdx = 0; entryIdx < node.entries.Count; ++entryIdx) { var entry = node.entries[entryIdx]; var elementNodeString = $"!DIEnumerator(name: \"{entry.name}\", value: {entry.value})"; var elementIdx = AddDebugInfoNode(elementNodeString); elementIndices.Add(elementIdx); } var elementsIdx = AddDebugInfoNode($"!{{{string.Join(", ", elementIndices.Select(ei => $"!{ei}"))}}}"); nodeString = $"!DICompositeType(tag: DW_TAG_enumeration_type, name: \"{fet.name}\", file: !{GetDIFile(node)}, line: {node.token.Line}, baseType: !{GetDIType(fet.integerType)}, size: {8 * GetSizeOfFrontendType(fet.integerType)}, elements: !{elementsIdx})"; } else if (ft is FrontendVectorType fvt) { // TODO(pragma): Add a derived type with the vector name var subrangeNodeString = $"!DISubrange(count: {fvt.length})"; var subrangeIdx = AddDebugInfoNode(subrangeNodeString); var elementsIdx = AddDebugInfoNode($"!{{!{subrangeIdx}}}"); nodeString = $"!DICompositeType(tag: DW_TAG_array_type, baseType: !{GetDIType(fvt.elementType)}, size: {SizeOfVectorType(fvt)}, flags: DIFlagVector, elements: !{elementsIdx})"; } Debug.Assert(nodeString != null); typeIdx = AddDebugInfoNode(nodeString); debugInfoTypeLookup.Add(ft, typeIdx); } return typeIdx; } // TODO(pragma): maybe promote this to Frontend int GetDISizeOfStruct(FrontendStructType st) { return GetSizeOfFrontendType(st); } int GetSizeOfFrontendType(FrontendType t) { switch (t) { case var _ when t.Equals(FrontendType.i8): return 1; case var _ when t.Equals(FrontendType.i16): return 2; case var _ when t.Equals(FrontendType.i32): return 4; case var _ when t.Equals(FrontendType.i64): return 8; case var _ when t.Equals(FrontendFunctionType.f32): return 4; case var _ when t.Equals(FrontendFunctionType.f64): return 8; case var _ when t.Equals(FrontendType.bool_): return 1; // TODO(pragma): switch to b8 b16 b32? case var _ when t.Equals(FrontendStructType.mm): return 8; case FrontendPointerType _: return 8; case FrontendFunctionType _: return 8; case FrontendStructType fst: return GetSizeOfStructType(fst); case FrontendArrayType fat: return SizeOfArrayType(fat); case FrontendEnumType fet: return GetSizeOfFrontendType(fet.integerType); case FrontendVectorType fvt: return GetSizeOfFrontendType(fvt.elementType) * fvt.length; } Debug.Assert(false); return -1; } int GetMinimumAlignmentForBackend(SSAType t) { switch (t.kind) { case TypeKind.Vector: { var vt = (VectorType)t; if (vt.elementType.kind == TypeKind.Float) { if (vt.elementCount == 4) { return 16; } else if (vt.elementCount == 8) { return 32; } else { Debug.Assert(false, "vector type not supported!"); return 32; } } return 16; } case TypeKind.Struct: { var st = (StructType)t; return st.elementTypes.Select(et => GetMinimumAlignmentForBackend(et)).Max(); } case TypeKind.Array: return GetMinimumAlignmentForBackend(((ArrayType)t).elementType); default: return 0; } } int GetAlignmentOfFrontendType(FrontendType t) { switch (t) { case var _ when t.Equals(FrontendType.i8): return 1; case var _ when t.Equals(FrontendType.i16): return 2; case var _ when t.Equals(FrontendType.i32): return 4; case var _ when t.Equals(FrontendType.i64): return 8; case var _ when t.Equals(FrontendFunctionType.f32): return 4; case var _ when t.Equals(FrontendFunctionType.f64): return 8; case var _ when t.Equals(FrontendType.bool_): return 1; // TODO(pragma): switch to b8 b16 b32? case var _ when t.Equals(FrontendType.mm): return 8; case FrontendPointerType _: return 8; case FrontendFunctionType _: return 8; case FrontendStructType fst: return GetAlignmentOfStruct(fst); case FrontendArrayType fat: return SizeOfArrayType(fat); case FrontendEnumType fet: return GetAlignmentOfFrontendType(fet.integerType); case FrontendVectorType fvt: return 16; // return GetSizeOfFrontendType(fvt.elementType) * fvt.length; } Debug.Assert(false); return -1; } int GetAlignmentOfStruct(FrontendStructType st) { var result = st.fields.Select(f => GetAlignmentOfFrontendType(f.type)).Max(); return result; } int GetAlignmentOfArray(FrontendArrayType at) { return GetAlignmentOfFrontendType(at.elementType); } int AlignPow2(int value, int alignment) { return (value + (alignment - 1)) & ~(alignment - 1); } int Align4(int value) { return (value + 3) & ~3; } int Align8(int value) { return (value + 7) & ~7; } int Align16(int value) { return (value + 15) & ~15; } List<int> GetOffsetsOfStruct(FrontendStructType st) { // TODO(pragma): is packed var result = new List<int>(); int pos = 0; foreach (var f in st.fields) { var sizeInBytes = GetSizeOfFrontendType(f.type); var alignment = st.packed ? 1 : GetAlignmentOfFrontendType(f.type); pos = AlignPow2(pos, alignment); result.Add(pos); pos += sizeInBytes; Debug.Assert(sizeInBytes > 0); } return result; } int SizeOfArrayType(FrontendArrayType at) { return GetSizeOfFrontendType(at.elementType) * at.dims.Aggregate(1, (a, b) => a * b); } int SizeOfVectorType(FrontendVectorType vt) { return GetSizeOfFrontendType(vt.elementType) * vt.length; } int GetSizeOfStructType(FrontendStructType st) { int pos = 0; foreach (var f in st.fields) { var sizeInBytes = GetSizeOfFrontendType(f.type); var alignment = st.packed ? 1 : GetAlignmentOfFrontendType(f.type); pos = AlignPow2(pos, alignment); pos += sizeInBytes; } var alignmentStruct = st.packed ? 1 : GetAlignmentOfStruct(st); pos = AlignPow2(pos, alignmentStruct); return pos; } } }
43.570827
374
0.493369
[ "MIT" ]
pragmascript/PragmaScript
src/Backend.DI.cs
31,066
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("GlassdoorUnitTest")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("GlassdoorUnitTest")] [assembly: AssemblyCopyright("Copyright © 2015")] [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("f246bc6b-2a65-4607-ab19-a27b672a8aa8")] // 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.027027
84
0.746979
[ "MIT" ]
JanglinSoftware/GlassDoorSDK
GlassdoorSDK/GlassdoorUnitTest/Properties/AssemblyInfo.cs
1,410
C#
using System.Security.Claims; using System.Threading.Tasks; namespace Tufan.Common.Authentication { public class DomainPrincipal : DomainClaimsPrincipal { private IPrincipalAccessor _principalAccessor; public DomainPrincipal(IPrincipalAccessor principalAccessor) { _principalAccessor = principalAccessor; } public override ClaimsPrincipal GetPrincipal() { return _principalAccessor.CurrentPrincipal; } public override Task<bool> Validate() { return Task.FromResult(true); } } }
24.4
68
0.655738
[ "MIT" ]
TufanOzdemir/BusTicket
src/Tufan.Common/Authentication/DomainPrincipal.cs
612
C#
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.HttpsPolicy; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.AspNetCore.HttpOverrides; namespace CalculatorDemoApp { 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. // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 public void ConfigureServices(IServiceCollection services) { services.AddRazorPages(); services.AddServerSideBlazor(); } // 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(); ConfigureForwarding(app); } else { app.UseExceptionHandler("/Error"); ConfigureForwarding(app); // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } //app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseRouting(); app.UseEndpoints(endpoints => { endpoints.MapBlazorHub(); endpoints.MapFallbackToPage("/_Host"); }); } public void ConfigureForwarding(IApplicationBuilder app) => app.UseForwardedHeaders(new ForwardedHeadersOptions { ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto }); } }
33.173913
143
0.629969
[ "Unlicense", "MIT" ]
RopleyIT/GLRParser
CalculatorExample/CalculatorDemoApp/Startup.cs
2,289
C#
using System; namespace VA.Blazor.CleanArchitecture.Application.Interfaces.Chat { public interface IChatHistory<TUser> where TUser : IChatUser { public long Id { get; set; } public string FromUserId { get; set; } public string ToUserId { get; set; } public string Message { get; set; } public DateTime CreatedDate { get; set; } public TUser FromUser { get; set; } public TUser ToUser { get; set; } } }
31.4
65
0.630573
[ "MIT" ]
vinaykarora/BlazorCleanArchitecture
src/VA.Blazor.CleanArchitecture.Application/Interfaces/Chat/IChatHistory.cs
473
C#
namespace Rackspace.VisualStudio.CloudExplorer.Databases { using System.Collections.Generic; using System.Drawing; using System.Threading; using System.Threading.Tasks; using Microsoft.VSDesigner.ServerExplorer; using net.openstack.Core.Domain; public class CloudDatabasesRootNode : CloudProductRootNode { private readonly CloudIdentity _identity; private Node[] _children; public CloudDatabasesRootNode(ServiceCatalog serviceCatalog, CloudIdentity identity) : base(serviceCatalog) { _identity = identity; } protected override Task<Node[]> CreateChildrenAsync(CancellationToken cancellationToken) { if (_children == null) { List<Node> nodes = new List<Node>(); foreach (Endpoint endpoint in ServiceCatalog.Endpoints) nodes.Add(new CloudDatabasesEndpointNode(_identity, ServiceCatalog, endpoint)); _children = nodes.ToArray(); } return Task.FromResult(_children); } public override Image Icon { get { return ServerExplorerIcons.CloudDatabases; } } protected override string DisplayText { get { return "Databases"; } } } }
26.830189
99
0.584388
[ "Apache-2.0" ]
sharwell/rax-vsix
Rackspace.VisualStudio.CloudExplorer/Databases/CloudDatabasesRootNode.cs
1,424
C#
using Microsoft.AspNetCore.Mvc; using Models.ViewModels; using Newtonsoft.Json; using SchoolWebApp.UI.Helpers; using SchoolWebApp.UI.Models; using SchoolWebApp.UI.Services; using System.Threading.Tasks; namespace SchoolWebApp.UI.Controllers { public class StudentController : Controller { private readonly IStudentClient _studentClient; public StudentController(IStudentClient studentClient) { _studentClient = studentClient; } public async Task<IActionResult> Index() { var auth = HttpContext.Session.GetObjectFromJson<JwtModel>("token"); if (auth == null) return RedirectToAction("Index", "User"); var studentResult = await _studentClient.GetStudentDetail(auth,auth.User.StudentId); if (studentResult.IsSuccessStatusCode) { string stringResult = await studentResult.Content.ReadAsStringAsync(); var student = JsonConvert.DeserializeObject<StudentDetailViewModel>(stringResult); if (student != null) { return View("Detail",student); } } return RedirectToAction("Index", "User"); } } }
31.02439
98
0.625786
[ "Apache-2.0" ]
codebycinar/SimpleObs
src/SchoolWebApp.UI/Controllers/StudentController.cs
1,274
C#
// DocSection: cm_api_v2_get_language // Tip: Find more about .NET SDKs at https://kontent.ai/learn/net using Kentico.Kontent.Management; var client = new ManagementClient(new ManagementOptions { ApiKey = "<YOUR_API_KEY>", ProjectId = "<YOUR_PROJECT_ID>" }); var identifier = Reference.ById(Guid.Parse("2ea66788-d3b8-5ff5-b37e-258502e4fd5d")); // var identifier = Reference.ByCodename("de-DE"); // var identifier = Reference.ByExternalId("standard-german"); var response = await client.GetLanguageAsync(identifier); // EndDocSection
33.9375
84
0.755064
[ "MIT" ]
KenticoDocs/cloud-docs-samples
net/management-api-v2/GetLanguage.cs
543
C#
using System; namespace Wordroller.Content.Properties.Tables { [Flags] public enum TableLookEnum : uint { None = 0x0000, FirstRow = 0x0020, LastRow = 0x0040, FirstColumn = 0x0080, LastColumn = 0x0100, NoHBand = 0x0200, NoVBand = 0x0400 } }
16.25
47
0.696154
[ "Apache-2.0" ]
shestakov/wordroller
Wordroller/Content/Properties/Tables/TableLookEnum.cs
262
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace OddOrEvenIntegers { class Program { static void Main(string[] args) { } } }
15
39
0.654167
[ "MIT" ]
mdraganov/Telerik-Academy
C#/C# Programming Part I/OperatorsAndExpressions/OddOrEvenIntegers/Program.cs
242
C#
namespace Teams.Services.API { using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; public class Program { public static void Main(string[] args) { CreateWebHostBuilder(args).Build().Run(); } public static IWebHostBuilder CreateWebHostBuilder(string[] args) => WebHost.CreateDefaultBuilder(args) .UseStartup<Startup>(); } }
23.888889
76
0.616279
[ "MIT" ]
andtkach/teams-api
Teams.Services.API/Program.cs
432
C#
using DSS.A2F.Fingerprint.Api.Shared.Mediatypes; using Newtonsoft.Json; using NLog; using System.Threading.Tasks; using WebSocketSharp; namespace DSS.UareU.Web.Api.Client.Services { public class ReaderWebSocketClientService { private WebSocket client { get; set; } private static NLog.Logger logger = LogManager.GetCurrentClassLogger(); ReaderService reader = new ReaderService(); const int TIMEOUT_SECONDS = 15; public ReaderWebSocketClientService(string url) { logger.Info("opening {0}", url); client = new WebSocket(url); client.OnMessage += Client_OnMessage; } public void Start(string name) { this.client.Connect(); this.client.Send("REGISTER_DEVICE:" + name); logger.Info("connecting"); } public void Close(string name) { this.client.Send("UNREGISTER_DEVICE:" + name); this.client.Close(); logger.Info("closing"); } private async void Client_OnMessage(object sender, MessageEventArgs e) { if (e.IsText) { var payload = JsonConvert.DeserializeObject<ReaderClientRequestMediaType>(e.Data); var request = new ReaderClientRequestMediaType { StateCheck = payload.StateCheck, }; switch (payload.Type) { case "device_info_request": logger.Info("requesting device info"); request.Type = "device_info_reply"; try { var info = await reader.GetReaderInfo(); request.Data = JsonConvert.SerializeObject(info); } catch { logger.Info("no device found"); request.Data = JsonConvert.SerializeObject(new { Message = "No device found" }); } if (this.client.IsAlive) { this.client.Send(JsonConvert.SerializeObject(request)); } break; case "capture_image_request": request.Type = "capture_image_reply"; var captureTask = reader.CaptureAsync(); logger.Info("requesting capture"); if (captureTask == await Task.WhenAny(captureTask, Task.Delay(TIMEOUT_SECONDS * 1000))) { await captureTask; await reader.GetCaptureImageAsync(this.reader.CurrentCaptureID, new FindCaptureOptions { Extended = false, }); if (this.reader.CurrentCaptureModel == null) { logger.Info("no reader found"); reader.Close(); request.Data = JsonConvert.SerializeObject(new { Message = "No reader found" }); } else { request.Data = JsonConvert.SerializeObject(new FingerCaptureClient { Image = this.reader.CurrentCaptureModel.Image, FMD = this.reader.CurrentCaptureModel.FMD, WSQ = this.reader.CurrentCaptureModel.WSQImage, ContentType = "image/jpg", }); logger.Info("capture done"); } } else { logger.Info("timeout"); reader.Close(); request.Data = JsonConvert.SerializeObject(new { Message = "Timeout after 15 seconds" }); } if (this.client.IsAlive) { this.client.Send(JsonConvert.SerializeObject(request)); } break; } } } } }
39.191667
118
0.422496
[ "MIT" ]
Electronic-Signatures-Industries/uareu-csharp-websockets-auth
DSS.UareU.Web.Api.Client/Services/ReaderWebSocketClientService.cs
4,705
C#
using System; using System.Diagnostics.Contracts; using System.Windows; using starshipxac.Windows.Devices.Interop; using starshipxac.Windows.Interop; namespace starshipxac.Windows.Devices { /// <summary> /// スクリーン情報を保持します。 /// </summary> public class Screen : IEquatable<Screen> { /// <summary> /// モニターハンドルを指定して、 /// <see cref="Screen" />クラスの新しいインスタンスを初期化します。 /// </summary> /// <param name="hMonitor">モニターハンドル。</param> internal Screen(IntPtr hMonitor) { Contract.Requires<ArgumentNullException>(hMonitor != IntPtr.Zero); this.Handle = hMonitor; } internal static Screen Create(IntPtr hMonitor) { var monitorInfo = MONITORINFOEX.Create(); var success = MultiMonitorNativeMethods.GetMonitorInfo(hMonitor, ref monitorInfo); if (!success) { return null; } var dpi = Dpi.Create(hMonitor); return new Screen(hMonitor) { DeviceName = monitorInfo.szDevice, IsPrimary = monitorInfo.dwFlags == MultiMonitorNativeMethods.MONITORINFOF_PRIMARY, Dpi = dpi, Bounds = CreateRect(monitorInfo.rcMonitor, dpi), WorkingArea = CreateRect(monitorInfo.rcWork, dpi) }; } /// <summary> /// モニターハンドルを取得します。 /// </summary> internal IntPtr Handle { get; } /// <summary> /// デバイス名を取得します。 /// </summary> public string DeviceName { get; private set; } /// <summary> /// 第一スクリーンかどうかを判定する値を取得します。 /// </summary> public bool IsPrimary { get; private set; } /// <summary> /// スクリーンの DPIを取得します。 /// </summary> public Dpi Dpi { get; private set; } /// <summary> /// スクリーンのサイズを取得します。 /// </summary> public Rect Bounds { get; private set; } /// <summary> /// スクリーン内のアプリケーション動作領域のサイズを取得します。 /// </summary> public Rect WorkingArea { get; private set; } public bool Equals(Screen other) { if (ReferenceEquals(null, other)) { return false; } if (ReferenceEquals(this, other)) { return true; } return this.Handle.Equals(other.Handle); } private static Rect CreateRect(RECT rect, Dpi dpi) { var factorX = dpi.X/(double)Dpi.Default.X; var factorY = dpi.Y/(double)Dpi.Default.Y; var left = rect.Left/factorX; var top = rect.Top/factorY; var width = rect.Width/factorX; var height = rect.Height/factorY; return new Rect(left, top, width, height); } public static bool operator ==(Screen x, Screen y) { return Equals(x, y); } public static bool operator !=(Screen x, Screen y) { return !Equals(x, y); } public override bool Equals(object obj) { if (ReferenceEquals(null, obj)) { return false; } if (this.GetType() != obj.GetType()) { return false; } if (ReferenceEquals(this, obj)) { return true; } return Equals((Screen)obj); } public override int GetHashCode() { return this.Handle.GetHashCode(); } public override string ToString() { return $"{{DeviceName: {this.DeviceName}}}"; } } }
28.417266
99
0.483544
[ "MIT" ]
rasmus-z/starshipxac.ShellLibrary
Source/starshipxac.Windows/Devices/Screen.cs
4,288
C#
using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using SSO.Web.Models; namespace SSO.Web.Controllers { public class HomeController : Controller { public IActionResult Index() { return View(); } public IActionResult Privacy() { return View(); } [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] public IActionResult Error() { return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); } } }
23.5
112
0.632624
[ "Apache-2.0" ]
afonsoft/SSO
SSO.Web/Controllers/HomeController.cs
707
C#
using System.Windows; using System.Windows.Controls; using System.Windows.Media; namespace Seovic.Samples.Bank.Support { public static class ValidationUtils { public static void MarkInvalid(this Control control, string message) { ControlState state = new ControlState(control.Background, control.ToolTip); control.Background = Brushes.PeachPuff; control.ToolTip = message; control.GotFocus += new RoutedEventHandler(state.Reset); } private class ControlState { public ControlState(Brush background, object tooltip) { m_background = background; m_tooltip = tooltip; } public void Reset(object sender, RoutedEventArgs e) { Control control = (Control) sender; control.Background = m_background; control.ToolTip = m_tooltip; control.GotFocus -= Reset; } private readonly Brush m_background; private readonly object m_tooltip; } } }
29.7
88
0.559764
[ "Apache-2.0" ]
paullewallencom/oracle-coherence-978-1-8471-9612-5
_/Source code/CoherentBank/net/src/BranchTerminal.WPF/Support/ValidationUtils.cs
1,188
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("MLNETStock")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("MLNETStock")] [assembly: AssemblyCopyright("Copyright © 2018")] [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("60ae96c6-c86c-4996-bdf2-ea030454f8ec")] // 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.513514
84
0.747118
[ "Apache-2.0" ]
davegautam/dotnetconfsamplecodes
Regression/MLNETStock/Properties/AssemblyInfo.cs
1,391
C#
namespace Nordigen.Net.Responses; using Newtonsoft.Json; public class DebtorAccount { [JsonConstructor] public DebtorAccount(string iban) { IBAN = iban; } public string IBAN { get; } }
15.4
38
0.619048
[ "MIT" ]
dariogriffo/Nordigen.Net
src/Nordigen.Net/Responses/DebtorAccount.cs
233
C#
/* * Copyright (c) 2018 THL A29 Limited, a Tencent company. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ namespace TencentCloud.Ccc.V20200210.Models { using Newtonsoft.Json; using System.Collections.Generic; using TencentCloud.Common; public class CallInMetrics : AbstractModel { /// <summary> /// IVR驻留数量 /// </summary> [JsonProperty("IvrCount")] public long? IvrCount{ get; set; } /// <summary> /// 排队中数量 /// </summary> [JsonProperty("QueueCount")] public long? QueueCount{ get; set; } /// <summary> /// 振铃中数量 /// </summary> [JsonProperty("RingCount")] public long? RingCount{ get; set; } /// <summary> /// 接通中数量 /// </summary> [JsonProperty("AcceptCount")] public long? AcceptCount{ get; set; } /// <summary> /// 客服转接外线中数量 /// </summary> [JsonProperty("TransferOuterCount")] public long? TransferOuterCount{ get; set; } /// <summary> /// 最大排队时长 /// </summary> [JsonProperty("MaxQueueDuration")] public long? MaxQueueDuration{ get; set; } /// <summary> /// 平均排队时长 /// </summary> [JsonProperty("AvgQueueDuration")] public long? AvgQueueDuration{ get; set; } /// <summary> /// 最大振铃时长 /// </summary> [JsonProperty("MaxRingDuration")] public long? MaxRingDuration{ get; set; } /// <summary> /// 平均振铃时长 /// </summary> [JsonProperty("AvgRingDuration")] public long? AvgRingDuration{ get; set; } /// <summary> /// 最大接通时长 /// </summary> [JsonProperty("MaxAcceptDuration")] public long? MaxAcceptDuration{ get; set; } /// <summary> /// 平均接通时长 /// </summary> [JsonProperty("AvgAcceptDuration")] public long? AvgAcceptDuration{ get; set; } /// <summary> /// For internal usage only. DO NOT USE IT. /// </summary> public override void ToMap(Dictionary<string, string> map, string prefix) { this.SetParamSimple(map, prefix + "IvrCount", this.IvrCount); this.SetParamSimple(map, prefix + "QueueCount", this.QueueCount); this.SetParamSimple(map, prefix + "RingCount", this.RingCount); this.SetParamSimple(map, prefix + "AcceptCount", this.AcceptCount); this.SetParamSimple(map, prefix + "TransferOuterCount", this.TransferOuterCount); this.SetParamSimple(map, prefix + "MaxQueueDuration", this.MaxQueueDuration); this.SetParamSimple(map, prefix + "AvgQueueDuration", this.AvgQueueDuration); this.SetParamSimple(map, prefix + "MaxRingDuration", this.MaxRingDuration); this.SetParamSimple(map, prefix + "AvgRingDuration", this.AvgRingDuration); this.SetParamSimple(map, prefix + "MaxAcceptDuration", this.MaxAcceptDuration); this.SetParamSimple(map, prefix + "AvgAcceptDuration", this.AvgAcceptDuration); } } }
32.517544
93
0.594551
[ "Apache-2.0" ]
TencentCloud/tencentcloud-sdk-dotnet
TencentCloud/Ccc/V20200210/Models/CallInMetrics.cs
3,835
C#
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.PowerShell.Cmdlets.Websites.Models.Api20210201 { using Microsoft.Azure.PowerShell.Cmdlets.Websites.Runtime.PowerShell; /// <summary>Trigger based on request execution time.</summary> [System.ComponentModel.TypeConverter(typeof(SlowRequestsBasedTriggerTypeConverter))] public partial class SlowRequestsBasedTrigger { /// <summary> /// <c>AfterDeserializeDictionary</c> will be called after the deserialization has finished, allowing customization of the /// object before it is returned. Implement this method in a partial class to enable this behavior /// </summary> /// <param name="content">The global::System.Collections.IDictionary content that should be used.</param> partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); /// <summary> /// <c>AfterDeserializePSObject</c> will be called after the deserialization has finished, allowing customization of the object /// before it is returned. Implement this method in a partial class to enable this behavior /// </summary> /// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param> partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); /// <summary> /// <c>BeforeDeserializeDictionary</c> will be called before the deserialization has commenced, allowing complete customization /// of the object before it is deserialized. /// If you wish to disable the default deserialization entirely, return <c>true</c> in the <see "returnNow" /> output parameter. /// Implement this method in a partial class to enable this behavior. /// </summary> /// <param name="content">The global::System.Collections.IDictionary content that should be used.</param> /// <param name="returnNow">Determines if the rest of the serialization should be processed, or if the method should return /// instantly.</param> partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); /// <summary> /// <c>BeforeDeserializePSObject</c> will be called before the deserialization has commenced, allowing complete customization /// of the object before it is deserialized. /// If you wish to disable the default deserialization entirely, return <c>true</c> in the <see "returnNow" /> output parameter. /// Implement this method in a partial class to enable this behavior. /// </summary> /// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param> /// <param name="returnNow">Determines if the rest of the serialization should be processed, or if the method should return /// instantly.</param> partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// <summary> /// <c>OverrideToString</c> will be called if it is implemented. Implement this method in a partial class to enable this behavior /// </summary> /// <param name="stringResult">/// instance serialized to a string, normally it is a Json</param> /// <param name="returnNow">/// set returnNow to true if you provide a customized OverrideToString function</param> partial void OverrideToString(ref string stringResult, ref bool returnNow); /// <summary> /// Deserializes a <see cref="global::System.Collections.IDictionary" /> into an instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.Websites.Models.Api20210201.SlowRequestsBasedTrigger" /// />. /// </summary> /// <param name="content">The global::System.Collections.IDictionary content that should be used.</param> /// <returns> /// an instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.Websites.Models.Api20210201.ISlowRequestsBasedTrigger" />. /// </returns> public static Microsoft.Azure.PowerShell.Cmdlets.Websites.Models.Api20210201.ISlowRequestsBasedTrigger DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new SlowRequestsBasedTrigger(content); } /// <summary> /// Deserializes a <see cref="global::System.Management.Automation.PSObject" /> into an instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.Websites.Models.Api20210201.SlowRequestsBasedTrigger" /// />. /// </summary> /// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param> /// <returns> /// an instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.Websites.Models.Api20210201.ISlowRequestsBasedTrigger" />. /// </returns> public static Microsoft.Azure.PowerShell.Cmdlets.Websites.Models.Api20210201.ISlowRequestsBasedTrigger DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SlowRequestsBasedTrigger(content); } /// <summary> /// Creates a new instance of <see cref="SlowRequestsBasedTrigger" />, deserializing the content from a json string. /// </summary> /// <param name="jsonText">a string containing a JSON serialized instance of this model.</param> /// <returns>an instance of the <see cref="className" /> model class.</returns> public static Microsoft.Azure.PowerShell.Cmdlets.Websites.Models.Api20210201.ISlowRequestsBasedTrigger FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Websites.Runtime.Json.JsonNode.Parse(jsonText)); /// <summary> /// Deserializes a <see cref="global::System.Collections.IDictionary" /> into a new instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.Websites.Models.Api20210201.SlowRequestsBasedTrigger" /// />. /// </summary> /// <param name="content">The global::System.Collections.IDictionary content that should be used.</param> internal SlowRequestsBasedTrigger(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); if (returnNow) { return; } // actually deserialize if (content.Contains("TimeTaken")) { ((Microsoft.Azure.PowerShell.Cmdlets.Websites.Models.Api20210201.ISlowRequestsBasedTriggerInternal)this).TimeTaken = (string) content.GetValueForProperty("TimeTaken",((Microsoft.Azure.PowerShell.Cmdlets.Websites.Models.Api20210201.ISlowRequestsBasedTriggerInternal)this).TimeTaken, global::System.Convert.ToString); } if (content.Contains("Path")) { ((Microsoft.Azure.PowerShell.Cmdlets.Websites.Models.Api20210201.ISlowRequestsBasedTriggerInternal)this).Path = (string) content.GetValueForProperty("Path",((Microsoft.Azure.PowerShell.Cmdlets.Websites.Models.Api20210201.ISlowRequestsBasedTriggerInternal)this).Path, global::System.Convert.ToString); } if (content.Contains("Count")) { ((Microsoft.Azure.PowerShell.Cmdlets.Websites.Models.Api20210201.ISlowRequestsBasedTriggerInternal)this).Count = (int?) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.Websites.Models.Api20210201.ISlowRequestsBasedTriggerInternal)this).Count, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("TimeInterval")) { ((Microsoft.Azure.PowerShell.Cmdlets.Websites.Models.Api20210201.ISlowRequestsBasedTriggerInternal)this).TimeInterval = (string) content.GetValueForProperty("TimeInterval",((Microsoft.Azure.PowerShell.Cmdlets.Websites.Models.Api20210201.ISlowRequestsBasedTriggerInternal)this).TimeInterval, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// <summary> /// Deserializes a <see cref="global::System.Management.Automation.PSObject" /> into a new instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.Websites.Models.Api20210201.SlowRequestsBasedTrigger" /// />. /// </summary> /// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param> internal SlowRequestsBasedTrigger(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); if (returnNow) { return; } // actually deserialize if (content.Contains("TimeTaken")) { ((Microsoft.Azure.PowerShell.Cmdlets.Websites.Models.Api20210201.ISlowRequestsBasedTriggerInternal)this).TimeTaken = (string) content.GetValueForProperty("TimeTaken",((Microsoft.Azure.PowerShell.Cmdlets.Websites.Models.Api20210201.ISlowRequestsBasedTriggerInternal)this).TimeTaken, global::System.Convert.ToString); } if (content.Contains("Path")) { ((Microsoft.Azure.PowerShell.Cmdlets.Websites.Models.Api20210201.ISlowRequestsBasedTriggerInternal)this).Path = (string) content.GetValueForProperty("Path",((Microsoft.Azure.PowerShell.Cmdlets.Websites.Models.Api20210201.ISlowRequestsBasedTriggerInternal)this).Path, global::System.Convert.ToString); } if (content.Contains("Count")) { ((Microsoft.Azure.PowerShell.Cmdlets.Websites.Models.Api20210201.ISlowRequestsBasedTriggerInternal)this).Count = (int?) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.Websites.Models.Api20210201.ISlowRequestsBasedTriggerInternal)this).Count, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("TimeInterval")) { ((Microsoft.Azure.PowerShell.Cmdlets.Websites.Models.Api20210201.ISlowRequestsBasedTriggerInternal)this).TimeInterval = (string) content.GetValueForProperty("TimeInterval",((Microsoft.Azure.PowerShell.Cmdlets.Websites.Models.Api20210201.ISlowRequestsBasedTriggerInternal)this).TimeInterval, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// <summary>Serializes this instance to a json string.</summary> /// <returns>a <see cref="System.String" /> containing this model serialized to JSON text.</returns> public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Websites.Runtime.SerializationMode.IncludeAll)?.ToString(); public override string ToString() { var returnNow = false; var result = global::System.String.Empty; OverrideToString(ref result, ref returnNow); if (returnNow) { return result; } return ToJsonString(); } } /// Trigger based on request execution time. [System.ComponentModel.TypeConverter(typeof(SlowRequestsBasedTriggerTypeConverter))] public partial interface ISlowRequestsBasedTrigger { } }
64.44086
352
0.683464
[ "MIT" ]
Agazoth/azure-powershell
src/Websites/Websites.Autorest/generated/api/Models/Api20210201/SlowRequestsBasedTrigger.PowerShell.cs
11,801
C#
using System; using System.IO; using System.Threading; using Autofac; using Rhino.ServiceBus.Hosting; using Rhino.ServiceBus.Impl; using Rhino.ServiceBus.Autofac; using Xunit; using System.Linq; namespace Rhino.ServiceBus.Tests.Containers.Autofac { public class Can_host_in_another_app_domain : MsmqTestBase, OccasionalConsumerOf<StringMsg> { readonly RemoteAppDomainHost host = new RemoteAppDomainHost( Path.Combine(Environment.CurrentDirectory, "Rhino.ServiceBus.Tests.dll"), typeof(TestBootStrapper)); private string reply; private readonly ManualResetEvent resetEvent = new ManualResetEvent(false); private readonly IContainer container; public Can_host_in_another_app_domain() { container = new ContainerBuilder().Build(); new RhinoServiceBusConfiguration() .UseAutofac(container) .UseStandaloneConfigurationFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "AnotherBus.config")) .Configure(); } [Fact] public void And_accept_messages_from_there() { host.Start(); using (var bus = container.Resolve<IStartableServiceBus>()) { bus.Start(); using (bus.AddInstanceSubscription(this)) { bus.Send(new Uri("msmq://localhost/test_queue").ToEndpoint(), new StringMsg { Value = "hello" }); Assert.True(resetEvent.WaitOne(TimeSpan.FromSeconds(10), false)); Assert.Equal("olleh", reply); } } } public override void Dispose() { base.Dispose(); host.Close(); } public void Consume(StringMsg message) { reply = message.Value; resetEvent.Set(); } } [CLSCompliant(false)] public class SimpleBootStrapper : AutofacBootStrapper { public SimpleBootStrapper(IContainer container) : base(container) { } } [CLSCompliant(false)] public class TestBootStrapper : AutofacBootStrapper { protected override void ConfigureContainer() { var builder = new ContainerBuilder(); builder.RegisterType<TestRemoteHandler>() .AsImplementedInterfaces(); builder.Update(Container); } } public class TestRemoteHandler : ConsumerOf<StringMsg> { private readonly IServiceBus bus; public TestRemoteHandler(IServiceBus bus) { this.bus = bus; } public void Consume(StringMsg message) { bus.Reply(new StringMsg { Value = new String(message.Value.Reverse().ToArray()) }); } } public class StringMsg { public string Value { get; set; } } }
27.463636
121
0.577623
[ "BSD-3-Clause" ]
EzyWebwerkstaden/rhino-esb
Rhino.ServiceBus.Tests/Containers/Autofac/Can_host_in_another_app_domain.cs
3,021
C#
using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Http; using System.Web.Http; using System.Text; using sfShareLib; using sfAPIService.Models; using System.Web.Script.Serialization; using sfAPIService.Filter; using Swashbuckle.Swagger.Annotations; using Newtonsoft.Json; namespace sfAPIService.Controllers { [Authorize] [CustomAuthorizationFilter(ClaimType = "Roles", ClaimValue = "admin")] [RoutePrefix("admin-api/ExternalDashboard")] public class ExternalDashboardController : CDSApiController { /// <summary> /// Client_Id : Admin - OK /// </summary> [HttpGet] [SwaggerResponse(HttpStatusCode.OK, Type = typeof(List<ExternalDashboardModel.Format_Detail>))] public IHttpActionResult GetAllExternalDashboard() { ExternalDashboardModel model = new ExternalDashboardModel(); return Content(HttpStatusCode.OK, model.GetAllByCompanyId(UserToken.CompanyId)); } ///// <summary> ///// Client_Id : Admin - OK ///// </summary> //[HttpGet] //[Route("{id}")] //[SwaggerResponse(HttpStatusCode.OK, Type = typeof(ExternalDashboardModel.Format_Detail))] //public IHttpActionResult GetExternalDashboardById(int id) //{ // try // { // ExternalDashboardModel model = new ExternalDashboardModel(); // return Content(HttpStatusCode.OK, model.GetById(id)); // } // catch (CDSException cdsEx) // { // return Content(HttpStatusCode.BadRequest, CDSException.GetCDSErrorMessageByCode(cdsEx.ErrorId)); // } // catch (Exception ex) // { // return Content(HttpStatusCode.InternalServerError, ex); // } //} ///// <summary> ///// Client_Id : Admin - OK ///// </summary> //[HttpPost] //public IHttpActionResult CreateExternalDashboard([FromBody]ExternalDashboardModel.Format_Create dataModel) //{ // string logForm = "Form : " + JsonConvert.SerializeObject(dataModel); // string logAPI = "[Post] " + Request.RequestUri.ToString(); // if (!ModelState.IsValid || dataModel == null) // { // Global._appLogger.Warn(logAPI + " || Input Parameter not expected || " + logForm); // return Content(HttpStatusCode.BadRequest, HttpResponseFormat.InvaildData()); // } // try // { // int companyId = Global.GetCompanyIdFromToken(); // ExternalDashboardModel model = new ExternalDashboardModel(); // int id = model.Create(companyId, dataModel); // return Content(HttpStatusCode.OK, HttpResponseFormat.Success(id)); // } // catch (CDSException cdsEx) // { // return Content(HttpStatusCode.BadRequest, CDSException.GetCDSErrorMessageByCode(cdsEx.ErrorId)); // } // catch (Exception ex) // { // StringBuilder logMessage = LogHelper.BuildExceptionMessage(ex); // logMessage.AppendLine(logForm); // Global._appLogger.Error(logAPI + logMessage); // return Content(HttpStatusCode.InternalServerError, ex); // } //} ///// <summary> ///// Client_Id : Admin - OK ///// </summary> //[HttpPatch] //[Route("{id}")] //public IHttpActionResult UpdateExternalDashboard(int id, [FromBody]ExternalDashboardModel.Format_Update dataModel) //{ // string logForm = "Form : " + JsonConvert.SerializeObject(dataModel); // string logAPI = "[Patch] " + Request.RequestUri.ToString(); // if (!ModelState.IsValid || dataModel == null) // { // Global._appLogger.Warn(logAPI + " || Input Parameter not expected || " + logForm); // return Content(HttpStatusCode.BadRequest, HttpResponseFormat.InvaildData()); // } // try // { // ExternalDashboardModel model = new ExternalDashboardModel(); // model.Update(id, dataModel); // return Content(HttpStatusCode.OK, HttpResponseFormat.Success()); // } // catch (CDSException cdsEx) // { // return Content(HttpStatusCode.BadRequest, CDSException.GetCDSErrorMessageByCode(cdsEx.ErrorId)); // } // catch (Exception ex) // { // StringBuilder logMessage = LogHelper.BuildExceptionMessage(ex); // logMessage.AppendLine(logForm); // Global._appLogger.Error(logAPI + logMessage); // return Content(HttpStatusCode.InternalServerError, ex); // } //} ///// <summary> ///// Client_Id : Admin - OK ///// </summary> //[HttpDelete] //[Route("{id}")] //public IHttpActionResult DeleteExternalDashboard(int id) //{ // try // { // ExternalDashboardModel model = new ExternalDashboardModel(); // model.DeleteById(id); // return Content(HttpStatusCode.OK, HttpResponseFormat.Success()); // } // catch (CDSException cdsEx) // { // return Content(HttpStatusCode.BadRequest, CDSException.GetCDSErrorMessageByCode(cdsEx.ErrorId)); // } // catch (Exception ex) // { // string logAPI = "[Delete] " + Request.RequestUri.ToString(); // StringBuilder logMessage = LogHelper.BuildExceptionMessage(ex); // Global._appLogger.Error(logAPI + logMessage); // return Content(HttpStatusCode.InternalServerError, ex); // } //} } }
38.197452
124
0.564616
[ "MIT" ]
KevinKao809/CDS20
APIService/Controllers/ExternalDashboardController.cs
5,999
C#
namespace FantasyCritic.Web.Models.Requests.League; public record CreatePublisherRequest(Guid LeagueID, int Year, string PublisherName);
34.5
84
0.847826
[ "MIT" ]
shawnwildermuth/FantasyCritic
src/FantasyCritic.Web/Models/Requests/League/CreatePublisherRequest.cs
138
C#
using Natasha; using Xunit; namespace NatashaUT { public interface ITest { int MethodWidthReturnInt(); string MethodWidthReturnString(); void MethodWidthParamsRefInt(ref int i); string MethodWidthParamsString(string str); string MethodWidthParams(int a,string str,int b); } [Trait("快速构建","接口")] public class DynamicInterfaceTest { [Fact(DisplayName = "接口动态实现")] public void InterfaceSet() { OopOperator<ITest> interfaceBuilder = new OopOperator<ITest>(); interfaceBuilder.ClassName("UTestClass"); interfaceBuilder["MethodWidthReturnInt"] = "return 123456;"; interfaceBuilder["MethodWidthReturnString"] = "return \"test\";"; interfaceBuilder["MethodWidthParamsRefInt"] = "i+=10;"; interfaceBuilder["MethodWidthParamsString"] = "return str+\"1\";"; interfaceBuilder["MethodWidthParams"] = "return a.ToString()+str+b.ToString();"; interfaceBuilder.Compile(); var test = interfaceBuilder.Create("UTestClass"); int testi = 1; test.MethodWidthParamsRefInt(ref testi); Assert.Equal(123456, test.MethodWidthReturnInt()); Assert.Equal("test", test.MethodWidthReturnString()); Assert.Equal(11, testi); Assert.Equal("test1", test.MethodWidthParamsString("test")); Assert.Equal("12test12", test.MethodWidthParams(12,"test",12)); } } }
38.820513
92
0.624174
[ "MIT" ]
csuffyy/Natasha
NatashaUT/DynamicInterfaceTest.cs
1,540
C#
using System.Collections; using UnityEngine; using UnityEngine.SceneManagement; using Tin.Resources; using Tin.Networking; namespace Scene.Lobby { ///Strictly designed for lobby. Try not to incorporate game mechanics here. /// Perhaps destroy once in room public class NetworkLobby : Photon.PunBehaviour { public static string errorLog; public ClientState debug; public static int invokeConnect; #region Lobby public static void ConnectToLobby () { Debug.Log ("Connecting"); PhotonNetwork.ConnectUsingSettings (Reference.GameVersion); PhotonNetwork.automaticallySyncScene = false; } public override void OnJoinedLobby () { Debug.Log ("Connected"); } public override void OnConnectionFail (DisconnectCause cause) { errorLog = cause.ToString (); } #endregion void Update () { debug = PhotonNetwork.connectionStateDetailed; } #region Transition public static void RandomGame () { PhotonNetwork.JoinRandomRoom (); } public static void CreateRoom (string name) { if (name.Trim () == "") Util.ErrorHandler.instance.ToggleMessageBox (true, "Room needs a name"); else { RoomOptions roomOptions = defaultRoomOptions (); PhotonNetwork.CreateRoom (name, roomOptions, null); } } public static RoomInfo[] GetRooms () { return PhotonNetwork.GetRoomList (); } public static void JoinRoom (string id) { PhotonNetwork.JoinRoom (id); } public override void OnLeftLobby () { if (PhotonNetwork.connected) {//In case user disconnects ///Customization will load customProperties StartCoroutine (LoadLevel ()); } } public static IEnumerator LoadLevel () { Debug.Log ("Loading Level - Lobby"); PhotonNetwork.isMessageQueueRunning = false; yield return new WaitForSeconds (2); AsyncOperation asyncLoad = UnityEngine.SceneManagement.SceneManager.LoadSceneAsync ("Game"); while (!asyncLoad.isDone) yield return null; PhotonNetwork.isMessageQueueRunning = true; Debug.Log ("Loaded Level - Lobby"); } public static bool isConnecting () { if (PhotonNetwork.connectionStateDetailed == ClientState.ConnectingToGameserver) return true; else if (PhotonNetwork.connectionStateDetailed == ClientState.ConnectedToGameserver) return true; else if (PhotonNetwork.connectionStateDetailed == ClientState.Joining) return true; else if (PhotonNetwork.connectionStateDetailed == ClientState.Joined) return true; else return false; } private static RoomOptions defaultRoomOptions () { RoomOptions roomOptions = new RoomOptions (); roomOptions.IsOpen = true; roomOptions.IsVisible = true; roomOptions.PublishUserId = true; roomOptions.MaxPlayers = Reference.MaxPlayersPerRoom; roomOptions.CustomRoomPropertiesForLobby = new string[]{ GameProperties.Key_Map, GameProperties.Key_GameState }; return roomOptions; } public override void OnJoinedRoom () { Debug.Log ("OnJoinedRoom - Lobby"); //Destroy (this); } #endregion } }
23.438462
115
0.721693
[ "MIT" ]
TinForge/Old-Unity-Code
Networking/NetworkLobby.cs
3,049
C#
using System; using Autofac; using SmartHotel.Clients.Core.Services.Analytic; using SmartHotel.Clients.Core.Services.Authentication; using SmartHotel.Clients.Core.Services.Booking; using SmartHotel.Clients.Core.Services.Chart; using SmartHotel.Clients.Core.Services.Dialog; using SmartHotel.Clients.Core.Services.Hotel; using SmartHotel.Clients.Core.Services.Location; using SmartHotel.Clients.Core.Services.Navigation; using SmartHotel.Clients.Core.Services.Notification; using SmartHotel.Clients.Core.Services.OpenUri; using SmartHotel.Clients.Core.Services.Request; using SmartHotel.Clients.Core.Services.Settings; using SmartHotel.Clients.Core.Services.Suggestion; using SmartHotel.Clients.Core.Models; namespace SmartHotel.Clients.Core.ViewModels.Base { public class Locator { private IContainer _container; private ContainerBuilder _containerBuilder; private static readonly Locator _instance = new Locator(); public static Locator Instance { get { return _instance; } } public Locator() { _containerBuilder = new ContainerBuilder(); _containerBuilder.RegisterType<AnalyticService>().As<IAnalyticService>(); _containerBuilder.RegisterType<DialogService>().As<IDialogService>(); _containerBuilder.RegisterType<NavigationService>().As<INavigationService>(); _containerBuilder.RegisterType<FakeChartService>().As<IChartService>(); _containerBuilder.RegisterType<AuthenticationService>().As<IAuthenticationService>(); _containerBuilder.RegisterType<LocationService>().As<ILocationService>(); _containerBuilder.RegisterType<OpenUriService>().As<IOpenUriService>(); _containerBuilder.RegisterType<RequestService>().As<IRequestService>(); _containerBuilder.RegisterType<DefaultBrowserCookiesService>().As<IBrowserCookiesService>(); _containerBuilder.RegisterType<GravatarUrlProvider>().As<IAvatarUrlProvider>(); _containerBuilder.RegisterType(typeof(SettingsService)).As(typeof(ISettingsService<RemoteSettings>)); if (AppSettings.UseFakes) { _containerBuilder.RegisterType<FakeBookingService>().As<IBookingService>(); _containerBuilder.RegisterType<FakeHotelService>().As<IHotelService>(); _containerBuilder.RegisterType<FakeNotificationService>().As<INotificationService>(); _containerBuilder.RegisterType<FakeSuggestionService>().As<ISuggestionService>(); } else { _containerBuilder.RegisterType<BookingService>().As<IBookingService>(); _containerBuilder.RegisterType<HotelService>().As<IHotelService>(); _containerBuilder.RegisterType<NotificationService>().As<INotificationService>(); _containerBuilder.RegisterType<SuggestionService>().As<ISuggestionService>(); } _containerBuilder.RegisterType<BookingCalendarViewModel>(); _containerBuilder.RegisterType<BookingHotelViewModel>(); _containerBuilder.RegisterType<BookingHotelsViewModel>(); _containerBuilder.RegisterType<BookingViewModel>(); _containerBuilder.RegisterType<CheckoutViewModel>(); _containerBuilder.RegisterType<HomeViewModel>(); _containerBuilder.RegisterType<LoginViewModel>(); _containerBuilder.RegisterType<MainViewModel>(); _containerBuilder.RegisterType<MenuViewModel>(); _containerBuilder.RegisterType<MyRoomViewModel>(); _containerBuilder.RegisterType<NotificationsViewModel>(); _containerBuilder.RegisterType<OpenDoorViewModel>(); _containerBuilder.RegisterType<SuggestionsViewModel>(); _containerBuilder.RegisterType(typeof(SettingsViewModel<RemoteSettings>)); _containerBuilder.RegisterType<ExtendedSplashViewModel>(); } public T Resolve<T>() { return _container.Resolve<T>(); } public object Resolve(Type type) { return _container.Resolve(type); } public void Register<TInterface, TImplementation>() where TImplementation : TInterface { _containerBuilder.RegisterType<TImplementation>().As<TInterface>(); } public void Register<T>() where T : class { _containerBuilder.RegisterType<T>(); } public void Build() { _container = _containerBuilder.Build(); } } }
43.027523
113
0.684222
[ "MIT" ]
Akshayvh94/6a810908_SmartHotel360-mobile-desktop-apps
src/SmartHotel.Clients/SmartHotel.Clients/ViewModels/Base/Locator.cs
4,692
C#
using IceCoffee.DbCore.Primitives.Service; using LuoShuiTianYi.Sdtd.Services.Dtos; using System; using System.Collections.Generic; using System.Text; namespace LuoShuiTianYi.Sdtd.Services.Contracts { public interface IStandardAccountService : IServiceBaseGuid<StandardAccountDto> { } }
23.076923
83
0.803333
[ "MIT" ]
1249993110/TianYiSdtdServerTools
Server/LuoShuiTianYi.Sdtd.Services/Contracts/IStandardAccountService.cs
302
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. [assembly:System.Reflection.AssemblyVersionAttribute("4.0.0.0")] [assembly:System.CLSCompliantAttribute(true)] [assembly:System.Reflection.AssemblyCompanyAttribute("Mono development team")] [assembly:System.Reflection.AssemblyCopyrightAttribute("(c) Various Mono authors")] [assembly:System.Reflection.AssemblyDefaultAliasAttribute("System.Transactions.dll")] [assembly:System.Reflection.AssemblyDescriptionAttribute("System.Transactions.dll")] [assembly:System.Reflection.AssemblyFileVersionAttribute("4.0.30319.1")] [assembly:System.Reflection.AssemblyInformationalVersionAttribute("4.0.30319.1")] [assembly:System.Reflection.AssemblyProductAttribute("Mono Common Language Infrastructure")] [assembly:System.Reflection.AssemblyTitleAttribute("System.Transactions.dll")] [assembly:System.Resources.NeutralResourcesLanguageAttribute("en-US")] [assembly:System.Resources.SatelliteContractVersionAttribute("4.0.0.0")] [assembly:System.Runtime.CompilerServices.ReferenceAssemblyAttribute] [assembly:System.Runtime.CompilerServices.RuntimeCompatibilityAttribute(WrapNonExceptionThrows=true)] [assembly:System.Runtime.InteropServices.BestFitMappingAttribute(false)] [assembly:System.Runtime.InteropServices.ComCompatibleVersionAttribute(1, 0, 3300, 0)] [assembly:System.Runtime.InteropServices.ComVisibleAttribute(false)] [assembly:System.Security.AllowPartiallyTrustedCallersAttribute] namespace System { [System.AttributeUsageAttribute((System.AttributeTargets)(32767), AllowMultiple=true)] internal partial class MonoDocumentationNoteAttribute : System.MonoTODOAttribute { public MonoDocumentationNoteAttribute(string comment) { } } [System.AttributeUsageAttribute((System.AttributeTargets)(32767), AllowMultiple=true)] internal partial class MonoExtensionAttribute : System.MonoTODOAttribute { public MonoExtensionAttribute(string comment) { } } [System.AttributeUsageAttribute((System.AttributeTargets)(32767), AllowMultiple=true)] internal partial class MonoInternalNoteAttribute : System.MonoTODOAttribute { public MonoInternalNoteAttribute(string comment) { } } [System.AttributeUsageAttribute((System.AttributeTargets)(32767), AllowMultiple=true)] internal partial class MonoLimitationAttribute : System.MonoTODOAttribute { public MonoLimitationAttribute(string comment) { } } [System.AttributeUsageAttribute((System.AttributeTargets)(32767), AllowMultiple=true)] internal partial class MonoNotSupportedAttribute : System.MonoTODOAttribute { public MonoNotSupportedAttribute(string comment) { } } [System.AttributeUsageAttribute((System.AttributeTargets)(32767), AllowMultiple=true)] internal partial class MonoTODOAttribute : System.Attribute { public MonoTODOAttribute() { } public MonoTODOAttribute(string comment) { } public string Comment { get { throw null; } } } } namespace System.Transactions { [System.SerializableAttribute] public sealed partial class CommittableTransaction : System.Transactions.Transaction, System.IAsyncResult, System.IDisposable, System.Runtime.Serialization.ISerializable { public CommittableTransaction() { } public CommittableTransaction(System.TimeSpan timeout) { } public CommittableTransaction(System.Transactions.TransactionOptions options) { } object System.IAsyncResult.AsyncState { get { throw null; } } System.Threading.WaitHandle System.IAsyncResult.AsyncWaitHandle { get { throw null; } } bool System.IAsyncResult.CompletedSynchronously { get { throw null; } } bool System.IAsyncResult.IsCompleted { get { throw null; } } public System.IAsyncResult BeginCommit(System.AsyncCallback callback, object user_defined_state) { throw null; } public void Commit() { } public void EndCommit(System.IAsyncResult ar) { } [System.MonoTODOAttribute("Not implemented")] void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public enum DependentCloneOption { BlockCommitUntilComplete = 0, RollbackIfNotComplete = 1, } [System.MonoTODOAttribute("Not supported yet")] [System.SerializableAttribute] public sealed partial class DependentTransaction : System.Transactions.Transaction, System.Runtime.Serialization.ISerializable { internal DependentTransaction() { } [System.MonoTODOAttribute] public void Complete() { } void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public partial class Enlistment { internal Enlistment() { } public void Done() { } } [System.FlagsAttribute] public enum EnlistmentOptions { EnlistDuringPrepareRequired = 1, None = 0, } public enum EnterpriseServicesInteropOption { Automatic = 1, Full = 2, None = 0, } public delegate System.Transactions.Transaction HostCurrentTransactionCallback(); [System.Runtime.InteropServices.InterfaceTypeAttribute((System.Runtime.InteropServices.ComInterfaceType)(1))] public partial interface IDtcTransaction { void Abort(System.IntPtr manager, int whatever, int whatever2); void Commit(int whatever, int whatever2, int whatever3); void GetTransactionInfo(System.IntPtr whatever); } public partial interface IEnlistmentNotification { void Commit(System.Transactions.Enlistment enlistment); void InDoubt(System.Transactions.Enlistment enlistment); void Prepare(System.Transactions.PreparingEnlistment preparingEnlistment); void Rollback(System.Transactions.Enlistment enlistment); } public partial interface IPromotableSinglePhaseNotification : System.Transactions.ITransactionPromoter { void Initialize(); void Rollback(System.Transactions.SinglePhaseEnlistment enlistment); void SinglePhaseCommit(System.Transactions.SinglePhaseEnlistment enlistment); } public partial interface ISimpleTransactionSuperior : System.Transactions.ITransactionPromoter { void Rollback(); } public partial interface ISinglePhaseNotification : System.Transactions.IEnlistmentNotification { void SinglePhaseCommit(System.Transactions.SinglePhaseEnlistment enlistment); } public enum IsolationLevel { Chaos = 5, ReadCommitted = 2, ReadUncommitted = 3, RepeatableRead = 1, Serializable = 0, Snapshot = 4, Unspecified = 6, } public partial interface ITransactionPromoter { byte[] Promote(); } public partial class PreparingEnlistment : System.Transactions.Enlistment { internal PreparingEnlistment() { } public void ForceRollback() { } [System.MonoTODOAttribute] public void ForceRollback(System.Exception ex) { } [System.MonoTODOAttribute] public void Prepared() { } [System.MonoTODOAttribute] public byte[] RecoveryInformation() { throw null; } } public partial class SinglePhaseEnlistment : System.Transactions.Enlistment { internal SinglePhaseEnlistment() { } public void Aborted() { } public void Aborted(System.Exception e) { } [System.MonoTODOAttribute] public void Committed() { } [System.MonoTODOAttribute("Not implemented")] public void InDoubt() { } [System.MonoTODOAttribute("Not implemented")] public void InDoubt(System.Exception e) { } } [System.SerializableAttribute] public sealed partial class SubordinateTransaction : System.Transactions.Transaction { public SubordinateTransaction(System.Transactions.IsolationLevel level, System.Transactions.ISimpleTransactionSuperior superior) { } } [System.SerializableAttribute] public partial class Transaction : System.IDisposable, System.Runtime.Serialization.ISerializable { internal Transaction() { } public static System.Transactions.Transaction Current { get { throw null; } set { } } public System.Transactions.IsolationLevel IsolationLevel { get { throw null; } } public System.Transactions.TransactionInformation TransactionInformation { get { throw null; } } public event System.Transactions.TransactionCompletedEventHandler TransactionCompleted { add { } remove { } } protected System.IAsyncResult BeginCommitInternal(System.AsyncCallback callback) { throw null; } public System.Transactions.Transaction Clone() { throw null; } [System.MonoTODOAttribute] public System.Transactions.DependentTransaction DependentClone(System.Transactions.DependentCloneOption option) { throw null; } public void Dispose() { } protected void EndCommitInternal(System.IAsyncResult ar) { } [System.MonoTODOAttribute("Only SinglePhase commit supported for durable resource managers.")] [System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.LinkDemand)] public System.Transactions.Enlistment EnlistDurable(System.Guid manager, System.Transactions.IEnlistmentNotification notification, System.Transactions.EnlistmentOptions options) { throw null; } [System.MonoTODOAttribute("Only Local Transaction Manager supported. Cannot have more than 1 durable resource per transaction. Only EnlistmentOptions.None supported yet.")] [System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.LinkDemand)] public System.Transactions.Enlistment EnlistDurable(System.Guid manager, System.Transactions.ISinglePhaseNotification notification, System.Transactions.EnlistmentOptions options) { throw null; } public bool EnlistPromotableSinglePhase(System.Transactions.IPromotableSinglePhaseNotification notification) { throw null; } [System.MonoTODOAttribute("EnlistmentOptions being ignored")] public System.Transactions.Enlistment EnlistVolatile(System.Transactions.IEnlistmentNotification notification, System.Transactions.EnlistmentOptions options) { throw null; } [System.MonoTODOAttribute("EnlistmentOptions being ignored")] public System.Transactions.Enlistment EnlistVolatile(System.Transactions.ISinglePhaseNotification notification, System.Transactions.EnlistmentOptions options) { throw null; } public override bool Equals(object obj) { throw null; } public override int GetHashCode() { throw null; } public static bool operator ==(System.Transactions.Transaction x, System.Transactions.Transaction y) { throw null; } public static bool operator !=(System.Transactions.Transaction x, System.Transactions.Transaction y) { throw null; } public void Rollback() { } public void Rollback(System.Exception ex) { } [System.MonoTODOAttribute] void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } [System.SerializableAttribute] public partial class TransactionAbortedException : System.Transactions.TransactionException { public TransactionAbortedException() { } protected TransactionAbortedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } public TransactionAbortedException(string message) { } public TransactionAbortedException(string message, System.Exception innerException) { } } public delegate void TransactionCompletedEventHandler(object o, System.Transactions.TransactionEventArgs e); public partial class TransactionEventArgs : System.EventArgs { public TransactionEventArgs() { } public System.Transactions.Transaction Transaction { get { throw null; } } } [System.SerializableAttribute] public partial class TransactionException : System.SystemException { protected TransactionException() { } protected TransactionException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } public TransactionException(string message) { } public TransactionException(string message, System.Exception innerException) { } } [System.SerializableAttribute] public partial class TransactionInDoubtException : System.Transactions.TransactionException { protected TransactionInDoubtException() { } protected TransactionInDoubtException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } public TransactionInDoubtException(string message) { } public TransactionInDoubtException(string message, System.Exception innerException) { } } public partial class TransactionInformation { internal TransactionInformation() { } public System.DateTime CreationTime { get { throw null; } } public System.Guid DistributedIdentifier { get { throw null; } } public string LocalIdentifier { get { throw null; } } public System.Transactions.TransactionStatus Status { get { throw null; } } } [System.MonoTODOAttribute] public static partial class TransactionInterop { [System.MonoTODOAttribute] public static System.Transactions.IDtcTransaction GetDtcTransaction(System.Transactions.Transaction transaction) { throw null; } [System.MonoTODOAttribute] public static byte[] GetExportCookie(System.Transactions.Transaction transaction, byte[] exportCookie) { throw null; } [System.MonoTODOAttribute] public static System.Transactions.Transaction GetTransactionFromDtcTransaction(System.Transactions.IDtcTransaction dtc) { throw null; } [System.MonoTODOAttribute] public static System.Transactions.Transaction GetTransactionFromExportCookie(byte[] exportCookie) { throw null; } [System.MonoTODOAttribute] public static System.Transactions.Transaction GetTransactionFromTransmitterPropagationToken(byte[] token) { throw null; } [System.MonoTODOAttribute] public static byte[] GetTransmitterPropagationToken(System.Transactions.Transaction transaction) { throw null; } [System.MonoTODOAttribute] public static byte[] GetWhereabouts() { throw null; } } public static partial class TransactionManager { public static System.TimeSpan DefaultTimeout { get { throw null; } } [System.MonoTODOAttribute("Not implemented")] public static System.Transactions.HostCurrentTransactionCallback HostCurrentCallback { get { throw null; } set { } } public static System.TimeSpan MaximumTimeout { get { throw null; } } public static event System.Transactions.TransactionStartedEventHandler DistributedTransactionStarted { add { } remove { } } [System.MonoTODOAttribute("Not implemented")] public static void RecoveryComplete(System.Guid manager) { } [System.MonoTODOAttribute("Not implemented")] public static System.Transactions.Enlistment Reenlist(System.Guid manager, byte[] recoveryInfo, System.Transactions.IEnlistmentNotification notification) { throw null; } } [System.SerializableAttribute] public partial class TransactionManagerCommunicationException : System.Transactions.TransactionException { protected TransactionManagerCommunicationException() { } protected TransactionManagerCommunicationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } public TransactionManagerCommunicationException(string message) { } public TransactionManagerCommunicationException(string message, System.Exception innerException) { } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public partial struct TransactionOptions { public System.Transactions.IsolationLevel IsolationLevel { get { throw null; } set { } } public System.TimeSpan Timeout { get { throw null; } set { } } public override bool Equals(object obj) { throw null; } public override int GetHashCode() { throw null; } public static bool operator ==(System.Transactions.TransactionOptions o1, System.Transactions.TransactionOptions o2) { throw null; } public static bool operator !=(System.Transactions.TransactionOptions o1, System.Transactions.TransactionOptions o2) { throw null; } } [System.SerializableAttribute] public partial class TransactionPromotionException : System.Transactions.TransactionException { protected TransactionPromotionException() { } protected TransactionPromotionException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } public TransactionPromotionException(string message) { } public TransactionPromotionException(string message, System.Exception innerException) { } } public sealed partial class TransactionScope : System.IDisposable { public TransactionScope() { } public TransactionScope(System.Transactions.Transaction transaction) { } public TransactionScope(System.Transactions.Transaction transaction, System.TimeSpan timeout) { } [System.MonoTODOAttribute("EnterpriseServicesInteropOption not supported.")] public TransactionScope(System.Transactions.Transaction transaction, System.TimeSpan timeout, System.Transactions.EnterpriseServicesInteropOption opt) { } public TransactionScope(System.Transactions.TransactionScopeOption option) { } public TransactionScope(System.Transactions.TransactionScopeOption option, System.TimeSpan timeout) { } public TransactionScope(System.Transactions.TransactionScopeOption scopeOption, System.Transactions.TransactionOptions options) { } [System.MonoTODOAttribute("EnterpriseServicesInteropOption not supported")] public TransactionScope(System.Transactions.TransactionScopeOption scopeOption, System.Transactions.TransactionOptions options, System.Transactions.EnterpriseServicesInteropOption opt) { } public void Complete() { } public void Dispose() { } } public enum TransactionScopeOption { Required = 0, RequiresNew = 1, Suppress = 2, } public delegate void TransactionStartedEventHandler(object o, System.Transactions.TransactionEventArgs e); public enum TransactionStatus { Aborted = 2, Active = 0, Committed = 1, InDoubt = 3, } } namespace System.Transactions.Configuration { public partial class DefaultSettingsSection : System.Configuration.ConfigurationSection { public DefaultSettingsSection() { } [System.Configuration.ConfigurationPropertyAttribute("distributedTransactionManagerName", DefaultValue="")] public string DistributedTransactionManagerName { get { throw null; } set { } } [System.Configuration.ConfigurationPropertyAttribute("timeout", DefaultValue="00:01:00")] [System.Configuration.TimeSpanValidatorAttribute(MinValueString="00:00:00", MaxValueString="10675199.02:48:05.4775807")] public System.TimeSpan Timeout { get { throw null; } set { } } } public partial class MachineSettingsSection : System.Configuration.ConfigurationSection { public MachineSettingsSection() { } [System.Configuration.ConfigurationPropertyAttribute("maxTimeout", DefaultValue="00:10:00")] [System.Configuration.TimeSpanValidatorAttribute(MinValueString="00:00:00", MaxValueString="10675199.02:48:05.4775807")] public System.TimeSpan MaxTimeout { get { throw null; } set { } } } public partial class TransactionsSectionGroup : System.Configuration.ConfigurationSectionGroup { public TransactionsSectionGroup() { } [System.Configuration.ConfigurationPropertyAttribute("defaultSettings")] public System.Transactions.Configuration.DefaultSettingsSection DefaultSettings { get { throw null; } } [System.Configuration.ConfigurationPropertyAttribute("machineSettings")] public System.Transactions.Configuration.MachineSettingsSection MachineSettings { get { throw null; } } public static System.Transactions.Configuration.TransactionsSectionGroup GetSectionGroup(System.Configuration.Configuration config) { throw null; } } }
58.074176
202
0.748427
[ "MIT" ]
marek-safar/reference-assemblies
src/v4.0/System.Transactions.cs
21,139
C#
// <auto-generated> // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. // </auto-generated> namespace UiPath.Web.Client201910.Models { using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.Runtime; using System.Runtime.Serialization; /// <summary> /// Defines values for RobotWithLicenseDtoType. /// </summary> [JsonConverter(typeof(StringEnumConverter))] public enum RobotWithLicenseDtoType { [EnumMember(Value = "NonProduction")] NonProduction, [EnumMember(Value = "Attended")] Attended, [EnumMember(Value = "Unattended")] Unattended, [EnumMember(Value = "Studio")] Studio, [EnumMember(Value = "Development")] Development, [EnumMember(Value = "StudioX")] StudioX } internal static class RobotWithLicenseDtoTypeEnumExtension { internal static string ToSerializedValue(this RobotWithLicenseDtoType? value) { return value == null ? null : ((RobotWithLicenseDtoType)value).ToSerializedValue(); } internal static string ToSerializedValue(this RobotWithLicenseDtoType value) { switch( value ) { case RobotWithLicenseDtoType.NonProduction: return "NonProduction"; case RobotWithLicenseDtoType.Attended: return "Attended"; case RobotWithLicenseDtoType.Unattended: return "Unattended"; case RobotWithLicenseDtoType.Studio: return "Studio"; case RobotWithLicenseDtoType.Development: return "Development"; case RobotWithLicenseDtoType.StudioX: return "StudioX"; } return null; } internal static RobotWithLicenseDtoType? ParseRobotWithLicenseDtoType(this string value) { switch( value ) { case "NonProduction": return RobotWithLicenseDtoType.NonProduction; case "Attended": return RobotWithLicenseDtoType.Attended; case "Unattended": return RobotWithLicenseDtoType.Unattended; case "Studio": return RobotWithLicenseDtoType.Studio; case "Development": return RobotWithLicenseDtoType.Development; case "StudioX": return RobotWithLicenseDtoType.StudioX; } return null; } } }
33.864198
96
0.580022
[ "MIT" ]
AFWberlin/orchestrator-powershell
UiPath.Web.Client/generated201910/Models/RobotWithLicenseDtoType.cs
2,743
C#
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. using Azure.Core.Testing; using NUnit.Framework; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace Azure.AI.TextAnalytics.Samples { [LiveOnly] public partial class TextAnalyticsSamples { [Test] public async Task RecognizeEntitiesBatchConvenienceAsync() { string endpoint = TestEnvironment.Endpoint; string apiKey = TestEnvironment.ApiKey; // Instantiate a client that will be used to call the service. var client = new TextAnalyticsClient(new Uri(endpoint), new AzureKeyCredential(apiKey)); var documents = new List<string> { "Microsoft was founded by Bill Gates and Paul Allen.", "Text Analytics is one of the Azure Cognitive Services.", "A key technology in Text Analytics is Named Entity Recognition (NER).", }; RecognizeEntitiesResultCollection results = await client.RecognizeEntitiesBatchAsync(documents); Console.WriteLine($"Recognized entities for each document are:"); int i = 0; foreach (RecognizeEntitiesResult result in results) { Console.WriteLine($"For document: \"{documents[i++]}\","); Console.WriteLine($"the following {result.Entities.Count()} entities were found: "); foreach (CategorizedEntity entity in result.Entities) { Console.WriteLine($" Text: {entity.Text}, Category: {entity.Category}, SubCategory: {entity.SubCategory}, Confidence score: {entity.ConfidenceScore}"); } } } } }
37.163265
174
0.627128
[ "MIT" ]
HeidiSteen/azure-sdk-for-net
sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample4_RecognizeEntitiesBatchConvenienceAsync.cs
1,823
C#
using System.Collections; using System.Collections.Generic; using UnityEngine; using Data; namespace Module { public class ActorFollowCamera : LateUpdateModule { protected override void InitRequiredDataType() { _requiredDataTypeList.Add(typeof(FollowCameraData)); _requiredDataTypeList.Add(typeof(ResourceData)); _requiredDataTypeList.Add(typeof(ResourceStateData)); } public override bool IsUpdateRequired(Data.Data data) { return false; } public override void Refresh(ObjectData objData) { var resourceStateData = objData.GetData<ResourceStateData>(); if (!resourceStateData.isInstantiated) { return; } var resourceData = objData.GetData<ResourceData>(); var position = resourceData.gameObject.transform.position; position.z = Camera.main.transform.position.z; Camera.main.transform.position = position; } } }
28.675676
73
0.624882
[ "MIT" ]
KrisLee/simple_game_tool_ecs
Assets/Scripts/Module/Actor/ActorFollowCamera.cs
1,063
C#
namespace _01.SweetDesert { using System; public class Program { public static void Main() { decimal money = decimal.Parse(Console.ReadLine()); int guests = int.Parse(Console.ReadLine()); decimal bananaPrice = decimal.Parse(Console.ReadLine()); decimal eggsPrice = decimal.Parse(Console.ReadLine()); decimal berryPrice = decimal.Parse(Console.ReadLine()); var portions = guests / 6; if (guests%6!=0) { portions++; } decimal pricePerPortion = 2 * bananaPrice + 4 * eggsPrice + 0.2m * berryPrice; decimal totalPrice = pricePerPortion * portions; decimal moneyLeft = money - totalPrice; if (moneyLeft>=0) { Console.WriteLine($"Ivancho has enough money - it would cost {totalPrice:f2}lv."); } else { Console.WriteLine($"Ivancho will have to withdraw money - he will need {Math.Abs(moneyLeft):f2}lv more."); } } } }
31.971429
122
0.533512
[ "MIT" ]
melikpehlivanov/Programming-Fundamentals-C-
AllExams/01. SweetDesert/Program.cs
1,121
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 The_Long_Dark_Save_Editor_2.Properties { 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()] public class Resources { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Resources() { } /// <summary> /// Returns the cached ResourceManager instance used by this class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] public static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("The_Long_Dark_Save_Editor_2.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } /// <summary> /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] public static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } /// <summary> /// Looks up a localized string similar to About. /// </summary> public static string About { get { return ResourceManager.GetString("About", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Cure. /// </summary> public static string ActionCure { get { return ResourceManager.GetString("ActionCure", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Add item. /// </summary> public static string AddItem { get { return ResourceManager.GetString("AddItem", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Afflictions. /// </summary> public static string Afflictions { get { return ResourceManager.GetString("Afflictions", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Blood loss. /// </summary> public static string AfflictionType_BloodLoss { get { return ResourceManager.GetString("AfflictionType_BloodLoss", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Burns. /// </summary> public static string AfflictionType_Burns { get { return ResourceManager.GetString("AfflictionType_Burns", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Electric burns. /// </summary> public static string AfflictionType_BurnsElectric { get { return ResourceManager.GetString("AfflictionType_BurnsElectric", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Cabin fever. /// </summary> public static string AfflictionType_CabinFever { get { return ResourceManager.GetString("AfflictionType_CabinFever", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Cabin fever risk. /// </summary> public static string AfflictionType_CabinFeverRisk { get { return ResourceManager.GetString("AfflictionType_CabinFeverRisk", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Dysentery. /// </summary> public static string AfflictionType_Dysentery { get { return ResourceManager.GetString("AfflictionType_Dysentery", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Food poisoning. /// </summary> public static string AfflictionType_FoodPoisioning { get { return ResourceManager.GetString("AfflictionType_FoodPoisioning", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Frostbite. /// </summary> public static string AfflictionType_Frostbite { get { return ResourceManager.GetString("AfflictionType_Frostbite", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Frostbite damage. /// </summary> public static string AfflictionType_FrostbiteDamage { get { return ResourceManager.GetString("AfflictionType_FrostbiteDamage", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Frostbite risk. /// </summary> public static string AfflictionType_FrostbiteRisk { get { return ResourceManager.GetString("AfflictionType_FrostbiteRisk", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Hypothermia. /// </summary> public static string AfflictionType_Hypothermia { get { return ResourceManager.GetString("AfflictionType_Hypothermia", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Hypothermia risk. /// </summary> public static string AfflictionType_HypothermiaRisk { get { return ResourceManager.GetString("AfflictionType_HypothermiaRisk", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Improved rest. /// </summary> public static string AfflictionType_ImprovedRest { get { return ResourceManager.GetString("AfflictionType_ImprovedRest", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Infection. /// </summary> public static string AfflictionType_Infection { get { return ResourceManager.GetString("AfflictionType_Infection", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Infection risk. /// </summary> public static string AfflictionType_InfectionRisk { get { return ResourceManager.GetString("AfflictionType_InfectionRisk", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Intestinal parasites. /// </summary> public static string AfflictionType_IntestinalParasites { get { return ResourceManager.GetString("AfflictionType_IntestinalParasites", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Intestinal parasites risk. /// </summary> public static string AfflictionType_IntestinalParasitesRisk { get { return ResourceManager.GetString("AfflictionType_IntestinalParasitesRisk", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Reduced fatigue. /// </summary> public static string AfflictionType_ReducedFatigue { get { return ResourceManager.GetString("AfflictionType_ReducedFatigue", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Sprained ankle. /// </summary> public static string AfflictionType_SprainedAnkle { get { return ResourceManager.GetString("AfflictionType_SprainedAnkle", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Sprained wrist. /// </summary> public static string AfflictionType_SprainedWrist { get { return ResourceManager.GetString("AfflictionType_SprainedWrist", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Sprained wrist major. /// </summary> public static string AfflictionType_SprainedWristMajor { get { return ResourceManager.GetString("AfflictionType_SprainedWristMajor", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Warming up. /// </summary> public static string AfflictionType_WarmingUp { get { return ResourceManager.GetString("AfflictionType_WarmingUp", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Amount. /// </summary> public static string Amount { get { return ResourceManager.GetString("Amount", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Amount (liters). /// </summary> public static string AmountLiter { get { return ResourceManager.GetString("AmountLiter", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Archery skillpoints. /// </summary> public static string ArcherySP { get { return ResourceManager.GetString("ArcherySP", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Backups. /// </summary> public static string Backups { get { return ResourceManager.GetString("Backups", resourceCulture); } } /// <summary> /// Looks up a localized string similar to 4 days of night 2019 badges unlocked. /// </summary> public static string Badges4DON2019CheckBox { get { return ResourceManager.GetString("Badges4DON2019CheckBox", resourceCulture); } } /// <summary> /// Looks up a localized string similar to 4 days of night badges unlocked. /// </summary> public static string Badges4DONCheckBox { get { return ResourceManager.GetString("Badges4DONCheckBox", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Blizzard walker progress. /// </summary> public static string BlizzardWalkerProgress { get { return ResourceManager.GetString("BlizzardWalkerProgress", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Books. /// </summary> public static string Books { get { return ResourceManager.GetString("Books", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Book smarts progress. /// </summary> public static string BookSmartProgress { get { return ResourceManager.GetString("BookSmartProgress", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Calories. /// </summary> public static string Calories { get { return ResourceManager.GetString("Calories", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Cancel. /// </summary> public static string Cancel { get { return ResourceManager.GetString("Cancel", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Carcass harvesting skillpoints. /// </summary> public static string CarcassHarvestingSP { get { return ResourceManager.GetString("CarcassHarvestingSP", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Clothing. /// </summary> public static string Clothing { get { return ResourceManager.GetString("Clothing", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Clothing repairing skillpoints. /// </summary> public static string ClothingRepairSP { get { return ResourceManager.GetString("ClothingRepairSP", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Cold fusion progress. /// </summary> public static string ColdFusionProgress { get { return ResourceManager.GetString("ColdFusionProgress", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Collectible. /// </summary> public static string Collectible { get { return ResourceManager.GetString("Collectible", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Condition. /// </summary> public static string Condition { get { return ResourceManager.GetString("Condition", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Cooking skillpoints. /// </summary> public static string CookingSP { get { return ResourceManager.GetString("CookingSP", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Current calories. /// </summary> public static string CurrentCalories { get { return ResourceManager.GetString("CurrentCalories", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Download. /// </summary> public static string Download { get { return ResourceManager.GetString("Download", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Efficient machine progress. /// </summary> public static string EfficientMachineProgress { get { return ResourceManager.GetString("EfficientMachineProgress", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Experience mode. /// </summary> public static string ExperienceMode { get { return ResourceManager.GetString("ExperienceMode", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Challenge Archivist. /// </summary> public static string ExperienceModeType_ChallengeArchivist { get { return ResourceManager.GetString("ExperienceModeType_ChallengeArchivist", resourceCulture); } } /// <summary> /// Looks up a localized string similar to As the Dead Sleep. /// </summary> public static string ExperienceModeType_ChallengeDeadManWalking { get { return ResourceManager.GetString("ExperienceModeType_ChallengeDeadManWalking", resourceCulture); } } /// <summary> /// Looks up a localized string similar to The Hunted. /// </summary> public static string ExperienceModeType_ChallengeHunted { get { return ResourceManager.GetString("ExperienceModeType_ChallengeHunted", resourceCulture); } } /// <summary> /// Looks up a localized string similar to The Hunted, Part 2. /// </summary> public static string ExperienceModeType_ChallengeHuntedPart2 { get { return ResourceManager.GetString("ExperienceModeType_ChallengeHuntedPart2", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Nomad. /// </summary> public static string ExperienceModeType_ChallengeNomad { get { return ResourceManager.GetString("ExperienceModeType_ChallengeNomad", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Hopeless Rescue. /// </summary> public static string ExperienceModeType_ChallengeRescue { get { return ResourceManager.GetString("ExperienceModeType_ChallengeRescue", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Whiteout. /// </summary> public static string ExperienceModeType_ChallengeWhiteout { get { return ResourceManager.GetString("ExperienceModeType_ChallengeWhiteout", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Custom. /// </summary> public static string ExperienceModeType_Custom { get { return ResourceManager.GetString("ExperienceModeType_Custom", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Four Days Of Night. /// </summary> public static string ExperienceModeType_FourDaysOfNight { get { return ResourceManager.GetString("ExperienceModeType_FourDaysOfNight", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Interloper. /// </summary> public static string ExperienceModeType_Interloper { get { return ResourceManager.GetString("ExperienceModeType_Interloper", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Pilgrim. /// </summary> public static string ExperienceModeType_Pilgrim { get { return ResourceManager.GetString("ExperienceModeType_Pilgrim", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Stalker. /// </summary> public static string ExperienceModeType_Stalker { get { return ResourceManager.GetString("ExperienceModeType_Stalker", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Story. /// </summary> public static string ExperienceModeType_Story { get { return ResourceManager.GetString("ExperienceModeType_Story", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Story Fresh. /// </summary> public static string ExperienceModeType_StoryFresh { get { return ResourceManager.GetString("ExperienceModeType_StoryFresh", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Story Hardened. /// </summary> public static string ExperienceModeType_StoryHardened { get { return ResourceManager.GetString("ExperienceModeType_StoryHardened", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Voyageur. /// </summary> public static string ExperienceModeType_Voyageur { get { return ResourceManager.GetString("ExperienceModeType_Voyageur", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Expert trapper progress. /// </summary> public static string ExpertTrapperProgress { get { return ResourceManager.GetString("ExpertTrapperProgress", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Fatigue. /// </summary> public static string Fatigue { get { return ResourceManager.GetString("Fatigue", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Fire master progress. /// </summary> public static string FireMasterProgress { get { return ResourceManager.GetString("FireMasterProgress", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Fire starting skillpoints. /// </summary> public static string FireStartingSP { get { return ResourceManager.GetString("FireStartingSP", resourceCulture); } } /// <summary> /// Looks up a localized string similar to First Aid. /// </summary> public static string FirstAid { get { return ResourceManager.GetString("FirstAid", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Food. /// </summary> public static string Food { get { return ResourceManager.GetString("Food", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Free runner progress. /// </summary> public static string FreeRunnerProgress { get { return ResourceManager.GetString("FreeRunnerProgress", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Freezing. /// </summary> public static string Freezing { get { return ResourceManager.GetString("Freezing", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Accelerant. /// </summary> public static string GEAR_Accelerant { get { return ResourceManager.GetString("GEAR_Accelerant", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Accelerant. /// </summary> public static string GEAR_AccelerantKerosene { get { return ResourceManager.GetString("GEAR_AccelerantKerosene", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Accelerant. /// </summary> public static string GEAR_AccelerantMedium { get { return ResourceManager.GetString("GEAR_AccelerantMedium", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Airline Food - Chicken. /// </summary> public static string GEAR_AirlineFoodChick { get { return ResourceManager.GetString("GEAR_AirlineFoodChick", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Airline Food - Vegetarian. /// </summary> public static string GEAR_AirlineFoodVeg { get { return ResourceManager.GetString("GEAR_AirlineFoodVeg", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Simple Arrow. /// </summary> public static string GEAR_Arrow { get { return ResourceManager.GetString("GEAR_Arrow", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Arrowhead. /// </summary> public static string GEAR_ArrowHead { get { return ResourceManager.GetString("GEAR_ArrowHead", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Arrow Shaft. /// </summary> public static string GEAR_ArrowShaft { get { return ResourceManager.GetString("GEAR_ArrowShaft", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Astrid Backpack. /// </summary> public static string GEAR_AstridBackPack { get { return ResourceManager.GetString("GEAR_AstridBackPack", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Astrid&apos;s Backpack. /// </summary> public static string GEAR_AstridBackPack_hangar { get { return ResourceManager.GetString("GEAR_AstridBackPack_hangar", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Astrid&apos;s Boots. /// </summary> public static string GEAR_AstridBoots { get { return ResourceManager.GetString("GEAR_AstridBoots", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Astrid&apos;s Gloves. /// </summary> public static string GEAR_AstridGloves { get { return ResourceManager.GetString("GEAR_AstridGloves", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Astrid&apos;s Jacket. /// </summary> public static string GEAR_AstridJacket { get { return ResourceManager.GetString("GEAR_AstridJacket", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Astrid&apos;s Jeans. /// </summary> public static string GEAR_AstridJeans { get { return ResourceManager.GetString("GEAR_AstridJeans", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Astrid&apos;s Sweater. /// </summary> public static string GEAR_AstridSweater { get { return ResourceManager.GetString("GEAR_AstridSweater", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Astrid Toque. /// </summary> public static string GEAR_AstridToque { get { return ResourceManager.GetString("GEAR_AstridToque", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Aurora Hatch Door Entry Code. /// </summary> public static string GEAR_AuroraHatchCode { get { return ResourceManager.GetString("GEAR_AuroraHatchCode", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Aurora Observation. /// </summary> public static string GEAR_AuroraObservationNote { get { return ResourceManager.GetString("GEAR_AuroraObservationNote", resourceCulture); } } /// <summary> /// Looks up a localized string similar to A Note Left Behind. /// </summary> public static string GEAR_BackerNote1C { get { return ResourceManager.GetString("GEAR_BackerNote1C", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Balaclava. /// </summary> public static string GEAR_Balaclava { get { return ResourceManager.GetString("GEAR_Balaclava", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Bank Manager&apos;s House Key. /// </summary> public static string GEAR_BankManagerHouseKey { get { return ResourceManager.GetString("GEAR_BankManagerHouseKey", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Bank Vault Code. /// </summary> public static string GEAR_BankVaultCode { get { return ResourceManager.GetString("GEAR_BankVaultCode", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Birch Bark. /// </summary> public static string GEAR_BarkTinder { get { return ResourceManager.GetString("GEAR_BarkTinder", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Baseball Cap. /// </summary> public static string GEAR_BaseballCap { get { return ResourceManager.GetString("GEAR_BaseballCap", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Trail Boots. /// </summary> public static string GEAR_BasicBoots { get { return ResourceManager.GetString("GEAR_BasicBoots", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Driving Gloves. /// </summary> public static string GEAR_BasicGloves { get { return ResourceManager.GetString("GEAR_BasicGloves", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Running Shoes. /// </summary> public static string GEAR_BasicShoes { get { return ResourceManager.GetString("GEAR_BasicShoes", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Windbreaker. /// </summary> public static string GEAR_BasicWinterCoat { get { return ResourceManager.GetString("GEAR_BasicWinterCoat", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Cotton Toque. /// </summary> public static string GEAR_BasicWoolHat { get { return ResourceManager.GetString("GEAR_BasicWoolHat", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Wool Scarf. /// </summary> public static string GEAR_BasicWoolScarf { get { return ResourceManager.GetString("GEAR_BasicWoolScarf", resourceCulture); } } /// <summary> /// Looks up a localized string similar to The Old Bear&apos;s Ear. /// </summary> public static string GEAR_BearEar { get { return ResourceManager.GetString("GEAR_BearEar", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Fresh Black Bear Hide. /// </summary> public static string GEAR_BearHide { get { return ResourceManager.GetString("GEAR_BearHide", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Cured Black Bear Hide. /// </summary> public static string GEAR_BearHideDried { get { return ResourceManager.GetString("GEAR_BearHideDried", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Bear Quarter. /// </summary> public static string GEAR_BearQuarter { get { return ResourceManager.GetString("GEAR_BearQuarter", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Bear Skin Bedroll. /// </summary> public static string GEAR_BearSkinBedRoll { get { return ResourceManager.GetString("GEAR_BearSkinBedRoll", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Bearskin Coat. /// </summary> public static string GEAR_BearSkinCoat { get { return ResourceManager.GetString("GEAR_BearSkinCoat", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Bear Spear. /// </summary> public static string GEAR_BearSpear { get { return ResourceManager.GetString("GEAR_BearSpear", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Broken Bear Spear. /// </summary> public static string GEAR_BearSpearBroken { get { return ResourceManager.GetString("GEAR_BearSpearBroken", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Broken Bear Spear. /// </summary> public static string GEAR_BearSpearBrokenStory { get { return ResourceManager.GetString("GEAR_BearSpearBrokenStory", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Bear Spear. /// </summary> public static string GEAR_BearSpearStory { get { return ResourceManager.GetString("GEAR_BearSpearStory", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Bedroll. /// </summary> public static string GEAR_BedRoll { get { return ResourceManager.GetString("GEAR_BedRoll", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Beef Jerky. /// </summary> public static string GEAR_BeefJerky { get { return ResourceManager.GetString("GEAR_BeefJerky", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Prepared Birch Bark . /// </summary> public static string GEAR_BirchbarkPrepared { get { return ResourceManager.GetString("GEAR_BirchbarkPrepared", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Birch Bark Tea. /// </summary> public static string GEAR_BirchbarkTea { get { return ResourceManager.GetString("GEAR_BirchbarkTea", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Green Birch Sapling. /// </summary> public static string GEAR_BirchSapling { get { return ResourceManager.GetString("GEAR_BirchSapling", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Cured Birch Sapling. /// </summary> public static string GEAR_BirchSaplingDried { get { return ResourceManager.GetString("GEAR_BirchSaplingDried", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Blood Stained-Convict Note. /// </summary> public static string GEAR_BlackrockConvictNote1 { get { return ResourceManager.GetString("GEAR_BlackrockConvictNote1", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Convict Note. /// </summary> public static string GEAR_BlackrockConvictNote2 { get { return ResourceManager.GetString("GEAR_BlackrockConvictNote2", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Convict Cache Directions. /// </summary> public static string GEAR_BlackrockConvictNote3 { get { return ResourceManager.GetString("GEAR_BlackrockConvictNote3", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Blackrock Penitentiary Memo. /// </summary> public static string GEAR_BlackrockMemo { get { return ResourceManager.GetString("GEAR_BlackrockMemo", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Bloody Hammer. /// </summary> public static string GEAR_BloodyHammer { get { return ResourceManager.GetString("GEAR_BloodyHammer", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Marine Flare. /// </summary> public static string GEAR_BlueFlare { get { return ResourceManager.GetString("GEAR_BlueFlare", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Bolt Cutters. /// </summary> public static string GEAR_BoltCutters { get { return ResourceManager.GetString("GEAR_BoltCutters", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Book. /// </summary> public static string GEAR_BookA { get { return ResourceManager.GetString("GEAR_BookA", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Stay On Target. /// </summary> public static string GEAR_BookArchery { get { return ResourceManager.GetString("GEAR_BookArchery", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Book. /// </summary> public static string GEAR_BookB { get { return ResourceManager.GetString("GEAR_BookB", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Book. /// </summary> public static string GEAR_BookBopen { get { return ResourceManager.GetString("GEAR_BookBopen", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Book. /// </summary> public static string GEAR_BookC { get { return ResourceManager.GetString("GEAR_BookC", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Field Dressing Your Kill, Vol. I. /// </summary> public static string GEAR_BookCarcassHarvesting { get { return ResourceManager.GetString("GEAR_BookCarcassHarvesting", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Wilderness Kitchen. /// </summary> public static string GEAR_BookCooking { get { return ResourceManager.GetString("GEAR_BookCooking", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Book. /// </summary> public static string GEAR_BookD { get { return ResourceManager.GetString("GEAR_BookD", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Book. /// </summary> public static string GEAR_BookE { get { return ResourceManager.GetString("GEAR_BookE", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Book. /// </summary> public static string GEAR_BookEopen { get { return ResourceManager.GetString("GEAR_BookEopen", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Book. /// </summary> public static string GEAR_BookF { get { return ResourceManager.GetString("GEAR_BookF", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Survive the Outdoors!. /// </summary> public static string GEAR_BookFireStarting { get { return ResourceManager.GetString("GEAR_BookFireStarting", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Book. /// </summary> public static string GEAR_BookFopen { get { return ResourceManager.GetString("GEAR_BookFopen", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Book. /// </summary> public static string GEAR_BookG { get { return ResourceManager.GetString("GEAR_BookG", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Practical Gunsmithing. /// </summary> public static string GEAR_BookGunsmithing { get { return ResourceManager.GetString("GEAR_BookGunsmithing", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Book. /// </summary> public static string GEAR_BookH { get { return ResourceManager.GetString("GEAR_BookH", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Book. /// </summary> public static string GEAR_BookHopen { get { return ResourceManager.GetString("GEAR_BookHopen", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Book. /// </summary> public static string GEAR_BookI { get { return ResourceManager.GetString("GEAR_BookI", resourceCulture); } } /// <summary> /// Looks up a localized string similar to The Frozen Angler. /// </summary> public static string GEAR_BookIceFishing { get { return ResourceManager.GetString("GEAR_BookIceFishing", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Book. /// </summary> public static string GEAR_BookManual { get { return ResourceManager.GetString("GEAR_BookManual", resourceCulture); } } /// <summary> /// Looks up a localized string similar to A Sewing Primer. /// </summary> public static string GEAR_BookMending { get { return ResourceManager.GetString("GEAR_BookMending", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Small Arms Handbook. /// </summary> public static string GEAR_BookRevolverFirearm { get { return ResourceManager.GetString("GEAR_BookRevolverFirearm", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Frontier Shooting Guide. /// </summary> public static string GEAR_BookRifleFirearm { get { return ResourceManager.GetString("GEAR_BookRifleFirearm", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Advanced Guns Guns Guns!. /// </summary> public static string GEAR_BookRifleFirearmAdvanced { get { return ResourceManager.GetString("GEAR_BookRifleFirearmAdvanced", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Local Legends - The Big One. /// </summary> public static string GEAR_BookTallTalesFishing { get { return ResourceManager.GetString("GEAR_BookTallTalesFishing", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Local Legends -The Lost Cave. /// </summary> public static string GEAR_BookTallTalesGlowCave { get { return ResourceManager.GetString("GEAR_BookTallTalesGlowCave", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Local Legends - Ghost Stag. /// </summary> public static string GEAR_BookTallTalesStag { get { return ResourceManager.GetString("GEAR_BookTallTalesStag", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Local Legends -Sasquatch. /// </summary> public static string GEAR_BookTallTalesYeti { get { return ResourceManager.GetString("GEAR_BookTallTalesYeti", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Antibiotics. /// </summary> public static string GEAR_BottleAntibiotics { get { return ResourceManager.GetString("GEAR_BottleAntibiotics", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Antiseptic. /// </summary> public static string GEAR_BottleHydrogenPeroxide { get { return ResourceManager.GetString("GEAR_BottleHydrogenPeroxide", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Painkillers. /// </summary> public static string GEAR_BottlePainKillers { get { return ResourceManager.GetString("GEAR_BottlePainKillers", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Survival Bow. /// </summary> public static string GEAR_Bow { get { return ResourceManager.GetString("GEAR_Bow", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Bow String. /// </summary> public static string GEAR_BowString { get { return ResourceManager.GetString("GEAR_BowString", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Bow Wood. /// </summary> public static string GEAR_BowWood { get { return ResourceManager.GetString("GEAR_BowWood", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Brand. /// </summary> public static string GEAR_Brand { get { return ResourceManager.GetString("GEAR_Brand", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Broken Arrow. /// </summary> public static string GEAR_BrokenArrow { get { return ResourceManager.GetString("GEAR_BrokenArrow", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Jeremiah&apos;s Broken Rifle. /// </summary> public static string GEAR_BrokenRifle { get { return ResourceManager.GetString("GEAR_BrokenRifle", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Bullet. /// </summary> public static string GEAR_Bullet { get { return ResourceManager.GetString("GEAR_Bullet", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Milton Hidden Cache Note. /// </summary> public static string GEAR_CacheNote_ChurchMarshDir { get { return ResourceManager.GetString("GEAR_CacheNote_ChurchMarshDir", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Park Notice. /// </summary> public static string GEAR_CampOfficeCollectible { get { return ResourceManager.GetString("GEAR_CampOfficeCollectible", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Candy Bar. /// </summary> public static string GEAR_CandyBar { get { return ResourceManager.GetString("GEAR_CandyBar", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Pork and Beans. /// </summary> public static string GEAR_CannedBeans { get { return ResourceManager.GetString("GEAR_CannedBeans", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Tin of Sardines. /// </summary> public static string GEAR_CannedSardines { get { return ResourceManager.GetString("GEAR_CannedSardines", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Communication Report. /// </summary> public static string GEAR_CanneryCodeNote { get { return ResourceManager.GetString("GEAR_CanneryCodeNote", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Cannery Memo. /// </summary> public static string GEAR_CanneryMemo { get { return ResourceManager.GetString("GEAR_CanneryMemo", resourceCulture); } } /// <summary> /// Looks up a localized string similar to The Technician&apos;s Notebook. /// </summary> public static string GEAR_CannerySurvivalPath { get { return ResourceManager.GetString("GEAR_CannerySurvivalPath", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Can Opener. /// </summary> public static string GEAR_CanOpener { get { return ResourceManager.GetString("GEAR_CanOpener", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Car Battery. /// </summary> public static string GEAR_CarBattery { get { return ResourceManager.GetString("GEAR_CarBattery", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Cargo Pants. /// </summary> public static string GEAR_CargoPants { get { return ResourceManager.GetString("GEAR_CargoPants", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Cat Tail Plant. /// </summary> public static string GEAR_CattailPlant { get { return ResourceManager.GetString("GEAR_CattailPlant", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Cat Tail Stalk. /// </summary> public static string GEAR_CattailStalk { get { return ResourceManager.GetString("GEAR_CattailStalk", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Cat Tail Head. /// </summary> public static string GEAR_CattailTinder { get { return ResourceManager.GetString("GEAR_CattailTinder", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Cave Hidden Cache Note. /// </summary> public static string GEAR_CaveCacheNote { get { return ResourceManager.GetString("GEAR_CaveCacheNote", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Charcoal. /// </summary> public static string GEAR_Charcoal { get { return ResourceManager.GetString("GEAR_Charcoal", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Church Hymn. /// </summary> public static string GEAR_ChurchHymn { get { return ResourceManager.GetString("GEAR_ChurchHymn", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Church Note EP 1. /// </summary> public static string GEAR_ChurchNoteEP1 { get { return ResourceManager.GetString("GEAR_ChurchNoteEP1", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Climber&apos;s Journal Page. /// </summary> public static string GEAR_ClimbersJournal { get { return ResourceManager.GetString("GEAR_ClimbersJournal", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Climbing Socks. /// </summary> public static string GEAR_ClimbingSocks { get { return ResourceManager.GetString("GEAR_ClimbingSocks", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Cloth. /// </summary> public static string GEAR_Cloth { get { return ResourceManager.GetString("GEAR_Cloth", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Coal. /// </summary> public static string GEAR_Coal { get { return ResourceManager.GetString("GEAR_Coal", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Cup of Coffee. /// </summary> public static string GEAR_CoffeeCup { get { return ResourceManager.GetString("GEAR_CoffeeCup", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Tin of Coffee. /// </summary> public static string GEAR_CoffeeTin { get { return ResourceManager.GetString("GEAR_CoffeeTin", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Collectible Note Common. /// </summary> public static string GEAR_CollectibleNoteCommonReward { get { return ResourceManager.GetString("GEAR_CollectibleNoteCommonReward", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Collectible Note Common. /// </summary> public static string GEAR_CollectibleNoteRareReward { get { return ResourceManager.GetString("GEAR_CollectibleNoteRareReward", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Combat Boots. /// </summary> public static string GEAR_CombatBoots { get { return ResourceManager.GetString("GEAR_CombatBoots", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Combat Pants. /// </summary> public static string GEAR_CombatPants { get { return ResourceManager.GetString("GEAR_CombatPants", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Compression Bandage. /// </summary> public static string GEAR_CompressionBandage { get { return ResourceManager.GetString("GEAR_CompressionBandage", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Condensed Milk. /// </summary> public static string GEAR_CondensedMilk { get { return ResourceManager.GetString("GEAR_CondensedMilk", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Convict Journal Entry. /// </summary> public static string GEAR_ConvictCorpseNote { get { return ResourceManager.GetString("GEAR_ConvictCorpseNote", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Coho Salmon (Cooked). /// </summary> public static string GEAR_CookedCohoSalmon { get { return ResourceManager.GetString("GEAR_CookedCohoSalmon", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Lake Whitefish (Cooked). /// </summary> public static string GEAR_CookedLakeWhiteFish { get { return ResourceManager.GetString("GEAR_CookedLakeWhiteFish", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Bear Meat (Cooked). /// </summary> public static string GEAR_CookedMeatBear { get { return ResourceManager.GetString("GEAR_CookedMeatBear", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Venison (Cooked). /// </summary> public static string GEAR_CookedMeatDeer { get { return ResourceManager.GetString("GEAR_CookedMeatDeer", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Moose Meat (Cooked). /// </summary> public static string GEAR_CookedMeatMoose { get { return ResourceManager.GetString("GEAR_CookedMeatMoose", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Rabbit (Cooked). /// </summary> public static string GEAR_CookedMeatRabbit { get { return ResourceManager.GetString("GEAR_CookedMeatRabbit", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Wolf Meat (Cooked). /// </summary> public static string GEAR_CookedMeatWolf { get { return ResourceManager.GetString("GEAR_CookedMeatWolf", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Rainbow Trout (Cooked). /// </summary> public static string GEAR_CookedRainbowTrout { get { return ResourceManager.GetString("GEAR_CookedRainbowTrout", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Smallmouth Bass (Cooked). /// </summary> public static string GEAR_CookedSmallMouthBass { get { return ResourceManager.GetString("GEAR_CookedSmallMouthBass", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Cooking Pot. /// </summary> public static string GEAR_CookingPot { get { return ResourceManager.GetString("GEAR_CookingPot", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Hoodie. /// </summary> public static string GEAR_CottonHoodie { get { return ResourceManager.GetString("GEAR_CottonHoodie", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Cotton Scarf. /// </summary> public static string GEAR_CottonScarf { get { return ResourceManager.GetString("GEAR_CottonScarf", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Dress Shirt. /// </summary> public static string GEAR_CottonShirt { get { return ResourceManager.GetString("GEAR_CottonShirt", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Sports Socks. /// </summary> public static string GEAR_CottonSocks { get { return ResourceManager.GetString("GEAR_CottonSocks", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Sports Socks (Start). /// </summary> public static string GEAR_CottonSocksStart { get { return ResourceManager.GetString("GEAR_CottonSocksStart", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Cowichan Sweater. /// </summary> public static string GEAR_CowichanSweater { get { return ResourceManager.GetString("GEAR_CowichanSweater", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Salty Crackers. /// </summary> public static string GEAR_Crackers { get { return ResourceManager.GetString("GEAR_Crackers", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Crow Feather. /// </summary> public static string GEAR_CrowFeather { get { return ResourceManager.GetString("GEAR_CrowFeather", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Dam Code Note. /// </summary> public static string GEAR_DamCodeNote { get { return ResourceManager.GetString("GEAR_DamCodeNote", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Carter Hydro Dam - Safety &amp; Shutdown Notice. /// </summary> public static string GEAR_DamCollectible1 { get { return ResourceManager.GetString("GEAR_DamCollectible1", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Dam Control Room Code. /// </summary> public static string GEAR_DamControlRoomCodeNote { get { return ResourceManager.GetString("GEAR_DamControlRoomCodeNote", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Elevator Maintenance Notice. /// </summary> public static string GEAR_DamElevatorNotice { get { return ResourceManager.GetString("GEAR_DamElevatorNotice", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Carter Hydro Staging Area Gate Key. /// </summary> public static string GEAR_DamFenceKey { get { return ResourceManager.GetString("GEAR_DamFenceKey", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Trash Can Letter. /// </summary> public static string GEAR_DamGarbageLetter { get { return ResourceManager.GetString("GEAR_DamGarbageLetter", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Aid Station Medical Locker Key. /// </summary> public static string GEAR_DamLockerKey { get { return ResourceManager.GetString("GEAR_DamLockerKey", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Dam Office Key. /// </summary> public static string GEAR_DamOfficeKey { get { return ResourceManager.GetString("GEAR_DamOfficeKey", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Breyerhouse Winter Crew Warning. /// </summary> public static string GEAR_DamTrailerBCrewNote { get { return ResourceManager.GetString("GEAR_DamTrailerBCrewNote", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Deerskin Boots. /// </summary> public static string GEAR_DeerSkinBoots { get { return ResourceManager.GetString("GEAR_DeerSkinBoots", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Deerskin Pants. /// </summary> public static string GEAR_DeerSkinPants { get { return ResourceManager.GetString("GEAR_DeerSkinPants", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Dog Food. /// </summary> public static string GEAR_DogFood { get { return ResourceManager.GetString("GEAR_DogFood", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Urban Parka. /// </summary> public static string GEAR_DownParka { get { return ResourceManager.GetString("GEAR_DownParka", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Ski Jacket. /// </summary> public static string GEAR_DownSkiJacket { get { return ResourceManager.GetString("GEAR_DownSkiJacket", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Down Vest. /// </summary> public static string GEAR_DownVest { get { return ResourceManager.GetString("GEAR_DownVest", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Dusting Sulfur. /// </summary> public static string GEAR_DustingSulfur { get { return ResourceManager.GetString("GEAR_DustingSulfur", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Wool Ear Wrap. /// </summary> public static string GEAR_EarMuffs { get { return ResourceManager.GetString("GEAR_EarMuffs", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Emergency Kit Note. /// </summary> public static string GEAR_EmergencyKitNote { get { return ResourceManager.GetString("GEAR_EmergencyKitNote", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Emergency Stim. /// </summary> public static string GEAR_EmergencyStim { get { return ResourceManager.GetString("GEAR_EmergencyStim", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Energy Bar. /// </summary> public static string GEAR_EnergyBar { get { return ResourceManager.GetString("GEAR_EnergyBar", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Church Artifact. /// </summary> public static string GEAR_Ep3_ChurchArtifact { get { return ResourceManager.GetString("GEAR_Ep3_ChurchArtifact", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Church Flyer. /// </summary> public static string GEAR_Ep3_ChurchFlyer { get { return ResourceManager.GetString("GEAR_Ep3_ChurchFlyer", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Undelivered Letter. /// </summary> public static string GEAR_Ep3_ChurchMotelLetter { get { return ResourceManager.GetString("GEAR_Ep3_ChurchMotelLetter", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Newspaper Clipping. /// </summary> public static string GEAR_Ep3_ChurchNewsClipping { get { return ResourceManager.GetString("GEAR_Ep3_ChurchNewsClipping", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Thankyou Letter. /// </summary> public static string GEAR_Ep3_ChurchThankyouLetter { get { return ResourceManager.GetString("GEAR_Ep3_ChurchThankyouLetter", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Diocese Report. /// </summary> public static string GEAR_Ep3_ChurchTheftReport { get { return ResourceManager.GetString("GEAR_Ep3_ChurchTheftReport", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Joplin&apos;s Journal, Part One. /// </summary> public static string GEAR_EP3_JoplinBunkerNote { get { return ResourceManager.GetString("GEAR_EP3_JoplinBunkerNote", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Joplin&apos;s Journal, Part Two. /// </summary> public static string GEAR_EP3_JoplinBunkerNote2 { get { return ResourceManager.GetString("GEAR_EP3_JoplinBunkerNote2", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Forest Talker Bunker Memo. /// </summary> public static string GEAR_EP3_JoplinCacheNote { get { return ResourceManager.GetString("GEAR_EP3_JoplinCacheNote", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Blood Soaked Note. /// </summary> public static string GEAR_EP3_PatientHistory01 { get { return ResourceManager.GetString("GEAR_EP3_PatientHistory01", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Blood Soaked Note. /// </summary> public static string GEAR_EP3_PatientHistory02 { get { return ResourceManager.GetString("GEAR_EP3_PatientHistory02", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Blood Soaked Note. /// </summary> public static string GEAR_EP3_PatientHistory03 { get { return ResourceManager.GetString("GEAR_EP3_PatientHistory03", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Blood Soaked Note. /// </summary> public static string GEAR_EP3_PatientHistory04 { get { return ResourceManager.GetString("GEAR_EP3_PatientHistory04", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Blood Soaked Note. /// </summary> public static string GEAR_EP3_PatientHistory05 { get { return ResourceManager.GetString("GEAR_EP3_PatientHistory05", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Blood Soaked Note. /// </summary> public static string GEAR_EP3_PatientHistory06 { get { return ResourceManager.GetString("GEAR_EP3_PatientHistory06", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Forest Talker Collectible, Part One. /// </summary> public static string GEAR_Ep3ForestTalkers_FTCollectible1 { get { return ResourceManager.GetString("GEAR_Ep3ForestTalkers_FTCollectible1", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Forest Talker Collectible, Part Two. /// </summary> public static string GEAR_Ep3ForestTalkers_FTCollectible2 { get { return ResourceManager.GetString("GEAR_Ep3ForestTalkers_FTCollectible2", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Forest Talker Collectible, Part Three. /// </summary> public static string GEAR_Ep3ForestTalkers_FTCollectible3 { get { return ResourceManager.GetString("GEAR_Ep3ForestTalkers_FTCollectible3", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Pleasant Valley Collectible, Part One. /// </summary> public static string GEAR_Ep3ForestTalkers_PVCollectible1 { get { return ResourceManager.GetString("GEAR_Ep3ForestTalkers_PVCollectible1", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Pleasant Valley Collectible, Part Two. /// </summary> public static string GEAR_Ep3ForestTalkers_PVCollectible2 { get { return ResourceManager.GetString("GEAR_Ep3ForestTalkers_PVCollectible2", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Pleasant Valley Collectible, Part Three. /// </summary> public static string GEAR_Ep3ForestTalkers_PVCollectible3 { get { return ResourceManager.GetString("GEAR_Ep3ForestTalkers_PVCollectible3", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Community Hall Flyer. /// </summary> public static string GEAR_Ep3HallFlyer { get { return ResourceManager.GetString("GEAR_Ep3HallFlyer", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Rosary. /// </summary> public static string GEAR_Ep3Rosary { get { return ResourceManager.GetString("GEAR_Ep3Rosary", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Map Of Pleasant Valley. /// </summary> public static string GEAR_Ep3TomsMap { get { return ResourceManager.GetString("GEAR_Ep3TomsMap", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Bank Deposit Box Key (#15). /// </summary> public static string GEAR_FarmerDepositBoxKey { get { return ResourceManager.GetString("GEAR_FarmerDepositBoxKey", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Farmer&apos;s Almanac. /// </summary> public static string GEAR_FarmersAlmanac { get { return ResourceManager.GetString("GEAR_FarmersAlmanac", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Fire Axe. /// </summary> public static string GEAR_FireAxe { get { return ResourceManager.GetString("GEAR_FireAxe", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Firelog. /// </summary> public static string GEAR_Firelog { get { return ResourceManager.GetString("GEAR_Firelog", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Firestriker. /// </summary> public static string GEAR_Firestriker { get { return ResourceManager.GetString("GEAR_Firestriker", resourceCulture); } } /// <summary> /// Looks up a localized string similar to First Aid Manual. /// </summary> public static string GEAR_FirstAidManual { get { return ResourceManager.GetString("GEAR_FirstAidManual", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Fisherman&apos;s Sweater. /// </summary> public static string GEAR_FishermanSweater { get { return ResourceManager.GetString("GEAR_FishermanSweater", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Line. /// </summary> public static string GEAR_FishingLine { get { return ResourceManager.GetString("GEAR_FishingLine", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Jeremiah&apos;s Repaired Rifle. /// </summary> public static string GEAR_FixedRifle { get { return ResourceManager.GetString("GEAR_FixedRifle", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Flare. /// </summary> public static string GEAR_FlareA { get { return ResourceManager.GetString("GEAR_FlareA", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Distress Pistol. /// </summary> public static string GEAR_FlareGun { get { return ResourceManager.GetString("GEAR_FlareGun", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Flare Shell. /// </summary> public static string GEAR_FlareGunAmmoSingle { get { return ResourceManager.GetString("GEAR_FlareGunAmmoSingle", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Distress Pistol Kit. /// </summary> public static string GEAR_FlareGunCase_hangar { get { return ResourceManager.GetString("GEAR_FlareGunCase_hangar", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Flashlight. /// </summary> public static string GEAR_Flashlight { get { return ResourceManager.GetString("GEAR_Flashlight", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Fleece Mittens. /// </summary> public static string GEAR_FleeceMittens { get { return ResourceManager.GetString("GEAR_FleeceMittens", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Sweatshirt. /// </summary> public static string GEAR_FleeceSweater { get { return ResourceManager.GetString("GEAR_FleeceSweater", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Flint &amp; Steel. /// </summary> public static string GEAR_FlintAndSteel { get { return ResourceManager.GetString("GEAR_FlintAndSteel", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Emergency Food. /// </summary> public static string GEAR_FoodSupplies_hangar { get { return ResourceManager.GetString("GEAR_FoodSupplies_hangar", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Forest Talker Dam Note. /// </summary> public static string GEAR_ForestTalkerDamNote { get { return ResourceManager.GetString("GEAR_ForestTalkerDamNote", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Forest Talker Flyer. /// </summary> public static string GEAR_ForestTalkerFlyer { get { return ResourceManager.GetString("GEAR_ForestTalkerFlyer", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Forest Talker Documents. /// </summary> public static string GEAR_ForestTalkerHiddenItem { get { return ResourceManager.GetString("GEAR_ForestTalkerHiddenItem", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Forest Talker Map Note. /// </summary> public static string GEAR_ForestTalkerMap { get { return ResourceManager.GetString("GEAR_ForestTalkerMap", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Forest Talker Note. /// </summary> public static string GEAR_ForestTalkerThankyou { get { return ResourceManager.GetString("GEAR_ForestTalkerThankyou", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Forest Talker Note. /// </summary> public static string GEAR_ForestTalkerThankyou2 { get { return ResourceManager.GetString("GEAR_ForestTalkerThankyou2", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Forge Blueprints. /// </summary> public static string GEAR_ForgeBlueprints { get { return ResourceManager.GetString("GEAR_ForgeBlueprints", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Gauntlets. /// </summary> public static string GEAR_Gauntlets { get { return ResourceManager.GetString("GEAR_Gauntlets", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Winter Forecast. /// </summary> public static string GEAR_GMExtraSuppliesNote { get { return ResourceManager.GetString("GEAR_GMExtraSuppliesNote", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Granola Bar. /// </summary> public static string GEAR_GranolaBar { get { return ResourceManager.GetString("GEAR_GranolaBar", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Cup of Herbal Tea. /// </summary> public static string GEAR_GreenTeaCup { get { return ResourceManager.GetString("GEAR_GreenTeaCup", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Herbal Tea. /// </summary> public static string GEAR_GreenTeaPackage { get { return ResourceManager.GetString("GEAR_GreenTeaPackage", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Mountaineering Boots. /// </summary> public static string GEAR_GreyMotherBoots { get { return ResourceManager.GetString("GEAR_GreyMotherBoots", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Grey Mother&apos;s Pearls. /// </summary> public static string GEAR_GreyMotherPearls { get { return ResourceManager.GetString("GEAR_GreyMotherPearls", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Lily&apos;s Trunk Key. /// </summary> public static string GEAR_GreyMotherTrunkKey { get { return ResourceManager.GetString("GEAR_GreyMotherTrunkKey", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Can of Gunpowder. /// </summary> public static string GEAR_GunpowderCan { get { return ResourceManager.GetString("GEAR_GunpowderCan", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Fresh Gut. /// </summary> public static string GEAR_Gut { get { return ResourceManager.GetString("GEAR_Gut", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Cured Gut. /// </summary> public static string GEAR_GutDried { get { return ResourceManager.GetString("GEAR_GutDried", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Hacksaw. /// </summary> public static string GEAR_Hacksaw { get { return ResourceManager.GetString("GEAR_Hacksaw", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Heavy Hammer. /// </summary> public static string GEAR_Hammer { get { return ResourceManager.GetString("GEAR_Hammer", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Hank&apos;s Prepper Cache Code. /// </summary> public static string GEAR_HankHatchCode { get { return ResourceManager.GetString("GEAR_HankHatchCode", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Hank&apos;s Journal - Part One. /// </summary> public static string GEAR_HankJournal1 { get { return ResourceManager.GetString("GEAR_HankJournal1", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Hank&apos;s Journal - Part Two. /// </summary> public static string GEAR_HankJournal2 { get { return ResourceManager.GetString("GEAR_HankJournal2", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Hank&apos;s Lock Box Key. /// </summary> public static string GEAR_HankLockboxKey { get { return ResourceManager.GetString("GEAR_HankLockboxKey", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Letter for Hank&apos;s Niece. /// </summary> public static string GEAR_HankNeiceLetter { get { return ResourceManager.GetString("GEAR_HankNeiceLetter", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Astrid&apos;s Hardcase. /// </summary> public static string GEAR_HardCase { get { return ResourceManager.GetString("GEAR_HardCase", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Astrid&apos;s Hardcase. /// </summary> public static string GEAR_HardCase_hangar { get { return ResourceManager.GetString("GEAR_HardCase_hangar", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Fir Firewood. /// </summary> public static string GEAR_Hardwood { get { return ResourceManager.GetString("GEAR_Hardwood", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Hatchet. /// </summary> public static string GEAR_Hatchet { get { return ResourceManager.GetString("GEAR_Hatchet", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Improvised Hatchet. /// </summary> public static string GEAR_HatchetImprovised { get { return ResourceManager.GetString("GEAR_HatchetImprovised", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Charcoal Note. /// </summary> public static string GEAR_HC_EP1_FM_TreeRoots_Dir { get { return ResourceManager.GetString("GEAR_HC_EP1_FM_TreeRoots_Dir", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Crumpled Note. /// </summary> public static string GEAR_HC_EP1_ML_AlansCave_Dir { get { return ResourceManager.GetString("GEAR_HC_EP1_ML_AlansCave_Dir", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Simple Note. /// </summary> public static string GEAR_HC_EP1_ML_ClearCut_Dir { get { return ResourceManager.GetString("GEAR_HC_EP1_ML_ClearCut_Dir", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Illegible Note. /// </summary> public static string GEAR_HC_EP1_ML_TracksEnt_Dir { get { return ResourceManager.GetString("GEAR_HC_EP1_ML_TracksEnt_Dir", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Handwritten Note. /// </summary> public static string GEAR_HC_EP1_RW_HunterLodge_Dir { get { return ResourceManager.GetString("GEAR_HC_EP1_RW_HunterLodge_Dir", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Blood Soaked Note. /// </summary> public static string GEAR_HC_EP1_RW_RavineEnd_Dir { get { return ResourceManager.GetString("GEAR_HC_EP1_RW_RavineEnd_Dir", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Bandage. /// </summary> public static string GEAR_HeavyBandage { get { return ResourceManager.GetString("GEAR_HeavyBandage", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Old Fashioned Parka. /// </summary> public static string GEAR_HeavyParka { get { return ResourceManager.GetString("GEAR_HeavyParka", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Thick Wool Sweater. /// </summary> public static string GEAR_HeavyWoolSweater { get { return ResourceManager.GetString("GEAR_HeavyWoolSweater", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Quality Tools. /// </summary> public static string GEAR_HighQualityTools { get { return ResourceManager.GetString("GEAR_HighQualityTools", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Hiker&apos;s Backpack. /// </summary> public static string GEAR_HikersBackPack { get { return ResourceManager.GetString("GEAR_HikersBackPack", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Home-made Soup. /// </summary> public static string GEAR_HomeMadeSoup { get { return ResourceManager.GetString("GEAR_HomeMadeSoup", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Hook. /// </summary> public static string GEAR_Hook { get { return ResourceManager.GetString("GEAR_Hook", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Fishing Tackle. /// </summary> public static string GEAR_HookAndLine { get { return ResourceManager.GetString("GEAR_HookAndLine", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Hunter Journal Page. /// </summary> public static string GEAR_HunterJournalPage { get { return ResourceManager.GetString("GEAR_HunterJournalPage", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Improvised Head Wrap. /// </summary> public static string GEAR_ImprovisedHat { get { return ResourceManager.GetString("GEAR_ImprovisedHat", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Improvised Hand Wraps. /// </summary> public static string GEAR_ImprovisedMittens { get { return ResourceManager.GetString("GEAR_ImprovisedMittens", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Insulated Boots. /// </summary> public static string GEAR_InsulatedBoots { get { return ResourceManager.GetString("GEAR_InsulatedBoots", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Snow Pants. /// </summary> public static string GEAR_InsulatedPants { get { return ResourceManager.GetString("GEAR_InsulatedPants", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Sport Vest. /// </summary> public static string GEAR_InsulatedVest { get { return ResourceManager.GetString("GEAR_InsulatedVest", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Jeans. /// </summary> public static string GEAR_Jeans { get { return ResourceManager.GetString("GEAR_Jeans", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Jeremiah&apos;s Knife. /// </summary> public static string GEAR_JeremiahKnife { get { return ResourceManager.GetString("GEAR_JeremiahKnife", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Jeremiah&apos;s Bearskin Coat. /// </summary> public static string GEAR_JeremiahsCoat { get { return ResourceManager.GetString("GEAR_JeremiahsCoat", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Jerry Can. /// </summary> public static string GEAR_JerrycanRusty { get { return ResourceManager.GetString("GEAR_JerrycanRusty", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Storm Lantern. /// </summary> public static string GEAR_KeroseneLampB { get { return ResourceManager.GetString("GEAR_KeroseneLampB", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Hunting Knife. /// </summary> public static string GEAR_Knife { get { return ResourceManager.GetString("GEAR_Knife", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Improvised Knife. /// </summary> public static string GEAR_KnifeImprovised { get { return ResourceManager.GetString("GEAR_KnifeImprovised", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Scrap Metal Shard. /// </summary> public static string GEAR_KnifeScrapMetal { get { return ResourceManager.GetString("GEAR_KnifeScrapMetal", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Knife Scrap Metal Clean. /// </summary> public static string GEAR_KnifeScrapMetal_Clean { get { return ResourceManager.GetString("GEAR_KnifeScrapMetal_Clean", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Carter Hydro Dam. /// </summary> public static string GEAR_KnowledgeCarterDam { get { return ResourceManager.GetString("GEAR_KnowledgeCarterDam", resourceCulture); } } /// <summary> /// Looks up a localized string similar to History of The Collapse, Part One. /// </summary> public static string GEAR_KnowledgeCollapse1 { get { return ResourceManager.GetString("GEAR_KnowledgeCollapse1", resourceCulture); } } /// <summary> /// Looks up a localized string similar to History of The Collapse, Part Two. /// </summary> public static string GEAR_KnowledgeCollapse2 { get { return ResourceManager.GetString("GEAR_KnowledgeCollapse2", resourceCulture); } } /// <summary> /// Looks up a localized string similar to History of The Collapse, Part Three. /// </summary> public static string GEAR_KnowledgeCollapse3 { get { return ResourceManager.GetString("GEAR_KnowledgeCollapse3", resourceCulture); } } /// <summary> /// Looks up a localized string similar to History of the Collapse, Part Four. /// </summary> public static string GEAR_KnowledgeCollapse4 { get { return ResourceManager.GetString("GEAR_KnowledgeCollapse4", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Town of Milton. /// </summary> public static string GEAR_KnowledgeMilton { get { return ResourceManager.GetString("GEAR_KnowledgeMilton", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Mystery Lake &amp; Area. /// </summary> public static string GEAR_KnowledgeMysteryLake { get { return ResourceManager.GetString("GEAR_KnowledgeMysteryLake", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Pleasant Valley History, Part One. /// </summary> public static string GEAR_KnowledgePVbook1 { get { return ResourceManager.GetString("GEAR_KnowledgePVbook1", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Pleasant Valley History, Part Two. /// </summary> public static string GEAR_KnowledgePVbook2 { get { return ResourceManager.GetString("GEAR_KnowledgePVbook2", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Pleasant Valley History, Part Three. /// </summary> public static string GEAR_KnowledgePVbook3 { get { return ResourceManager.GetString("GEAR_KnowledgePVbook3", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Key To Lake Cabin #1. /// </summary> public static string GEAR_LakeCabinKey1 { get { return ResourceManager.GetString("GEAR_LakeCabinKey1", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Key To Lake Cabin #2. /// </summary> public static string GEAR_LakeCabinKey2 { get { return ResourceManager.GetString("GEAR_LakeCabinKey2", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Key To Lake Cabin #3. /// </summary> public static string GEAR_LakeCabinKey3 { get { return ResourceManager.GetString("GEAR_LakeCabinKey3", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Torn Paper. /// </summary> public static string GEAR_LakeDeerHuntNote { get { return ResourceManager.GetString("GEAR_LakeDeerHuntNote", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Crumpled Note. /// </summary> public static string GEAR_LakeIncidentNote { get { return ResourceManager.GetString("GEAR_LakeIncidentNote", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Off Season Fun. /// </summary> public static string GEAR_LakeLetter1 { get { return ResourceManager.GetString("GEAR_LakeLetter1", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Logging Camp Trailer Key. /// </summary> public static string GEAR_LakeTrailerKey1 { get { return ResourceManager.GetString("GEAR_LakeTrailerKey1", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Lantern Fuel. /// </summary> public static string GEAR_LampFuel { get { return ResourceManager.GetString("GEAR_LampFuel", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Lantern Fuel. /// </summary> public static string GEAR_LampFuelFull { get { return ResourceManager.GetString("GEAR_LampFuelFull", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Fresh Leather. /// </summary> public static string GEAR_Leather { get { return ResourceManager.GetString("GEAR_Leather", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Cured Leather. /// </summary> public static string GEAR_LeatherDried { get { return ResourceManager.GetString("GEAR_LeatherDried", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Fresh Deer Hide. /// </summary> public static string GEAR_LeatherHide { get { return ResourceManager.GetString("GEAR_LeatherHide", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Cured Deer Hide. /// </summary> public static string GEAR_LeatherHideDried { get { return ResourceManager.GetString("GEAR_LeatherHideDried", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Leather Shoes. /// </summary> public static string GEAR_LeatherShoes { get { return ResourceManager.GetString("GEAR_LeatherShoes", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Fresh Leather. /// </summary> public static string GEAR_LeatherStrips { get { return ResourceManager.GetString("GEAR_LeatherStrips", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Jeremiah&apos;s Letters. /// </summary> public static string GEAR_LetterBundle { get { return ResourceManager.GetString("GEAR_LetterBundle", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Simple Parka. /// </summary> public static string GEAR_LightParka { get { return ResourceManager.GetString("GEAR_LightParka", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Lyly&apos;s Map. /// </summary> public static string GEAR_LilyClimbMap { get { return ResourceManager.GetString("GEAR_LilyClimbMap", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Line. /// </summary> public static string GEAR_Line { get { return ResourceManager.GetString("GEAR_Line", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Thermal Underwear. /// </summary> public static string GEAR_LongUnderwear { get { return ResourceManager.GetString("GEAR_LongUnderwear", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Thermal Underwear (Start). /// </summary> public static string GEAR_LongUnderwearStart { get { return ResourceManager.GetString("GEAR_LongUnderwearStart", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Wool Longjohns. /// </summary> public static string GEAR_LongUnderwearWool { get { return ResourceManager.GetString("GEAR_LongUnderwearWool", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Mackinaw Jacket. /// </summary> public static string GEAR_MackinawJacket { get { return ResourceManager.GetString("GEAR_MackinawJacket", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Magnifying Lens. /// </summary> public static string GEAR_MagnifyingLens { get { return ResourceManager.GetString("GEAR_MagnifyingLens", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Green Maple Sapling. /// </summary> public static string GEAR_MapleSapling { get { return ResourceManager.GetString("GEAR_MapleSapling", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Cured Maple Sapling. /// </summary> public static string GEAR_MapleSaplingDried { get { return ResourceManager.GetString("GEAR_MapleSaplingDried", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Map Snippet Mt. /// </summary> public static string GEAR_MapSnippetMt { get { return ResourceManager.GetString("GEAR_MapSnippetMt", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Map To Railyard. /// </summary> public static string GEAR_MapToRailyard { get { return ResourceManager.GetString("GEAR_MapToRailyard", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Carter Hydro Medical Supplies. /// </summary> public static string GEAR_MedicalSupplies { get { return ResourceManager.GetString("GEAR_MedicalSupplies", resourceCulture); } } /// <summary> /// Looks up a localized string similar to First Aid Kit. /// </summary> public static string GEAR_MedicalSupplies_hangar { get { return ResourceManager.GetString("GEAR_MedicalSupplies_hangar", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Military Coat. /// </summary> public static string GEAR_MilitaryParka { get { return ResourceManager.GetString("GEAR_MilitaryParka", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Lost In The Storm. /// </summary> public static string GEAR_MiltonCaveLetter { get { return ResourceManager.GetString("GEAR_MiltonCaveLetter", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Bank Deposit Box Key (#7). /// </summary> public static string GEAR_MiltonDepositBoxKey1 { get { return ResourceManager.GetString("GEAR_MiltonDepositBoxKey1", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Bank Deposit Box Key (#13). /// </summary> public static string GEAR_MiltonDepositBoxKey2 { get { return ResourceManager.GetString("GEAR_MiltonDepositBoxKey2", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Bank Deposit Box Key (#20). /// </summary> public static string GEAR_MiltonDepositBoxKey3 { get { return ResourceManager.GetString("GEAR_MiltonDepositBoxKey3", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Highway Robbery. /// </summary> public static string GEAR_MiltonFlareGunNote { get { return ResourceManager.GetString("GEAR_MiltonFlareGunNote", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Medicine in my backyard. /// </summary> public static string GEAR_MiltonGardenCache { get { return ResourceManager.GetString("GEAR_MiltonGardenCache", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Tearful Letter. /// </summary> public static string GEAR_MiltonLetter1 { get { return ResourceManager.GetString("GEAR_MiltonLetter1", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Betrayal. /// </summary> public static string GEAR_MiltonLetter2 { get { return ResourceManager.GetString("GEAR_MiltonLetter2", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Milton Post Office Note. /// </summary> public static string GEAR_MiltonPostOfficeCollectible1 { get { return ResourceManager.GetString("GEAR_MiltonPostOfficeCollectible1", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Orca Gas Store Notice. /// </summary> public static string GEAR_MiltonStoreNotice { get { return ResourceManager.GetString("GEAR_MiltonStoreNotice", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Wool Mittens. /// </summary> public static string GEAR_Mittens { get { return ResourceManager.GetString("GEAR_Mittens", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Fresh Moose Hide. /// </summary> public static string GEAR_MooseHide { get { return ResourceManager.GetString("GEAR_MooseHide", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Moose-Hide Satchel. /// </summary> public static string GEAR_MooseHideBag { get { return ResourceManager.GetString("GEAR_MooseHideBag", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Moose-Hide Cloak. /// </summary> public static string GEAR_MooseHideCloak { get { return ResourceManager.GetString("GEAR_MooseHideCloak", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Cured Moose Hide. /// </summary> public static string GEAR_MooseHideDried { get { return ResourceManager.GetString("GEAR_MooseHideDried", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Moose Quarter. /// </summary> public static string GEAR_MooseQuarter { get { return ResourceManager.GetString("GEAR_MooseQuarter", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Morphine. /// </summary> public static string GEAR_Morphine { get { return ResourceManager.GetString("GEAR_Morphine", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Paradise Meadows Farm Key. /// </summary> public static string GEAR_MountainTownFarmKey { get { return ResourceManager.GetString("GEAR_MountainTownFarmKey", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Mountain Town Farm Note. /// </summary> public static string GEAR_MountainTownFarmNote { get { return ResourceManager.GetString("GEAR_MountainTownFarmNote", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Mountain Town Lock Box Key. /// </summary> public static string GEAR_MountainTownLockBoxKey { get { return ResourceManager.GetString("GEAR_MountainTownLockBoxKey", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Mountain Town Map. /// </summary> public static string GEAR_MountainTownMap { get { return ResourceManager.GetString("GEAR_MountainTownMap", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Mountain Town Store Key. /// </summary> public static string GEAR_MountainTownStoreKey { get { return ResourceManager.GetString("GEAR_MountainTownStoreKey", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Military-Grade MRE. /// </summary> public static string GEAR_MRE { get { return ResourceManager.GetString("GEAR_MRE", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Mukluks. /// </summary> public static string GEAR_MuklukBoots { get { return ResourceManager.GetString("GEAR_MuklukBoots", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Newsprint. /// </summary> public static string GEAR_Newsprint { get { return ResourceManager.GetString("GEAR_Newsprint", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Newsprint Roll. /// </summary> public static string GEAR_NewsprintRoll { get { return ResourceManager.GetString("GEAR_NewsprintRoll", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Milton Credit Union Letter. /// </summary> public static string GEAR_NoteMCU { get { return ResourceManager.GetString("GEAR_NoteMCU", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Grey Mother&apos;s Safety Deposit Box. /// </summary> public static string GEAR_OldLadyStolenItem { get { return ResourceManager.GetString("GEAR_OldLadyStolenItem", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Old Man&apos;s Beard Wound Dressing. /// </summary> public static string GEAR_OldMansBeardDressing { get { return ResourceManager.GetString("GEAR_OldMansBeardDressing", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Old Man&apos;s Beard Lichen. /// </summary> public static string GEAR_OldMansBeardHarvested { get { return ResourceManager.GetString("GEAR_OldMansBeardHarvested", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Overpass Brochure. /// </summary> public static string GEAR_OverpassBrochure { get { return ResourceManager.GetString("GEAR_OverpassBrochure", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Cardboard Matches. /// </summary> public static string GEAR_PackMatches { get { return ResourceManager.GetString("GEAR_PackMatches", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Stack of Papers. /// </summary> public static string GEAR_PaperStack { get { return ResourceManager.GetString("GEAR_PaperStack", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Passenger Manifest. /// </summary> public static string GEAR_PassengerManifest { get { return ResourceManager.GetString("GEAR_PassengerManifest", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Peanut Butter. /// </summary> public static string GEAR_PeanutButter { get { return ResourceManager.GetString("GEAR_PeanutButter", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Pinnacle Peaches. /// </summary> public static string GEAR_PinnacleCanPeaches { get { return ResourceManager.GetString("GEAR_PinnacleCanPeaches", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Rabbit Carcass. /// </summary> public static string GEAR_Placeholder { get { return ResourceManager.GetString("GEAR_Placeholder", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Plaid Shirt. /// </summary> public static string GEAR_PlaidShirt { get { return ResourceManager.GetString("GEAR_PlaidShirt", resourceCulture); } } /// <summary> /// Looks up a localized string similar to ID: S. Gagne. /// </summary> public static string GEAR_PlaneCrashID1 { get { return ResourceManager.GetString("GEAR_PlaneCrashID1", resourceCulture); } } /// <summary> /// Looks up a localized string similar to ID: G. Russel. /// </summary> public static string GEAR_PlaneCrashID10 { get { return ResourceManager.GetString("GEAR_PlaneCrashID10", resourceCulture); } } /// <summary> /// Looks up a localized string similar to ID: K. Morrison. /// </summary> public static string GEAR_PlaneCrashID2 { get { return ResourceManager.GetString("GEAR_PlaneCrashID2", resourceCulture); } } /// <summary> /// Looks up a localized string similar to ID: F. Leblanc. /// </summary> public static string GEAR_PlaneCrashID3 { get { return ResourceManager.GetString("GEAR_PlaneCrashID3", resourceCulture); } } /// <summary> /// Looks up a localized string similar to ID: D. Belanger. /// </summary> public static string GEAR_PlaneCrashID4 { get { return ResourceManager.GetString("GEAR_PlaneCrashID4", resourceCulture); } } /// <summary> /// Looks up a localized string similar to ID: R. Tan. /// </summary> public static string GEAR_PlaneCrashID5 { get { return ResourceManager.GetString("GEAR_PlaneCrashID5", resourceCulture); } } /// <summary> /// Looks up a localized string similar to ID: V. Singh. /// </summary> public static string GEAR_PlaneCrashID6 { get { return ResourceManager.GetString("GEAR_PlaneCrashID6", resourceCulture); } } /// <summary> /// Looks up a localized string similar to ID: A. Lewis. /// </summary> public static string GEAR_PlaneCrashID7 { get { return ResourceManager.GetString("GEAR_PlaneCrashID7", resourceCulture); } } /// <summary> /// Looks up a localized string similar to ID: T. Chan. /// </summary> public static string GEAR_PlaneCrashID8 { get { return ResourceManager.GetString("GEAR_PlaneCrashID8", resourceCulture); } } /// <summary> /// Looks up a localized string similar to ID: O. Gould. /// </summary> public static string GEAR_PlaneCrashID9 { get { return ResourceManager.GetString("GEAR_PlaneCrashID9", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Expedition Parka. /// </summary> public static string GEAR_PremiumWinterCoat { get { return ResourceManager.GetString("GEAR_PremiumWinterCoat", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Prison Transport Manifest. /// </summary> public static string GEAR_PrisonBusNote { get { return ResourceManager.GetString("GEAR_PrisonBusNote", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Prybar. /// </summary> public static string GEAR_Prybar { get { return ResourceManager.GetString("GEAR_Prybar", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Pumpkin Pie. /// </summary> public static string GEAR_PumpkinPie { get { return ResourceManager.GetString("GEAR_PumpkinPie", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Mariner&apos;s Pea Coat. /// </summary> public static string GEAR_QualityWinterCoat { get { return ResourceManager.GetString("GEAR_QualityWinterCoat", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Rabbit Carcass. /// </summary> public static string GEAR_RabbitCarcass { get { return ResourceManager.GetString("GEAR_RabbitCarcass", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Fresh Rabbit Pelt. /// </summary> public static string GEAR_RabbitPelt { get { return ResourceManager.GetString("GEAR_RabbitPelt", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Cured Rabbit Pelt. /// </summary> public static string GEAR_RabbitPeltDried { get { return ResourceManager.GetString("GEAR_RabbitPeltDried", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Rabbitskin Hat. /// </summary> public static string GEAR_RabbitskinHat { get { return ResourceManager.GetString("GEAR_RabbitskinHat", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Rabbitskin Mitts. /// </summary> public static string GEAR_RabbitSkinMittens { get { return ResourceManager.GetString("GEAR_RabbitSkinMittens", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Radio Parts. /// </summary> public static string GEAR_RadioParts { get { return ResourceManager.GetString("GEAR_RadioParts", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Coho Salmon (Raw). /// </summary> public static string GEAR_RawCohoSalmon { get { return ResourceManager.GetString("GEAR_RawCohoSalmon", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Lake Whitefish (Raw). /// </summary> public static string GEAR_RawLakeWhiteFish { get { return ResourceManager.GetString("GEAR_RawLakeWhiteFish", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Black Bear Meat. /// </summary> public static string GEAR_RawMeatBear { get { return ResourceManager.GetString("GEAR_RawMeatBear", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Venison (Raw). /// </summary> public static string GEAR_RawMeatDeer { get { return ResourceManager.GetString("GEAR_RawMeatDeer", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Moose Meat. /// </summary> public static string GEAR_RawMeatMoose { get { return ResourceManager.GetString("GEAR_RawMeatMoose", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Rabbit (Raw). /// </summary> public static string GEAR_RawMeatRabbit { get { return ResourceManager.GetString("GEAR_RawMeatRabbit", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Wolf Meat (Raw). /// </summary> public static string GEAR_RawMeatWolf { get { return ResourceManager.GetString("GEAR_RawMeatWolf", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Rainbow Trout (Raw). /// </summary> public static string GEAR_RawRainbowTrout { get { return ResourceManager.GetString("GEAR_RawRainbowTrout", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Smallmouth Bass (Raw). /// </summary> public static string GEAR_RawSmallMouthBass { get { return ResourceManager.GetString("GEAR_RawSmallMouthBass", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Reclaimed Wood. /// </summary> public static string GEAR_ReclaimedWoodB { get { return ResourceManager.GetString("GEAR_ReclaimedWoodB", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Recycled Can. /// </summary> public static string GEAR_RecycledCan { get { return ResourceManager.GetString("GEAR_RecycledCan", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Reishi Mushroom. /// </summary> public static string GEAR_ReishiMushroom { get { return ResourceManager.GetString("GEAR_ReishiMushroom", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Prepared Reishi Mushrooms. /// </summary> public static string GEAR_ReishiPrepared { get { return ResourceManager.GetString("GEAR_ReishiPrepared", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Reishi Tea. /// </summary> public static string GEAR_ReishiTea { get { return ResourceManager.GetString("GEAR_ReishiTea", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Revolver. /// </summary> public static string GEAR_Revolver { get { return ResourceManager.GetString("GEAR_Revolver", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Revolver Ammunition. /// </summary> public static string GEAR_RevolverAmmoBox { get { return ResourceManager.GetString("GEAR_RevolverAmmoBox", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Revolver Shell Casing. /// </summary> public static string GEAR_RevolverAmmoCasing { get { return ResourceManager.GetString("GEAR_RevolverAmmoCasing", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Revolver Cartridge. /// </summary> public static string GEAR_RevolverAmmoSingle { get { return ResourceManager.GetString("GEAR_RevolverAmmoSingle", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Rick&apos;s Journal. /// </summary> public static string GEAR_RicksJournal { get { return ResourceManager.GetString("GEAR_RicksJournal", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Hunting Rifle. /// </summary> public static string GEAR_Rifle { get { return ResourceManager.GetString("GEAR_Rifle", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Rifle Ammunition. /// </summary> public static string GEAR_RifleAmmoBox { get { return ResourceManager.GetString("GEAR_RifleAmmoBox", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Rifle Shell Casing. /// </summary> public static string GEAR_RifleAmmoCasing { get { return ResourceManager.GetString("GEAR_RifleAmmoCasing", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Rifle Cartridge. /// </summary> public static string GEAR_RifleAmmoSingle { get { return ResourceManager.GetString("GEAR_RifleAmmoSingle", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Rifle Blanks. /// </summary> public static string GEAR_RifleBlanks { get { return ResourceManager.GetString("GEAR_RifleBlanks", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Rifle Bullets. /// </summary> public static string GEAR_RifleBullets { get { return ResourceManager.GetString("GEAR_RifleBullets", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Firearm Cleaning Kit. /// </summary> public static string GEAR_RifleCleaningKit { get { return ResourceManager.GetString("GEAR_RifleCleaningKit", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Hunting Rifle. /// </summary> public static string GEAR_RifleHuntingLodge { get { return ResourceManager.GetString("GEAR_RifleHuntingLodge", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Mountaineering Rope. /// </summary> public static string GEAR_Rope { get { return ResourceManager.GetString("GEAR_Rope", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Rose Hip. /// </summary> public static string GEAR_RoseHip { get { return ResourceManager.GetString("GEAR_RoseHip", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Prepared Rose hips. /// </summary> public static string GEAR_RosehipsPrepared { get { return ResourceManager.GetString("GEAR_RosehipsPrepared", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Rose Hip Tea. /// </summary> public static string GEAR_RoseHipTea { get { return ResourceManager.GetString("GEAR_RoseHipTea", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Basement Key. /// </summary> public static string GEAR_RuralRegionFarmKey { get { return ResourceManager.GetString("GEAR_RuralRegionFarmKey", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Scrap Lead. /// </summary> public static string GEAR_ScrapLead { get { return ResourceManager.GetString("GEAR_ScrapLead", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Scrap Metal. /// </summary> public static string GEAR_ScrapMetal { get { return ResourceManager.GetString("GEAR_ScrapMetal", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Sewing Kit. /// </summary> public static string GEAR_SewingKit { get { return ResourceManager.GetString("GEAR_SewingKit", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Whetstone. /// </summary> public static string GEAR_SharpeningStone { get { return ResourceManager.GetString("GEAR_SharpeningStone", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Shovel. /// </summary> public static string GEAR_Shovel { get { return ResourceManager.GetString("GEAR_Shovel", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Simple Tools. /// </summary> public static string GEAR_SimpleTools { get { return ResourceManager.GetString("GEAR_SimpleTools", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Ski Boots. /// </summary> public static string GEAR_SkiBoots { get { return ResourceManager.GetString("GEAR_SkiBoots", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Ski Gloves. /// </summary> public static string GEAR_SkiGloves { get { return ResourceManager.GetString("GEAR_SkiGloves", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Light Shell. /// </summary> public static string GEAR_SkiJacket { get { return ResourceManager.GetString("GEAR_SkiJacket", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Snare. /// </summary> public static string GEAR_Snare { get { return ResourceManager.GetString("GEAR_Snare", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Summit Soda. /// </summary> public static string GEAR_Soda { get { return ResourceManager.GetString("GEAR_Soda", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Go! Energy Drink. /// </summary> public static string GEAR_SodaEnergy { get { return ResourceManager.GetString("GEAR_SodaEnergy", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Stacy&apos;s Grape Soda. /// </summary> public static string GEAR_SodaGrape { get { return ResourceManager.GetString("GEAR_SodaGrape", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Orange Soda. /// </summary> public static string GEAR_SodaOrange { get { return ResourceManager.GetString("GEAR_SodaOrange", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Cedar Firewood. /// </summary> public static string GEAR_Softwood { get { return ResourceManager.GetString("GEAR_Softwood", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Spear Head. /// </summary> public static string GEAR_SpearHead { get { return ResourceManager.GetString("GEAR_SpearHead", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Deer Quarter. /// </summary> public static string GEAR_StagQuarter { get { return ResourceManager.GetString("GEAR_StagQuarter", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Stick. /// </summary> public static string GEAR_Stick { get { return ResourceManager.GetString("GEAR_Stick", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Stone. /// </summary> public static string GEAR_Stone { get { return ResourceManager.GetString("GEAR_Stone", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Stump Remover. /// </summary> public static string GEAR_StumpRemover { get { return ResourceManager.GetString("GEAR_StumpRemover", resourceCulture); } } /// <summary> /// Looks up a localized string similar to A Sewing Primer. /// </summary> public static string GEAR_SurvivalSchoolClothing { get { return ResourceManager.GetString("GEAR_SurvivalSchoolClothing", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Frontier Shooting Guide. /// </summary> public static string GEAR_SurvivalSchoolDeerHunt { get { return ResourceManager.GetString("GEAR_SurvivalSchoolDeerHunt", resourceCulture); } } /// <summary> /// Looks up a localized string similar to The Frozen Angler. /// </summary> public static string GEAR_SurvivalSchoolFishing { get { return ResourceManager.GetString("GEAR_SurvivalSchoolFishing", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Medicinal Plants of Great Bear. /// </summary> public static string GEAR_SurvivalSchoolPlants { get { return ResourceManager.GetString("GEAR_SurvivalSchoolPlants", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Field Dressing Your Kill, Vol. I. /// </summary> public static string GEAR_SurvivalSchoolRabbits { get { return ResourceManager.GetString("GEAR_SurvivalSchoolRabbits", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Advanced Guns Guns Guns!. /// </summary> public static string GEAR_SurvivalSchoolWolfHunt { get { return ResourceManager.GetString("GEAR_SurvivalSchoolWolfHunt", resourceCulture); } } /// <summary> /// Looks up a localized string similar to T-Shirt. /// </summary> public static string GEAR_TeeShirt { get { return ResourceManager.GetString("GEAR_TeeShirt", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Tinder Plug. /// </summary> public static string GEAR_Tinder { get { return ResourceManager.GetString("GEAR_Tinder", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Tomato Soup. /// </summary> public static string GEAR_TomatoSoupCan { get { return ResourceManager.GetString("GEAR_TomatoSoupCan", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Wool Toque. /// </summary> public static string GEAR_Toque { get { return ResourceManager.GetString("GEAR_Toque", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Torch. /// </summary> public static string GEAR_Torch { get { return ResourceManager.GetString("GEAR_Torch", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Forest Talker Supplies. /// </summary> public static string GEAR_TrailerSupplies { get { return ResourceManager.GetString("GEAR_TrailerSupplies", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Transponder Parts. /// </summary> public static string GEAR_TransponderParts { get { return ResourceManager.GetString("GEAR_TransponderParts", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Utilities Bill. /// </summary> public static string GEAR_UtilitiesBill { get { return ResourceManager.GetString("GEAR_UtilitiesBill", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Water Bottle. /// </summary> public static string GEAR_Water1000ml { get { return ResourceManager.GetString("GEAR_Water1000ml", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Water Bottle. /// </summary> public static string GEAR_Water500ml { get { return ResourceManager.GetString("GEAR_Water500ml", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Water Purification Tablets. /// </summary> public static string GEAR_WaterPurificationTablets { get { return ResourceManager.GetString("GEAR_WaterPurificationTablets", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Water (Unsafe). /// </summary> public static string GEAR_WaterSupplyNotPotable { get { return ResourceManager.GetString("GEAR_WaterSupplyNotPotable", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Water (Potable). /// </summary> public static string GEAR_WaterSupplyPotable { get { return ResourceManager.GetString("GEAR_WaterSupplyPotable", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Water Tower Note. /// </summary> public static string GEAR_WaterTowerNote { get { return ResourceManager.GetString("GEAR_WaterTowerNote", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Mackenzie&apos;s Boots. /// </summary> public static string GEAR_WillBoots { get { return ResourceManager.GetString("GEAR_WillBoots", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Mackenzie&apos;s Boots (Start). /// </summary> public static string GEAR_WillBootsStart { get { return ResourceManager.GetString("GEAR_WillBootsStart", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Mackenzie&apos;s Pants. /// </summary> public static string GEAR_WillPants { get { return ResourceManager.GetString("GEAR_WillPants", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Mackenzie&apos;s Pants (Start). /// </summary> public static string GEAR_WillPantsStart { get { return ResourceManager.GetString("GEAR_WillPantsStart", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Mackenzie&apos;s Parka. /// </summary> public static string GEAR_WillParka { get { return ResourceManager.GetString("GEAR_WillParka", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Mackenzie&apos;s Parka. /// </summary> public static string GEAR_WillParka_Tossed { get { return ResourceManager.GetString("GEAR_WillParka_Tossed", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Mackenzie&apos;s Shirt. /// </summary> public static string GEAR_WillShirt { get { return ResourceManager.GetString("GEAR_WillShirt", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Mackenzie&apos;s Shirt (Start). /// </summary> public static string GEAR_WillShirtStart { get { return ResourceManager.GetString("GEAR_WillShirtStart", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Mackenzie&apos;s Sweater. /// </summary> public static string GEAR_WillSweater { get { return ResourceManager.GetString("GEAR_WillSweater", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Mackenzie&apos;s Sweater (Start). /// </summary> public static string GEAR_WillSweaterStart { get { return ResourceManager.GetString("GEAR_WillSweaterStart", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Mackenzie&apos;s Toque. /// </summary> public static string GEAR_WillToque { get { return ResourceManager.GetString("GEAR_WillToque", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Wolf Carcass. /// </summary> public static string GEAR_WolfCarcass { get { return ResourceManager.GetString("GEAR_WolfCarcass", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Fresh Wolf Pelt. /// </summary> public static string GEAR_WolfPelt { get { return ResourceManager.GetString("GEAR_WolfPelt", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Cured Wolf Pelt. /// </summary> public static string GEAR_WolfPeltDried { get { return ResourceManager.GetString("GEAR_WolfPeltDried", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Wolf Quarter. /// </summary> public static string GEAR_WolfQuarter { get { return ResourceManager.GetString("GEAR_WolfQuarter", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Wolfskin Coat. /// </summary> public static string GEAR_WolfSkinCape { get { return ResourceManager.GetString("GEAR_WolfSkinCape", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Wood Matches. /// </summary> public static string GEAR_WoodMatches { get { return ResourceManager.GetString("GEAR_WoodMatches", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Wool Shirt. /// </summary> public static string GEAR_WoolShirt { get { return ResourceManager.GetString("GEAR_WoolShirt", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Wool Socks. /// </summary> public static string GEAR_WoolSocks { get { return ResourceManager.GetString("GEAR_WoolSocks", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Thin Wool Sweater. /// </summary> public static string GEAR_WoolSweater { get { return ResourceManager.GetString("GEAR_WoolSweater", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Long Wool Scarf. /// </summary> public static string GEAR_WoolWrap { get { return ResourceManager.GetString("GEAR_WoolWrap", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Fleece Cowl. /// </summary> public static string GEAR_WoolWrapCap { get { return ResourceManager.GetString("GEAR_WoolWrapCap", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Work Boots. /// </summary> public static string GEAR_WorkBoots { get { return ResourceManager.GetString("GEAR_WorkBoots", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Work Gloves. /// </summary> public static string GEAR_WorkGloves { get { return ResourceManager.GetString("GEAR_WorkGloves", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Work Pants. /// </summary> public static string GEAR_WorkPants { get { return ResourceManager.GetString("GEAR_WorkPants", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Gunsmithing skillpoints. /// </summary> public static string GunsmithingSkillSP { get { return ResourceManager.GetString("GunsmithingSkillSP", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Guts. /// </summary> public static string GutAmount { get { return ResourceManager.GetString("GutAmount", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Health. /// </summary> public static string Health { get { return ResourceManager.GetString("Health", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Hidden. /// </summary> public static string Hidden { get { return ResourceManager.GetString("Hidden", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Hides. /// </summary> public static string HideAmount { get { return ResourceManager.GetString("HideAmount", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Ice fishing skillpoints. /// </summary> public static string IceFishingSP { get { return ResourceManager.GetString("IceFishingSP", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Infinite carry. /// </summary> public static string InfiniteCarry { get { return ResourceManager.GetString("InfiniteCarry", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Injuries. /// </summary> public static string Injuries { get { return ResourceManager.GetString("Injuries", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Inventory. /// </summary> public static string Inventory { get { return ResourceManager.GetString("Inventory", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Invulnerable. /// </summary> public static string Invulnerable { get { return ResourceManager.GetString("Invulnerable", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Books. /// </summary> public static string ItemCategory_Books { get { return ResourceManager.GetString("ItemCategory_Books", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Clothing. /// </summary> public static string ItemCategory_Clothing { get { return ResourceManager.GetString("ItemCategory_Clothing", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Collectible. /// </summary> public static string ItemCategory_Collectible { get { return ResourceManager.GetString("ItemCategory_Collectible", resourceCulture); } } /// <summary> /// Looks up a localized string similar to First Aid. /// </summary> public static string ItemCategory_FirstAid { get { return ResourceManager.GetString("ItemCategory_FirstAid", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Food. /// </summary> public static string ItemCategory_Food { get { return ResourceManager.GetString("ItemCategory_Food", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Hidden. /// </summary> public static string ItemCategory_Hidden { get { return ResourceManager.GetString("ItemCategory_Hidden", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Materials. /// </summary> public static string ItemCategory_Materials { get { return ResourceManager.GetString("ItemCategory_Materials", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Tools. /// </summary> public static string ItemCategory_Tools { get { return ResourceManager.GetString("ItemCategory_Tools", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Unknown. /// </summary> public static string ItemCategory_Unknown { get { return ResourceManager.GetString("ItemCategory_Unknown", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Map. /// </summary> public static string Map { get { return ResourceManager.GetString("Map", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Materials. /// </summary> public static string Materials { get { return ResourceManager.GetString("Materials", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Meat (kg). /// </summary> public static string MeatAmount { get { return ResourceManager.GetString("MeatAmount", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Never die. /// </summary> public static string NeverDie { get { return ResourceManager.GetString("NeverDie", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Open map. /// </summary> public static string OpenMapCommand { get { return ResourceManager.GetString("OpenMapCommand", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Player. /// </summary> public static string Player { get { return ResourceManager.GetString("Player", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Position. /// </summary> public static string Position { get { return ResourceManager.GetString("Position", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Profile. /// </summary> public static string Profile { get { return ResourceManager.GetString("Profile", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Progress. /// </summary> public static string Progress { get { return ResourceManager.GetString("Progress", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Refresh. /// </summary> public static string Refresh { get { return ResourceManager.GetString("Refresh", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Region. /// </summary> public static string Region { get { return ResourceManager.GetString("Region", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Cannery Region. /// </summary> public static string RegionsWithMap_CanneryRegion { get { return ResourceManager.GetString("RegionsWithMap_CanneryRegion", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Coastal Highway. /// </summary> public static string RegionsWithMap_CoastalRegion { get { return ResourceManager.GetString("RegionsWithMap_CoastalRegion", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Timberwolf Mountain. /// </summary> public static string RegionsWithMap_CrashMountainRegion { get { return ResourceManager.GetString("RegionsWithMap_CrashMountainRegion", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Crumbling Highway. /// </summary> public static string RegionsWithMap_HighwayTransitionZone { get { return ResourceManager.GetString("RegionsWithMap_HighwayTransitionZone", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Mystery Lake. /// </summary> public static string RegionsWithMap_LakeRegion { get { return ResourceManager.GetString("RegionsWithMap_LakeRegion", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Forlorn Muskeg. /// </summary> public static string RegionsWithMap_MarshRegion { get { return ResourceManager.GetString("RegionsWithMap_MarshRegion", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Mountain Town. /// </summary> public static string RegionsWithMap_MountainTownRegion { get { return ResourceManager.GetString("RegionsWithMap_MountainTownRegion", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Ravine. /// </summary> public static string RegionsWithMap_RavineTransitionZone { get { return ResourceManager.GetString("RegionsWithMap_RavineTransitionZone", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Hushed River Valley. /// </summary> public static string RegionsWithMap_RiverValleyRegion { get { return ResourceManager.GetString("RegionsWithMap_RiverValleyRegion", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Pleasant Valley. /// </summary> public static string RegionsWithMap_RuralRegion { get { return ResourceManager.GetString("RegionsWithMap_RuralRegion", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Broken Railroad. /// </summary> public static string RegionsWithMap_TracksRegion { get { return ResourceManager.GetString("RegionsWithMap_TracksRegion", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Desolation Point. /// </summary> public static string RegionsWithMap_WhalingStationRegion { get { return ResourceManager.GetString("RegionsWithMap_WhalingStationRegion", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Remove. /// </summary> public static string Remove { get { return ResourceManager.GetString("Remove", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Remove all. /// </summary> public static string RemoveAll { get { return ResourceManager.GetString("RemoveAll", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Repair all. /// </summary> public static string RepairAll { get { return ResourceManager.GetString("RepairAll", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Revolver skillpoints. /// </summary> public static string RevolverSkillSP { get { return ResourceManager.GetString("RevolverSkillSP", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Rifle skillpoints. /// </summary> public static string RifleSP { get { return ResourceManager.GetString("RifleSP", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Rounds in clip. /// </summary> public static string RoundsInClip { get { return ResourceManager.GetString("RoundsInClip", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Save. /// </summary> public static string Save { get { return ResourceManager.GetString("Save", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Skills. /// </summary> public static string Skills { get { return ResourceManager.GetString("Skills", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Snow walker progress. /// </summary> public static string SnowWalkerProgress { get { return ResourceManager.GetString("SnowWalkerProgress", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Straight to the heart progress. /// </summary> public static string StraightToHeartProgress { get { return ResourceManager.GetString("StraightToHeartProgress", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Test branch. /// </summary> public static string TestBranch { get { return ResourceManager.GetString("TestBranch", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Thirst. /// </summary> public static string Thirst { get { return ResourceManager.GetString("Thirst", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Time spent evolving (hours). /// </summary> public static string TimeEvolving { get { return ResourceManager.GetString("TimeEvolving", resourceCulture); } } /// <summary> /// Looks up a localized string similar to The Long Dark (v1.67) Save Editor. /// </summary> public static string Title { get { return ResourceManager.GetString("Title", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Tools. /// </summary> public static string Tools { get { return ResourceManager.GetString("Tools", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Traits. /// </summary> public static string Traits { get { return ResourceManager.GetString("Traits", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Unknown. /// </summary> public static string Unknown { get { return ResourceManager.GetString("Unknown", resourceCulture); } } } }
34.182106
193
0.532246
[ "MIT" ]
brewingcode/TLD-Save-Editor
The Long Dark Save Editor 2/Properties/Resources.Designer.cs
183,389
C#
using System; namespace SampleWebsite.Data { public class WeatherForecast { public DateTime Date { get; set; } public int TemperatureC { get; set; } public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); public string Summary { get; set; } } }
18.6875
69
0.608696
[ "MIT" ]
conficient/BlazorTemplater-StaticDemo
SampleWebsite/Data/WeatherForecast.cs
299
C#
using System; using System.Collections.Generic; using System.IO; using System.Threading; using Assets.Scripts.IAJ.Unity.Pathfinding; using Assets.Scripts.IAJ.Unity.Pathfinding.DataStructures.GoalBounding; using Assets.Scripts.IAJ.Unity.Pathfinding.GoalBounding; using Assets.Scripts.IAJ.Unity.Pathfinding.Heuristics; using Assets.Scripts.IAJ.Unity.Pathfinding.Path; using Assets.Scripts.IAJ.Unity.Utils; using RAIN.Navigation.Graph; using RAIN.Navigation.NavMesh; using UnityEditor; using UnityEditor.VersionControl; using UnityEngine; namespace Assets.Resources.Editor { public class IajMenuItemsThreaded { public static int Progress; public static GoalBoundingTable GoalBoundingTable; private static readonly int AuxThreads = SystemInfo.processorCount; [MenuItem("IAJ/Calculate Goal Bounds (Threaded)")] private static void CalculateGoalBounds() { WriteTimestampToFile("Start"); //get the NavMeshGraph from the current scene NavMeshPathGraph navMesh = GameObject.Find("Navigation Mesh").GetComponent<NavMeshRig>().NavMesh.Graph; //this is needed because RAIN AI does some initialization the first time the QuantizeToNode method is called //if this method is not called, the connections in the navigationgraph are not properly initialized navMesh.QuantizeToNode (new Vector3 (0, 0, 0), 1.0f); GoalBoundingTable = ScriptableObject.CreateInstance<GoalBoundingTable>(); var nodes = GetNodesHack(navMesh); GoalBoundingTable.table = new NodeGoalBounds[nodes.Count]; // Init Multithread var doneEvents = new ManualResetEvent[AuxThreads]; //calculate goal bounds for each edge EditorUtility.DisplayProgressBar("GoalBounding precomputation progress", "Calculating goal bounds for each edge", 0); int doneEventsIterator = 0; for (int i=0; i < nodes.Count; i++) { if (nodes[i] is NavMeshEdge) { //initialize the GoalBounds structure for the edge var auxGoalBounds = ScriptableObject.CreateInstance<NodeGoalBounds>(); auxGoalBounds.connectionBounds = new Assets.Scripts.IAJ.Unity.Pathfinding.DataStructures.GoalBounding.Bounds[nodes[i].OutEdgeCount]; for (int j = 0; j < nodes[i].OutEdgeCount; j++) { auxGoalBounds.connectionBounds[j] = ScriptableObject.CreateInstance<Scripts.IAJ.Unity.Pathfinding.DataStructures.GoalBounding.Bounds>(); auxGoalBounds.connectionBounds[j].InitializeBounds(nodes[i].Position); } doneEvents[doneEventsIterator] = new ManualResetEvent(false); var task = new IAJTask(doneEvents[doneEventsIterator], navMesh, nodes[i], auxGoalBounds); ThreadPool.QueueUserWorkItem(task.ThreadPoolCallback, i); if (doneEventsIterator == AuxThreads - 1) { float percentage = (float)IajMenuItemsThreaded.Progress / (float)nodes.Count; EditorUtility.DisplayProgressBar("GoalBounding precomputation progress", "Calculating goal bounds for each edge", percentage); WaitHandle.WaitAll(doneEvents); doneEventsIterator = 0; } else { doneEventsIterator++; } } } WaitHandle.WaitAll(doneEvents); EditorUtility.DisplayProgressBar("GoalBounding precomputation progress", "Calculating goal bounds for each edge", 1.0f); Progress = 0; //saving the assets, this takes forever using Unity's serialization mechanism WriteTimestampToFile("End of GoalBoundsDijkstraMapFlooding"); GoalBoundingTable.SaveToAssetDatabaseOptimized(); WriteTimestampToFile("End of Storing"); EditorUtility.ClearProgressBar(); } public static void WriteTimestampToFile(string tag, string filename = "threaded.txt", bool clearFile = false) { string path = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + @"\" + filename; if (File.Exists(path)) { if (clearFile) { File.Delete(path); } using (var streamWriter = File.AppendText(path)) { streamWriter.WriteLine(tag + " - " + System.DateTime.Now.ToLongTimeString()); } } else { using (var streamWriter = File.CreateText(path)) { streamWriter.WriteLine(tag + " - " + System.DateTime.Now.ToLongTimeString()); } } } private static List<NavigationGraphNode> GetNodesHack(NavMeshPathGraph graph) { //this hack is needed because in order to implement NodeArrayA* you need to have full acess to all the nodes in the navigation graph in the beginning of the search //unfortunately in RAINNavigationGraph class the field which contains the full List of Nodes is private //I cannot change the field to public, however there is a trick in C#. If you know the name of the field, you can access it using reflection (even if it is private) //using reflection is not very efficient, but it is ok because this is only called once in the creation of the class //by the way, NavMeshPathGraph is a derived class from RAINNavigationGraph class and the _pathNodes field is defined in the base class, //that's why we're using the type of the base class in the reflection call return (List<NavigationGraphNode>)Assets.Scripts.IAJ.Unity.Utils.Reflection.GetInstanceField(typeof(RAINNavigationGraph), graph, "_pathNodes"); } } public class IAJTask { private readonly ManualResetEvent _doneEvent; private readonly GoalBoundsDijkstraMapFlooding _dijkstra; private NodeGoalBounds _goalBoundingTableItem; private NavigationGraphNode _node; private readonly NodeGoalBounds _auxGoalBounds; public IAJTask(ManualResetEvent doneEvent, NavMeshPathGraph navMesh, NavigationGraphNode node, NodeGoalBounds auxGoalBounds) { _doneEvent = doneEvent; _dijkstra= new GoalBoundsDijkstraMapFlooding(navMesh); _node = node; _auxGoalBounds = auxGoalBounds; } public void ThreadPoolCallback(object state) { //run a Dijkstra mapflooding for each node _dijkstra.Search(_node, _auxGoalBounds); // progress IajMenuItemsThreaded.Progress++; int index = (int) state; IajMenuItemsThreaded.GoalBoundingTable.table[index] = _auxGoalBounds; _doneEvent.Set(); } } }
43.761905
176
0.618471
[ "MIT" ]
miguel-amaral/iaj-project-3
Assets/Editor/IajMenuItemsThreaded.cs
7,354
C#
using System; using System.Collections.Generic; using System.Linq; using NWN.FinalFantasy.Core; using NWN.FinalFantasy.Core.NWNX; using NWN.FinalFantasy.Core.NWScript.Enum; using NWN.FinalFantasy.Core.NWScript.Enum.Item; using NWN.FinalFantasy.Entity; using NWN.FinalFantasy.Feature.DialogDefinition; using static NWN.FinalFantasy.Core.NWScript.NWScript; using Object = NWN.FinalFantasy.Core.NWNX.Object; using ObjectType = NWN.FinalFantasy.Core.NWScript.Enum.ObjectType; using Player = NWN.FinalFantasy.Entity.Player; namespace NWN.FinalFantasy.Service { public static class PlayerMarket { // Serves two purposes: // 1.) Tracks the names of stores. // 2.) Identifies that the store is active and should be displayed on the shop list. private static Dictionary<string, string> ActiveStoreNames { get; } = new Dictionary<string, string>(); // Tracks the merchant object which contains the items being sold by a store. private static Dictionary<string, uint> StoreMerchants { get; } = new Dictionary<string, uint>(); // Tracks the number of players accessing each store. private static Dictionary<string, int> StoresOpen { get; } = new Dictionary<string, int>(); /// <summary> /// When the module loads, look for all player stores and see if they're open and active. /// Those that are will be added to the cache for later look-up. /// </summary> [NWNEventHandler("mod_load")] public static void LoadPlayerStores() { var keys = DB.SearchKeys("PlayerStore"); foreach (var key in keys) { var dbPlayerStore = DB.Get<PlayerStore>(key); UpdateCacheEntry(key, dbPlayerStore); } } /// <summary> /// Determines if a store is currently open and if it should be displayed in the menu. /// </summary> /// <param name="store">The store to check.</param> /// <returns>true if store is available, false otherwise</returns> public static bool IsStoreOpen(PlayerStore store) { var validItemsForSale = store.ItemsForSale.Count(x => x.Value.Price > 0); if (store.IsOpen && DateTime.UtcNow < store.DateLeaseExpires && validItemsForSale > 0) { return true; } else { return false; } } /// <summary> /// Retrieves all of the active stores. /// </summary> /// <returns>A dictionary containing all of the active stores.</returns> public static Dictionary<string, string> GetAllActiveStores() { return ActiveStoreNames.ToDictionary(x => x.Key, y => y.Value); } public static void OpenPlayerStore(uint player, string sellerPlayerId) { uint merchant; if (StoreMerchants.ContainsKey(sellerPlayerId)) { merchant = StoreMerchants[sellerPlayerId]; } else { var dbPlayerStore = DB.Get<PlayerStore>(sellerPlayerId); merchant = CreateMerchantObject(sellerPlayerId, dbPlayerStore); StoreMerchants[sellerPlayerId] = merchant; } OpenStore(merchant, player); } private static uint CreateMerchantObject(string sellerPlayerId, PlayerStore dbPlayerStore) { const string StoreResref = "player_store"; var merchant = CreateObject(ObjectType.Store, StoreResref, GetLocation(OBJECT_SELF)); SetLocalString(merchant, "SELLER_PLAYER_ID", sellerPlayerId); foreach (var item in dbPlayerStore.ItemsForSale) { if (item.Value.Price <= 0) continue; var deserialized = Object.Deserialize(item.Value.Data); Object.AcquireItem(merchant, deserialized); var originalBaseGPValue = Core.NWNX.Item.GetBaseGoldPieceValue(deserialized); var originalAdditionalGPValue = Core.NWNX.Item.GetAddGoldPieceValue(deserialized); SetLocalInt(deserialized, "ORIGINAL_BASE_GP_VALUE", originalBaseGPValue); SetLocalInt(deserialized, "ORIGINAL_ADDITIONAL_GP_VALUE", originalAdditionalGPValue); Core.NWNX.Item.SetBaseGoldPieceValue(deserialized, item.Value.Price); Core.NWNX.Item.SetAddGoldPieceValue(deserialized, 0); } return merchant; } /// <summary> /// Updates the cache with the latest information from this entity. /// This should be called after changing a player store's details. /// </summary> /// <param name="playerId">The store owner's player Id</param> /// <param name="dbPlayerStore">The player store entity</param> public static void UpdateCacheEntry(string playerId, PlayerStore dbPlayerStore) { if (IsStoreOpen(dbPlayerStore)) { ActiveStoreNames[playerId] = dbPlayerStore.StoreName; } else { if (ActiveStoreNames.ContainsKey(playerId)) { ActiveStoreNames.Remove(playerId); } } } /// <summary> /// Returns true if one or more players are accessing a store. /// Otherwise, returns false. /// </summary> /// <param name="sellerPlayerId">The player Id of the seller.</param> /// <returns>True if being accessed, false otherwise</returns> public static bool IsStoreBeingAccessed(string sellerPlayerId) { return StoresOpen.ContainsKey(sellerPlayerId) && StoresOpen[sellerPlayerId] > 0; } /// <summary> /// When an item is added to the terminal, track it and reopen the market terminal dialog. /// </summary> [NWNEventHandler("mkt_term_dist")] public static void MarketTerminalDisturbed() { if (GetInventoryDisturbType() != DisturbType.Added) return; var player = GetLastDisturbed(); var playerId = GetObjectUUID(player); var dbPlayer = DB.Get<Player>(playerId); var dbPlayerStore = DB.Get<PlayerStore>(playerId); var item = GetInventoryDisturbItem(); var itemId = GetObjectUUID(item); var serialized = Object.Serialize(item); var listingLimit = 5 + dbPlayer.SeedProgress.Rank * 5; if (dbPlayerStore.ItemsForSale.Count >= listingLimit || // Listing limit reached. GetBaseItemType(item) == BaseItem.Gold || // Gold can't be listed. string.IsNullOrWhiteSpace(GetResRef(item)) || // Items without resrefs can't be listed. GetHasInventory(item)) // Bags and other containers can't be listed. { Item.ReturnItem(player, item); SendMessageToPC(player, "This item cannot be listed."); return; } dbPlayerStore.ItemsForSale.Add(itemId, new PlayerStoreItem { Data = serialized, Name = GetName(item), Price = 0, StackSize = GetItemStackSize(item) }); DB.Set(playerId, dbPlayerStore); DestroyObject(item); SendMessageToPC(player, $"Listing limit: {dbPlayerStore.ItemsForSale.Count} / {5 + dbPlayer.SeedProgress.Rank * 5}"); } /// <summary> /// When the terminal is opened, send an instructional message to the player. /// </summary> [NWNEventHandler("mkt_term_open")] public static void MarketTerminalOpened() { var player = GetLastOpenedBy(); FloatingTextStringOnCreature("Place the items you wish to sell into the container. When you're finished, click the terminal again.", player, false); } /// <summary> /// When the terminal is closed, reset all event scripts on it. /// </summary> [NWNEventHandler("mkt_term_closed")] public static void MarketTerminalClosed() { var terminal = OBJECT_SELF; SetEventScript(terminal, EventScript.Placeable_OnOpen, string.Empty); SetEventScript(terminal, EventScript.Placeable_OnClosed, string.Empty); SetEventScript(terminal, EventScript.Placeable_OnInventoryDisturbed, string.Empty); SetEventScript(terminal, EventScript.Placeable_OnUsed, "start_convo"); } /// <summary> /// When a player's shop is opened, /// </summary> [NWNEventHandler("plyr_shop_open")] public static void PlayerShopOpened() { var store = OBJECT_SELF; var sellerPlayerId = GetLocalString(store, "SELLER_PLAYER_ID"); if (!StoresOpen.ContainsKey(sellerPlayerId)) { StoresOpen[sellerPlayerId] = 1; } else { StoresOpen[sellerPlayerId]--; } } /// <summary> /// When a player's shop is closed, /// </summary> [NWNEventHandler("plyr_shop_closed")] public static void PlayerShopClosed() { var store = OBJECT_SELF; var sellerPlayerId = GetLocalString(store, "SELLER_PLAYER_ID"); StoresOpen[sellerPlayerId]--; // If no one's accessing the store right now, destroy it and remove it from cache. if (StoresOpen[sellerPlayerId] <= 0) { StoreMerchants.Remove(sellerPlayerId); StoresOpen.Remove(sellerPlayerId); DestroyObject(store); } } /// <summary> /// When a player buys an item, deposit that gil into their store till and remove the item from the database. /// </summary> [NWNEventHandler("store_buy_aft")] public static void PlayerShopBuyItem() { var buyer = OBJECT_SELF; var item = StringToObject(Events.GetEventData("ITEM")); var price = Convert.ToInt32(Events.GetEventData("PRICE")); var store = StringToObject(Events.GetEventData("STORE")); var sellerPlayerId = GetLocalString(store, "SELLER_PLAYER_ID"); var dbPlayer = DB.Get<Player>(sellerPlayerId); var dbPlayerStore = DB.Get<PlayerStore>(sellerPlayerId); var itemId = GetObjectUUID(item); // Audit the purchase. Log.Write(LogGroup.PlayerMarket, $"{GetName(buyer)} purchased item '{GetName(item)}' x{GetItemStackSize(item)} for {price} gil from {dbPlayer.Name}'s store."); var taxed = price - (int)(price * dbPlayerStore.TaxRate); if (taxed < 1) taxed = 1; dbPlayerStore.Till += taxed; dbPlayerStore.ItemsForSale.Remove(itemId); DB.Set(sellerPlayerId, dbPlayerStore); // Set pricing back to normal var originalBaseGPValue = GetLocalInt(item, "ORIGINAL_BASE_GP_VALUE"); var originalAdditionalGPValue = GetLocalInt(item, "ORIGINAL_ADDITIONAL_GP_VALUE"); Core.NWNX.Item.SetBaseGoldPieceValue(item, originalBaseGPValue); Core.NWNX.Item.SetAddGoldPieceValue(item, originalAdditionalGPValue); DeleteLocalInt(item, "ORIGINAL_BASE_GP_VALUE"); DeleteLocalInt(item, "ORIGINAL_ADDITIONAL_GP_VALUE"); } } }
39.830508
171
0.596426
[ "MIT" ]
Martinus-1453/NWN.FinalFantasy
NWN.FinalFantasy/Service/PlayerMarket.cs
11,752
C#
using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Runtime.CompilerServices; using System.Runtime.Serialization; namespace System.Waf.Foundation { /// <summary> /// Defines a base class for a model that supports validation. /// </summary> [DataContract] public abstract class ValidatableModel : Model, INotifyDataErrorInfo { private static readonly ValidationResult[] noErrors = Array.Empty<ValidationResult>(); // DCS does not call ctor -> initialize fields at first use. private Dictionary<string, List<ValidationResult>> errorsDictionary; private IReadOnlyList<ValidationResult> errors; private bool hasErrors; /// <summary> /// Gets a value that indicates whether the entity has validation errors. /// </summary> public bool HasErrors { get => hasErrors; private set => SetProperty(ref hasErrors, value); } /// <summary> /// Gets all errors. The errors for a specified property and the entity errors. /// </summary> public IReadOnlyList<ValidationResult> Errors => errors ?? (errors = noErrors); private Dictionary<string, List<ValidationResult>> ErrorsDictionary => errorsDictionary ?? (errorsDictionary = new Dictionary<string, List<ValidationResult>>()); /// <summary> /// Occurs when the validation errors have changed for a property or for the entire entity. /// </summary> public event EventHandler<DataErrorsChangedEventArgs> ErrorsChanged; /// <summary> /// Gets the validation errors for a specified property or for the entire entity. /// </summary> /// <param name="propertyName">The name of the property to retrieve validation errors for; /// or null or String.Empty, to retrieve entity-level errors.</param> /// <returns>The validation errors for the property or entity.</returns> public IEnumerable<ValidationResult> GetErrors(string propertyName) { if (ErrorsDictionary.TryGetValue(propertyName ?? "", out var result)) { return result; } return noErrors; } IEnumerable INotifyDataErrorInfo.GetErrors(string propertyName) { return GetErrors(propertyName); } /// <summary> /// Validates the object and all its properties. The validation results are stored and can be retrieved by the /// GetErrors method. If the validation results are changing then the ErrorsChanged event will be raised. /// </summary> /// <returns>True if the object is valid, otherwise false.</returns> public bool Validate() { var validationResults = new List<ValidationResult>(); Validator.TryValidateObject(this, new ValidationContext(this), validationResults, true); UpdateErrors(validationResults); return !HasErrors; } /// <summary> /// Set the property with the specified value and validate the property. If the value is not equal with the field then the field is /// set, a PropertyChanged event is raised, the property is validated and it returns true. /// </summary> /// <typeparam name="T">Type of the property.</typeparam> /// <param name="field">Reference to the backing field of the property.</param> /// <param name="value">The new value for the property.</param> /// <param name="propertyName">The property name. This optional parameter can be skipped /// because the compiler is able to create it automatically.</param> /// <returns>True if the value has changed, false if the old and new value were equal.</returns> /// <exception cref="ArgumentException">The argument propertyName must not be null or empty.</exception> protected bool SetPropertyAndValidate<T>(ref T field, T value, [CallerMemberName] string propertyName = null) { if (string.IsNullOrEmpty(propertyName)) throw new ArgumentException("The argument propertyName must not be null or empty.", nameof(propertyName)); if (SetProperty(ref field, value, propertyName)) { Validate(); return true; } return false; } /// <summary> /// Raises the <see cref="ErrorsChanged"/> event. /// </summary> /// <param name="e">The <see cref="System.ComponentModel.DataErrorsChangedEventArgs"/> instance containing the event data.</param> protected virtual void OnErrorsChanged(DataErrorsChangedEventArgs e) { ErrorsChanged?.Invoke(this, e); } private void RaiseErrorsChanged(string propertyName = "") { OnErrorsChanged(new DataErrorsChangedEventArgs(propertyName)); } private void UpdateErrors(IReadOnlyList<ValidationResult> validationResults, string propertyName = null) { var newErrors = new Dictionary<string, List<ValidationResult>>(); foreach (var validationResult in validationResults) { var memberNames = validationResult.MemberNames.Any() ? validationResult.MemberNames : new[] { "" }; foreach (string memberName in memberNames) { if (!newErrors.ContainsKey(memberName)) { newErrors.Add(memberName, new List<ValidationResult>() { validationResult }); } else { newErrors[memberName].Add(validationResult); } } } var changedProperties = new HashSet<string>(); var errorKeys = propertyName == null ? ErrorsDictionary.Keys : ErrorsDictionary.Keys.Where(x => x == propertyName); var newErrorKeys = propertyName == null ? newErrors.Keys : newErrors.Keys.Where(x => x == propertyName); foreach (var propertyToRemove in errorKeys.Except(newErrorKeys).ToArray()) { changedProperties.Add(propertyToRemove); ErrorsDictionary.Remove(propertyToRemove); } foreach (var propertyToUpdate in errorKeys.ToArray()) { if (!ErrorsDictionary[propertyToUpdate].SequenceEqual(newErrors[propertyToUpdate], ValidationResultComparer.Default)) { changedProperties.Add(propertyToUpdate); ErrorsDictionary[propertyToUpdate] = newErrors[propertyToUpdate]; } } foreach (var propertyToAdd in newErrorKeys.Except(errorKeys).ToArray()) { changedProperties.Add(propertyToAdd); ErrorsDictionary.Add(propertyToAdd, newErrors[propertyToAdd]); } if (changedProperties.Any()) { errors = ErrorsDictionary.Values.SelectMany(x => x).Distinct().ToArray(); HasErrors = ErrorsDictionary.Any(); RaisePropertyChanged(nameof(Errors)); } foreach (var changedProperty in changedProperties) RaiseErrorsChanged(changedProperty); } private sealed class ValidationResultComparer : IEqualityComparer<ValidationResult> { public static ValidationResultComparer Default { get; } = new ValidationResultComparer(); public bool Equals(ValidationResult x, ValidationResult y) { if (x == y) return true; if (x == null || y == null) return false; return Equals(x.ErrorMessage, y.ErrorMessage) && x.MemberNames.SequenceEqual(y.MemberNames); } public int GetHashCode(ValidationResult obj) { if (obj == null) return 0; return (obj.ErrorMessage?.GetHashCode() ?? 0) ^ obj.MemberNames.Select(x => x?.GetHashCode() ?? 0).Aggregate(0, (current, next) => current ^ next); } } } }
45.037037
170
0.598097
[ "MIT" ]
pskpatil/waf
src/System.Waf/System.Waf/System.Waf.Core/Foundation/ValidatableModel.cs
8,514
C#
// Generated by Fuzzlyn v1.2 on 2021-08-10 14:27:45 // Run on .NET 6.0.0-dev on X64 Windows // Seed: 17332121036766880281 // Reduced from 83.2 KiB to 0.6 KiB in 00:00:40 // Debug: Outputs 1 // Release: Outputs 0 struct S0 { public bool F0; public uint F1; public short F2; public ulong F4; public S0(uint f1): this() { F1 = f1; } } struct S1 { public S0 F0; public ushort F4; public S1(S0 f0): this() { F0 = f0; } } struct S2 { public S1 F0; public S2(S1 f0): this() { F0 = f0; } } public class Program { public static void Main() { S2 vr3 = new S2(new S1(new S0(1))); System.Console.WriteLine(vr3.F0.F0.F0); System.Console.WriteLine(vr3.F0.F0.F1); } }
16.595745
51
0.561538
[ "MIT" ]
jakobbotsch/Fuzzlyn
examples/reduced/17332121036766880281.cs
780
C#
using System.Net; namespace com.lemonway { /// <summary> /// EndUserInfo is required in the LwRequest /// </summary> public class EndUserInfo { public string IP; public string UserAgent; } }
15.538462
45
0.693069
[ "MIT" ]
lemonwaysas/aspdotnet-client-directkit-json2
src/LemonWayService/EndUserInfo.cs
204
C#
using Microsoft.AspNetCore.Mvc.Controllers; using Microsoft.OpenApi.Models; using Swashbuckle.AspNetCore.SwaggerGen; namespace Calabonga.Microservice.Module.Web.AppStart.SwaggerFilters { /// <summary> /// Swagger Method Info Generator from summary for <see cref="M:GetPaged{T}"/> /// </summary> public class ApplySummariesOperationFilter : IOperationFilter { /// <inheritdoc /> public void Apply(OpenApiOperation operation, OperationFilterContext context) { var controllerActionDescriptor = context.ApiDescription.ActionDescriptor as ControllerActionDescriptor; if (controllerActionDescriptor == null) { return; } var actionName = controllerActionDescriptor.ActionName; if (actionName != "GetPaged") return; var resourceName = controllerActionDescriptor.ControllerName; operation.Summary = $"Returns paged list of the {resourceName} as IPagedList wrapped with OperationResult"; } } }
39.037037
119
0.680266
[ "MIT" ]
Calabonga/Microservice-Template
AspNetCore v3.0/Calabonga.Microservice.Module/Calabonga.Microservice.Module.Web/AppStart/SwaggerFilters/ApplySummariesOperationFilter.cs
1,056
C#