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 NUnit.Framework; using Terrace.Extensions; using System; using System.Collections.Generic; using System.Text; using System.Collections; using System.Linq; namespace Terrace.Extensions.Tests { [TestFixture] public class ByteArrayExtensionTests_ToInt64 { [Test] public void ToInt64_ReturnsInt64() { byte[] bytes = long.MinValue.ToBytes(); long expected = long.MinValue; long actual = bytes.ToInt64(); Assert.That(actual, Is.EqualTo(expected)); } [Test] public void ToInt64_ReturnsInt64_WithStartIndex() { byte[] bytes = long.MinValue.ToBytes().Concat(long.MaxValue.ToBytes()).ToArray(); long expected = long.MaxValue; long actual = bytes.ToInt64(8); Assert.That(actual, Is.EqualTo(expected)); } } }
24.916667
93
0.60981
[ "MIT" ]
YeochangYoon/Terrace.Extensions
test/Terrace.Extensions.Tests/System.Byte[]/Byte[].ToInt64.Tests.cs
899
C#
// ----------------------------------------------------------------------- // <copyright file="RoleBase.cs" company="OSharp开源团队"> // Copyright (c) 2014-2017 OSharp. All rights reserved. // </copyright> // <site>http://www.osharp.org</site> // <last-editor>郭明锋</last-editor> // <last-date>2017-09-04 19:33</last-date> // ----------------------------------------------------------------------- using System; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using OSharp.Entity; namespace OSharp.Identity { /// <summary> /// 角色信息基类 /// </summary> /// <typeparam name="TRoleKey">角色编号类型</typeparam> public abstract class RoleBase<TRoleKey> : EntityBase<TRoleKey>, ICreatedTime, ILockable, ISoftDeletable where TRoleKey : IEquatable<TRoleKey> { /// <summary> /// 初始化一个<see cref="RoleBase{TRoleKey}"/>类型的新实例 /// </summary> protected RoleBase() { CreatedTime = DateTime.Now; } /// <summary> /// 获取或设置 角色名称 /// </summary> [Required, DisplayName("角色名称")] public string Name { get; set; } /// <summary> /// 获取或设置 标准化角色名称 /// </summary> [Required, DisplayName("标准化角色名称")] public string NormalizedName { get; set; } /// <summary> /// 获取或设置 一个随机值,每当某个角色被保存到存储区时,该值将发生变化。 /// </summary> [DisplayName("版本标识")] public string ConcurrencyStamp { get; set; } = Guid.NewGuid().ToString(); /// <summary> /// 获取或设置 角色描述 /// </summary> [StringLength(512)] [DisplayName("角色描述")] public string Remark { get; set; } /// <summary> /// 获取或设置 是否管理员角色 /// </summary> [DisplayName("是否管理员角色")] public bool IsAdmin { get; set; } /// <summary> /// 获取或设置 是否默认角色,用户注册后拥有此角色 /// </summary> [DisplayName("是否默认角色")] public bool IsDefault { get; set; } /// <summary> /// 获取或设置 是否系统角色 /// </summary> [DisplayName("是否系统角色")] public bool IsSystem { get; set; } /// <summary> /// 获取或设置 是否锁定 /// </summary> [DisplayName("是否锁定")] public bool IsLocked { get; set; } /// <summary> /// 获取设置 信息创建时间 /// </summary> [DisplayName("创建时间")] public DateTime CreatedTime { get; set; } /// <summary> /// 获取或设置 数据逻辑删除时间,为null表示正常数据,有值表示已逻辑删除,同时删除时间每次不同也能保证索引唯一性 /// </summary> public DateTime? DeletedTime { get; set; } /// <summary>Returns a string that represents the current object.</summary> /// <returns>A string that represents the current object.</returns> public override string ToString() { return Name; } } }
28.019608
108
0.514696
[ "Apache-2.0" ]
0xflotus/osharp
src/OSharp.Permissions/Identity/RoleBase.cs
3,370
C#
using System; using System.Collections; using System.Collections.Generic; using System.Collections.Immutable; namespace WSharp.Compiler.Syntax { public sealed class SeparatedSyntaxList<T> : IEnumerable<T> where T : SyntaxNode { internal SeparatedSyntaxList(ImmutableArray<SyntaxNode> nodesAndSeparators) => this.NodesAndSeparators = nodesAndSeparators; public SyntaxToken GetSeparator(int index) { if(index < 0 || index >= this.Count - 1) { throw new ArgumentOutOfRangeException(nameof(index)); } return (SyntaxToken)this.NodesAndSeparators[(index * 2) + 1]; } public IEnumerator<T> GetEnumerator() { for(var i = 0; i < this.Count; i++) { yield return this[i]; } } IEnumerator IEnumerable.GetEnumerator() => this.GetEnumerator(); public T this[int index] => (T)this.NodesAndSeparators[index * 2]; public ImmutableArray<SyntaxNode> GetAllNodes() => this.NodesAndSeparators; public int Count => (this.NodesAndSeparators.Length + 1) / 2; private ImmutableArray<SyntaxNode> NodesAndSeparators { get; } } }
26.8
81
0.721082
[ "MIT" ]
JasonBock/WSharp
WSharp.Compiler/Syntax/SeparatedSyntaxList.cs
1,074
C#
using System.Diagnostics.Tracing; namespace Storage.NetCore { /// <summary> /// Internal logger /// </summary> [EventSource(Name = "Storage.Net")] public sealed class StorageEventSource : EventSource { /// <summary> /// Logger instance /// </summary> public static StorageEventSource Log { get; } = new StorageEventSource(); /// <summary> /// Writes generic debug message /// </summary> /// <param name="subsystem"></param> /// <param name="message"></param> [Event(1, Level = EventLevel.Verbose, Message = "{0}: {1}")] public void Debug(string subsystem, string message) { if(this.IsEnabled()) { this.WriteEvent(1, subsystem, message); } } /// <summary> /// Writes generic error message /// </summary> /// <param name="subsystem"></param> /// <param name="message"></param> [Event(2, Level = EventLevel.Error, Message = "{0}: {1}")] public void Error(string subsystem, string message) { if(this.IsEnabled()) { this.WriteEvent(2, subsystem, message); } } } }
25.978261
79
0.545607
[ "MIT" ]
alexneblett/storage
src/Storage.Net/StorageEventSource.cs
1,197
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace GoldRush { public abstract class MoveableObject { public bool isLoaded; public abstract bool canMove(); public abstract void Move(); } }
19.285714
40
0.685185
[ "MPL-2.0", "MPL-2.0-no-copyleft-exception" ]
dutchmartin/GoldRush
GoldRush/MoveableObject.cs
272
C#
using System; using System.Collections.Generic; using System.Threading; using Prometheus.Client.Collectors; using Prometheus.Client.MetricsWriter.Abstractions; namespace Prometheus.Client { public abstract class Labelled<TConfig> where TConfig : MetricConfiguration { private LabelValues _labelValues; private long _timestamp; private long _hasObservation = 0; protected TConfig Configuration; protected IReadOnlyList<KeyValuePair<string, string>> Labels => _labelValues.Labels; protected long? Timestamp { get { if (!Configuration.IncludeTimestamp) return null; return Interlocked.Read(ref _timestamp); } } public bool HasObservations => Interlocked.Read(ref _hasObservation) != 0; protected internal virtual void Init(LabelValues labelValues, TConfig configuration) { _labelValues = labelValues; Configuration = configuration; } protected internal abstract void Collect(IMetricsWriter writer); protected void TimestampIfRequired(long? timestamp = null) { Interlocked.Exchange(ref _hasObservation, 1); if (!Configuration.IncludeTimestamp) return; var now = DateTime.UtcNow.ToUnixTime(); if (!timestamp.HasValue) { // no needs to check anything, null means now. Interlocked.Exchange(ref _timestamp, now); return; } // use now if provided timestamp is in future if (timestamp > now) { Interlocked.Exchange(ref _timestamp, now); return; } // use provided timestamp unless current timestamp bigger while (true) { long current = Interlocked.Read(ref _timestamp); if (current > timestamp) return; if (current == Interlocked.CompareExchange(ref _timestamp, timestamp.Value, current)) return; } } } }
29.210526
101
0.574324
[ "MIT" ]
malachib/Prometheus.Client
src/Prometheus.Client/Labelled.cs
2,220
C#
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // <auto-generated/> #nullable disable using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using Azure; using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; using Azure.ResourceManager.Core; using Azure.ResourceManager.Network.Models; using Azure.ResourceManager.Resources.Models; namespace Azure.ResourceManager.Network { /// <summary> A Class representing a VirtualRouterPeering along with the instance operations that can be performed on it. </summary> public partial class VirtualRouterPeering : ArmResource { /// <summary> Generate the resource identifier of a <see cref="VirtualRouterPeering"/> instance. </summary> public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string virtualRouterName, string peeringName) { var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}/peerings/{peeringName}"; return new ResourceIdentifier(resourceId); } private readonly ClientDiagnostics _clientDiagnostics; private readonly VirtualRouterPeeringsRestOperations _virtualRouterPeeringsRestClient; private readonly VirtualRouterPeeringData _data; /// <summary> Initializes a new instance of the <see cref="VirtualRouterPeering"/> class for mocking. </summary> protected VirtualRouterPeering() { } /// <summary> Initializes a new instance of the <see cref = "VirtualRouterPeering"/> class. </summary> /// <param name="options"> The client parameters to use in these operations. </param> /// <param name="resource"> The resource that is the target of operations. </param> internal VirtualRouterPeering(ArmResource options, VirtualRouterPeeringData resource) : base(options, new ResourceIdentifier(resource.Id)) { HasData = true; _data = resource; _clientDiagnostics = new ClientDiagnostics(ClientOptions); _virtualRouterPeeringsRestClient = new VirtualRouterPeeringsRestOperations(_clientDiagnostics, Pipeline, ClientOptions, BaseUri); } /// <summary> Initializes a new instance of the <see cref="VirtualRouterPeering"/> class. </summary> /// <param name="options"> The client parameters to use in these operations. </param> /// <param name="id"> The identifier of the resource that is the target of operations. </param> internal VirtualRouterPeering(ArmResource options, ResourceIdentifier id) : base(options, id) { _clientDiagnostics = new ClientDiagnostics(ClientOptions); _virtualRouterPeeringsRestClient = new VirtualRouterPeeringsRestOperations(_clientDiagnostics, Pipeline, ClientOptions, BaseUri); } /// <summary> Initializes a new instance of the <see cref="VirtualRouterPeering"/> class. </summary> /// <param name="clientOptions"> The client options to build client context. </param> /// <param name="credential"> The credential to build client context. </param> /// <param name="uri"> The uri to build client context. </param> /// <param name="pipeline"> The pipeline to build client context. </param> /// <param name="id"> The identifier of the resource that is the target of operations. </param> internal VirtualRouterPeering(ArmClientOptions clientOptions, TokenCredential credential, Uri uri, HttpPipeline pipeline, ResourceIdentifier id) : base(clientOptions, credential, uri, pipeline, id) { _clientDiagnostics = new ClientDiagnostics(ClientOptions); _virtualRouterPeeringsRestClient = new VirtualRouterPeeringsRestOperations(_clientDiagnostics, Pipeline, ClientOptions, BaseUri); } /// <summary> Gets the resource type for the operations. </summary> public static readonly ResourceType ResourceType = "Microsoft.Network/virtualRouters/peerings"; /// <summary> Gets the valid resource type for the operations. </summary> protected override ResourceType ValidResourceType => ResourceType; /// <summary> Gets whether or not the current instance has data. </summary> public virtual bool HasData { get; } /// <summary> Gets the data representing this Feature. </summary> /// <exception cref="InvalidOperationException"> Throws if there is no data loaded in the current instance. </exception> public virtual VirtualRouterPeeringData Data { get { if (!HasData) throw new InvalidOperationException("The current instance does not have data, you must call Get first."); return _data; } } /// <summary> Gets the specified Virtual Router Peering. </summary> /// <param name="cancellationToken"> The cancellation token to use. </param> public async virtual Task<Response<VirtualRouterPeering>> GetAsync(CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("VirtualRouterPeering.Get"); scope.Start(); try { var response = await _virtualRouterPeeringsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(response.GetRawResponse()).ConfigureAwait(false); return Response.FromValue(new VirtualRouterPeering(this, response.Value), response.GetRawResponse()); } catch (Exception e) { scope.Failed(e); throw; } } /// <summary> Gets the specified Virtual Router Peering. </summary> /// <param name="cancellationToken"> The cancellation token to use. </param> public virtual Response<VirtualRouterPeering> Get(CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("VirtualRouterPeering.Get"); scope.Start(); try { var response = _virtualRouterPeeringsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) throw _clientDiagnostics.CreateRequestFailedException(response.GetRawResponse()); return Response.FromValue(new VirtualRouterPeering(this, response.Value), response.GetRawResponse()); } catch (Exception e) { scope.Failed(e); throw; } } /// <summary> Lists all available geo-locations. </summary> /// <param name="cancellationToken"> A token to allow the caller to cancel the call to the service. The default value is <see cref="CancellationToken.None" />. </param> /// <returns> A collection of locations that may take multiple service requests to iterate over. </returns> public async virtual Task<IEnumerable<Location>> GetAvailableLocationsAsync(CancellationToken cancellationToken = default) { return await ListAvailableLocationsAsync(ResourceType, cancellationToken).ConfigureAwait(false); } /// <summary> Lists all available geo-locations. </summary> /// <param name="cancellationToken"> A token to allow the caller to cancel the call to the service. The default value is <see cref="CancellationToken.None" />. </param> /// <returns> A collection of locations that may take multiple service requests to iterate over. </returns> public virtual IEnumerable<Location> GetAvailableLocations(CancellationToken cancellationToken = default) { return ListAvailableLocations(ResourceType, cancellationToken); } /// <summary> Deletes the specified peering from a Virtual Router. </summary> /// <param name="waitForCompletion"> Waits for the completion of the long running operations. </param> /// <param name="cancellationToken"> The cancellation token to use. </param> public async virtual Task<VirtualRouterPeeringDeleteOperation> DeleteAsync(bool waitForCompletion = true, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("VirtualRouterPeering.Delete"); scope.Start(); try { var response = await _virtualRouterPeeringsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); var operation = new VirtualRouterPeeringDeleteOperation(_clientDiagnostics, Pipeline, _virtualRouterPeeringsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response); if (waitForCompletion) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; } catch (Exception e) { scope.Failed(e); throw; } } /// <summary> Deletes the specified peering from a Virtual Router. </summary> /// <param name="waitForCompletion"> Waits for the completion of the long running operations. </param> /// <param name="cancellationToken"> The cancellation token to use. </param> public virtual VirtualRouterPeeringDeleteOperation Delete(bool waitForCompletion = true, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("VirtualRouterPeering.Delete"); scope.Start(); try { var response = _virtualRouterPeeringsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); var operation = new VirtualRouterPeeringDeleteOperation(_clientDiagnostics, Pipeline, _virtualRouterPeeringsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response); if (waitForCompletion) operation.WaitForCompletion(cancellationToken); return operation; } catch (Exception e) { scope.Failed(e); throw; } } } }
55.927835
240
0.675668
[ "MIT" ]
93mishra/azure-sdk-for-net
sdk/network/Azure.ResourceManager.Network/src/Generated/VirtualRouterPeering.cs
10,850
C#
using System.Collections; using System.Collections.Generic; using UnityEngine; public interface IMageBossState { void Execute(); void Enter(MageBoss enemy); void Exit(); void OnCollisionEnter2D(Collision2D other); }
19.583333
47
0.744681
[ "Apache-2.0" ]
MadGriffonGames/BiltyBlop
Assets/Scripts/Enemies&States/BossMage/Mage/IMageBossState.cs
237
C#
using System; using System.Collections.Generic; using System.Configuration; using System.Data; using System.Data.SqlClient; using System.Linq; using System.Text; using System.Threading.Tasks; using Epam.Task7.Entities; using Epam.Task7.DAL.Interface; namespace Epam.Task7.DAL { public class UserDBDao : IUserDao { private string _connectionString; private static Dictionary<string, User> repoUsers = new Dictionary<string, User>(); public UserDBDao() { this._connectionString = ConfigurationManager.ConnectionStrings["Default"].ConnectionString; this.GetAll(); } public void Add(User user) { using (var sqlConnection = new SqlConnection(this._connectionString)) { var command = sqlConnection.CreateCommand(); command.CommandText = "INSERT INTO users (name, birth) VALUES (\'" + user.Name + "\', \'" + user.DateOfBirth + "\'); INSERT INTO useraward (id_user) VALUES (IDENT_CURRENT(\'users\'))"; command.CommandType = CommandType.Text; sqlConnection.Open(); command.ExecuteReader(); sqlConnection.Close(); } repoUsers.Clear(); this.GetAll(); } public void Change(int no, string newname, string newdate) { repoUsers.Clear(); this.GetAll(); User user = this.GetByNo(no); using (var sqlConnection = new SqlConnection(this._connectionString)) { var command = sqlConnection.CreateCommand(); command.CommandText = "UPDATE users SET name = \'" + newname + "\', birth = \'" + newdate + "\' WHERE id_user = " + user.Id; command.CommandType = CommandType.Text; sqlConnection.Open(); command.ExecuteReader(); sqlConnection.Close(); } repoUsers.Clear(); this.GetAll(); } public void Delete(string id) { using (var sqlConnection = new SqlConnection(this._connectionString)) { var command = sqlConnection.CreateCommand(); command.CommandText = "DELETE FROM useraward WHERE useraward.id_user = " + id + ";DELETE FROM users WHERE id_user = " + id; command.CommandType = CommandType.Text; sqlConnection.Open(); command.ExecuteReader(); sqlConnection.Close(); } } public void DeleteByNo(int no) { repoUsers.Clear(); this.GetAll(); int count = 0; foreach (var item in repoUsers) { if (count == no - 1) { this.Delete(item.Value.Id); } count++; } repoUsers.Clear(); this.GetAll(); } public IEnumerable<User> GetAll() { repoUsers.Clear(); var result = new List<User>(); using (var sqlConnection = new SqlConnection(this._connectionString)) { var command = sqlConnection.CreateCommand(); command.CommandText = "SELECT users.id_user, users.name, users.birth, award.id_award, award.title FROM award, users, useraward WHERE useraward.id_award = award.id_award AND useraward.id_user = users.id_user UNION SELECT users.id_user, users.name, users.birth, null, null FROM useraward, users WHERE useraward.id_user = users.id_user AND useraward.id_award IS NULL"; command.CommandType = CommandType.Text; sqlConnection.Open(); var reader = command.ExecuteReader(); while (reader.Read()) { User u = new User(reader["id_user"] + "", reader["name"] + "", ((DateTime)reader["birth"]).ToString("d")); Award a = new Award(reader["id_award"] == DBNull.Value ? "" : reader["id_award"] + "", reader["title"] + ""); if (!repoUsers.ContainsKey(u.Id)) { repoUsers.Add(u.Id, u); repoUsers[u.Id].Awards.Add(a); } else { repoUsers[u.Id].Awards.Add(a); } } sqlConnection.Close(); } foreach (var item in repoUsers) { result.Add(item.Value); } return result; } public User GetById(string id) { repoUsers.Clear(); this.GetAll(); foreach (var item in repoUsers) { if (item.Value.Id == id) { return item.Value; } } return null; } public User GetByNo(int no) { repoUsers.Clear(); this.GetAll(); int count = 0; foreach (var item in repoUsers) { if (count == no - 1) { return item.Value; } count++; } return null; } } }
30.75
381
0.495011
[ "MIT" ]
Julya-Boldyreva/XT-2018Q4
Epam.Task11_12/Epam.Task7.DAL/UserDBDao.cs
5,414
C#
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.CodeFixes; using Microsoft.CodeAnalysis.CSharp.FxCopAnalyzers.Usage; using Microsoft.CodeAnalysis.Diagnostics; using Microsoft.CodeAnalysis.FxCopAnalyzers.Usage; using Microsoft.CodeAnalysis.Test.Utilities; using Microsoft.CodeAnalysis.VisualBasic.FxCopAnalyzers.Usage; using Xunit; namespace Microsoft.CodeAnalysis.UnitTests { public partial class CA2231FixerTests : CodeFixTestBase { protected override DiagnosticAnalyzer GetBasicDiagnosticAnalyzer() { return new CA2231DiagnosticAnalyzer(); } protected override CodeFixProvider GetBasicCodeFixProvider() { return new CA2231BasicCodeFixProvider(); } protected override DiagnosticAnalyzer GetCSharpDiagnosticAnalyzer() { return new CA2231DiagnosticAnalyzer(); } protected override CodeFixProvider GetCSharpCodeFixProvider() { return new CA2231CSharpCodeFixProvider(); } [Fact, Trait(Traits.Feature, Traits.Features.Diagnostics)] public void CA2231CSharpCodeFixNoEqualsOperator() { VerifyCSharpFix(@" using System; // value type without overridding Equals public struct A { public override bool Equals(Object obj) { return true; } } ", @" using System; // value type without overridding Equals public struct A { public override bool Equals(Object obj) { return true; } public static bool operator ==(A left, A right) { throw new NotImplementedException(); } public static bool operator !=(A left, A right) { throw new NotImplementedException(); } } ", // This fix introduces the compiler warning: // Test0.cs(5,15): warning CS0661: 'A' defines operator == or operator != but does not override Object.GetHashCode() allowNewCompilerDiagnostics: true); } [Fact, Trait(Traits.Feature, Traits.Features.Diagnostics)] public void CA2231BasicCodeFixNoEqualsOperator() { VerifyBasicFix(@" Imports System Public Structure A Public Overloads Overrides Function Equals(obj As Object) As Boolean Return True End Function End Structure ", @" Imports System Public Structure A Public Overloads Overrides Function Equals(obj As Object) As Boolean Return True End Function Public Shared Operator =(left As A, right As A) As Boolean Throw New NotImplementedException() End Operator Public Shared Operator <>(left As A, right As A) As Boolean Throw New NotImplementedException() End Operator End Structure "); } } }
26.309091
161
0.677954
[ "Apache-2.0" ]
DavidKarlas/roslyn
src/Diagnostics/FxCop/Test/Usage/CodeFixes/CA2231FixerTests.cs
2,896
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using BattleTech; using BattleTech.UI; using Harmony; namespace IRTweaks.Modules.Misc { [HarmonyPatch(typeof(SimGameState))] [HarmonyPatch("ApplySimGameEventResult", new Type[] {typeof(SimGameEventResult), typeof(List<object>), typeof(SimGameEventTracker)})] public static class SimGameState_ApplySimGameEventResult { static bool Prepare() => Mod.Config.Fixes.DifficultyModsFromStats; public static void Postfix(SimGameState __instance, SimGameEventResult result, List<object> objects, SimGameEventTracker tracker = null) { if (result.Scope == EventScope.Company) { if (result.Stats != null) { foreach (var simGameStat in result.Stats) { if (simGameStat.name == "IRTweaks_DiffMod") { var sim = UnityGameInstance.BattleTechGame.Simulation; if (!sim.CompanyStats.ContainsStatistic(simGameStat.name)) { Mod.Log.Info?.Write( $"DiffMods: Something wrong here, we should have added the stat 'IRTweaks_DiffMod' to company stats already."); } else { sim.DifficultySettings.RefreshCareerScoreMultiplier(); Mod.Log.Info?.Write( $"DiffMods: Found IRTweaks_DiffMod in stat results, refreshing difficulty modifier."); } } } } } } } [HarmonyPatch(typeof(SimGameDifficulty))] [HarmonyPatch("RefreshCareerScoreMultiplier")] public static class SimGameDifficulty_RefreshCareerScoreMultiplier { static bool Prepare() => Mod.Config.Fixes.DifficultyModsFromStats; public static bool Prefix(SimGameDifficulty __instance, Dictionary<string, SimGameDifficulty.DifficultySetting> ___difficultyDict, Dictionary<string, int> ___difficultyIndices, ref float ___curCareerModifier) { float num = 0f; foreach (string key in ___difficultyDict.Keys) { SimGameDifficulty.DifficultySetting difficultySetting = ___difficultyDict[key]; SimGameDifficulty.DifficultyOption difficultyOption = difficultySetting.Options[___difficultyIndices[key]]; if (difficultySetting.Enabled) { num += difficultyOption.CareerScoreModifier; } } ___curCareerModifier = num; var sim = UnityGameInstance.BattleTechGame.Simulation; if (sim == null) return false; if (!sim.CompanyStats.ContainsStatistic("IRTweaks_DiffMod")) return false; var curMod = __instance.GetRawCareerModifier(); var irMod = sim.CompanyStats.GetValue<float>("IRTweaks_DiffMod"); ___curCareerModifier += irMod; //Traverse.Create(__instance).Field("curCareerModifier").SetValue(newMod); Mod.Log.Info?.Write( $"DiffMods: Adding IRMod {irMod} to current career mod {curMod} for final career difficulty modifier {___curCareerModifier}."); return false; } } [HarmonyPatch(typeof(SimGameDifficultySettingsModule))] [HarmonyPatch("CalculateRawScoreMod")] public static class SimGameDifficultySettingsModule_CalculateRawScoreMod { static bool Prepare() => Mod.Config.Fixes.DifficultyModsFromStats; public static void Postfix(SimGameDifficultySettingsModule __instance, ref float __result) { var sim = UnityGameInstance.BattleTechGame.Simulation; if (sim == null) return; if (!sim.CompanyStats.ContainsStatistic("IRTweaks_DiffMod")) return; var irMod = sim.CompanyStats.GetValue<float>("IRTweaks_DiffMod"); __result += irMod; } } }
41.524272
216
0.59668
[ "MIT" ]
BattletechModders/IRTweaks
IRTweaks/IRTweaks/Modules/Misc/DifficultyModsFromStats.cs
4,279
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using Microsoft.Build.Framework; using Microsoft.Build.Utilities; using System; using System.IO; using System.IO.Compression; namespace Microsoft.DotNet.Build.Tasks { public sealed class ZipFileExtractToDirectory : Task { /// <summary> /// The path to the directory to be archived. /// </summary> [Required] public string SourceArchive { get; set; } /// <summary> /// The path of the archive to be created. /// </summary> [Required] public string DestinationDirectory { get; set; } /// <summary> /// Indicates if the destination directory should be cleaned if it already exists. /// </summary> public bool OverwriteDestination { get; set; } public override bool Execute() { try { if (Directory.Exists(DestinationDirectory)) { if (OverwriteDestination == true) { Log.LogMessage(MessageImportance.Low, "'{0}' already exists, trying to delete before unzipping...", DestinationDirectory); Directory.Delete(DestinationDirectory, recursive: true); } } Log.LogMessage(MessageImportance.High, "Decompressing '{0}' into '{1}'...", SourceArchive, DestinationDirectory); if (!Directory.Exists(Path.GetDirectoryName(DestinationDirectory))) Directory.CreateDirectory(Path.GetDirectoryName(DestinationDirectory)); // match tar default behavior to overwrite by default // Replace this code with ZipFile.ExtractToDirectory when https://github.com/dotnet/corefx/pull/14806 is available using (ZipArchive archive = ZipFile.Open(SourceArchive, ZipArchiveMode.Read)) { DirectoryInfo di = Directory.CreateDirectory(DestinationDirectory); string destinationDirectoryFullPath = di.FullName; foreach (ZipArchiveEntry entry in archive.Entries) { string fileDestinationPath = Path.GetFullPath(Path.Combine(destinationDirectoryFullPath, entry.FullName)); if (Path.GetFileName(fileDestinationPath).Length == 0) { // If it is a directory: Directory.CreateDirectory(fileDestinationPath); } else { // If it is a file: // Create containing directory: Directory.CreateDirectory(Path.GetDirectoryName(fileDestinationPath)); entry.ExtractToFile(fileDestinationPath, overwrite: true); } } } } catch (Exception e) { // We have 2 log calls because we want a nice error message but we also want to capture the callstack in the log. Log.LogError("An exception has occured while trying to decompress '{0}' into '{1}'.", SourceArchive, DestinationDirectory); Log.LogMessage(MessageImportance.Low, e.ToString()); return false; } return true; } } }
42.302326
146
0.557174
[ "MIT" ]
APiZFiBlockChain4/cli
build_projects/dotnet-cli-build/ZipFileExtractToDirectory.cs
3,640
C#
/******************************************************************************* * Copyright 2012-2019 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. * ***************************************************************************** * * AWS Tools for Windows (TM) PowerShell (TM) * */ using System; using System.Collections.Generic; using System.Linq; using System.Management.Automation; using System.Text; using Amazon.PowerShell.Common; using Amazon.Runtime; using Amazon.ConfigService; using Amazon.ConfigService.Model; namespace Amazon.PowerShell.Cmdlets.CFG { /// <summary> /// Returns a list of organization conformance packs. /// /// <note><para> /// When you specify the limit and the next token, you receive a paginated response. /// </para><para> /// Limit and next token are not applicable if you specify organization conformance packs /// names. They are only applicable, when you request all the organization conformance /// packs. /// </para></note><br/><br/>This cmdlet automatically pages all available results to the pipeline - parameters related to iteration are only needed if you want to manually control the paginated output. To disable autopagination, use -NoAutoIteration. /// </summary> [Cmdlet("Get", "CFGOrganizationConformancePack")] [OutputType("Amazon.ConfigService.Model.OrganizationConformancePack")] [AWSCmdlet("Calls the AWS Config DescribeOrganizationConformancePacks API operation.", Operation = new[] {"DescribeOrganizationConformancePacks"}, SelectReturnType = typeof(Amazon.ConfigService.Model.DescribeOrganizationConformancePacksResponse))] [AWSCmdletOutput("Amazon.ConfigService.Model.OrganizationConformancePack or Amazon.ConfigService.Model.DescribeOrganizationConformancePacksResponse", "This cmdlet returns a collection of Amazon.ConfigService.Model.OrganizationConformancePack objects.", "The service call response (type Amazon.ConfigService.Model.DescribeOrganizationConformancePacksResponse) can also be referenced from properties attached to the cmdlet entry in the $AWSHistory stack." )] public partial class GetCFGOrganizationConformancePackCmdlet : AmazonConfigServiceClientCmdlet, IExecutor { #region Parameter OrganizationConformancePackName /// <summary> /// <para> /// <para>The name that you assign to an organization conformance pack.</para> /// </para> /// </summary> [System.Management.Automation.Parameter(Position = 0, ValueFromPipelineByPropertyName = true, ValueFromPipeline = true)] [Alias("OrganizationConformancePackNames")] public System.String[] OrganizationConformancePackName { get; set; } #endregion #region Parameter Limit /// <summary> /// <para> /// <para>The maximum number of organization config packs returned on each page. If you do no /// specify a number, Config uses the default. The default is 100.</para> /// </para> /// <para> /// <br/><b>Note:</b> In AWSPowerShell and AWSPowerShell.NetCore this parameter is used to limit the total number of items returned by the cmdlet. /// <br/>In AWS.Tools this parameter is simply passed to the service to specify how many items should be returned by each service call. /// <br/>Pipe the output of this cmdlet into Select-Object -First to terminate retrieving data pages early and control the number of items returned. /// </para> /// </summary> [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("MaxItems")] public int? Limit { get; set; } #endregion #region Parameter NextToken /// <summary> /// <para> /// <para>The nextToken string returned on a previous page that you use to get the next page /// of results in a paginated response.</para> /// </para> /// <para> /// <br/><b>Note:</b> This parameter is only used if you are manually controlling output pagination of the service API call. /// <br/>In order to manually control output pagination, use '-NextToken $null' for the first call and '-NextToken $AWSHistory.LastServiceResponse.NextToken' for subsequent calls. /// </para> /// </summary> [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String NextToken { get; set; } #endregion #region Parameter Select /// <summary> /// Use the -Select parameter to control the cmdlet output. The default value is 'OrganizationConformancePacks'. /// Specifying -Select '*' will result in the cmdlet returning the whole service response (Amazon.ConfigService.Model.DescribeOrganizationConformancePacksResponse). /// Specifying the name of a property of type Amazon.ConfigService.Model.DescribeOrganizationConformancePacksResponse will result in that property being returned. /// Specifying -Select '^ParameterName' will result in the cmdlet returning the selected cmdlet parameter value. /// </summary> [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public string Select { get; set; } = "OrganizationConformancePacks"; #endregion #region Parameter PassThru /// <summary> /// Changes the cmdlet behavior to return the value passed to the OrganizationConformancePackName parameter. /// The -PassThru parameter is deprecated, use -Select '^OrganizationConformancePackName' instead. This parameter will be removed in a future version. /// </summary> [System.Obsolete("The -PassThru parameter is deprecated, use -Select '^OrganizationConformancePackName' instead. This parameter will be removed in a future version.")] [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public SwitchParameter PassThru { get; set; } #endregion #region Parameter NoAutoIteration /// <summary> /// By default the cmdlet will auto-iterate and retrieve all results to the pipeline by performing multiple /// service calls. If set, the cmdlet will retrieve only the next 'page' of results using the value of NextToken /// as the start point. /// </summary> [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public SwitchParameter NoAutoIteration { get; set; } #endregion protected override void ProcessRecord() { base.ProcessRecord(); var context = new CmdletContext(); // allow for manipulation of parameters prior to loading into context PreExecutionContextLoad(context); #pragma warning disable CS0618, CS0612 //A class member was marked with the Obsolete attribute if (ParameterWasBound(nameof(this.Select))) { context.Select = CreateSelectDelegate<Amazon.ConfigService.Model.DescribeOrganizationConformancePacksResponse, GetCFGOrganizationConformancePackCmdlet>(Select) ?? throw new System.ArgumentException("Invalid value for -Select parameter.", nameof(this.Select)); if (this.PassThru.IsPresent) { throw new System.ArgumentException("-PassThru cannot be used when -Select is specified.", nameof(this.Select)); } } else if (this.PassThru.IsPresent) { context.Select = (response, cmdlet) => this.OrganizationConformancePackName; } #pragma warning restore CS0618, CS0612 //A class member was marked with the Obsolete attribute context.Limit = this.Limit; #if !MODULAR if (ParameterWasBound(nameof(this.Limit)) && this.Limit.HasValue) { WriteWarning("AWSPowerShell and AWSPowerShell.NetCore use the Limit parameter to limit the total number of items returned by the cmdlet." + " This behavior is obsolete and will be removed in a future version of these modules. Pipe the output of this cmdlet into Select-Object -First to terminate" + " retrieving data pages early and control the number of items returned. AWS.Tools already implements the new behavior of simply passing Limit" + " to the service to specify how many items should be returned by each service call."); } #endif context.NextToken = this.NextToken; if (this.OrganizationConformancePackName != null) { context.OrganizationConformancePackName = new List<System.String>(this.OrganizationConformancePackName); } // allow further manipulation of loaded context prior to processing PostExecutionContextLoad(context); var output = Execute(context) as CmdletOutput; ProcessOutput(output); } #region IExecutor Members #if MODULAR public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; #pragma warning disable CS0618, CS0612 //A class member was marked with the Obsolete attribute var useParameterSelect = this.Select.StartsWith("^") || this.PassThru.IsPresent; #pragma warning restore CS0618, CS0612 //A class member was marked with the Obsolete attribute // create request and set iteration invariants var request = new Amazon.ConfigService.Model.DescribeOrganizationConformancePacksRequest(); if (cmdletContext.Limit != null) { request.Limit = AutoIterationHelpers.ConvertEmitLimitToServiceTypeInt32(cmdletContext.Limit.Value); } if (cmdletContext.OrganizationConformancePackName != null) { request.OrganizationConformancePackNames = cmdletContext.OrganizationConformancePackName; } // Initialize loop variant and commence piping var _nextToken = cmdletContext.NextToken; var _userControllingPaging = this.NoAutoIteration.IsPresent || ParameterWasBound(nameof(this.NextToken)); var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint); do { request.NextToken = _nextToken; CmdletOutput output; try { var response = CallAWSServiceOperation(client, request); object pipelineOutput = null; if (!useParameterSelect) { pipelineOutput = cmdletContext.Select(response, this); } output = new CmdletOutput { PipelineOutput = pipelineOutput, ServiceResponse = response }; _nextToken = response.NextToken; } catch (Exception e) { output = new CmdletOutput { ErrorResponse = e }; } ProcessOutput(output); } while (!_userControllingPaging && AutoIterationHelpers.HasValue(_nextToken)); if (useParameterSelect) { WriteObject(cmdletContext.Select(null, this)); } return null; } #else public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; var useParameterSelect = this.Select.StartsWith("^") || this.PassThru.IsPresent; // create request and set iteration invariants var request = new Amazon.ConfigService.Model.DescribeOrganizationConformancePacksRequest(); if (cmdletContext.OrganizationConformancePackName != null) { request.OrganizationConformancePackNames = cmdletContext.OrganizationConformancePackName; } // Initialize loop variants and commence piping System.String _nextToken = null; int? _emitLimit = null; int _retrievedSoFar = 0; if (AutoIterationHelpers.HasValue(cmdletContext.NextToken)) { _nextToken = cmdletContext.NextToken; } if (cmdletContext.Limit.HasValue) { // The service has a maximum page size of 100. If the user has // asked for more items than page max, and there is no page size // configured, we rely on the service ignoring the set maximum // and giving us 100 items back. If a page size is set, that will // be used to configure the pagination. // We'll make further calls to satisfy the user's request. _emitLimit = cmdletContext.Limit; } var _userControllingPaging = this.NoAutoIteration.IsPresent || ParameterWasBound(nameof(this.NextToken)); var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint); do { request.NextToken = _nextToken; if (_emitLimit.HasValue) { int correctPageSize = Math.Min(100, _emitLimit.Value); request.Limit = AutoIterationHelpers.ConvertEmitLimitToInt32(correctPageSize); } CmdletOutput output; try { var response = CallAWSServiceOperation(client, request); object pipelineOutput = null; if (!useParameterSelect) { pipelineOutput = cmdletContext.Select(response, this); } output = new CmdletOutput { PipelineOutput = pipelineOutput, ServiceResponse = response }; int _receivedThisCall = response.OrganizationConformancePacks.Count; _nextToken = response.NextToken; _retrievedSoFar += _receivedThisCall; if (_emitLimit.HasValue) { _emitLimit -= _receivedThisCall; } } catch (Exception e) { if (_retrievedSoFar == 0 || !_emitLimit.HasValue) { output = new CmdletOutput { ErrorResponse = e }; } else { break; } } ProcessOutput(output); } while (!_userControllingPaging && AutoIterationHelpers.HasValue(_nextToken) && (!_emitLimit.HasValue || _emitLimit.Value >= 0)); if (useParameterSelect) { WriteObject(cmdletContext.Select(null, this)); } return null; } #endif public ExecutorContext CreateContext() { return new CmdletContext(); } #endregion #region AWS Service Operation Call private Amazon.ConfigService.Model.DescribeOrganizationConformancePacksResponse CallAWSServiceOperation(IAmazonConfigService client, Amazon.ConfigService.Model.DescribeOrganizationConformancePacksRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Config", "DescribeOrganizationConformancePacks"); try { #if DESKTOP return client.DescribeOrganizationConformancePacks(request); #elif CORECLR return client.DescribeOrganizationConformancePacksAsync(request).GetAwaiter().GetResult(); #else #error "Unknown build edition" #endif } catch (AmazonServiceException exc) { var webException = exc.InnerException as System.Net.WebException; if (webException != null) { throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException); } throw; } } #endregion internal partial class CmdletContext : ExecutorContext { public int? Limit { get; set; } public System.String NextToken { get; set; } public List<System.String> OrganizationConformancePackName { get; set; } public System.Func<Amazon.ConfigService.Model.DescribeOrganizationConformancePacksResponse, GetCFGOrganizationConformancePackCmdlet, object> Select { get; set; } = (response, cmdlet) => response.OrganizationConformancePacks; } } }
48.186842
254
0.597674
[ "Apache-2.0" ]
aws/aws-tools-for-powershell
modules/AWSPowerShell/Cmdlets/ConfigService/Basic/Get-CFGOrganizationConformancePack-Cmdlet.cs
18,311
C#
using System; using System.Data; using System.Data.SqlClient; using System.Globalization; namespace DataBridge.SqlServer.IntegrationTests { internal static class TestDatabase { private const int SqlErrorCodeDatabaseNotExists = -2146232060; public static void EnsureCleanDatabaseExists(string dbConnString, string msdbConnString) { var alreadyExists = false; string dbName = null; using (var conn = new SqlConnection(dbConnString)) { dbName = conn.Database; try { if (conn.State != ConnectionState.Open) { conn.Open(); } alreadyExists = true; conn.Close(); } catch (SqlException ex) { if (ex.ErrorCode == SqlErrorCodeDatabaseNotExists) { alreadyExists = false; } else { throw; } } } if (alreadyExists) { KillDatabaseConnections(msdbConnString, dbName); DropDatabase(msdbConnString, dbName); } CreateDatabase(msdbConnString, dbName); CreateTableOne(dbConnString); } private static void CreateDatabase(string msdbConnString, string dbName) { using (var msdbConn = new SqlConnection(msdbConnString)) { msdbConn.Open(); var msdbCmd = new SqlCommand($"CREATE DATABASE [{dbName}]", msdbConn); msdbCmd.ExecuteNonQuery(); msdbConn.Close(); } } private static void KillDatabaseConnections(string msdbConnString, string dbName) { using (var msdbConn = new SqlConnection(msdbConnString)) { msdbConn.Open(); var msdbCmd = new SqlCommand($"ALTER DATABASE [{dbName}] SET SINGLE_USER WITH ROLLBACK IMMEDIATE", msdbConn); msdbCmd.ExecuteNonQuery(); msdbConn.Close(); } } private static void DropDatabase(string msdbConnString, string dbName) { using (var msdbConn = new SqlConnection(msdbConnString)) { msdbConn.Open(); var msdbCmd = new SqlCommand($"DROP DATABASE [{dbName}]", msdbConn); msdbCmd.ExecuteNonQuery(); msdbConn.Close(); } } private static void CreateTableOne(string dbConnString) { using (var dbConn = new SqlConnection(dbConnString)) { dbConn.Open(); var cmd = new SqlCommand($@" CREATE TABLE TableOne ( Id int IDENTITY(1,1) PRIMARY KEY, LastUpdatedOnUtc DATETIME NOT NULL, Name varchar(255), DateOfBirthUtc DATETIME )" , dbConn); cmd.ExecuteNonQuery(); dbConn.Close(); } } public static void InsertOneRowIntoTableOne(string dbConnString) { using (var dbConn = new SqlConnection(dbConnString)) { dbConn.Open(); var cmd = new SqlCommand($@" INSERT INTO TableOne (LastUpdatedOnUtc, Name, DateOfBirthUtc) VALUES ('{DateTime.UtcNow.ToString("yyyy-MM-dd HH:m:ss", DateTimeFormatInfo.CurrentInfo)}', 'One', '2000-01-01 13:00:00')" , dbConn); cmd.ExecuteNonQuery(); dbConn.Close(); } } } }
32.051282
125
0.5096
[ "MIT" ]
nootn/DataBridge
DataBridge.SqlServer.IntegrationTests/TestDatabase.cs
3,752
C#
using System.Collections.Generic; using System.Diagnostics; using TES3Lib.Base; using TES3Lib.Subrecords.ALCH; using TES3Lib.Subrecords.Shared; using TES3Lib.Subrecords.Shared.Castable; namespace TES3Lib.Records { [DebuggerDisplay("{NAME.EditorId}")] public class ALCH : Record { /// <summary> /// EditorId /// </summary> public NAME NAME { get; set; } /// <summary> /// Model /// </summary> public MODL MODL { get; set; } /// <summary> /// Icon /// </summary> public TEXT TEXT { get; set; } /// <summary> /// Display name /// </summary> public FNAM FNAM { get; set; } /// <summary> /// Item properties /// </summary> public ALDT ALDT { get; set; } /// <summary> /// List of magical effects /// </summary> public List<ENAM> ENAM { get; set; } /// <summary> /// Script /// </summary> public SCRI SCRI { get; set; } public ALCH() { } public ALCH(byte[] rawData) : base(rawData) { BuildSubrecords(); } } }
20.913793
51
0.490519
[ "MIT" ]
NullCascade/TES3Tool
TES3Lib/Records/ALCH.cs
1,215
C#
using System; using System.Collections.Generic; using System.Linq; namespace HoneybeeSchema { public class ConstrucitonThermalCalculator { private static List<Energy.IMaterial> MaterialList { get; set; } public static void CalOpaqueValues(List<Energy.IMaterial> materials, out double RValue, out double RFactor) { MaterialList = materials; RValue = materials.Select(_ => _.RValue).Sum(); RFactor = RValue + (1 / OutdoorHeatTransferCoeff) + (1 / IndoorHeatTransferCoeff); } public static void CalWindowValues(List<Energy.IMaterial> materials, out double RValue, out double RFactor, out double solarT, out double SHGC, out double vt) { //instance.MaterialList = materials; MaterialList = materials; var gaps = materials.OfType<Energy.IWindowMaterialGas>(); var gapCount = gaps.Count(); if (gapCount == 0) { RValue = materials.FirstOrDefault().RValue; RFactor = RValue + 1 / Out_h_simple + 1 / In_h_simple; } else { Cal_layered_r_value_initial(gapCount, out var r_vals, out var emissivities); var rs = Solve_r_value(r_vals, emissivities); RValue = rs.Skip(1).Reverse().Skip(1).Sum(); // remove the first and last for R value RFactor = rs.Sum(); } var mats = materials; //SolarT, SHGC if (mats.FirstOrDefault() is EnergyWindowMaterialSimpleGlazSys glz) { solarT = glz.SolarTransmittance; SHGC = glz.Shgc; vt = glz.Vt; } else { //SolarT solarT = CalSolarTrans(mats); //VisT vt = CalVisTrans(mats); //SHGC var u_fac = 1 / RFactor; var t_sol = solarT; Func<double, double> fn = (x) => EnergyWindowMaterialSimpleGlazSys.CalSolarTransmittance(u_fac, x) - t_sol; SHGC = Secant(0, 1, fn, 0.01); } } private static double InsideEmissivity => GetMaterialEmissivityBack(MaterialList.LastOrDefault()); private static double OutsideEmissivity => GetMaterialEmissivity(MaterialList.FirstOrDefault()); private static double GetMaterialEmissivityBack(Energy.IMaterial material) { var insideEmissivity = 0.9; var insideMaterial = material; if (insideMaterial is EnergyWindowMaterialSimpleGlazSys) insideEmissivity = 0.84; else if (insideMaterial is EnergyWindowMaterialBlind blind) insideEmissivity = blind.EmissivityBack; else if (insideMaterial is EnergyWindowMaterialGlazing glz) insideEmissivity = glz.EmissivityBack; else if (insideMaterial is EnergyWindowMaterialShade shd) insideEmissivity = shd.Emissivity; // opaque else if (insideMaterial is EnergyMaterial opq) insideEmissivity = opq.ThermalAbsorptance; else if (insideMaterial is EnergyMaterialNoMass noMass) insideEmissivity = noMass.ThermalAbsorptance; return insideEmissivity; } private static double GetMaterialEmissivity(Energy.IMaterial material) { var emmiss = 0.9; var mat = material; if (mat is Energy.IWindowMaterialGlazing glz) emmiss = glz.Emissivity; else if (mat is Energy.IWindowMaterialShade shd) emmiss = shd.Emissivity; // opaque else if (mat is EnergyMaterial opq) emmiss = opq.ThermalAbsorptance; else if (mat is EnergyMaterialNoMass noMass) emmiss = noMass.ThermalAbsorptance; return emmiss; } #region OpaqueConstruction helpers //https://github.com/ladybug-tools/honeybee-energy/blob/e8ee6e5cd325f88d4ba67ca0e4bc910f479fe332/honeybee_energy/construction/_base.py#L162 private static double OutdoorHeatTransferCoeff => 23; private static double IndoorHeatTransferCoeff => 3.6 + (4.4 * InsideEmissivity / 0.84); #endregion #region WindowConstruction helpers //https://github.com/ladybug-tools/honeybee-energy/blob/e8ee6e5cd325f88d4ba67ca0e4bc910f479fe332/honeybee_energy/construction/_base.py#L162 private static double Out_h_simple => 23; private static double In_h_simple => 3.6 + (4.4 * InsideEmissivity / 0.84); private static double CalOut_h(double wind_speed = 6.7, double t_kelvin = 273.15) { var conv_h = 4 + (4 * wind_speed); var rad_h = 4 * 5.6697e-8 * OutsideEmissivity * Math.Pow(t_kelvin, 3); return conv_h + rad_h; } private static double CalIn_h(double t_kelvin = 293.15, double delta_t = 15, double height = 1.0, double angle = 90, double pressure = 101325) { var airDensity = 28.97 * pressure * 0.001 / (8.314 * t_kelvin); var airSpecificHeat = 1002.73699951 + 0.012324 * t_kelvin; var airViscosity = 0.00000372 + 0.00000005 * t_kelvin; var airConductivity = 0.002873 + 0.0000776 * t_kelvin; var _ray_numerator = (airDensity * airDensity) * Math.Pow(height, 3) * 9.81 * airSpecificHeat * delta_t; var _ray_denominator = t_kelvin * airViscosity * airConductivity; var _rayleigh_h = Math.Abs(_ray_numerator / _ray_denominator); var _sin_a = Math.Sin(Math.PI / 180 * angle); var _rayleigh_c = 2.5e5 * Math.Pow((Math.Exp(0.72 * angle) / _sin_a), (1 / 5.0)); var nusselt = 0.0; if (_rayleigh_h < _rayleigh_c) { nusselt = 0.56 * Math.Pow(_rayleigh_h * _sin_a, (1 / 4.0)); } else { var nu_1 = 0.56 * Math.Pow((_rayleigh_c * _sin_a), (1 / 4.0)); var nu_2 = 0.13 * (Math.Pow(_rayleigh_h, (1 / 3.0)) - Math.Pow(_rayleigh_c, (1 / 3.0))); nusselt = nu_1 + nu_2; } var _conv_h = nusselt * (airConductivity / height); var _rad_h = 4 * 5.6697e-8 * InsideEmissivity * Math.Pow(t_kelvin, 3); return _conv_h + _rad_h; } //https://github.com/ladybug-tools/honeybee-energy/blob/e8ee6e5cd325f88d4ba67ca0e4bc910f479fe332/honeybee_energy/construction/window.py#L510 private static void Cal_layered_r_value_initial(int gap_count, out List<double> r_vals, out List<(double back, double front)> emiss, double delta_t_guess = 15, double avg_t_guess = 273.15, double wind_speed = 6.7) { r_vals = new List<double>() { 1 / CalOut_h(wind_speed, avg_t_guess - delta_t_guess) }; emiss = new List<(double back, double front)>(); var delta_t = delta_t_guess / gap_count; var mats = MaterialList.ToList(); var i = 0; foreach (var mat in mats) { if (mat is Energy.IWindowMaterialGlazing glz) { r_vals.Add(glz.RValue); emiss.Add((0.84, 0.84)); } else if (mat is Energy.IWindowMaterialGas gas) // # gas material { var e_front = GetMaterialEmissivity(mats[i + 1]); var e_back = GetMaterialEmissivityBack(mats[i - 1]); var u = gas.CalUValue(delta_t, e_back, e_front, t_kelvin: avg_t_guess); r_vals.Add(1 / u); emiss.Add((e_back, e_front)); } i++; } r_vals.Add(1 / In_h_simple); } private static List<double> Cal_layered_r_value(List<double> temperatures, List<double> r_values_init, List<(double back, double front)> emiss, double height = 1.0, double angle = 90.0, double pressure = 101325) { var r_vals = new List<double>() { r_values_init[0] }; var mats = MaterialList.ToList(); var mat_counts = mats.Count; for (int i = 0; i < mat_counts; i++) { var mat = mats[i]; if (mat is Energy.IWindowMaterialGlazing glz) { r_vals.Add(r_values_init[i + 1]); } else if (mat is Energy.IWindowMaterialGas gas) // # gas material { var delta_t = Math.Abs(temperatures[i + 1] - temperatures[i + 2]); var avg_temp = ((temperatures[i + 1] + temperatures[i + 2]) / 2) + 273.15; var u = gas.CalUValueAtAngle(delta_t, emiss[i].back, emiss[i].front, height, angle, avg_temp, pressure); r_vals.Add(1 / u); } } var tCount = temperatures.Count; var delta_t2 = Math.Abs(temperatures[tCount - 1] - temperatures[tCount - 2]); var avg_temp2 = ((temperatures[tCount - 1] + temperatures[tCount - 2]) / 2) + 273.15; r_vals.Add(1 / CalIn_h(avg_temp2, delta_t2, height, angle, pressure)); return r_vals; } private static List<double> Solve_r_value(List<double> r_vals, List<(double back, double front)> emissivities) { var r_last = 0.0; var r_next = r_vals.Sum(); while (System.Math.Abs(r_next - r_last) > 0.001) // # 0.001 is the r-value tolerance { r_last = r_vals.Sum(); var temperatures = Temperature_profile_from_r_values(r_vals); r_vals = Cal_layered_r_value(temperatures, r_vals, emissivities); r_next = r_vals.Sum(); } return r_vals; } private static List<double> Temperature_profile_from_r_values( List<double> r_values, double outside_temperature = -18, double inside_temperature = 21) { // """Get a list of temperatures at each material boundary between R-values.""" var r_factor = r_values.Sum(); var delta_t = inside_temperature - outside_temperature; var temperatures = new List<double>() { outside_temperature }; for (int i = 0; i < r_values.Count; i++) { temperatures.Add(temperatures[i] + (delta_t * (r_values[i] / r_factor))); } return temperatures; } #endregion private static double CalSolarTrans(List<Energy.IMaterial> mats) { var i = 0; var trans = 1.0; var gap_refs = new List<double>(); foreach (var item in mats) { if (item is EnergyWindowMaterialGlazing mat) { if (i != 0) { var reff = 0.0; var prev_pane = mats[i - 2] as EnergyWindowMaterialGlazing; var solRefBack = prev_pane.SolarReflectanceBack.Obj; var prev_pane_solRefBack = solRefBack is double sfb ? sfb : 1; var ref_i = mat.SolarReflectance * prev_pane_solRefBack; for (int r = 0; r < 3; r++) //# simulate 3 bounces back and forth { reff += ref_i; ref_i = ref_i * ref_i; } foreach (var prev_ref in gap_refs) { var b_ref_i = mat.SolarReflectance * prev_ref; for (int r = 0; r < 3; r++) //# simulate 3 bounces back and forth { reff += b_ref_i; b_ref_i = b_ref_i * b_ref_i; } } gap_refs.Add(prev_pane_solRefBack); trans += reff * trans; //# add the back-reflected portion } trans *= mat.SolarTransmittance; // pass everything through the glass } i++; } return trans; } private static double CalVisTrans(List<Energy.IMaterial> mats) { var i = 0; var trans = 1.0; var gap_refs = new List<double>(); foreach (var item in mats) { if (item is EnergyWindowMaterialGlazing mat) { if (i != 0) { var reff = 0.0; var prev_pane = mats[i - 2] as EnergyWindowMaterialGlazing; var solRefBack = prev_pane.VisibleReflectanceBack.Obj; var prev_pane_solRefBack = solRefBack is double sfb ? sfb : 1; var ref_i = mat.VisibleReflectance * prev_pane_solRefBack; for (int r = 0; r < 3; r++) //# simulate 3 bounces back and forth { reff += ref_i; ref_i = ref_i * ref_i; } foreach (var prev_ref in gap_refs) { var b_ref_i = mat.VisibleReflectance * prev_ref; for (int r = 0; r < 3; r++) //# simulate 3 bounces back and forth { reff += b_ref_i; b_ref_i = b_ref_i * b_ref_i; } } gap_refs.Add(prev_pane_solRefBack); trans += reff * trans; //# add the back-reflected portion } trans *= mat.VisibleTransmittance; // pass everything through the glass } i++; } return trans; } private static double Secant(double a, double b, Func<double, double> fn, double epsilon) { var f1 = fn(a); if (Math.Abs(f1) <= epsilon) return a; var f2 = fn(b); if (Math.Abs(f2) <= epsilon) return b; for (int i = 0; i < 100; i++) { var slope = (f2 - f1) / (b - a); var c = b - f2 / slope; var f3 = fn(c); if (Math.Abs(f3) <= epsilon) return c; a = b; b = c; f1 = f2; f2 = f3; } return 0; } } } ;
40.847826
167
0.51244
[ "MIT" ]
chriswmackey/honeybee-schema-dotnet
src/HoneybeeSchema/ManualAdded/Model/ConstrucitonThermalCalculator.cs
15,034
C#
namespace Employees.App.Command { using System; public class ExitCommand : ICommand { public string Execute(params string[] args) { Console.WriteLine("Good Bye!"); Environment.Exit(0); return string.Empty; } } }
18.1875
51
0.549828
[ "MIT" ]
Pazzobg/03.01.CSharp-DB-Advanced-Entity-Framework
11. EF Core AutoMapping Objects/P01_EmployeesMappingUsingServices/Employees.App/Command/ExitCommand.cs
293
C#
using System.Diagnostics; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Wexflow.DotnetCore.Tests { [TestClass] public class FileContentMatch { [TestInitialize] public void TestInitialize() { } [TestCleanup] public void TestCleanup() { } [TestMethod] public void FileContentMatchTest() { Stopwatch stopwatch = Stopwatch.StartNew(); Helper.StartWorkflow(126); stopwatch.Stop(); Assert.IsTrue(stopwatch.ElapsedMilliseconds > 1000); stopwatch.Reset(); stopwatch.Start(); Helper.StartWorkflow(127); stopwatch.Stop(); Assert.IsTrue(stopwatch.ElapsedMilliseconds > 2000); } } }
24.823529
65
0.552133
[ "MIT" ]
mohammad-matini/wexflow
tests/dotnet-core/Wexflow.DotnetCore.Tests/FileContentMatch.cs
846
C#
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. namespace Microsoft.ClearScript.JavaScript { /// <summary> /// Defines properties and methods common to all JavaScript /// <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays">typed arrays</see>. /// </summary> public interface ITypedArray : IArrayBufferView { /// <summary> /// Gets the typed array's length. /// </summary> ulong Length { get; } } /// <summary> /// Represents a JavaScript <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays">typed array</see>. /// </summary> /// <typeparam name="T">The typed array's element type.</typeparam> /// <remarks> /// <para> /// The following table lists the specific interfaces implemented by JavaScript typed arrays: /// </para> /// <para> /// <list type="table"> /// <listheader> /// <term>Typed&#xA0;Array</term> /// <term>Interface(s)&#xA0;(C#)</term> /// </listheader> /// <item> /// <term><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array">Uint8Array</see></term> /// <term><c>ITypedArray&#x3C;byte&#x3E;</c></term> /// </item> /// <item> /// <term><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray">Uint8ClampedArray</see></term> /// <term><c>ITypedArray&#x3C;byte&#x3E;</c></term> /// </item> /// <item> /// <term><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array">Int8Array</see></term> /// <term><c>ITypedArray&#x3C;sbyte&#x3E;</c></term> /// </item> /// <item> /// <term><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array">Uint16Array</see></term> /// <term><c>ITypedArray&#x3C;ushort&#x3E;</c> and <c>ITypedArray&#x3C;char&#x3E;</c></term> /// </item> /// <item> /// <term><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array">Int16Array</see></term> /// <term><c>ITypedArray&#x3C;short&#x3E;</c></term> /// </item> /// <item> /// <term><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array">Uint32Array</see></term> /// <term><c>ITypedArray&#x3C;uint&#x3E;</c></term> /// </item> /// <item> /// <term><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array">Int32Array</see></term> /// <term><c>ITypedArray&#x3C;int&#x3E;</c></term> /// </item> /// <item> /// <term><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array">Float32Array</see></term> /// <term><c>ITypedArray&#x3C;float&#x3E;</c></term> /// </item> /// <item> /// <term><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array">Float64Array</see></term> /// <term><c>ITypedArray&#x3C;double&#x3E;</c></term> /// </item> /// </list> /// </para> /// </remarks> public interface ITypedArray<T> : ITypedArray { /// <summary> /// Creates an array containing a copy of the typed array's contents. /// </summary> /// <returns>A new array containing a copy of the typed array's contents.</returns> T[] ToArray(); /// <summary> /// Copies elements from the typed array into the specified array. /// </summary> /// <param name="index">The index within the typed array of the first element to copy.</param> /// <param name="length">The maximum number of elements to copy.</param> /// <param name="destination">The array into which to copy the elements.</param> /// <param name="destinationIndex">The index within <paramref name="destination"/> at which to store the first copied element.</param> /// <returns>The number of elements copied.</returns> ulong Read(ulong index, ulong length, T[] destination, ulong destinationIndex); /// <summary> /// Copies elements from the specified array into the typed array. /// </summary> /// <param name="source">The array from which to copy the elements.</param> /// <param name="sourceIndex">The index within <paramref name="source"/> of the first element to copy.</param> /// <param name="length">The maximum number of elements to copy.</param> /// <param name="index">The index within the typed array at which to store the first copied element.</param> /// <returns>The number of elements copied.</returns> ulong Write(T[] source, ulong sourceIndex, ulong length, ulong index); } }
51.64
163
0.601278
[ "MIT" ]
Amalkarunakaran/ClearScript
ClearScript/JavaScript/ITypedArray.cs
5,164
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 ssm-2014-11-06.normal.json service model. */ using System; using Amazon.Runtime; namespace Amazon.SimpleSystemsManagement { /// <summary> /// Constants used for properties of type AssociationComplianceSeverity. /// </summary> public class AssociationComplianceSeverity : ConstantClass { /// <summary> /// Constant CRITICAL for AssociationComplianceSeverity /// </summary> public static readonly AssociationComplianceSeverity CRITICAL = new AssociationComplianceSeverity("CRITICAL"); /// <summary> /// Constant HIGH for AssociationComplianceSeverity /// </summary> public static readonly AssociationComplianceSeverity HIGH = new AssociationComplianceSeverity("HIGH"); /// <summary> /// Constant LOW for AssociationComplianceSeverity /// </summary> public static readonly AssociationComplianceSeverity LOW = new AssociationComplianceSeverity("LOW"); /// <summary> /// Constant MEDIUM for AssociationComplianceSeverity /// </summary> public static readonly AssociationComplianceSeverity MEDIUM = new AssociationComplianceSeverity("MEDIUM"); /// <summary> /// Constant UNSPECIFIED for AssociationComplianceSeverity /// </summary> public static readonly AssociationComplianceSeverity UNSPECIFIED = new AssociationComplianceSeverity("UNSPECIFIED"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public AssociationComplianceSeverity(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static AssociationComplianceSeverity FindValue(string value) { return FindValue<AssociationComplianceSeverity>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator AssociationComplianceSeverity(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type AssociationExecutionFilterKey. /// </summary> public class AssociationExecutionFilterKey : ConstantClass { /// <summary> /// Constant CreatedTime for AssociationExecutionFilterKey /// </summary> public static readonly AssociationExecutionFilterKey CreatedTime = new AssociationExecutionFilterKey("CreatedTime"); /// <summary> /// Constant ExecutionId for AssociationExecutionFilterKey /// </summary> public static readonly AssociationExecutionFilterKey ExecutionId = new AssociationExecutionFilterKey("ExecutionId"); /// <summary> /// Constant Status for AssociationExecutionFilterKey /// </summary> public static readonly AssociationExecutionFilterKey Status = new AssociationExecutionFilterKey("Status"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public AssociationExecutionFilterKey(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static AssociationExecutionFilterKey FindValue(string value) { return FindValue<AssociationExecutionFilterKey>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator AssociationExecutionFilterKey(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type AssociationExecutionTargetsFilterKey. /// </summary> public class AssociationExecutionTargetsFilterKey : ConstantClass { /// <summary> /// Constant ResourceId for AssociationExecutionTargetsFilterKey /// </summary> public static readonly AssociationExecutionTargetsFilterKey ResourceId = new AssociationExecutionTargetsFilterKey("ResourceId"); /// <summary> /// Constant ResourceType for AssociationExecutionTargetsFilterKey /// </summary> public static readonly AssociationExecutionTargetsFilterKey ResourceType = new AssociationExecutionTargetsFilterKey("ResourceType"); /// <summary> /// Constant Status for AssociationExecutionTargetsFilterKey /// </summary> public static readonly AssociationExecutionTargetsFilterKey Status = new AssociationExecutionTargetsFilterKey("Status"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public AssociationExecutionTargetsFilterKey(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static AssociationExecutionTargetsFilterKey FindValue(string value) { return FindValue<AssociationExecutionTargetsFilterKey>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator AssociationExecutionTargetsFilterKey(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type AssociationFilterKey. /// </summary> public class AssociationFilterKey : ConstantClass { /// <summary> /// Constant AssociationId for AssociationFilterKey /// </summary> public static readonly AssociationFilterKey AssociationId = new AssociationFilterKey("AssociationId"); /// <summary> /// Constant AssociationName for AssociationFilterKey /// </summary> public static readonly AssociationFilterKey AssociationName = new AssociationFilterKey("AssociationName"); /// <summary> /// Constant AssociationStatusName for AssociationFilterKey /// </summary> public static readonly AssociationFilterKey AssociationStatusName = new AssociationFilterKey("AssociationStatusName"); /// <summary> /// Constant InstanceId for AssociationFilterKey /// </summary> public static readonly AssociationFilterKey InstanceId = new AssociationFilterKey("InstanceId"); /// <summary> /// Constant LastExecutedAfter for AssociationFilterKey /// </summary> public static readonly AssociationFilterKey LastExecutedAfter = new AssociationFilterKey("LastExecutedAfter"); /// <summary> /// Constant LastExecutedBefore for AssociationFilterKey /// </summary> public static readonly AssociationFilterKey LastExecutedBefore = new AssociationFilterKey("LastExecutedBefore"); /// <summary> /// Constant Name for AssociationFilterKey /// </summary> public static readonly AssociationFilterKey Name = new AssociationFilterKey("Name"); /// <summary> /// Constant ResourceGroupName for AssociationFilterKey /// </summary> public static readonly AssociationFilterKey ResourceGroupName = new AssociationFilterKey("ResourceGroupName"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public AssociationFilterKey(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static AssociationFilterKey FindValue(string value) { return FindValue<AssociationFilterKey>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator AssociationFilterKey(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type AssociationFilterOperatorType. /// </summary> public class AssociationFilterOperatorType : ConstantClass { /// <summary> /// Constant EQUAL for AssociationFilterOperatorType /// </summary> public static readonly AssociationFilterOperatorType EQUAL = new AssociationFilterOperatorType("EQUAL"); /// <summary> /// Constant GREATER_THAN for AssociationFilterOperatorType /// </summary> public static readonly AssociationFilterOperatorType GREATER_THAN = new AssociationFilterOperatorType("GREATER_THAN"); /// <summary> /// Constant LESS_THAN for AssociationFilterOperatorType /// </summary> public static readonly AssociationFilterOperatorType LESS_THAN = new AssociationFilterOperatorType("LESS_THAN"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public AssociationFilterOperatorType(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static AssociationFilterOperatorType FindValue(string value) { return FindValue<AssociationFilterOperatorType>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator AssociationFilterOperatorType(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type AssociationStatusName. /// </summary> public class AssociationStatusName : ConstantClass { /// <summary> /// Constant Failed for AssociationStatusName /// </summary> public static readonly AssociationStatusName Failed = new AssociationStatusName("Failed"); /// <summary> /// Constant Pending for AssociationStatusName /// </summary> public static readonly AssociationStatusName Pending = new AssociationStatusName("Pending"); /// <summary> /// Constant Success for AssociationStatusName /// </summary> public static readonly AssociationStatusName Success = new AssociationStatusName("Success"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public AssociationStatusName(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static AssociationStatusName FindValue(string value) { return FindValue<AssociationStatusName>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator AssociationStatusName(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type AssociationSyncCompliance. /// </summary> public class AssociationSyncCompliance : ConstantClass { /// <summary> /// Constant AUTO for AssociationSyncCompliance /// </summary> public static readonly AssociationSyncCompliance AUTO = new AssociationSyncCompliance("AUTO"); /// <summary> /// Constant MANUAL for AssociationSyncCompliance /// </summary> public static readonly AssociationSyncCompliance MANUAL = new AssociationSyncCompliance("MANUAL"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public AssociationSyncCompliance(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static AssociationSyncCompliance FindValue(string value) { return FindValue<AssociationSyncCompliance>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator AssociationSyncCompliance(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type AttachmentHashType. /// </summary> public class AttachmentHashType : ConstantClass { /// <summary> /// Constant Sha256 for AttachmentHashType /// </summary> public static readonly AttachmentHashType Sha256 = new AttachmentHashType("Sha256"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public AttachmentHashType(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static AttachmentHashType FindValue(string value) { return FindValue<AttachmentHashType>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator AttachmentHashType(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type AttachmentsSourceKey. /// </summary> public class AttachmentsSourceKey : ConstantClass { /// <summary> /// Constant AttachmentReference for AttachmentsSourceKey /// </summary> public static readonly AttachmentsSourceKey AttachmentReference = new AttachmentsSourceKey("AttachmentReference"); /// <summary> /// Constant S3FileUrl for AttachmentsSourceKey /// </summary> public static readonly AttachmentsSourceKey S3FileUrl = new AttachmentsSourceKey("S3FileUrl"); /// <summary> /// Constant SourceUrl for AttachmentsSourceKey /// </summary> public static readonly AttachmentsSourceKey SourceUrl = new AttachmentsSourceKey("SourceUrl"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public AttachmentsSourceKey(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static AttachmentsSourceKey FindValue(string value) { return FindValue<AttachmentsSourceKey>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator AttachmentsSourceKey(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type AutomationExecutionFilterKey. /// </summary> public class AutomationExecutionFilterKey : ConstantClass { /// <summary> /// Constant AutomationSubtype for AutomationExecutionFilterKey /// </summary> public static readonly AutomationExecutionFilterKey AutomationSubtype = new AutomationExecutionFilterKey("AutomationSubtype"); /// <summary> /// Constant AutomationType for AutomationExecutionFilterKey /// </summary> public static readonly AutomationExecutionFilterKey AutomationType = new AutomationExecutionFilterKey("AutomationType"); /// <summary> /// Constant CurrentAction for AutomationExecutionFilterKey /// </summary> public static readonly AutomationExecutionFilterKey CurrentAction = new AutomationExecutionFilterKey("CurrentAction"); /// <summary> /// Constant DocumentNamePrefix for AutomationExecutionFilterKey /// </summary> public static readonly AutomationExecutionFilterKey DocumentNamePrefix = new AutomationExecutionFilterKey("DocumentNamePrefix"); /// <summary> /// Constant ExecutionId for AutomationExecutionFilterKey /// </summary> public static readonly AutomationExecutionFilterKey ExecutionId = new AutomationExecutionFilterKey("ExecutionId"); /// <summary> /// Constant ExecutionStatus for AutomationExecutionFilterKey /// </summary> public static readonly AutomationExecutionFilterKey ExecutionStatus = new AutomationExecutionFilterKey("ExecutionStatus"); /// <summary> /// Constant OpsItemId for AutomationExecutionFilterKey /// </summary> public static readonly AutomationExecutionFilterKey OpsItemId = new AutomationExecutionFilterKey("OpsItemId"); /// <summary> /// Constant ParentExecutionId for AutomationExecutionFilterKey /// </summary> public static readonly AutomationExecutionFilterKey ParentExecutionId = new AutomationExecutionFilterKey("ParentExecutionId"); /// <summary> /// Constant StartTimeAfter for AutomationExecutionFilterKey /// </summary> public static readonly AutomationExecutionFilterKey StartTimeAfter = new AutomationExecutionFilterKey("StartTimeAfter"); /// <summary> /// Constant StartTimeBefore for AutomationExecutionFilterKey /// </summary> public static readonly AutomationExecutionFilterKey StartTimeBefore = new AutomationExecutionFilterKey("StartTimeBefore"); /// <summary> /// Constant TagKey for AutomationExecutionFilterKey /// </summary> public static readonly AutomationExecutionFilterKey TagKey = new AutomationExecutionFilterKey("TagKey"); /// <summary> /// Constant TargetResourceGroup for AutomationExecutionFilterKey /// </summary> public static readonly AutomationExecutionFilterKey TargetResourceGroup = new AutomationExecutionFilterKey("TargetResourceGroup"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public AutomationExecutionFilterKey(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static AutomationExecutionFilterKey FindValue(string value) { return FindValue<AutomationExecutionFilterKey>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator AutomationExecutionFilterKey(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type AutomationExecutionStatus. /// </summary> public class AutomationExecutionStatus : ConstantClass { /// <summary> /// Constant Approved for AutomationExecutionStatus /// </summary> public static readonly AutomationExecutionStatus Approved = new AutomationExecutionStatus("Approved"); /// <summary> /// Constant Cancelled for AutomationExecutionStatus /// </summary> public static readonly AutomationExecutionStatus Cancelled = new AutomationExecutionStatus("Cancelled"); /// <summary> /// Constant Cancelling for AutomationExecutionStatus /// </summary> public static readonly AutomationExecutionStatus Cancelling = new AutomationExecutionStatus("Cancelling"); /// <summary> /// Constant ChangeCalendarOverrideApproved for AutomationExecutionStatus /// </summary> public static readonly AutomationExecutionStatus ChangeCalendarOverrideApproved = new AutomationExecutionStatus("ChangeCalendarOverrideApproved"); /// <summary> /// Constant ChangeCalendarOverrideRejected for AutomationExecutionStatus /// </summary> public static readonly AutomationExecutionStatus ChangeCalendarOverrideRejected = new AutomationExecutionStatus("ChangeCalendarOverrideRejected"); /// <summary> /// Constant CompletedWithFailure for AutomationExecutionStatus /// </summary> public static readonly AutomationExecutionStatus CompletedWithFailure = new AutomationExecutionStatus("CompletedWithFailure"); /// <summary> /// Constant CompletedWithSuccess for AutomationExecutionStatus /// </summary> public static readonly AutomationExecutionStatus CompletedWithSuccess = new AutomationExecutionStatus("CompletedWithSuccess"); /// <summary> /// Constant Failed for AutomationExecutionStatus /// </summary> public static readonly AutomationExecutionStatus Failed = new AutomationExecutionStatus("Failed"); /// <summary> /// Constant InProgress for AutomationExecutionStatus /// </summary> public static readonly AutomationExecutionStatus InProgress = new AutomationExecutionStatus("InProgress"); /// <summary> /// Constant Pending for AutomationExecutionStatus /// </summary> public static readonly AutomationExecutionStatus Pending = new AutomationExecutionStatus("Pending"); /// <summary> /// Constant PendingApproval for AutomationExecutionStatus /// </summary> public static readonly AutomationExecutionStatus PendingApproval = new AutomationExecutionStatus("PendingApproval"); /// <summary> /// Constant PendingChangeCalendarOverride for AutomationExecutionStatus /// </summary> public static readonly AutomationExecutionStatus PendingChangeCalendarOverride = new AutomationExecutionStatus("PendingChangeCalendarOverride"); /// <summary> /// Constant Rejected for AutomationExecutionStatus /// </summary> public static readonly AutomationExecutionStatus Rejected = new AutomationExecutionStatus("Rejected"); /// <summary> /// Constant RunbookInProgress for AutomationExecutionStatus /// </summary> public static readonly AutomationExecutionStatus RunbookInProgress = new AutomationExecutionStatus("RunbookInProgress"); /// <summary> /// Constant Scheduled for AutomationExecutionStatus /// </summary> public static readonly AutomationExecutionStatus Scheduled = new AutomationExecutionStatus("Scheduled"); /// <summary> /// Constant Success for AutomationExecutionStatus /// </summary> public static readonly AutomationExecutionStatus Success = new AutomationExecutionStatus("Success"); /// <summary> /// Constant TimedOut for AutomationExecutionStatus /// </summary> public static readonly AutomationExecutionStatus TimedOut = new AutomationExecutionStatus("TimedOut"); /// <summary> /// Constant Waiting for AutomationExecutionStatus /// </summary> public static readonly AutomationExecutionStatus Waiting = new AutomationExecutionStatus("Waiting"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public AutomationExecutionStatus(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static AutomationExecutionStatus FindValue(string value) { return FindValue<AutomationExecutionStatus>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator AutomationExecutionStatus(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type AutomationSubtype. /// </summary> public class AutomationSubtype : ConstantClass { /// <summary> /// Constant ChangeRequest for AutomationSubtype /// </summary> public static readonly AutomationSubtype ChangeRequest = new AutomationSubtype("ChangeRequest"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public AutomationSubtype(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static AutomationSubtype FindValue(string value) { return FindValue<AutomationSubtype>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator AutomationSubtype(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type AutomationType. /// </summary> public class AutomationType : ConstantClass { /// <summary> /// Constant CrossAccount for AutomationType /// </summary> public static readonly AutomationType CrossAccount = new AutomationType("CrossAccount"); /// <summary> /// Constant Local for AutomationType /// </summary> public static readonly AutomationType Local = new AutomationType("Local"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public AutomationType(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static AutomationType FindValue(string value) { return FindValue<AutomationType>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator AutomationType(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type CalendarState. /// </summary> public class CalendarState : ConstantClass { /// <summary> /// Constant CLOSED for CalendarState /// </summary> public static readonly CalendarState CLOSED = new CalendarState("CLOSED"); /// <summary> /// Constant OPEN for CalendarState /// </summary> public static readonly CalendarState OPEN = new CalendarState("OPEN"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public CalendarState(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static CalendarState FindValue(string value) { return FindValue<CalendarState>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator CalendarState(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type CommandFilterKey. /// </summary> public class CommandFilterKey : ConstantClass { /// <summary> /// Constant DocumentName for CommandFilterKey /// </summary> public static readonly CommandFilterKey DocumentName = new CommandFilterKey("DocumentName"); /// <summary> /// Constant ExecutionStage for CommandFilterKey /// </summary> public static readonly CommandFilterKey ExecutionStage = new CommandFilterKey("ExecutionStage"); /// <summary> /// Constant InvokedAfter for CommandFilterKey /// </summary> public static readonly CommandFilterKey InvokedAfter = new CommandFilterKey("InvokedAfter"); /// <summary> /// Constant InvokedBefore for CommandFilterKey /// </summary> public static readonly CommandFilterKey InvokedBefore = new CommandFilterKey("InvokedBefore"); /// <summary> /// Constant Status for CommandFilterKey /// </summary> public static readonly CommandFilterKey Status = new CommandFilterKey("Status"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public CommandFilterKey(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static CommandFilterKey FindValue(string value) { return FindValue<CommandFilterKey>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator CommandFilterKey(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type CommandInvocationStatus. /// </summary> public class CommandInvocationStatus : ConstantClass { /// <summary> /// Constant Cancelled for CommandInvocationStatus /// </summary> public static readonly CommandInvocationStatus Cancelled = new CommandInvocationStatus("Cancelled"); /// <summary> /// Constant Cancelling for CommandInvocationStatus /// </summary> public static readonly CommandInvocationStatus Cancelling = new CommandInvocationStatus("Cancelling"); /// <summary> /// Constant Delayed for CommandInvocationStatus /// </summary> public static readonly CommandInvocationStatus Delayed = new CommandInvocationStatus("Delayed"); /// <summary> /// Constant Failed for CommandInvocationStatus /// </summary> public static readonly CommandInvocationStatus Failed = new CommandInvocationStatus("Failed"); /// <summary> /// Constant InProgress for CommandInvocationStatus /// </summary> public static readonly CommandInvocationStatus InProgress = new CommandInvocationStatus("InProgress"); /// <summary> /// Constant Pending for CommandInvocationStatus /// </summary> public static readonly CommandInvocationStatus Pending = new CommandInvocationStatus("Pending"); /// <summary> /// Constant Success for CommandInvocationStatus /// </summary> public static readonly CommandInvocationStatus Success = new CommandInvocationStatus("Success"); /// <summary> /// Constant TimedOut for CommandInvocationStatus /// </summary> public static readonly CommandInvocationStatus TimedOut = new CommandInvocationStatus("TimedOut"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public CommandInvocationStatus(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static CommandInvocationStatus FindValue(string value) { return FindValue<CommandInvocationStatus>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator CommandInvocationStatus(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type CommandPluginStatus. /// </summary> public class CommandPluginStatus : ConstantClass { /// <summary> /// Constant Cancelled for CommandPluginStatus /// </summary> public static readonly CommandPluginStatus Cancelled = new CommandPluginStatus("Cancelled"); /// <summary> /// Constant Failed for CommandPluginStatus /// </summary> public static readonly CommandPluginStatus Failed = new CommandPluginStatus("Failed"); /// <summary> /// Constant InProgress for CommandPluginStatus /// </summary> public static readonly CommandPluginStatus InProgress = new CommandPluginStatus("InProgress"); /// <summary> /// Constant Pending for CommandPluginStatus /// </summary> public static readonly CommandPluginStatus Pending = new CommandPluginStatus("Pending"); /// <summary> /// Constant Success for CommandPluginStatus /// </summary> public static readonly CommandPluginStatus Success = new CommandPluginStatus("Success"); /// <summary> /// Constant TimedOut for CommandPluginStatus /// </summary> public static readonly CommandPluginStatus TimedOut = new CommandPluginStatus("TimedOut"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public CommandPluginStatus(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static CommandPluginStatus FindValue(string value) { return FindValue<CommandPluginStatus>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator CommandPluginStatus(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type CommandStatus. /// </summary> public class CommandStatus : ConstantClass { /// <summary> /// Constant Cancelled for CommandStatus /// </summary> public static readonly CommandStatus Cancelled = new CommandStatus("Cancelled"); /// <summary> /// Constant Cancelling for CommandStatus /// </summary> public static readonly CommandStatus Cancelling = new CommandStatus("Cancelling"); /// <summary> /// Constant Failed for CommandStatus /// </summary> public static readonly CommandStatus Failed = new CommandStatus("Failed"); /// <summary> /// Constant InProgress for CommandStatus /// </summary> public static readonly CommandStatus InProgress = new CommandStatus("InProgress"); /// <summary> /// Constant Pending for CommandStatus /// </summary> public static readonly CommandStatus Pending = new CommandStatus("Pending"); /// <summary> /// Constant Success for CommandStatus /// </summary> public static readonly CommandStatus Success = new CommandStatus("Success"); /// <summary> /// Constant TimedOut for CommandStatus /// </summary> public static readonly CommandStatus TimedOut = new CommandStatus("TimedOut"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public CommandStatus(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static CommandStatus FindValue(string value) { return FindValue<CommandStatus>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator CommandStatus(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type ComplianceQueryOperatorType. /// </summary> public class ComplianceQueryOperatorType : ConstantClass { /// <summary> /// Constant BEGIN_WITH for ComplianceQueryOperatorType /// </summary> public static readonly ComplianceQueryOperatorType BEGIN_WITH = new ComplianceQueryOperatorType("BEGIN_WITH"); /// <summary> /// Constant EQUAL for ComplianceQueryOperatorType /// </summary> public static readonly ComplianceQueryOperatorType EQUAL = new ComplianceQueryOperatorType("EQUAL"); /// <summary> /// Constant GREATER_THAN for ComplianceQueryOperatorType /// </summary> public static readonly ComplianceQueryOperatorType GREATER_THAN = new ComplianceQueryOperatorType("GREATER_THAN"); /// <summary> /// Constant LESS_THAN for ComplianceQueryOperatorType /// </summary> public static readonly ComplianceQueryOperatorType LESS_THAN = new ComplianceQueryOperatorType("LESS_THAN"); /// <summary> /// Constant NOT_EQUAL for ComplianceQueryOperatorType /// </summary> public static readonly ComplianceQueryOperatorType NOT_EQUAL = new ComplianceQueryOperatorType("NOT_EQUAL"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public ComplianceQueryOperatorType(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static ComplianceQueryOperatorType FindValue(string value) { return FindValue<ComplianceQueryOperatorType>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator ComplianceQueryOperatorType(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type ComplianceSeverity. /// </summary> public class ComplianceSeverity : ConstantClass { /// <summary> /// Constant CRITICAL for ComplianceSeverity /// </summary> public static readonly ComplianceSeverity CRITICAL = new ComplianceSeverity("CRITICAL"); /// <summary> /// Constant HIGH for ComplianceSeverity /// </summary> public static readonly ComplianceSeverity HIGH = new ComplianceSeverity("HIGH"); /// <summary> /// Constant INFORMATIONAL for ComplianceSeverity /// </summary> public static readonly ComplianceSeverity INFORMATIONAL = new ComplianceSeverity("INFORMATIONAL"); /// <summary> /// Constant LOW for ComplianceSeverity /// </summary> public static readonly ComplianceSeverity LOW = new ComplianceSeverity("LOW"); /// <summary> /// Constant MEDIUM for ComplianceSeverity /// </summary> public static readonly ComplianceSeverity MEDIUM = new ComplianceSeverity("MEDIUM"); /// <summary> /// Constant UNSPECIFIED for ComplianceSeverity /// </summary> public static readonly ComplianceSeverity UNSPECIFIED = new ComplianceSeverity("UNSPECIFIED"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public ComplianceSeverity(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static ComplianceSeverity FindValue(string value) { return FindValue<ComplianceSeverity>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator ComplianceSeverity(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type ComplianceStatus. /// </summary> public class ComplianceStatus : ConstantClass { /// <summary> /// Constant COMPLIANT for ComplianceStatus /// </summary> public static readonly ComplianceStatus COMPLIANT = new ComplianceStatus("COMPLIANT"); /// <summary> /// Constant NON_COMPLIANT for ComplianceStatus /// </summary> public static readonly ComplianceStatus NON_COMPLIANT = new ComplianceStatus("NON_COMPLIANT"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public ComplianceStatus(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static ComplianceStatus FindValue(string value) { return FindValue<ComplianceStatus>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator ComplianceStatus(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type ComplianceUploadType. /// </summary> public class ComplianceUploadType : ConstantClass { /// <summary> /// Constant COMPLETE for ComplianceUploadType /// </summary> public static readonly ComplianceUploadType COMPLETE = new ComplianceUploadType("COMPLETE"); /// <summary> /// Constant PARTIAL for ComplianceUploadType /// </summary> public static readonly ComplianceUploadType PARTIAL = new ComplianceUploadType("PARTIAL"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public ComplianceUploadType(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static ComplianceUploadType FindValue(string value) { return FindValue<ComplianceUploadType>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator ComplianceUploadType(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type ConnectionStatus. /// </summary> public class ConnectionStatus : ConstantClass { /// <summary> /// Constant Connected for ConnectionStatus /// </summary> public static readonly ConnectionStatus Connected = new ConnectionStatus("Connected"); /// <summary> /// Constant NotConnected for ConnectionStatus /// </summary> public static readonly ConnectionStatus NotConnected = new ConnectionStatus("NotConnected"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public ConnectionStatus(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static ConnectionStatus FindValue(string value) { return FindValue<ConnectionStatus>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator ConnectionStatus(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type DescribeActivationsFilterKeys. /// </summary> public class DescribeActivationsFilterKeys : ConstantClass { /// <summary> /// Constant ActivationIds for DescribeActivationsFilterKeys /// </summary> public static readonly DescribeActivationsFilterKeys ActivationIds = new DescribeActivationsFilterKeys("ActivationIds"); /// <summary> /// Constant DefaultInstanceName for DescribeActivationsFilterKeys /// </summary> public static readonly DescribeActivationsFilterKeys DefaultInstanceName = new DescribeActivationsFilterKeys("DefaultInstanceName"); /// <summary> /// Constant IamRole for DescribeActivationsFilterKeys /// </summary> public static readonly DescribeActivationsFilterKeys IamRole = new DescribeActivationsFilterKeys("IamRole"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public DescribeActivationsFilterKeys(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static DescribeActivationsFilterKeys FindValue(string value) { return FindValue<DescribeActivationsFilterKeys>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator DescribeActivationsFilterKeys(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type DocumentFilterKey. /// </summary> public class DocumentFilterKey : ConstantClass { /// <summary> /// Constant DocumentType for DocumentFilterKey /// </summary> public static readonly DocumentFilterKey DocumentType = new DocumentFilterKey("DocumentType"); /// <summary> /// Constant Name for DocumentFilterKey /// </summary> public static readonly DocumentFilterKey Name = new DocumentFilterKey("Name"); /// <summary> /// Constant Owner for DocumentFilterKey /// </summary> public static readonly DocumentFilterKey Owner = new DocumentFilterKey("Owner"); /// <summary> /// Constant PlatformTypes for DocumentFilterKey /// </summary> public static readonly DocumentFilterKey PlatformTypes = new DocumentFilterKey("PlatformTypes"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public DocumentFilterKey(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static DocumentFilterKey FindValue(string value) { return FindValue<DocumentFilterKey>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator DocumentFilterKey(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type DocumentFormat. /// </summary> public class DocumentFormat : ConstantClass { /// <summary> /// Constant JSON for DocumentFormat /// </summary> public static readonly DocumentFormat JSON = new DocumentFormat("JSON"); /// <summary> /// Constant TEXT for DocumentFormat /// </summary> public static readonly DocumentFormat TEXT = new DocumentFormat("TEXT"); /// <summary> /// Constant YAML for DocumentFormat /// </summary> public static readonly DocumentFormat YAML = new DocumentFormat("YAML"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public DocumentFormat(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static DocumentFormat FindValue(string value) { return FindValue<DocumentFormat>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator DocumentFormat(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type DocumentHashType. /// </summary> public class DocumentHashType : ConstantClass { /// <summary> /// Constant Sha1 for DocumentHashType /// </summary> public static readonly DocumentHashType Sha1 = new DocumentHashType("Sha1"); /// <summary> /// Constant Sha256 for DocumentHashType /// </summary> public static readonly DocumentHashType Sha256 = new DocumentHashType("Sha256"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public DocumentHashType(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static DocumentHashType FindValue(string value) { return FindValue<DocumentHashType>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator DocumentHashType(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type DocumentMetadataEnum. /// </summary> public class DocumentMetadataEnum : ConstantClass { /// <summary> /// Constant DocumentReviews for DocumentMetadataEnum /// </summary> public static readonly DocumentMetadataEnum DocumentReviews = new DocumentMetadataEnum("DocumentReviews"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public DocumentMetadataEnum(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static DocumentMetadataEnum FindValue(string value) { return FindValue<DocumentMetadataEnum>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator DocumentMetadataEnum(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type DocumentParameterType. /// </summary> public class DocumentParameterType : ConstantClass { /// <summary> /// Constant String for DocumentParameterType /// </summary> public static readonly DocumentParameterType String = new DocumentParameterType("String"); /// <summary> /// Constant StringList for DocumentParameterType /// </summary> public static readonly DocumentParameterType StringList = new DocumentParameterType("StringList"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public DocumentParameterType(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static DocumentParameterType FindValue(string value) { return FindValue<DocumentParameterType>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator DocumentParameterType(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type DocumentPermissionType. /// </summary> public class DocumentPermissionType : ConstantClass { /// <summary> /// Constant Share for DocumentPermissionType /// </summary> public static readonly DocumentPermissionType Share = new DocumentPermissionType("Share"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public DocumentPermissionType(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static DocumentPermissionType FindValue(string value) { return FindValue<DocumentPermissionType>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator DocumentPermissionType(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type DocumentReviewAction. /// </summary> public class DocumentReviewAction : ConstantClass { /// <summary> /// Constant Approve for DocumentReviewAction /// </summary> public static readonly DocumentReviewAction Approve = new DocumentReviewAction("Approve"); /// <summary> /// Constant Reject for DocumentReviewAction /// </summary> public static readonly DocumentReviewAction Reject = new DocumentReviewAction("Reject"); /// <summary> /// Constant SendForReview for DocumentReviewAction /// </summary> public static readonly DocumentReviewAction SendForReview = new DocumentReviewAction("SendForReview"); /// <summary> /// Constant UpdateReview for DocumentReviewAction /// </summary> public static readonly DocumentReviewAction UpdateReview = new DocumentReviewAction("UpdateReview"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public DocumentReviewAction(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static DocumentReviewAction FindValue(string value) { return FindValue<DocumentReviewAction>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator DocumentReviewAction(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type DocumentReviewCommentType. /// </summary> public class DocumentReviewCommentType : ConstantClass { /// <summary> /// Constant Comment for DocumentReviewCommentType /// </summary> public static readonly DocumentReviewCommentType Comment = new DocumentReviewCommentType("Comment"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public DocumentReviewCommentType(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static DocumentReviewCommentType FindValue(string value) { return FindValue<DocumentReviewCommentType>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator DocumentReviewCommentType(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type DocumentStatus. /// </summary> public class DocumentStatus : ConstantClass { /// <summary> /// Constant Active for DocumentStatus /// </summary> public static readonly DocumentStatus Active = new DocumentStatus("Active"); /// <summary> /// Constant Creating for DocumentStatus /// </summary> public static readonly DocumentStatus Creating = new DocumentStatus("Creating"); /// <summary> /// Constant Deleting for DocumentStatus /// </summary> public static readonly DocumentStatus Deleting = new DocumentStatus("Deleting"); /// <summary> /// Constant Failed for DocumentStatus /// </summary> public static readonly DocumentStatus Failed = new DocumentStatus("Failed"); /// <summary> /// Constant Updating for DocumentStatus /// </summary> public static readonly DocumentStatus Updating = new DocumentStatus("Updating"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public DocumentStatus(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static DocumentStatus FindValue(string value) { return FindValue<DocumentStatus>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator DocumentStatus(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type DocumentType. /// </summary> public class DocumentType : ConstantClass { /// <summary> /// Constant ApplicationConfiguration for DocumentType /// </summary> public static readonly DocumentType ApplicationConfiguration = new DocumentType("ApplicationConfiguration"); /// <summary> /// Constant ApplicationConfigurationSchema for DocumentType /// </summary> public static readonly DocumentType ApplicationConfigurationSchema = new DocumentType("ApplicationConfigurationSchema"); /// <summary> /// Constant Automation for DocumentType /// </summary> public static readonly DocumentType Automation = new DocumentType("Automation"); /// <summary> /// Constant AutomationChangeTemplate for DocumentType /// </summary> public static readonly DocumentType AutomationChangeTemplate = new DocumentType("Automation.ChangeTemplate"); /// <summary> /// Constant ChangeCalendar for DocumentType /// </summary> public static readonly DocumentType ChangeCalendar = new DocumentType("ChangeCalendar"); /// <summary> /// Constant Command for DocumentType /// </summary> public static readonly DocumentType Command = new DocumentType("Command"); /// <summary> /// Constant DeploymentStrategy for DocumentType /// </summary> public static readonly DocumentType DeploymentStrategy = new DocumentType("DeploymentStrategy"); /// <summary> /// Constant Package for DocumentType /// </summary> public static readonly DocumentType Package = new DocumentType("Package"); /// <summary> /// Constant Policy for DocumentType /// </summary> public static readonly DocumentType Policy = new DocumentType("Policy"); /// <summary> /// Constant ProblemAnalysis for DocumentType /// </summary> public static readonly DocumentType ProblemAnalysis = new DocumentType("ProblemAnalysis"); /// <summary> /// Constant ProblemAnalysisTemplate for DocumentType /// </summary> public static readonly DocumentType ProblemAnalysisTemplate = new DocumentType("ProblemAnalysisTemplate"); /// <summary> /// Constant Session for DocumentType /// </summary> public static readonly DocumentType Session = new DocumentType("Session"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public DocumentType(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static DocumentType FindValue(string value) { return FindValue<DocumentType>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator DocumentType(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type ExecutionMode. /// </summary> public class ExecutionMode : ConstantClass { /// <summary> /// Constant Auto for ExecutionMode /// </summary> public static readonly ExecutionMode Auto = new ExecutionMode("Auto"); /// <summary> /// Constant Interactive for ExecutionMode /// </summary> public static readonly ExecutionMode Interactive = new ExecutionMode("Interactive"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public ExecutionMode(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static ExecutionMode FindValue(string value) { return FindValue<ExecutionMode>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator ExecutionMode(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type Fault. /// </summary> public class Fault : ConstantClass { /// <summary> /// Constant Client for Fault /// </summary> public static readonly Fault Client = new Fault("Client"); /// <summary> /// Constant Server for Fault /// </summary> public static readonly Fault Server = new Fault("Server"); /// <summary> /// Constant Unknown for Fault /// </summary> public static readonly Fault Unknown = new Fault("Unknown"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public Fault(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static Fault FindValue(string value) { return FindValue<Fault>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator Fault(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type InstanceInformationFilterKey. /// </summary> public class InstanceInformationFilterKey : ConstantClass { /// <summary> /// Constant ActivationIds for InstanceInformationFilterKey /// </summary> public static readonly InstanceInformationFilterKey ActivationIds = new InstanceInformationFilterKey("ActivationIds"); /// <summary> /// Constant AgentVersion for InstanceInformationFilterKey /// </summary> public static readonly InstanceInformationFilterKey AgentVersion = new InstanceInformationFilterKey("AgentVersion"); /// <summary> /// Constant AssociationStatus for InstanceInformationFilterKey /// </summary> public static readonly InstanceInformationFilterKey AssociationStatus = new InstanceInformationFilterKey("AssociationStatus"); /// <summary> /// Constant IamRole for InstanceInformationFilterKey /// </summary> public static readonly InstanceInformationFilterKey IamRole = new InstanceInformationFilterKey("IamRole"); /// <summary> /// Constant InstanceIds for InstanceInformationFilterKey /// </summary> public static readonly InstanceInformationFilterKey InstanceIds = new InstanceInformationFilterKey("InstanceIds"); /// <summary> /// Constant PingStatus for InstanceInformationFilterKey /// </summary> public static readonly InstanceInformationFilterKey PingStatus = new InstanceInformationFilterKey("PingStatus"); /// <summary> /// Constant PlatformTypes for InstanceInformationFilterKey /// </summary> public static readonly InstanceInformationFilterKey PlatformTypes = new InstanceInformationFilterKey("PlatformTypes"); /// <summary> /// Constant ResourceType for InstanceInformationFilterKey /// </summary> public static readonly InstanceInformationFilterKey ResourceType = new InstanceInformationFilterKey("ResourceType"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public InstanceInformationFilterKey(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static InstanceInformationFilterKey FindValue(string value) { return FindValue<InstanceInformationFilterKey>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator InstanceInformationFilterKey(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type InstancePatchStateOperatorType. /// </summary> public class InstancePatchStateOperatorType : ConstantClass { /// <summary> /// Constant Equal for InstancePatchStateOperatorType /// </summary> public static readonly InstancePatchStateOperatorType Equal = new InstancePatchStateOperatorType("Equal"); /// <summary> /// Constant GreaterThan for InstancePatchStateOperatorType /// </summary> public static readonly InstancePatchStateOperatorType GreaterThan = new InstancePatchStateOperatorType("GreaterThan"); /// <summary> /// Constant LessThan for InstancePatchStateOperatorType /// </summary> public static readonly InstancePatchStateOperatorType LessThan = new InstancePatchStateOperatorType("LessThan"); /// <summary> /// Constant NotEqual for InstancePatchStateOperatorType /// </summary> public static readonly InstancePatchStateOperatorType NotEqual = new InstancePatchStateOperatorType("NotEqual"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public InstancePatchStateOperatorType(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static InstancePatchStateOperatorType FindValue(string value) { return FindValue<InstancePatchStateOperatorType>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator InstancePatchStateOperatorType(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type InventoryAttributeDataType. /// </summary> public class InventoryAttributeDataType : ConstantClass { /// <summary> /// Constant Number for InventoryAttributeDataType /// </summary> public static readonly InventoryAttributeDataType Number = new InventoryAttributeDataType("number"); /// <summary> /// Constant String for InventoryAttributeDataType /// </summary> public static readonly InventoryAttributeDataType String = new InventoryAttributeDataType("string"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public InventoryAttributeDataType(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static InventoryAttributeDataType FindValue(string value) { return FindValue<InventoryAttributeDataType>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator InventoryAttributeDataType(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type InventoryDeletionStatus. /// </summary> public class InventoryDeletionStatus : ConstantClass { /// <summary> /// Constant Complete for InventoryDeletionStatus /// </summary> public static readonly InventoryDeletionStatus Complete = new InventoryDeletionStatus("Complete"); /// <summary> /// Constant InProgress for InventoryDeletionStatus /// </summary> public static readonly InventoryDeletionStatus InProgress = new InventoryDeletionStatus("InProgress"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public InventoryDeletionStatus(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static InventoryDeletionStatus FindValue(string value) { return FindValue<InventoryDeletionStatus>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator InventoryDeletionStatus(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type InventoryQueryOperatorType. /// </summary> public class InventoryQueryOperatorType : ConstantClass { /// <summary> /// Constant BeginWith for InventoryQueryOperatorType /// </summary> public static readonly InventoryQueryOperatorType BeginWith = new InventoryQueryOperatorType("BeginWith"); /// <summary> /// Constant Equal for InventoryQueryOperatorType /// </summary> public static readonly InventoryQueryOperatorType Equal = new InventoryQueryOperatorType("Equal"); /// <summary> /// Constant Exists for InventoryQueryOperatorType /// </summary> public static readonly InventoryQueryOperatorType Exists = new InventoryQueryOperatorType("Exists"); /// <summary> /// Constant GreaterThan for InventoryQueryOperatorType /// </summary> public static readonly InventoryQueryOperatorType GreaterThan = new InventoryQueryOperatorType("GreaterThan"); /// <summary> /// Constant LessThan for InventoryQueryOperatorType /// </summary> public static readonly InventoryQueryOperatorType LessThan = new InventoryQueryOperatorType("LessThan"); /// <summary> /// Constant NotEqual for InventoryQueryOperatorType /// </summary> public static readonly InventoryQueryOperatorType NotEqual = new InventoryQueryOperatorType("NotEqual"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public InventoryQueryOperatorType(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static InventoryQueryOperatorType FindValue(string value) { return FindValue<InventoryQueryOperatorType>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator InventoryQueryOperatorType(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type InventorySchemaDeleteOption. /// </summary> public class InventorySchemaDeleteOption : ConstantClass { /// <summary> /// Constant DeleteSchema for InventorySchemaDeleteOption /// </summary> public static readonly InventorySchemaDeleteOption DeleteSchema = new InventorySchemaDeleteOption("DeleteSchema"); /// <summary> /// Constant DisableSchema for InventorySchemaDeleteOption /// </summary> public static readonly InventorySchemaDeleteOption DisableSchema = new InventorySchemaDeleteOption("DisableSchema"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public InventorySchemaDeleteOption(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static InventorySchemaDeleteOption FindValue(string value) { return FindValue<InventorySchemaDeleteOption>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator InventorySchemaDeleteOption(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type LastResourceDataSyncStatus. /// </summary> public class LastResourceDataSyncStatus : ConstantClass { /// <summary> /// Constant Failed for LastResourceDataSyncStatus /// </summary> public static readonly LastResourceDataSyncStatus Failed = new LastResourceDataSyncStatus("Failed"); /// <summary> /// Constant InProgress for LastResourceDataSyncStatus /// </summary> public static readonly LastResourceDataSyncStatus InProgress = new LastResourceDataSyncStatus("InProgress"); /// <summary> /// Constant Successful for LastResourceDataSyncStatus /// </summary> public static readonly LastResourceDataSyncStatus Successful = new LastResourceDataSyncStatus("Successful"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public LastResourceDataSyncStatus(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static LastResourceDataSyncStatus FindValue(string value) { return FindValue<LastResourceDataSyncStatus>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator LastResourceDataSyncStatus(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type MaintenanceWindowExecutionStatus. /// </summary> public class MaintenanceWindowExecutionStatus : ConstantClass { /// <summary> /// Constant CANCELLED for MaintenanceWindowExecutionStatus /// </summary> public static readonly MaintenanceWindowExecutionStatus CANCELLED = new MaintenanceWindowExecutionStatus("CANCELLED"); /// <summary> /// Constant CANCELLING for MaintenanceWindowExecutionStatus /// </summary> public static readonly MaintenanceWindowExecutionStatus CANCELLING = new MaintenanceWindowExecutionStatus("CANCELLING"); /// <summary> /// Constant FAILED for MaintenanceWindowExecutionStatus /// </summary> public static readonly MaintenanceWindowExecutionStatus FAILED = new MaintenanceWindowExecutionStatus("FAILED"); /// <summary> /// Constant IN_PROGRESS for MaintenanceWindowExecutionStatus /// </summary> public static readonly MaintenanceWindowExecutionStatus IN_PROGRESS = new MaintenanceWindowExecutionStatus("IN_PROGRESS"); /// <summary> /// Constant PENDING for MaintenanceWindowExecutionStatus /// </summary> public static readonly MaintenanceWindowExecutionStatus PENDING = new MaintenanceWindowExecutionStatus("PENDING"); /// <summary> /// Constant SKIPPED_OVERLAPPING for MaintenanceWindowExecutionStatus /// </summary> public static readonly MaintenanceWindowExecutionStatus SKIPPED_OVERLAPPING = new MaintenanceWindowExecutionStatus("SKIPPED_OVERLAPPING"); /// <summary> /// Constant SUCCESS for MaintenanceWindowExecutionStatus /// </summary> public static readonly MaintenanceWindowExecutionStatus SUCCESS = new MaintenanceWindowExecutionStatus("SUCCESS"); /// <summary> /// Constant TIMED_OUT for MaintenanceWindowExecutionStatus /// </summary> public static readonly MaintenanceWindowExecutionStatus TIMED_OUT = new MaintenanceWindowExecutionStatus("TIMED_OUT"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public MaintenanceWindowExecutionStatus(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static MaintenanceWindowExecutionStatus FindValue(string value) { return FindValue<MaintenanceWindowExecutionStatus>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator MaintenanceWindowExecutionStatus(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type MaintenanceWindowResourceType. /// </summary> public class MaintenanceWindowResourceType : ConstantClass { /// <summary> /// Constant INSTANCE for MaintenanceWindowResourceType /// </summary> public static readonly MaintenanceWindowResourceType INSTANCE = new MaintenanceWindowResourceType("INSTANCE"); /// <summary> /// Constant RESOURCE_GROUP for MaintenanceWindowResourceType /// </summary> public static readonly MaintenanceWindowResourceType RESOURCE_GROUP = new MaintenanceWindowResourceType("RESOURCE_GROUP"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public MaintenanceWindowResourceType(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static MaintenanceWindowResourceType FindValue(string value) { return FindValue<MaintenanceWindowResourceType>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator MaintenanceWindowResourceType(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type MaintenanceWindowTaskCutoffBehavior. /// </summary> public class MaintenanceWindowTaskCutoffBehavior : ConstantClass { /// <summary> /// Constant CANCEL_TASK for MaintenanceWindowTaskCutoffBehavior /// </summary> public static readonly MaintenanceWindowTaskCutoffBehavior CANCEL_TASK = new MaintenanceWindowTaskCutoffBehavior("CANCEL_TASK"); /// <summary> /// Constant CONTINUE_TASK for MaintenanceWindowTaskCutoffBehavior /// </summary> public static readonly MaintenanceWindowTaskCutoffBehavior CONTINUE_TASK = new MaintenanceWindowTaskCutoffBehavior("CONTINUE_TASK"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public MaintenanceWindowTaskCutoffBehavior(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static MaintenanceWindowTaskCutoffBehavior FindValue(string value) { return FindValue<MaintenanceWindowTaskCutoffBehavior>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator MaintenanceWindowTaskCutoffBehavior(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type MaintenanceWindowTaskType. /// </summary> public class MaintenanceWindowTaskType : ConstantClass { /// <summary> /// Constant AUTOMATION for MaintenanceWindowTaskType /// </summary> public static readonly MaintenanceWindowTaskType AUTOMATION = new MaintenanceWindowTaskType("AUTOMATION"); /// <summary> /// Constant LAMBDA for MaintenanceWindowTaskType /// </summary> public static readonly MaintenanceWindowTaskType LAMBDA = new MaintenanceWindowTaskType("LAMBDA"); /// <summary> /// Constant RUN_COMMAND for MaintenanceWindowTaskType /// </summary> public static readonly MaintenanceWindowTaskType RUN_COMMAND = new MaintenanceWindowTaskType("RUN_COMMAND"); /// <summary> /// Constant STEP_FUNCTIONS for MaintenanceWindowTaskType /// </summary> public static readonly MaintenanceWindowTaskType STEP_FUNCTIONS = new MaintenanceWindowTaskType("STEP_FUNCTIONS"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public MaintenanceWindowTaskType(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static MaintenanceWindowTaskType FindValue(string value) { return FindValue<MaintenanceWindowTaskType>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator MaintenanceWindowTaskType(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type NotificationEvent. /// </summary> public class NotificationEvent : ConstantClass { /// <summary> /// Constant All for NotificationEvent /// </summary> public static readonly NotificationEvent All = new NotificationEvent("All"); /// <summary> /// Constant Cancelled for NotificationEvent /// </summary> public static readonly NotificationEvent Cancelled = new NotificationEvent("Cancelled"); /// <summary> /// Constant Failed for NotificationEvent /// </summary> public static readonly NotificationEvent Failed = new NotificationEvent("Failed"); /// <summary> /// Constant InProgress for NotificationEvent /// </summary> public static readonly NotificationEvent InProgress = new NotificationEvent("InProgress"); /// <summary> /// Constant Success for NotificationEvent /// </summary> public static readonly NotificationEvent Success = new NotificationEvent("Success"); /// <summary> /// Constant TimedOut for NotificationEvent /// </summary> public static readonly NotificationEvent TimedOut = new NotificationEvent("TimedOut"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public NotificationEvent(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static NotificationEvent FindValue(string value) { return FindValue<NotificationEvent>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator NotificationEvent(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type NotificationType. /// </summary> public class NotificationType : ConstantClass { /// <summary> /// Constant Command for NotificationType /// </summary> public static readonly NotificationType Command = new NotificationType("Command"); /// <summary> /// Constant Invocation for NotificationType /// </summary> public static readonly NotificationType Invocation = new NotificationType("Invocation"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public NotificationType(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static NotificationType FindValue(string value) { return FindValue<NotificationType>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator NotificationType(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type OperatingSystem. /// </summary> public class OperatingSystem : ConstantClass { /// <summary> /// Constant AMAZON_LINUX for OperatingSystem /// </summary> public static readonly OperatingSystem AMAZON_LINUX = new OperatingSystem("AMAZON_LINUX"); /// <summary> /// Constant AMAZON_LINUX_2 for OperatingSystem /// </summary> public static readonly OperatingSystem AMAZON_LINUX_2 = new OperatingSystem("AMAZON_LINUX_2"); /// <summary> /// Constant CENTOS for OperatingSystem /// </summary> public static readonly OperatingSystem CENTOS = new OperatingSystem("CENTOS"); /// <summary> /// Constant DEBIAN for OperatingSystem /// </summary> public static readonly OperatingSystem DEBIAN = new OperatingSystem("DEBIAN"); /// <summary> /// Constant MACOS for OperatingSystem /// </summary> public static readonly OperatingSystem MACOS = new OperatingSystem("MACOS"); /// <summary> /// Constant ORACLE_LINUX for OperatingSystem /// </summary> public static readonly OperatingSystem ORACLE_LINUX = new OperatingSystem("ORACLE_LINUX"); /// <summary> /// Constant RASPBIAN for OperatingSystem /// </summary> public static readonly OperatingSystem RASPBIAN = new OperatingSystem("RASPBIAN"); /// <summary> /// Constant REDHAT_ENTERPRISE_LINUX for OperatingSystem /// </summary> public static readonly OperatingSystem REDHAT_ENTERPRISE_LINUX = new OperatingSystem("REDHAT_ENTERPRISE_LINUX"); /// <summary> /// Constant SUSE for OperatingSystem /// </summary> public static readonly OperatingSystem SUSE = new OperatingSystem("SUSE"); /// <summary> /// Constant UBUNTU for OperatingSystem /// </summary> public static readonly OperatingSystem UBUNTU = new OperatingSystem("UBUNTU"); /// <summary> /// Constant WINDOWS for OperatingSystem /// </summary> public static readonly OperatingSystem WINDOWS = new OperatingSystem("WINDOWS"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public OperatingSystem(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static OperatingSystem FindValue(string value) { return FindValue<OperatingSystem>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator OperatingSystem(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type OpsFilterOperatorType. /// </summary> public class OpsFilterOperatorType : ConstantClass { /// <summary> /// Constant BeginWith for OpsFilterOperatorType /// </summary> public static readonly OpsFilterOperatorType BeginWith = new OpsFilterOperatorType("BeginWith"); /// <summary> /// Constant Equal for OpsFilterOperatorType /// </summary> public static readonly OpsFilterOperatorType Equal = new OpsFilterOperatorType("Equal"); /// <summary> /// Constant Exists for OpsFilterOperatorType /// </summary> public static readonly OpsFilterOperatorType Exists = new OpsFilterOperatorType("Exists"); /// <summary> /// Constant GreaterThan for OpsFilterOperatorType /// </summary> public static readonly OpsFilterOperatorType GreaterThan = new OpsFilterOperatorType("GreaterThan"); /// <summary> /// Constant LessThan for OpsFilterOperatorType /// </summary> public static readonly OpsFilterOperatorType LessThan = new OpsFilterOperatorType("LessThan"); /// <summary> /// Constant NotEqual for OpsFilterOperatorType /// </summary> public static readonly OpsFilterOperatorType NotEqual = new OpsFilterOperatorType("NotEqual"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public OpsFilterOperatorType(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static OpsFilterOperatorType FindValue(string value) { return FindValue<OpsFilterOperatorType>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator OpsFilterOperatorType(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type OpsItemDataType. /// </summary> public class OpsItemDataType : ConstantClass { /// <summary> /// Constant SearchableString for OpsItemDataType /// </summary> public static readonly OpsItemDataType SearchableString = new OpsItemDataType("SearchableString"); /// <summary> /// Constant String for OpsItemDataType /// </summary> public static readonly OpsItemDataType String = new OpsItemDataType("String"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public OpsItemDataType(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static OpsItemDataType FindValue(string value) { return FindValue<OpsItemDataType>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator OpsItemDataType(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type OpsItemEventFilterKey. /// </summary> public class OpsItemEventFilterKey : ConstantClass { /// <summary> /// Constant OpsItemId for OpsItemEventFilterKey /// </summary> public static readonly OpsItemEventFilterKey OpsItemId = new OpsItemEventFilterKey("OpsItemId"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public OpsItemEventFilterKey(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static OpsItemEventFilterKey FindValue(string value) { return FindValue<OpsItemEventFilterKey>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator OpsItemEventFilterKey(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type OpsItemEventFilterOperator. /// </summary> public class OpsItemEventFilterOperator : ConstantClass { /// <summary> /// Constant Equal for OpsItemEventFilterOperator /// </summary> public static readonly OpsItemEventFilterOperator Equal = new OpsItemEventFilterOperator("Equal"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public OpsItemEventFilterOperator(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static OpsItemEventFilterOperator FindValue(string value) { return FindValue<OpsItemEventFilterOperator>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator OpsItemEventFilterOperator(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type OpsItemFilterKey. /// </summary> public class OpsItemFilterKey : ConstantClass { /// <summary> /// Constant ActualEndTime for OpsItemFilterKey /// </summary> public static readonly OpsItemFilterKey ActualEndTime = new OpsItemFilterKey("ActualEndTime"); /// <summary> /// Constant ActualStartTime for OpsItemFilterKey /// </summary> public static readonly OpsItemFilterKey ActualStartTime = new OpsItemFilterKey("ActualStartTime"); /// <summary> /// Constant AutomationId for OpsItemFilterKey /// </summary> public static readonly OpsItemFilterKey AutomationId = new OpsItemFilterKey("AutomationId"); /// <summary> /// Constant Category for OpsItemFilterKey /// </summary> public static readonly OpsItemFilterKey Category = new OpsItemFilterKey("Category"); /// <summary> /// Constant ChangeRequestByApproverArn for OpsItemFilterKey /// </summary> public static readonly OpsItemFilterKey ChangeRequestByApproverArn = new OpsItemFilterKey("ChangeRequestByApproverArn"); /// <summary> /// Constant ChangeRequestByApproverName for OpsItemFilterKey /// </summary> public static readonly OpsItemFilterKey ChangeRequestByApproverName = new OpsItemFilterKey("ChangeRequestByApproverName"); /// <summary> /// Constant ChangeRequestByRequesterArn for OpsItemFilterKey /// </summary> public static readonly OpsItemFilterKey ChangeRequestByRequesterArn = new OpsItemFilterKey("ChangeRequestByRequesterArn"); /// <summary> /// Constant ChangeRequestByRequesterName for OpsItemFilterKey /// </summary> public static readonly OpsItemFilterKey ChangeRequestByRequesterName = new OpsItemFilterKey("ChangeRequestByRequesterName"); /// <summary> /// Constant ChangeRequestByTargetsResourceGroup for OpsItemFilterKey /// </summary> public static readonly OpsItemFilterKey ChangeRequestByTargetsResourceGroup = new OpsItemFilterKey("ChangeRequestByTargetsResourceGroup"); /// <summary> /// Constant ChangeRequestByTemplate for OpsItemFilterKey /// </summary> public static readonly OpsItemFilterKey ChangeRequestByTemplate = new OpsItemFilterKey("ChangeRequestByTemplate"); /// <summary> /// Constant CreatedBy for OpsItemFilterKey /// </summary> public static readonly OpsItemFilterKey CreatedBy = new OpsItemFilterKey("CreatedBy"); /// <summary> /// Constant CreatedTime for OpsItemFilterKey /// </summary> public static readonly OpsItemFilterKey CreatedTime = new OpsItemFilterKey("CreatedTime"); /// <summary> /// Constant InsightByType for OpsItemFilterKey /// </summary> public static readonly OpsItemFilterKey InsightByType = new OpsItemFilterKey("InsightByType"); /// <summary> /// Constant LastModifiedTime for OpsItemFilterKey /// </summary> public static readonly OpsItemFilterKey LastModifiedTime = new OpsItemFilterKey("LastModifiedTime"); /// <summary> /// Constant OperationalData for OpsItemFilterKey /// </summary> public static readonly OpsItemFilterKey OperationalData = new OpsItemFilterKey("OperationalData"); /// <summary> /// Constant OperationalDataKey for OpsItemFilterKey /// </summary> public static readonly OpsItemFilterKey OperationalDataKey = new OpsItemFilterKey("OperationalDataKey"); /// <summary> /// Constant OperationalDataValue for OpsItemFilterKey /// </summary> public static readonly OpsItemFilterKey OperationalDataValue = new OpsItemFilterKey("OperationalDataValue"); /// <summary> /// Constant OpsItemId for OpsItemFilterKey /// </summary> public static readonly OpsItemFilterKey OpsItemId = new OpsItemFilterKey("OpsItemId"); /// <summary> /// Constant OpsItemType for OpsItemFilterKey /// </summary> public static readonly OpsItemFilterKey OpsItemType = new OpsItemFilterKey("OpsItemType"); /// <summary> /// Constant PlannedEndTime for OpsItemFilterKey /// </summary> public static readonly OpsItemFilterKey PlannedEndTime = new OpsItemFilterKey("PlannedEndTime"); /// <summary> /// Constant PlannedStartTime for OpsItemFilterKey /// </summary> public static readonly OpsItemFilterKey PlannedStartTime = new OpsItemFilterKey("PlannedStartTime"); /// <summary> /// Constant Priority for OpsItemFilterKey /// </summary> public static readonly OpsItemFilterKey Priority = new OpsItemFilterKey("Priority"); /// <summary> /// Constant ResourceId for OpsItemFilterKey /// </summary> public static readonly OpsItemFilterKey ResourceId = new OpsItemFilterKey("ResourceId"); /// <summary> /// Constant Severity for OpsItemFilterKey /// </summary> public static readonly OpsItemFilterKey Severity = new OpsItemFilterKey("Severity"); /// <summary> /// Constant Source for OpsItemFilterKey /// </summary> public static readonly OpsItemFilterKey Source = new OpsItemFilterKey("Source"); /// <summary> /// Constant Status for OpsItemFilterKey /// </summary> public static readonly OpsItemFilterKey Status = new OpsItemFilterKey("Status"); /// <summary> /// Constant Title for OpsItemFilterKey /// </summary> public static readonly OpsItemFilterKey Title = new OpsItemFilterKey("Title"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public OpsItemFilterKey(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static OpsItemFilterKey FindValue(string value) { return FindValue<OpsItemFilterKey>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator OpsItemFilterKey(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type OpsItemFilterOperator. /// </summary> public class OpsItemFilterOperator : ConstantClass { /// <summary> /// Constant Contains for OpsItemFilterOperator /// </summary> public static readonly OpsItemFilterOperator Contains = new OpsItemFilterOperator("Contains"); /// <summary> /// Constant Equal for OpsItemFilterOperator /// </summary> public static readonly OpsItemFilterOperator Equal = new OpsItemFilterOperator("Equal"); /// <summary> /// Constant GreaterThan for OpsItemFilterOperator /// </summary> public static readonly OpsItemFilterOperator GreaterThan = new OpsItemFilterOperator("GreaterThan"); /// <summary> /// Constant LessThan for OpsItemFilterOperator /// </summary> public static readonly OpsItemFilterOperator LessThan = new OpsItemFilterOperator("LessThan"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public OpsItemFilterOperator(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static OpsItemFilterOperator FindValue(string value) { return FindValue<OpsItemFilterOperator>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator OpsItemFilterOperator(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type OpsItemRelatedItemsFilterKey. /// </summary> public class OpsItemRelatedItemsFilterKey : ConstantClass { /// <summary> /// Constant AssociationId for OpsItemRelatedItemsFilterKey /// </summary> public static readonly OpsItemRelatedItemsFilterKey AssociationId = new OpsItemRelatedItemsFilterKey("AssociationId"); /// <summary> /// Constant ResourceType for OpsItemRelatedItemsFilterKey /// </summary> public static readonly OpsItemRelatedItemsFilterKey ResourceType = new OpsItemRelatedItemsFilterKey("ResourceType"); /// <summary> /// Constant ResourceUri for OpsItemRelatedItemsFilterKey /// </summary> public static readonly OpsItemRelatedItemsFilterKey ResourceUri = new OpsItemRelatedItemsFilterKey("ResourceUri"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public OpsItemRelatedItemsFilterKey(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static OpsItemRelatedItemsFilterKey FindValue(string value) { return FindValue<OpsItemRelatedItemsFilterKey>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator OpsItemRelatedItemsFilterKey(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type OpsItemRelatedItemsFilterOperator. /// </summary> public class OpsItemRelatedItemsFilterOperator : ConstantClass { /// <summary> /// Constant Equal for OpsItemRelatedItemsFilterOperator /// </summary> public static readonly OpsItemRelatedItemsFilterOperator Equal = new OpsItemRelatedItemsFilterOperator("Equal"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public OpsItemRelatedItemsFilterOperator(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static OpsItemRelatedItemsFilterOperator FindValue(string value) { return FindValue<OpsItemRelatedItemsFilterOperator>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator OpsItemRelatedItemsFilterOperator(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type OpsItemStatus. /// </summary> public class OpsItemStatus : ConstantClass { /// <summary> /// Constant Approved for OpsItemStatus /// </summary> public static readonly OpsItemStatus Approved = new OpsItemStatus("Approved"); /// <summary> /// Constant Cancelled for OpsItemStatus /// </summary> public static readonly OpsItemStatus Cancelled = new OpsItemStatus("Cancelled"); /// <summary> /// Constant Cancelling for OpsItemStatus /// </summary> public static readonly OpsItemStatus Cancelling = new OpsItemStatus("Cancelling"); /// <summary> /// Constant ChangeCalendarOverrideApproved for OpsItemStatus /// </summary> public static readonly OpsItemStatus ChangeCalendarOverrideApproved = new OpsItemStatus("ChangeCalendarOverrideApproved"); /// <summary> /// Constant ChangeCalendarOverrideRejected for OpsItemStatus /// </summary> public static readonly OpsItemStatus ChangeCalendarOverrideRejected = new OpsItemStatus("ChangeCalendarOverrideRejected"); /// <summary> /// Constant Closed for OpsItemStatus /// </summary> public static readonly OpsItemStatus Closed = new OpsItemStatus("Closed"); /// <summary> /// Constant CompletedWithFailure for OpsItemStatus /// </summary> public static readonly OpsItemStatus CompletedWithFailure = new OpsItemStatus("CompletedWithFailure"); /// <summary> /// Constant CompletedWithSuccess for OpsItemStatus /// </summary> public static readonly OpsItemStatus CompletedWithSuccess = new OpsItemStatus("CompletedWithSuccess"); /// <summary> /// Constant Failed for OpsItemStatus /// </summary> public static readonly OpsItemStatus Failed = new OpsItemStatus("Failed"); /// <summary> /// Constant InProgress for OpsItemStatus /// </summary> public static readonly OpsItemStatus InProgress = new OpsItemStatus("InProgress"); /// <summary> /// Constant Open for OpsItemStatus /// </summary> public static readonly OpsItemStatus Open = new OpsItemStatus("Open"); /// <summary> /// Constant Pending for OpsItemStatus /// </summary> public static readonly OpsItemStatus Pending = new OpsItemStatus("Pending"); /// <summary> /// Constant PendingApproval for OpsItemStatus /// </summary> public static readonly OpsItemStatus PendingApproval = new OpsItemStatus("PendingApproval"); /// <summary> /// Constant PendingChangeCalendarOverride for OpsItemStatus /// </summary> public static readonly OpsItemStatus PendingChangeCalendarOverride = new OpsItemStatus("PendingChangeCalendarOverride"); /// <summary> /// Constant Rejected for OpsItemStatus /// </summary> public static readonly OpsItemStatus Rejected = new OpsItemStatus("Rejected"); /// <summary> /// Constant Resolved for OpsItemStatus /// </summary> public static readonly OpsItemStatus Resolved = new OpsItemStatus("Resolved"); /// <summary> /// Constant RunbookInProgress for OpsItemStatus /// </summary> public static readonly OpsItemStatus RunbookInProgress = new OpsItemStatus("RunbookInProgress"); /// <summary> /// Constant Scheduled for OpsItemStatus /// </summary> public static readonly OpsItemStatus Scheduled = new OpsItemStatus("Scheduled"); /// <summary> /// Constant TimedOut for OpsItemStatus /// </summary> public static readonly OpsItemStatus TimedOut = new OpsItemStatus("TimedOut"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public OpsItemStatus(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static OpsItemStatus FindValue(string value) { return FindValue<OpsItemStatus>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator OpsItemStatus(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type ParametersFilterKey. /// </summary> public class ParametersFilterKey : ConstantClass { /// <summary> /// Constant KeyId for ParametersFilterKey /// </summary> public static readonly ParametersFilterKey KeyId = new ParametersFilterKey("KeyId"); /// <summary> /// Constant Name for ParametersFilterKey /// </summary> public static readonly ParametersFilterKey Name = new ParametersFilterKey("Name"); /// <summary> /// Constant Type for ParametersFilterKey /// </summary> public static readonly ParametersFilterKey Type = new ParametersFilterKey("Type"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public ParametersFilterKey(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static ParametersFilterKey FindValue(string value) { return FindValue<ParametersFilterKey>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator ParametersFilterKey(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type ParameterTier. /// </summary> public class ParameterTier : ConstantClass { /// <summary> /// Constant Advanced for ParameterTier /// </summary> public static readonly ParameterTier Advanced = new ParameterTier("Advanced"); /// <summary> /// Constant IntelligentTiering for ParameterTier /// </summary> public static readonly ParameterTier IntelligentTiering = new ParameterTier("Intelligent-Tiering"); /// <summary> /// Constant Standard for ParameterTier /// </summary> public static readonly ParameterTier Standard = new ParameterTier("Standard"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public ParameterTier(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static ParameterTier FindValue(string value) { return FindValue<ParameterTier>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator ParameterTier(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type ParameterType. /// </summary> public class ParameterType : ConstantClass { /// <summary> /// Constant SecureString for ParameterType /// </summary> public static readonly ParameterType SecureString = new ParameterType("SecureString"); /// <summary> /// Constant String for ParameterType /// </summary> public static readonly ParameterType String = new ParameterType("String"); /// <summary> /// Constant StringList for ParameterType /// </summary> public static readonly ParameterType StringList = new ParameterType("StringList"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public ParameterType(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static ParameterType FindValue(string value) { return FindValue<ParameterType>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator ParameterType(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type PatchAction. /// </summary> public class PatchAction : ConstantClass { /// <summary> /// Constant ALLOW_AS_DEPENDENCY for PatchAction /// </summary> public static readonly PatchAction ALLOW_AS_DEPENDENCY = new PatchAction("ALLOW_AS_DEPENDENCY"); /// <summary> /// Constant BLOCK for PatchAction /// </summary> public static readonly PatchAction BLOCK = new PatchAction("BLOCK"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public PatchAction(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static PatchAction FindValue(string value) { return FindValue<PatchAction>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator PatchAction(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type PatchComplianceDataState. /// </summary> public class PatchComplianceDataState : ConstantClass { /// <summary> /// Constant FAILED for PatchComplianceDataState /// </summary> public static readonly PatchComplianceDataState FAILED = new PatchComplianceDataState("FAILED"); /// <summary> /// Constant INSTALLED for PatchComplianceDataState /// </summary> public static readonly PatchComplianceDataState INSTALLED = new PatchComplianceDataState("INSTALLED"); /// <summary> /// Constant INSTALLED_OTHER for PatchComplianceDataState /// </summary> public static readonly PatchComplianceDataState INSTALLED_OTHER = new PatchComplianceDataState("INSTALLED_OTHER"); /// <summary> /// Constant INSTALLED_PENDING_REBOOT for PatchComplianceDataState /// </summary> public static readonly PatchComplianceDataState INSTALLED_PENDING_REBOOT = new PatchComplianceDataState("INSTALLED_PENDING_REBOOT"); /// <summary> /// Constant INSTALLED_REJECTED for PatchComplianceDataState /// </summary> public static readonly PatchComplianceDataState INSTALLED_REJECTED = new PatchComplianceDataState("INSTALLED_REJECTED"); /// <summary> /// Constant MISSING for PatchComplianceDataState /// </summary> public static readonly PatchComplianceDataState MISSING = new PatchComplianceDataState("MISSING"); /// <summary> /// Constant NOT_APPLICABLE for PatchComplianceDataState /// </summary> public static readonly PatchComplianceDataState NOT_APPLICABLE = new PatchComplianceDataState("NOT_APPLICABLE"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public PatchComplianceDataState(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static PatchComplianceDataState FindValue(string value) { return FindValue<PatchComplianceDataState>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator PatchComplianceDataState(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type PatchComplianceLevel. /// </summary> public class PatchComplianceLevel : ConstantClass { /// <summary> /// Constant CRITICAL for PatchComplianceLevel /// </summary> public static readonly PatchComplianceLevel CRITICAL = new PatchComplianceLevel("CRITICAL"); /// <summary> /// Constant HIGH for PatchComplianceLevel /// </summary> public static readonly PatchComplianceLevel HIGH = new PatchComplianceLevel("HIGH"); /// <summary> /// Constant INFORMATIONAL for PatchComplianceLevel /// </summary> public static readonly PatchComplianceLevel INFORMATIONAL = new PatchComplianceLevel("INFORMATIONAL"); /// <summary> /// Constant LOW for PatchComplianceLevel /// </summary> public static readonly PatchComplianceLevel LOW = new PatchComplianceLevel("LOW"); /// <summary> /// Constant MEDIUM for PatchComplianceLevel /// </summary> public static readonly PatchComplianceLevel MEDIUM = new PatchComplianceLevel("MEDIUM"); /// <summary> /// Constant UNSPECIFIED for PatchComplianceLevel /// </summary> public static readonly PatchComplianceLevel UNSPECIFIED = new PatchComplianceLevel("UNSPECIFIED"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public PatchComplianceLevel(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static PatchComplianceLevel FindValue(string value) { return FindValue<PatchComplianceLevel>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator PatchComplianceLevel(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type PatchDeploymentStatus. /// </summary> public class PatchDeploymentStatus : ConstantClass { /// <summary> /// Constant APPROVED for PatchDeploymentStatus /// </summary> public static readonly PatchDeploymentStatus APPROVED = new PatchDeploymentStatus("APPROVED"); /// <summary> /// Constant EXPLICIT_APPROVED for PatchDeploymentStatus /// </summary> public static readonly PatchDeploymentStatus EXPLICIT_APPROVED = new PatchDeploymentStatus("EXPLICIT_APPROVED"); /// <summary> /// Constant EXPLICIT_REJECTED for PatchDeploymentStatus /// </summary> public static readonly PatchDeploymentStatus EXPLICIT_REJECTED = new PatchDeploymentStatus("EXPLICIT_REJECTED"); /// <summary> /// Constant PENDING_APPROVAL for PatchDeploymentStatus /// </summary> public static readonly PatchDeploymentStatus PENDING_APPROVAL = new PatchDeploymentStatus("PENDING_APPROVAL"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public PatchDeploymentStatus(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static PatchDeploymentStatus FindValue(string value) { return FindValue<PatchDeploymentStatus>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator PatchDeploymentStatus(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type PatchFilterKey. /// </summary> public class PatchFilterKey : ConstantClass { /// <summary> /// Constant ADVISORY_ID for PatchFilterKey /// </summary> public static readonly PatchFilterKey ADVISORY_ID = new PatchFilterKey("ADVISORY_ID"); /// <summary> /// Constant ARCH for PatchFilterKey /// </summary> public static readonly PatchFilterKey ARCH = new PatchFilterKey("ARCH"); /// <summary> /// Constant BUGZILLA_ID for PatchFilterKey /// </summary> public static readonly PatchFilterKey BUGZILLA_ID = new PatchFilterKey("BUGZILLA_ID"); /// <summary> /// Constant CLASSIFICATION for PatchFilterKey /// </summary> public static readonly PatchFilterKey CLASSIFICATION = new PatchFilterKey("CLASSIFICATION"); /// <summary> /// Constant CVE_ID for PatchFilterKey /// </summary> public static readonly PatchFilterKey CVE_ID = new PatchFilterKey("CVE_ID"); /// <summary> /// Constant EPOCH for PatchFilterKey /// </summary> public static readonly PatchFilterKey EPOCH = new PatchFilterKey("EPOCH"); /// <summary> /// Constant MSRC_SEVERITY for PatchFilterKey /// </summary> public static readonly PatchFilterKey MSRC_SEVERITY = new PatchFilterKey("MSRC_SEVERITY"); /// <summary> /// Constant NAME for PatchFilterKey /// </summary> public static readonly PatchFilterKey NAME = new PatchFilterKey("NAME"); /// <summary> /// Constant PATCH_ID for PatchFilterKey /// </summary> public static readonly PatchFilterKey PATCH_ID = new PatchFilterKey("PATCH_ID"); /// <summary> /// Constant PATCH_SET for PatchFilterKey /// </summary> public static readonly PatchFilterKey PATCH_SET = new PatchFilterKey("PATCH_SET"); /// <summary> /// Constant PRIORITY for PatchFilterKey /// </summary> public static readonly PatchFilterKey PRIORITY = new PatchFilterKey("PRIORITY"); /// <summary> /// Constant PRODUCT for PatchFilterKey /// </summary> public static readonly PatchFilterKey PRODUCT = new PatchFilterKey("PRODUCT"); /// <summary> /// Constant PRODUCT_FAMILY for PatchFilterKey /// </summary> public static readonly PatchFilterKey PRODUCT_FAMILY = new PatchFilterKey("PRODUCT_FAMILY"); /// <summary> /// Constant RELEASE for PatchFilterKey /// </summary> public static readonly PatchFilterKey RELEASE = new PatchFilterKey("RELEASE"); /// <summary> /// Constant REPOSITORY for PatchFilterKey /// </summary> public static readonly PatchFilterKey REPOSITORY = new PatchFilterKey("REPOSITORY"); /// <summary> /// Constant SECTION for PatchFilterKey /// </summary> public static readonly PatchFilterKey SECTION = new PatchFilterKey("SECTION"); /// <summary> /// Constant SECURITY for PatchFilterKey /// </summary> public static readonly PatchFilterKey SECURITY = new PatchFilterKey("SECURITY"); /// <summary> /// Constant SEVERITY for PatchFilterKey /// </summary> public static readonly PatchFilterKey SEVERITY = new PatchFilterKey("SEVERITY"); /// <summary> /// Constant VERSION for PatchFilterKey /// </summary> public static readonly PatchFilterKey VERSION = new PatchFilterKey("VERSION"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public PatchFilterKey(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static PatchFilterKey FindValue(string value) { return FindValue<PatchFilterKey>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator PatchFilterKey(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type PatchOperationType. /// </summary> public class PatchOperationType : ConstantClass { /// <summary> /// Constant Install for PatchOperationType /// </summary> public static readonly PatchOperationType Install = new PatchOperationType("Install"); /// <summary> /// Constant Scan for PatchOperationType /// </summary> public static readonly PatchOperationType Scan = new PatchOperationType("Scan"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public PatchOperationType(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static PatchOperationType FindValue(string value) { return FindValue<PatchOperationType>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator PatchOperationType(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type PatchProperty. /// </summary> public class PatchProperty : ConstantClass { /// <summary> /// Constant CLASSIFICATION for PatchProperty /// </summary> public static readonly PatchProperty CLASSIFICATION = new PatchProperty("CLASSIFICATION"); /// <summary> /// Constant MSRC_SEVERITY for PatchProperty /// </summary> public static readonly PatchProperty MSRC_SEVERITY = new PatchProperty("MSRC_SEVERITY"); /// <summary> /// Constant PRIORITY for PatchProperty /// </summary> public static readonly PatchProperty PRIORITY = new PatchProperty("PRIORITY"); /// <summary> /// Constant PRODUCT for PatchProperty /// </summary> public static readonly PatchProperty PRODUCT = new PatchProperty("PRODUCT"); /// <summary> /// Constant PRODUCT_FAMILY for PatchProperty /// </summary> public static readonly PatchProperty PRODUCT_FAMILY = new PatchProperty("PRODUCT_FAMILY"); /// <summary> /// Constant SEVERITY for PatchProperty /// </summary> public static readonly PatchProperty SEVERITY = new PatchProperty("SEVERITY"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public PatchProperty(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static PatchProperty FindValue(string value) { return FindValue<PatchProperty>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator PatchProperty(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type PatchSet. /// </summary> public class PatchSet : ConstantClass { /// <summary> /// Constant APPLICATION for PatchSet /// </summary> public static readonly PatchSet APPLICATION = new PatchSet("APPLICATION"); /// <summary> /// Constant OS for PatchSet /// </summary> public static readonly PatchSet OS = new PatchSet("OS"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public PatchSet(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static PatchSet FindValue(string value) { return FindValue<PatchSet>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator PatchSet(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type PingStatus. /// </summary> public class PingStatus : ConstantClass { /// <summary> /// Constant ConnectionLost for PingStatus /// </summary> public static readonly PingStatus ConnectionLost = new PingStatus("ConnectionLost"); /// <summary> /// Constant Inactive for PingStatus /// </summary> public static readonly PingStatus Inactive = new PingStatus("Inactive"); /// <summary> /// Constant Online for PingStatus /// </summary> public static readonly PingStatus Online = new PingStatus("Online"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public PingStatus(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static PingStatus FindValue(string value) { return FindValue<PingStatus>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator PingStatus(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type PlatformType. /// </summary> public class PlatformType : ConstantClass { /// <summary> /// Constant Linux for PlatformType /// </summary> public static readonly PlatformType Linux = new PlatformType("Linux"); /// <summary> /// Constant Windows for PlatformType /// </summary> public static readonly PlatformType Windows = new PlatformType("Windows"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public PlatformType(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static PlatformType FindValue(string value) { return FindValue<PlatformType>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator PlatformType(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type RebootOption. /// </summary> public class RebootOption : ConstantClass { /// <summary> /// Constant NoReboot for RebootOption /// </summary> public static readonly RebootOption NoReboot = new RebootOption("NoReboot"); /// <summary> /// Constant RebootIfNeeded for RebootOption /// </summary> public static readonly RebootOption RebootIfNeeded = new RebootOption("RebootIfNeeded"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public RebootOption(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static RebootOption FindValue(string value) { return FindValue<RebootOption>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator RebootOption(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type ResourceDataSyncS3Format. /// </summary> public class ResourceDataSyncS3Format : ConstantClass { /// <summary> /// Constant JsonSerDe for ResourceDataSyncS3Format /// </summary> public static readonly ResourceDataSyncS3Format JsonSerDe = new ResourceDataSyncS3Format("JsonSerDe"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public ResourceDataSyncS3Format(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static ResourceDataSyncS3Format FindValue(string value) { return FindValue<ResourceDataSyncS3Format>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator ResourceDataSyncS3Format(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type ResourceType. /// </summary> public class ResourceType : ConstantClass { /// <summary> /// Constant Document for ResourceType /// </summary> public static readonly ResourceType Document = new ResourceType("Document"); /// <summary> /// Constant EC2Instance for ResourceType /// </summary> public static readonly ResourceType EC2Instance = new ResourceType("EC2Instance"); /// <summary> /// Constant ManagedInstance for ResourceType /// </summary> public static readonly ResourceType ManagedInstance = new ResourceType("ManagedInstance"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public ResourceType(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static ResourceType FindValue(string value) { return FindValue<ResourceType>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator ResourceType(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type ResourceTypeForTagging. /// </summary> public class ResourceTypeForTagging : ConstantClass { /// <summary> /// Constant Document for ResourceTypeForTagging /// </summary> public static readonly ResourceTypeForTagging Document = new ResourceTypeForTagging("Document"); /// <summary> /// Constant MaintenanceWindow for ResourceTypeForTagging /// </summary> public static readonly ResourceTypeForTagging MaintenanceWindow = new ResourceTypeForTagging("MaintenanceWindow"); /// <summary> /// Constant ManagedInstance for ResourceTypeForTagging /// </summary> public static readonly ResourceTypeForTagging ManagedInstance = new ResourceTypeForTagging("ManagedInstance"); /// <summary> /// Constant OpsItem for ResourceTypeForTagging /// </summary> public static readonly ResourceTypeForTagging OpsItem = new ResourceTypeForTagging("OpsItem"); /// <summary> /// Constant OpsMetadata for ResourceTypeForTagging /// </summary> public static readonly ResourceTypeForTagging OpsMetadata = new ResourceTypeForTagging("OpsMetadata"); /// <summary> /// Constant Parameter for ResourceTypeForTagging /// </summary> public static readonly ResourceTypeForTagging Parameter = new ResourceTypeForTagging("Parameter"); /// <summary> /// Constant PatchBaseline for ResourceTypeForTagging /// </summary> public static readonly ResourceTypeForTagging PatchBaseline = new ResourceTypeForTagging("PatchBaseline"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public ResourceTypeForTagging(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static ResourceTypeForTagging FindValue(string value) { return FindValue<ResourceTypeForTagging>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator ResourceTypeForTagging(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type ReviewStatus. /// </summary> public class ReviewStatus : ConstantClass { /// <summary> /// Constant APPROVED for ReviewStatus /// </summary> public static readonly ReviewStatus APPROVED = new ReviewStatus("APPROVED"); /// <summary> /// Constant NOT_REVIEWED for ReviewStatus /// </summary> public static readonly ReviewStatus NOT_REVIEWED = new ReviewStatus("NOT_REVIEWED"); /// <summary> /// Constant PENDING for ReviewStatus /// </summary> public static readonly ReviewStatus PENDING = new ReviewStatus("PENDING"); /// <summary> /// Constant REJECTED for ReviewStatus /// </summary> public static readonly ReviewStatus REJECTED = new ReviewStatus("REJECTED"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public ReviewStatus(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static ReviewStatus FindValue(string value) { return FindValue<ReviewStatus>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator ReviewStatus(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type SessionFilterKey. /// </summary> public class SessionFilterKey : ConstantClass { /// <summary> /// Constant InvokedAfter for SessionFilterKey /// </summary> public static readonly SessionFilterKey InvokedAfter = new SessionFilterKey("InvokedAfter"); /// <summary> /// Constant InvokedBefore for SessionFilterKey /// </summary> public static readonly SessionFilterKey InvokedBefore = new SessionFilterKey("InvokedBefore"); /// <summary> /// Constant Owner for SessionFilterKey /// </summary> public static readonly SessionFilterKey Owner = new SessionFilterKey("Owner"); /// <summary> /// Constant SessionId for SessionFilterKey /// </summary> public static readonly SessionFilterKey SessionId = new SessionFilterKey("SessionId"); /// <summary> /// Constant Status for SessionFilterKey /// </summary> public static readonly SessionFilterKey Status = new SessionFilterKey("Status"); /// <summary> /// Constant Target for SessionFilterKey /// </summary> public static readonly SessionFilterKey Target = new SessionFilterKey("Target"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public SessionFilterKey(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static SessionFilterKey FindValue(string value) { return FindValue<SessionFilterKey>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator SessionFilterKey(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type SessionState. /// </summary> public class SessionState : ConstantClass { /// <summary> /// Constant Active for SessionState /// </summary> public static readonly SessionState Active = new SessionState("Active"); /// <summary> /// Constant History for SessionState /// </summary> public static readonly SessionState History = new SessionState("History"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public SessionState(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static SessionState FindValue(string value) { return FindValue<SessionState>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator SessionState(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type SessionStatus. /// </summary> public class SessionStatus : ConstantClass { /// <summary> /// Constant Connected for SessionStatus /// </summary> public static readonly SessionStatus Connected = new SessionStatus("Connected"); /// <summary> /// Constant Connecting for SessionStatus /// </summary> public static readonly SessionStatus Connecting = new SessionStatus("Connecting"); /// <summary> /// Constant Disconnected for SessionStatus /// </summary> public static readonly SessionStatus Disconnected = new SessionStatus("Disconnected"); /// <summary> /// Constant Failed for SessionStatus /// </summary> public static readonly SessionStatus Failed = new SessionStatus("Failed"); /// <summary> /// Constant Terminated for SessionStatus /// </summary> public static readonly SessionStatus Terminated = new SessionStatus("Terminated"); /// <summary> /// Constant Terminating for SessionStatus /// </summary> public static readonly SessionStatus Terminating = new SessionStatus("Terminating"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public SessionStatus(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static SessionStatus FindValue(string value) { return FindValue<SessionStatus>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator SessionStatus(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type SignalType. /// </summary> public class SignalType : ConstantClass { /// <summary> /// Constant Approve for SignalType /// </summary> public static readonly SignalType Approve = new SignalType("Approve"); /// <summary> /// Constant Reject for SignalType /// </summary> public static readonly SignalType Reject = new SignalType("Reject"); /// <summary> /// Constant Resume for SignalType /// </summary> public static readonly SignalType Resume = new SignalType("Resume"); /// <summary> /// Constant StartStep for SignalType /// </summary> public static readonly SignalType StartStep = new SignalType("StartStep"); /// <summary> /// Constant StopStep for SignalType /// </summary> public static readonly SignalType StopStep = new SignalType("StopStep"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public SignalType(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static SignalType FindValue(string value) { return FindValue<SignalType>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator SignalType(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type StepExecutionFilterKey. /// </summary> public class StepExecutionFilterKey : ConstantClass { /// <summary> /// Constant Action for StepExecutionFilterKey /// </summary> public static readonly StepExecutionFilterKey Action = new StepExecutionFilterKey("Action"); /// <summary> /// Constant StartTimeAfter for StepExecutionFilterKey /// </summary> public static readonly StepExecutionFilterKey StartTimeAfter = new StepExecutionFilterKey("StartTimeAfter"); /// <summary> /// Constant StartTimeBefore for StepExecutionFilterKey /// </summary> public static readonly StepExecutionFilterKey StartTimeBefore = new StepExecutionFilterKey("StartTimeBefore"); /// <summary> /// Constant StepExecutionId for StepExecutionFilterKey /// </summary> public static readonly StepExecutionFilterKey StepExecutionId = new StepExecutionFilterKey("StepExecutionId"); /// <summary> /// Constant StepExecutionStatus for StepExecutionFilterKey /// </summary> public static readonly StepExecutionFilterKey StepExecutionStatus = new StepExecutionFilterKey("StepExecutionStatus"); /// <summary> /// Constant StepName for StepExecutionFilterKey /// </summary> public static readonly StepExecutionFilterKey StepName = new StepExecutionFilterKey("StepName"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public StepExecutionFilterKey(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static StepExecutionFilterKey FindValue(string value) { return FindValue<StepExecutionFilterKey>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator StepExecutionFilterKey(string value) { return FindValue(value); } } /// <summary> /// Constants used for properties of type StopType. /// </summary> public class StopType : ConstantClass { /// <summary> /// Constant Cancel for StopType /// </summary> public static readonly StopType Cancel = new StopType("Cancel"); /// <summary> /// Constant Complete for StopType /// </summary> public static readonly StopType Complete = new StopType("Complete"); /// <summary> /// This constant constructor does not need to be called if the constant /// you are attempting to use is already defined as a static instance of /// this class. /// This constructor should be used to construct constants that are not /// defined as statics, for instance if attempting to use a feature that is /// newer than the current version of the SDK. /// </summary> public StopType(string value) : base(value) { } /// <summary> /// Finds the constant for the unique value. /// </summary> /// <param name="value">The unique value for the constant</param> /// <returns>The constant for the unique value</returns> public static StopType FindValue(string value) { return FindValue<StopType>(value); } /// <summary> /// Utility method to convert strings to the constant class. /// </summary> /// <param name="value">The string value to convert to the constant class.</param> /// <returns></returns> public static implicit operator StopType(string value) { return FindValue(value); } } }
40.035063
154
0.624329
[ "Apache-2.0" ]
MDanialSaleem/aws-sdk-net
sdk/src/Services/SimpleSystemsManagement/Generated/ServiceEnumerations.cs
202,097
C#
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ namespace Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.PowerShell { using static Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.Extensions; [System.ComponentModel.TypeConverter(typeof(AsyncOperationResponseTypeConverter))] public class AsyncOperationResponse { private string _target; public string Target { get => _target; set => _target = value; } public AsyncOperationResponse() { } internal AsyncOperationResponse(Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.Json.JsonObject json) { // pull target { Target = If(json?.PropertyT<Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.Json.JsonString>("target"), out var _v) ? (string)_v : (string)Target; } } public string ToJsonString() { return $"{{ \"target\" : \"{this.Target}\" }}"; } public static AsyncOperationResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.Json.JsonObject json ? new AsyncOperationResponse(json) : null; } /// <summary> /// Creates a new instance of <see cref="AdministratorDetails" />, 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 AsyncOperationResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.Json.JsonNode.Parse(jsonText)); } public partial class AsyncOperationResponseTypeConverter : System.Management.Automation.PSTypeConverter { /// <summary> /// Determines if the converter can convert the <see cref="sourceValue"/> parameter to the <see cref="destinationType" /> /// parameter. /// </summary> /// <param name="sourceValue">the <see cref="System.Object"/> to convert from</param> /// <param name="destinationType">the <see cref="System.Type" /> to convert to</param> /// <returns> /// <c>true</c> if the converter can convert the <see cref="sourceValue"/> parameter to the <see cref="destinationType" /> /// parameter, otherwise <c>false</c>. /// </returns> public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// <summary> /// Determines if the converter can convert the <see cref="sourceValue"/> parameter to the <see cref="destinationType" /> /// parameter. /// </summary> /// <param name="sourceValue">the <see cref="System.Object" /> instance to check if it can be converted to the <see cref="AsyncOperationResponse" /// /> type.</param> /// <returns> /// <c>true</c> if the instance could be converted to a <see cref="AsyncOperationResponse" /> type, otherwise <c>false</c> /// </returns> public static bool CanConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return true; } global::System.Type type = sourceValue.GetType(); if (typeof(System.Management.Automation.PSObject).IsAssignableFrom(type)) { // we say yest to PSObjects return true; } if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) { // we say yest to Hashtables/dictionaries return true; } try { if (null != sourceValue.ToJsonString()) { return true; } } catch { // Not one of our objects } try { string text = sourceValue.ToString()?.Trim(); return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.Json.JsonType.Object; } catch { // Doesn't look like it can be treated as JSON } return false; } /// <summary> /// Determines if the <see cref="sourceValue" /> parameter can be converted to the <see cref="destinationType" /> parameter /// </summary> /// <param name="sourceValue">the <see cref="System.Object"/> to convert from</param> /// <param name="destinationType">the <see cref="System.Type" /> to convert to</param> /// <returns> /// <c>true</c> if the converter can convert the <see cref="sourceValue" /> parameter to the <see cref="destinationType" /> /// parameter, otherwise <c>false</c> /// </returns> public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; /// <summary> /// Converts the <see cref="sourceValue" /> parameter to the <see cref="destinationType" /> parameter using <see cref="formatProvider" /// /> and <see cref="ignoreCase" /> /// </summary> /// <param name="sourceValue">the <see cref="System.Object"/> to convert from</param> /// <param name="destinationType">the <see cref="System.Type" /> to convert to</param> /// <param name="formatProvider">not used by this TypeConverter.</param> /// <param name="ignoreCase">when set to <c>true</c>, will ignore the case when converting.</param> /// <returns> /// an instance of <see cref="AsyncOperationResponse" />, or <c>null</c> if there is no suitable conversion. /// </returns> public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); /// <summary> /// Converts the <see cref="sourceValue" /> parameter to the <see cref="destinationType" /> parameter using <see cref="formatProvider" /// /> and <see cref="ignoreCase" /> /// </summary> /// <param name="sourceValue">the value to convert into an instance of <see cref="AsyncOperationResponse" />.</param> /// <returns> /// an instance of <see cref="AsyncOperationResponse" />, or <c>null</c> if there is no suitable conversion. /// </returns> public static object ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); if (typeof(AsyncOperationResponse).IsAssignableFrom(type)) { return sourceValue; } try { return AsyncOperationResponse.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString()); ; } catch { // Unable to use JSON pattern } if (typeof(System.Management.Automation.PSObject).IsAssignableFrom(type)) { return new AsyncOperationResponse { Target = (sourceValue as System.Management.Automation.PSObject).GetValueForProperty<string>("target", "", global::System.Convert.ToString) }; } if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) { return new AsyncOperationResponse { Target = (sourceValue as global::System.Collections.IDictionary).GetValueForProperty<string>("target", "", global::System.Convert.ToString) }; } return null; } /// <summary>NotImplemented -- this will return <c>null</c></summary> /// <param name="sourceValue">the <see cref="System.Object"/> to convert from</param> /// <param name="destinationType">the <see cref="System.Type" /> to convert to</param> /// <param name="formatProvider">not used by this TypeConverter.</param> /// <param name="ignoreCase">when set to <c>true</c>, will ignore the case when converting.</param> /// <returns>will always return <c>null</c>.</returns> public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; } }
52.847458
273
0.589694
[ "MIT" ]
3quanfeng/azure-powershell
src/DesktopVirtualization/generated/runtime/AsyncOperationResponse.cs
9,178
C#
namespace Merchello.Core.Persistence.Repositories { using System; using System.Collections.Generic; using System.Data; using System.Linq; using Merchello.Core.Models; using Merchello.Core.Models.EntityBase; using Merchello.Core.Models.Rdbms; using Merchello.Core.Persistence.Factories; using Merchello.Core.Persistence.Querying; using Merchello.Core.Persistence.UnitOfWork; using Umbraco.Core; using Umbraco.Core.Cache; using Umbraco.Core.Logging; using Umbraco.Core.Persistence; using Umbraco.Core.Persistence.Querying; using Umbraco.Core.Persistence.SqlSyntax; /// <summary> /// The ship method repository. /// </summary> internal class ShipMethodRepository : MerchelloPetaPocoRepositoryBase<IShipMethod>, IShipMethodRepository { /// <summary> /// Initializes a new instance of the <see cref="ShipMethodRepository"/> class. /// </summary> /// <param name="work"> /// The work. /// </param> /// <param name="cache"> /// The cache. /// </param> /// <param name="logger"> /// The logger. /// </param> /// <param name="sqlSyntax"> /// The SQL syntax. /// </param> public ShipMethodRepository( IDatabaseUnitOfWork work, CacheHelper cache, ILogger logger, ISqlSyntaxProvider sqlSyntax) : base(work, cache, logger, sqlSyntax) { } /// <summary> /// Gets a <see cref="IShipMethod"/> by it's key. /// </summary> /// <param name="key"> /// The key. /// </param> /// <returns> /// The <see cref="IShipMethod"/>. /// </returns> protected override IShipMethod PerformGet(Guid key) { var sql = GetBaseQuery(false) .Where(GetBaseWhereClause(), new { Key = key }); var dto = Database.Fetch<ShipMethodDto>(sql).FirstOrDefault(); if (dto == null) return null; var factory = new ShipMethodFactory(); return factory.BuildEntity(dto); } /// <summary> /// Gets all <see cref="IShipMethod"/>. /// </summary> /// <param name="keys"> /// The keys. /// </param> /// <returns> /// The <see cref="IEnumerable{IShipMethod}"/>. /// </returns> protected override IEnumerable<IShipMethod> PerformGetAll(params Guid[] keys) { if (keys.Any()) { foreach (var key in keys) { yield return Get(key); } } else { var factory = new ShipMethodFactory(); var dtos = Database.Fetch<ShipMethodDto>(GetBaseQuery(false)); foreach (var dto in dtos) { yield return factory.BuildEntity(dto); } } } /// <summary> /// Gets a collection of <see cref="IShipMethod"/> by query. /// </summary> /// <param name="query"> /// The query. /// </param> /// <returns> /// The <see cref="IEnumerable{IShipMethod}"/>. /// </returns> protected override IEnumerable<IShipMethod> PerformGetByQuery(IQuery<IShipMethod> query) { var sqlClause = GetBaseQuery(false); var translator = new SqlTranslator<IShipMethod>(sqlClause, query); var sql = translator.Translate(); var dtos = Database.Fetch<ShipMethodDto>(sql); return dtos.DistinctBy(x => x.Key).Select(dto => Get(dto.Key)); } /// <summary> /// Gets the base SQL clause. /// </summary> /// <param name="isCount"> /// The is count. /// </param> /// <returns> /// The <see cref="Sql"/>. /// </returns> protected override Sql GetBaseQuery(bool isCount) { var sql = new Sql(); sql.Select(isCount ? "COUNT(*)" : "*") .From<ShipMethodDto>(SqlSyntax); return sql; } /// <summary> /// Gets the base where clause. /// </summary> /// <returns> /// The <see cref="string"/>. /// </returns> protected override string GetBaseWhereClause() { return "merchShipMethod.pk = @Key"; } /// <summary> /// Gets the list of delete clauses. /// </summary> /// <returns> /// The <see cref="IEnumerable{String}"/>. /// </returns> protected override IEnumerable<string> GetDeleteClauses() { // TODO : RSS - The update in the middle of these delete clauses needs to be refactored - just a quick fix for now var list = new List<string> { "DELETE FROM merchShipRateTier WHERE shipMethodKey = @Key", "UPDATE merchShipment SET shipMethodKey = NULL WHERE shipMethodKey = @Key", "DELETE FROM merchShipMethod WHERE pk = @Key" }; return list; } /// <summary> /// Saves a new item to the database. /// </summary> /// <param name="entity"> /// The entity. /// </param> protected override void PersistNewItem(IShipMethod entity) { // assert a shipmethod does not already exist for this country with this service code var query = Querying.Query<IShipMethod>.Builder.Where( x => x.ShipCountryKey == entity.ShipCountryKey && x.ServiceCode == entity.ServiceCode); if(GetByQuery(query).Any()) throw new ConstraintException("A Shipmethod already exists for this ShipCountry with this ServiceCode"); ((Entity)entity).AddingEntity(); var factory = new ShipMethodFactory(); var dto = factory.BuildDto(entity); Database.Insert(dto); entity.Key = dto.Key; entity.ResetDirtyProperties(); } /// <summary> /// Saves an existing item to the database. /// </summary> /// <param name="entity"> /// The entity. /// </param> protected override void PersistUpdatedItem(IShipMethod entity) { ((Entity)entity).AddingEntity(); var factory = new ShipMethodFactory(); var dto = factory.BuildDto(entity); Database.Update(dto); entity.ResetDirtyProperties(); } } }
31.430556
144
0.520548
[ "MIT" ]
Mindbus/Merchello
src/Merchello.Core/Persistence/Repositories/ShipMethodRepository.cs
6,791
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.Management.Batch { using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; /// <summary> /// BatchAccountOperations operations. /// </summary> internal partial class BatchAccountOperations : Microsoft.Rest.IServiceOperations<BatchManagementClient>, IBatchAccountOperations { /// <summary> /// Initializes a new instance of the BatchAccountOperations class. /// </summary> /// <param name='client'> /// Reference to the service client. /// </param> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> internal BatchAccountOperations(BatchManagementClient client) { if (client == null) { throw new System.ArgumentNullException("client"); } this.Client = client; } /// <summary> /// Gets a reference to the BatchManagementClient /// </summary> public BatchManagementClient Client { get; private set; } /// <summary> /// Creates a new Batch account with the specified parameters. Existing /// accounts cannot be updated with this API and should instead be updated /// with the Update Batch Account API. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group that contains the new Batch account. /// </param> /// <param name='accountName'> /// A name for the Batch account which must be unique within the region. Batch /// account names must be between 3 and 24 characters in length and must use /// only numbers and lowercase letters. This name is used as part of the DNS /// name that is used to access the Batch service in the region in which the /// account is created. For example: /// http://accountname.region.batch.azure.com/. /// </param> /// <param name='parameters'> /// Additional parameters for account creation. /// </param> /// <param name='customHeaders'> /// The headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public async System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<BatchAccount>> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, BatchAccountCreateParameters parameters, System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request Microsoft.Rest.Azure.AzureOperationResponse<BatchAccount> _response = await BeginCreateWithHttpMessagesAsync( resourceGroupName, accountName, parameters, customHeaders, cancellationToken); return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken); } /// <summary> /// Creates a new Batch account with the specified parameters. Existing /// accounts cannot be updated with this API and should instead be updated /// with the Update Batch Account API. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group that contains the new Batch account. /// </param> /// <param name='accountName'> /// A name for the Batch account which must be unique within the region. Batch /// account names must be between 3 and 24 characters in length and must use /// only numbers and lowercase letters. This name is used as part of the DNS /// name that is used to access the Batch service in the region in which the /// account is created. For example: /// http://accountname.region.batch.azure.com/. /// </param> /// <param name='parameters'> /// Additional parameters for account creation. /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="Microsoft.Rest.Azure.CloudException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="Microsoft.Rest.SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="Microsoft.Rest.ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<BatchAccount>> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string accountName, BatchAccountCreateParameters parameters, System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (accountName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (accountName.Length > 24) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 24); } if (accountName.Length < 3) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); } if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[-\\w\\._]+$")) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[-\\w\\._]+$"); } } if (parameters == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } if (parameters != null) { parameters.Validate(); } if (this.Client.ApiVersion == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary<string, object> tracingParameters = new System.Collections.Generic.Dictionary<string, object>(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); System.Collections.Generic.List<string> _queryParameters = new System.Collections.Generic.List<string>(); if (this.Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += "?" + string.Join("&", _queryParameters); } // Create HTTP transport objects System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; if(parameters != null) { _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 202 && (int)_statusCode != 200) { var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } catch (Newtonsoft.Json.JsonException) { // Ignore the exception } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new Microsoft.Rest.Azure.AzureOperationResponse<BatchAccount>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<BatchAccount>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// <summary> /// Updates the properties of an existing Batch account. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group that contains the Batch account. /// </param> /// <param name='accountName'> /// The name of the account. /// </param> /// <param name='parameters'> /// Additional parameters for account update. /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="Microsoft.Rest.Azure.CloudException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="Microsoft.Rest.SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="Microsoft.Rest.ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<BatchAccount>> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, BatchAccountUpdateParameters parameters, System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (accountName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (accountName.Length > 24) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 24); } if (accountName.Length < 3) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); } if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[-\\w\\._]+$")) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[-\\w\\._]+$"); } } if (parameters == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } if (this.Client.ApiVersion == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary<string, object> tracingParameters = new System.Collections.Generic.Dictionary<string, object>(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); System.Collections.Generic.List<string> _queryParameters = new System.Collections.Generic.List<string>(); if (this.Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += "?" + string.Join("&", _queryParameters); } // Create HTTP transport objects System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; if(parameters != null) { _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } catch (Newtonsoft.Json.JsonException) { // Ignore the exception } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new Microsoft.Rest.Azure.AzureOperationResponse<BatchAccount>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<BatchAccount>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// <summary> /// Deletes the specified Batch account. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group that contains the Batch account to be /// deleted. /// </param> /// <param name='accountName'> /// The name of the account to be deleted. /// </param> /// <param name='customHeaders'> /// The headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public async System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse> DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send request Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, accountName, customHeaders, cancellationToken); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// <summary> /// Deletes the specified Batch account. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group that contains the Batch account to be /// deleted. /// </param> /// <param name='accountName'> /// The name of the account to be deleted. /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="Microsoft.Rest.Azure.CloudException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="Microsoft.Rest.ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (accountName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (accountName.Length > 24) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 24); } if (accountName.Length < 3) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); } if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[-\\w\\._]+$")) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[-\\w\\._]+$"); } } if (this.Client.ApiVersion == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary<string, object> tracingParameters = new System.Collections.Generic.Dictionary<string, object>(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("cancellationToken", cancellationToken); Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); System.Collections.Generic.List<string> _queryParameters = new System.Collections.Generic.List<string>(); if (this.Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += "?" + string.Join("&", _queryParameters); } // Create HTTP transport objects System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; // Set Credentials if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 202 && (int)_statusCode != 204 && (int)_statusCode != 200) { var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); if (_httpResponse.Content != null) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); } else { _responseContent = string.Empty; } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// <summary> /// Gets information about the specified Batch account. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group that contains the Batch account. /// </param> /// <param name='accountName'> /// The name of the account. /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="Microsoft.Rest.Azure.CloudException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="Microsoft.Rest.SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="Microsoft.Rest.ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<BatchAccount>> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (accountName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (accountName.Length > 24) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 24); } if (accountName.Length < 3) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); } if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[-\\w\\._]+$")) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[-\\w\\._]+$"); } } if (this.Client.ApiVersion == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary<string, object> tracingParameters = new System.Collections.Generic.Dictionary<string, object>(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("cancellationToken", cancellationToken); Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); System.Collections.Generic.List<string> _queryParameters = new System.Collections.Generic.List<string>(); if (this.Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += "?" + string.Join("&", _queryParameters); } // Create HTTP transport objects System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; // Set Credentials if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } catch (Newtonsoft.Json.JsonException) { // Ignore the exception } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new Microsoft.Rest.Azure.AzureOperationResponse<BatchAccount>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<BatchAccount>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// <summary> /// Gets information about the Batch accounts associated with the subscription. /// </summary> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="Microsoft.Rest.Azure.CloudException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="Microsoft.Rest.SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="Microsoft.Rest.ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<Microsoft.Rest.Azure.IPage<BatchAccount>>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (this.Client.ApiVersion == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary<string, object> tracingParameters = new System.Collections.Generic.Dictionary<string, object>(); tracingParameters.Add("cancellationToken", cancellationToken); Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Batch/batchAccounts").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); System.Collections.Generic.List<string> _queryParameters = new System.Collections.Generic.List<string>(); if (this.Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += "?" + string.Join("&", _queryParameters); } // Create HTTP transport objects System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; // Set Credentials if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } catch (Newtonsoft.Json.JsonException) { // Ignore the exception } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new Microsoft.Rest.Azure.AzureOperationResponse<Microsoft.Rest.Azure.IPage<BatchAccount>>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<Page<BatchAccount>>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// <summary> /// Gets information about the Batch accounts associated within the specified /// resource group. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group whose Batch accounts to list. /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="Microsoft.Rest.Azure.CloudException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="Microsoft.Rest.SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="Microsoft.Rest.ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<Microsoft.Rest.Azure.IPage<BatchAccount>>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (this.Client.ApiVersion == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary<string, object> tracingParameters = new System.Collections.Generic.Dictionary<string, object>(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("cancellationToken", cancellationToken); Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); System.Collections.Generic.List<string> _queryParameters = new System.Collections.Generic.List<string>(); if (this.Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += "?" + string.Join("&", _queryParameters); } // Create HTTP transport objects System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; // Set Credentials if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } catch (Newtonsoft.Json.JsonException) { // Ignore the exception } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new Microsoft.Rest.Azure.AzureOperationResponse<Microsoft.Rest.Azure.IPage<BatchAccount>>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<Page<BatchAccount>>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// <summary> /// Synchronizes access keys for the auto storage account configured for the /// specified Batch account. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group that contains the Batch account. /// </param> /// <param name='accountName'> /// The name of the Batch account. /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="Microsoft.Rest.Azure.CloudException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="Microsoft.Rest.ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse> SynchronizeAutoStorageKeysWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (accountName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (accountName.Length > 24) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 24); } if (accountName.Length < 3) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); } if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[-\\w\\._]+$")) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[-\\w\\._]+$"); } } if (this.Client.ApiVersion == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary<string, object> tracingParameters = new System.Collections.Generic.Dictionary<string, object>(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("cancellationToken", cancellationToken); Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "SynchronizeAutoStorageKeys", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/syncAutoStorageKeys").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); System.Collections.Generic.List<string> _queryParameters = new System.Collections.Generic.List<string>(); if (this.Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += "?" + string.Join("&", _queryParameters); } // Create HTTP transport objects System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; // Set Credentials if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 204) { var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); if (_httpResponse.Content != null) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); } else { _responseContent = string.Empty; } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// <summary> /// Regenerates the specified account key for the specified Batch account. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group that contains the Batch account. /// </param> /// <param name='accountName'> /// The name of the account. /// </param> /// <param name='keyName'> /// The type of account key to regenerate. Possible values include: 'Primary', /// 'Secondary' /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="Microsoft.Rest.Azure.CloudException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="Microsoft.Rest.SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="Microsoft.Rest.ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<BatchAccountKeys>> RegenerateKeyWithHttpMessagesAsync(string resourceGroupName, string accountName, AccountKeyType keyName, System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (accountName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (accountName.Length > 24) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 24); } if (accountName.Length < 3) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); } if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[-\\w\\._]+$")) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[-\\w\\._]+$"); } } if (this.Client.ApiVersion == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } BatchAccountRegenerateKeyParameters parameters = new BatchAccountRegenerateKeyParameters(); parameters.KeyName = keyName; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary<string, object> tracingParameters = new System.Collections.Generic.Dictionary<string, object>(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "RegenerateKey", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/regenerateKeys").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); System.Collections.Generic.List<string> _queryParameters = new System.Collections.Generic.List<string>(); if (this.Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += "?" + string.Join("&", _queryParameters); } // Create HTTP transport objects System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; if(parameters != null) { _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } catch (Newtonsoft.Json.JsonException) { // Ignore the exception } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new Microsoft.Rest.Azure.AzureOperationResponse<BatchAccountKeys>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<BatchAccountKeys>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// <summary> /// Gets the account keys for the specified Batch account. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group that contains the Batch account. /// </param> /// <param name='accountName'> /// The name of the account. /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="Microsoft.Rest.Azure.CloudException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="Microsoft.Rest.SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="Microsoft.Rest.ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<BatchAccountKeys>> GetKeysWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (accountName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (accountName.Length > 24) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 24); } if (accountName.Length < 3) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); } if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[-\\w\\._]+$")) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[-\\w\\._]+$"); } } if (this.Client.ApiVersion == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary<string, object> tracingParameters = new System.Collections.Generic.Dictionary<string, object>(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("cancellationToken", cancellationToken); Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetKeys", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/listKeys").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); System.Collections.Generic.List<string> _queryParameters = new System.Collections.Generic.List<string>(); if (this.Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += "?" + string.Join("&", _queryParameters); } // Create HTTP transport objects System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; // Set Credentials if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } catch (Newtonsoft.Json.JsonException) { // Ignore the exception } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new Microsoft.Rest.Azure.AzureOperationResponse<BatchAccountKeys>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<BatchAccountKeys>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// <summary> /// Gets information about the Batch accounts associated with the subscription. /// </summary> /// <param name='nextPageLink'> /// The NextLink from the previous successful call to List operation. /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="Microsoft.Rest.Azure.CloudException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="Microsoft.Rest.SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="Microsoft.Rest.ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<Microsoft.Rest.Azure.IPage<BatchAccount>>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (nextPageLink == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary<string, object> tracingParameters = new System.Collections.Generic.Dictionary<string, object>(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); System.Collections.Generic.List<string> _queryParameters = new System.Collections.Generic.List<string>(); if (_queryParameters.Count > 0) { _url += "?" + string.Join("&", _queryParameters); } // Create HTTP transport objects System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; // Set Credentials if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } catch (Newtonsoft.Json.JsonException) { // Ignore the exception } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new Microsoft.Rest.Azure.AzureOperationResponse<Microsoft.Rest.Azure.IPage<BatchAccount>>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<Page<BatchAccount>>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// <summary> /// Gets information about the Batch accounts associated within the specified /// resource group. /// </summary> /// <param name='nextPageLink'> /// The NextLink from the previous successful call to List operation. /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="Microsoft.Rest.Azure.CloudException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="Microsoft.Rest.SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="Microsoft.Rest.ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<Microsoft.Rest.Azure.IPage<BatchAccount>>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (nextPageLink == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary<string, object> tracingParameters = new System.Collections.Generic.Dictionary<string, object>(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); System.Collections.Generic.List<string> _queryParameters = new System.Collections.Generic.List<string>(); if (_queryParameters.Count > 0) { _url += "?" + string.Join("&", _queryParameters); } // Create HTTP transport objects System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; // Set Credentials if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } catch (Newtonsoft.Json.JsonException) { // Ignore the exception } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new Microsoft.Rest.Azure.AzureOperationResponse<Microsoft.Rest.Azure.IPage<BatchAccount>>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<Page<BatchAccount>>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } }
51.45986
436
0.584869
[ "MIT" ]
dnelly/azure-sdk-for-net
src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/BatchAccountOperations.cs
117,946
C#
/* MIT License Copyright (c) 2017 Uvi Vagabond, UnityBerserkers 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.Collections; using System.Collections.Generic; using UnityEngine; using UnityBerserkersGizmos; public class VizualizeRotateTowardsTest : MonoBehaviour { [Header ("Press Play and will start to rotate!")] [Space (22)] [Header ("Origin and end of rotation:")] [SerializeField]Vector3 origin; [SerializeField]Vector3 endDirection = Vector3.zero; [Tooltip ("Velocity in degrees/s")][SerializeField]float maxDegreesVelocity = 6; [Tooltip ("Constraint for lenght of vector")][SerializeField]float maxMagnitudeDelta = 3; void Update () { float maxAngleInDegrees = maxDegreesVelocity * Mathf.Deg2Rad * Time.deltaTime; // if you want to see rotation for other transform direction change CURRENT value here and in VisualizeRotateTowards Vector3 direction = Vector3.RotateTowards (current: transform.up, target: endDirection, maxRadiansDelta: maxAngleInDegrees, maxMagnitudeDelta: maxMagnitudeDelta); transform.up = direction; } void OnDrawGizmos () { GizmosForVector.VisualizeRotateTowards (origin: origin, current: transform.up, target: endDirection); } }
45.395833
164
0.791648
[ "MIT" ]
uvivagabond/Visualization-of-physics-in-Unity
Assets/Scripts/Test Scripts for Vectors/VizualizeRotateTowardsTest.cs
2,181
C#
using System; using System.IO; using Microsoft.DotNet.Cli.Utils; namespace Microsoft.DotNet.Tools.Compiler.Native { public class Program { public static int Main(string[] args) { DebugHelper.HandleDebugSwitch(ref args); return ExecuteApp(args); } private static int ExecuteApp(string[] args) { // Support Response File foreach(var arg in args) { if(arg.Contains(".rsp")) { args = ParseResponseFile(arg); if (args == null) { return 1; } } } try { var cmdLineArgs = ArgumentsParser.Parse(args); var config = cmdLineArgs.GetNativeCompileSettings(); DirectoryExtensions.CleanOrCreateDirectory(config.OutputDirectory); DirectoryExtensions.CleanOrCreateDirectory(config.IntermediateDirectory); var nativeCompiler = NativeCompiler.Create(config); var result = nativeCompiler.CompileToNative(config); return result ? 0 : 1; } catch (Exception ex) { #if DEBUG Console.WriteLine(ex); #else Reporter.Error.WriteLine(ex.Message); #endif return 1; } } private static string[] ParseResponseFile(string rspPath) { if (!File.Exists(rspPath)) { Reporter.Error.WriteLine("Invalid Response File Path"); return null; } string content; try { content = File.ReadAllText(rspPath); } catch (Exception) { Reporter.Error.WriteLine("Unable to Read Response File"); return null; } var nArgs = content.Split(new [] {"\r\n", "\n"}, StringSplitOptions.RemoveEmptyEntries); return nArgs; } } }
26.54321
100
0.485116
[ "MIT" ]
BrennanConroy/cli
src/Microsoft.DotNet.Tools.Compiler.Native/Program.cs
2,152
C#
using System.Collections.Generic; namespace BfavToFavrModConverter.Bfav { /// <summary>Represents BFAV's 'content.json' file.</summary> public class BfavContent { /********* ** Accessors *********/ /// <summary>The content wrapper for each animal.</summary> public List<BfavCategory> Categories { get; set; } } }
24.733333
67
0.595687
[ "MIT" ]
AndyCrocker/StardewMods
BfavToFavrModConverter/Bfav/BfavContent.cs
373
C#
// <auto-generated /> using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Northwind.Persistence; namespace Northwind.Persistence.Migrations { [DbContext(typeof(NorthwindDbContext))] partial class NorthwindDbContextModelSnapshot : ModelSnapshot { protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "2.2.1-servicing-10028") .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); modelBuilder.Entity("Northwind.Domain.Entities.Date", b => { b.Property<int>("DateId") .ValueGeneratedOnAdd() .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<DateTime>("ReservationDate"); b.Property<int>("RoomId"); b.HasKey("DateId"); b.HasIndex("RoomId"); b.ToTable("Dates"); }); modelBuilder.Entity("Northwind.Domain.Entities.Room", b => { b.Property<int>("RoomId") .ValueGeneratedOnAdd() .HasColumnName("RoomId") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<int>("RoomCapacity"); b.Property<int>("RoomNumber"); b.HasKey("RoomId"); b.ToTable("Rooms"); }); modelBuilder.Entity("Northwind.Domain.Entities.Date", b => { b.HasOne("Northwind.Domain.Entities.Room") .WithMany("ReservationDates") .HasForeignKey("RoomId") .OnDelete(DeleteBehavior.Cascade); }); #pragma warning restore 612, 618 } } }
35.454545
125
0.570085
[ "MIT" ]
aquapirat/IntivePatronage3
Northwind.Persistence/Migrations/NorthwindDbContextModelSnapshot.cs
2,342
C#
using System; using System.Collections; using System.Collections.Generic; using System.IO; using System.Linq; using System.Numerics; namespace Tasks { public class E { public static void Main(string[] args) { var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false }; Console.SetOut(sw); Solve(); Console.Out.Flush(); } public static void Solve() { var N = Scanner.Scan<int>(); var S = Scanner.Scan<string>().Select(x => x - '0').ToArray(); var X = Scanner.Scan<string>().Select(x => x == 'T' ? 0 : 1).ToArray(); var dp = new bool[N + 1, 7]; dp[N, 0] = true; for (var i = N - 1; i >= 0; i--) { for (var j = 0; j < 7; j++) { var x10 = dp[i + 1, 10 * j % 7]; var x10s = dp[i + 1, (10 * j + S[i]) % 7]; if (X[i] == 1) dp[i, j] = x10 && x10s; else dp[i, j] = x10 || x10s; } } var answer = dp[0, 0] ? "Takahashi" : "Aoki"; Console.WriteLine(answer); } public static class Scanner { private static Queue<string> queue = new Queue<string>(); public static T Next<T>() { if (!queue.Any()) foreach (var item in Console.ReadLine().Trim().Split(" ")) queue.Enqueue(item); return (T)Convert.ChangeType(queue.Dequeue(), typeof(T)); } public static T Scan<T>() => Next<T>(); public static (T1, T2) Scan<T1, T2>() => (Next<T1>(), Next<T2>()); public static (T1, T2, T3) Scan<T1, T2, T3>() => (Next<T1>(), Next<T2>(), Next<T3>()); public static (T1, T2, T3, T4) Scan<T1, T2, T3, T4>() => (Next<T1>(), Next<T2>(), Next<T3>(), Next<T4>()); public static (T1, T2, T3, T4, T5) Scan<T1, T2, T3, T4, T5>() => (Next<T1>(), Next<T2>(), Next<T3>(), Next<T4>(), Next<T5>()); public static (T1, T2, T3, T4, T5, T6) Scan<T1, T2, T3, T4, T5, T6>() => (Next<T1>(), Next<T2>(), Next<T3>(), Next<T4>(), Next<T5>(), Next<T6>()); public static IEnumerable<T> ScanEnumerable<T>() => Console.ReadLine().Trim().Split(" ").Select(x => (T)Convert.ChangeType(x, typeof(T))); } } }
40.15
158
0.466169
[ "CC0-1.0" ]
AconCavy/AtCoder.Tasks.CS
ABC/ABC195/Tasks/E.cs
2,409
C#
namespace OQF.Utils { public static class MoveValidator { public static bool IsValidMove(string move) { return MoveParser.GetMove(move) != null; } } }
16.3
45
0.705521
[ "Apache-2.0" ]
dotnetpro/contest012017
OpenQuoridorFramework/OQF.Utils/MoveValidator.cs
165
C#
using Microsoft.AspNetCore.Mvc.ApplicationModels; using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Options; namespace OCore.Mvc.RazorPages { public static class ModularPageMvcCoreBuilderExtensions { public static IMvcCoreBuilder AddModularRazorPages(this IMvcCoreBuilder builder) { builder.AddRazorPages(); builder.Services.TryAddEnumerable( ServiceDescriptor.Transient<IConfigureOptions<RazorPagesOptions>, ModularPageRazorPagesOptionsSetup>()); builder.Services.TryAddEnumerable( ServiceDescriptor.Singleton<IPageApplicationModelProvider, ModularPageApplicationModelProvider>()); return builder; } } }
35.458333
120
0.749706
[ "BSD-3-Clause" ]
china-live/OCore
src/OCore/OCore.Mvc.Core/RazorPages/ModularPageMvcCoreBuilderExtensions.cs
851
C#
using GradeBook.Models; namespace GradeBook { public class Program { public const string CommandInfoFilePath = "command-help.json"; public static void Main() { var school = new School("Unibit"); var terminal = new ConsoleTerminal(school); terminal.Start(); } } }
21.5625
70
0.576812
[ "MIT" ]
KostaDinkov/unibit-programming-practice
GradeBook/Program.cs
347
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Collections.Concurrent; using System.IO; using System.Text; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Reflection; using System.Runtime.Serialization; using System.Reflection.Runtime.General; using System.Reflection.Runtime.Modules; using System.Reflection.Runtime.TypeInfos; using System.Reflection.Runtime.TypeParsing; using System.Reflection.Runtime.CustomAttributes; using System.Collections.Generic; using Internal.Reflection.Core; using Internal.Reflection.Core.Execution; using Internal.Reflection.Core.NonPortable; using System.Security; namespace System.Reflection.Runtime.Assemblies { // // The runtime's implementation of an Assembly. // internal abstract partial class RuntimeAssemblyInfo : RuntimeAssembly, IEquatable<RuntimeAssemblyInfo> { public bool Equals(RuntimeAssemblyInfo? other) { if (other == null) return false; return this.Equals((object)other); } public sealed override string FullName { get { return GetName().FullName; } } public sealed override void GetObjectData(SerializationInfo info, StreamingContext context) { throw new PlatformNotSupportedException(); } public abstract override Module ManifestModule { get; } public sealed override IEnumerable<Module> Modules { get { yield return ManifestModule; } } public sealed override Module GetModule(string name) { if (name == ManifestModule.ScopeName) return ManifestModule; return null; } [RequiresUnreferencedCode("Types might be removed")] public sealed override Type GetType(string name, bool throwOnError, bool ignoreCase) { if (name == null) throw new ArgumentNullException(); if (name.Length == 0) throw new ArgumentException(); TypeName typeName = TypeParser.ParseAssemblyQualifiedTypeName(name, throwOnError: throwOnError); if (typeName == null) return null; if (typeName is AssemblyQualifiedTypeName) { if (throwOnError) throw new ArgumentException(SR.Argument_AssemblyGetTypeCannotSpecifyAssembly); // Cannot specify an assembly qualifier in a typename passed to Assembly.GetType() else return null; } CoreAssemblyResolver coreAssemblyResolver = GetRuntimeAssemblyIfExists; CoreTypeResolver coreTypeResolver = delegate (Assembly containingAssemblyIfAny, string coreTypeName) { if (containingAssemblyIfAny == null) return GetTypeCore(coreTypeName, ignoreCase: ignoreCase); else return containingAssemblyIfAny.GetTypeCore(coreTypeName, ignoreCase: ignoreCase); }; GetTypeOptions getTypeOptions = new GetTypeOptions(coreAssemblyResolver, coreTypeResolver, throwOnError: throwOnError, ignoreCase: ignoreCase); return typeName.ResolveType(this, getTypeOptions); } #pragma warning disable 0067 // Silence warning about ModuleResolve not being used. public sealed override event ModuleResolveEventHandler? ModuleResolve; #pragma warning restore 0067 public sealed override bool ReflectionOnly => false; // ReflectionOnly loading not supported. public sealed override bool IsCollectible => false; // Unloading not supported. internal abstract RuntimeAssemblyName RuntimeAssemblyName { get; } public sealed override AssemblyName GetName() { return RuntimeAssemblyName.ToAssemblyName(); } [RequiresUnreferencedCode("Types might be removed")] public sealed override Type[] GetForwardedTypes() { List<Type> types = new List<Type>(); List<Exception>? exceptions = null; foreach (TypeForwardInfo typeForwardInfo in TypeForwardInfos) { string fullTypeName = typeForwardInfo.NamespaceName.Length == 0 ? typeForwardInfo.TypeName : typeForwardInfo.NamespaceName + "." + typeForwardInfo.TypeName; RuntimeAssemblyName redirectedAssemblyName = typeForwardInfo.RedirectedAssemblyName; Type? type = null; RuntimeAssemblyInfo redirectedAssembly; Exception exception = TryGetRuntimeAssembly(redirectedAssemblyName, out redirectedAssembly); if (exception == null) { type = redirectedAssembly.GetTypeCore(fullTypeName, ignoreCase: false); // GetTypeCore() will follow any further type-forwards if needed. if (type == null) exception = Helpers.CreateTypeLoadException(fullTypeName.EscapeTypeNameIdentifier(), redirectedAssembly); } Debug.Assert((type != null) != (exception != null)); // Exactly one of these must be non-null. if (type != null) { types.Add(type); AddPublicNestedTypes(type, types); } else { if (exceptions == null) { exceptions = new List<Exception>(); } exceptions.Add(exception); } } if (exceptions != null) { int numTypes = types.Count; int numExceptions = exceptions.Count; types.AddRange(new Type[numExceptions]); // add one null Type for each exception. exceptions.InsertRange(0, new Exception[numTypes]); // align the Exceptions with the null Types. throw new ReflectionTypeLoadException(types.ToArray(), exceptions.ToArray()); } return types.ToArray(); } /// <summary> /// Intentionally excludes forwards to nested types. /// </summary> protected abstract IEnumerable<TypeForwardInfo> TypeForwardInfos { get; } [RequiresUnreferencedCode("Types might be removed")] private static void AddPublicNestedTypes(Type type, List<Type> types) { foreach (Type nestedType in type.GetNestedTypes(BindingFlags.Public)) { types.Add(nestedType); AddPublicNestedTypes(nestedType, types); } } /// <summary> /// Helper routine for the more general Type.GetType() family of apis. /// /// Resolves top-level named types only. No nested types. No constructed types. /// /// Returns null if the type does not exist. Throws for all other error cases. /// </summary> internal RuntimeTypeInfo GetTypeCore(string fullName, bool ignoreCase) { if (ignoreCase) return GetTypeCoreCaseInsensitive(fullName); else return GetTypeCoreCaseSensitive(fullName); } // Types that derive from RuntimeAssembly must implement the following public surface area members public abstract override IEnumerable<CustomAttributeData> CustomAttributes { get; } public abstract override IEnumerable<TypeInfo> DefinedTypes { [RequiresUnreferencedCode("Types might be removed")] get; } public abstract override MethodInfo EntryPoint { get; } public abstract override IEnumerable<Type> ExportedTypes { [RequiresUnreferencedCode("Types might be removed")] get; } public abstract override ManifestResourceInfo GetManifestResourceInfo(string resourceName); public abstract override string[] GetManifestResourceNames(); public abstract override Stream GetManifestResourceStream(string name); public abstract override string ImageRuntimeVersion { get; } public abstract override bool Equals(object obj); public abstract override int GetHashCode(); /// <summary> /// Ensures a module is loaded and that its module constructor is executed. If the module is fully /// loaded and its constructor already ran, we do not run it again. /// </summary> internal abstract void RunModuleConstructor(); /// <summary> /// Perform a lookup for a type based on a name. Overriders are expected to /// have a non-cached implementation, as the result is expected to be cached by /// callers of this method. Should be implemented by every format specific /// RuntimeAssembly implementor /// </summary> internal abstract RuntimeTypeInfo UncachedGetTypeCoreCaseSensitive(string fullName); /// <summary> /// Perform a lookup for a type based on a name. Overriders may or may not /// have a cached implementation, as the result is not expected to be cached by /// callers of this method, but it is also a rarely used api. Should be /// implemented by every format specific RuntimeAssembly implementor /// </summary> internal abstract RuntimeTypeInfo GetTypeCoreCaseInsensitive(string fullName); internal RuntimeTypeInfo GetTypeCoreCaseSensitive(string fullName) { return this.CaseSensitiveTypeTable.GetOrAdd(fullName); } private CaseSensitiveTypeCache CaseSensitiveTypeTable { get { return _lazyCaseSensitiveTypeTable ??= new CaseSensitiveTypeCache(this); } } #pragma warning disable 0672 // GlobalAssemblyCache is Obsolete. public sealed override bool GlobalAssemblyCache { get { return false; } } #pragma warning restore 0672 public sealed override long HostContext { get { return 0; } } [RequiresUnreferencedCode("Types and members the loaded module depends on might be removed")] public sealed override Module LoadModule(string moduleName, byte[] rawModule, byte[] rawSymbolStore) { throw new PlatformNotSupportedException(); } [RequiresAssemblyFiles(ThrowingMessageInRAF)] public sealed override FileStream GetFile(string name) { throw new FileNotFoundException(); } [RequiresAssemblyFiles(ThrowingMessageInRAF)] public sealed override FileStream[] GetFiles(bool getResourceModules) { throw new FileNotFoundException(); } public sealed override SecurityRuleSet SecurityRuleSet { get { return SecurityRuleSet.None; } } /// <summary> /// Returns a *freshly allocated* array of loaded Assemblies. /// </summary> internal static Assembly[] GetLoadedAssemblies() { // Important: The result of this method is the return value of the AppDomain.GetAssemblies() api so // so it must return a freshly allocated array on each call. AssemblyBinder binder = ReflectionCoreExecution.ExecutionDomain.ReflectionDomainSetup.AssemblyBinder; IList<AssemblyBindResult> bindResults = binder.GetLoadedAssemblies(); Assembly[] results = new Assembly[bindResults.Count]; for (int i = 0; i < bindResults.Count; i++) { Assembly assembly = GetRuntimeAssembly(bindResults[i]); results[i] = assembly; } return results; } private volatile CaseSensitiveTypeCache _lazyCaseSensitiveTypeTable; private sealed class CaseSensitiveTypeCache : ConcurrentUnifier<string, RuntimeTypeInfo> { public CaseSensitiveTypeCache(RuntimeAssemblyInfo runtimeAssembly) { _runtimeAssembly = runtimeAssembly; } protected sealed override RuntimeTypeInfo Factory(string key) { return _runtimeAssembly.UncachedGetTypeCoreCaseSensitive(key); } private readonly RuntimeAssemblyInfo _runtimeAssembly; } } }
38.122024
182
0.619408
[ "MIT" ]
LoopedBard3/runtime
src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Runtime/Assemblies/RuntimeAssemblyInfo.cs
12,809
C#
#region File Description //----------------------------------------------------------------------------- // GameSprite2D.cs // // Microsoft XNA Community Game Platform // Copyright (C) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- #endregion #region Using Statements using System; using System.Collections.Generic; using System.Text; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; using RobotGameData.Render; using RobotGameData.Resource; using RobotGameData.Collision; using RobotGameData.GameInterface; #endregion namespace RobotGameData.GameObject { #region Sprite2DObject /// <summary> /// this structure stores an 2D sprite object’s information. /// </summary> public class Sprite2DObject : INamed { #region Fields String name = String.Empty; Rectangle screenRectangle = Rectangle.Empty; Rectangle sourceRectangle = Rectangle.Empty; Color color = new Color(0xFF, 0xFF, 0xFF); float rotation = 0.0f; float scale = 1.0f; bool visible = true; #endregion #region Properties public string Name { get { return name; } set { name = value; } } public bool Visible { get { return visible; } set { visible = value; } } public Rectangle ScreenRectangle { get { return screenRectangle; } set { screenRectangle = value; } } public Vector2 ScreenPosition { get { return new Vector2(screenRectangle.X, screenRectangle.Y); } set { screenRectangle.X = (int)value.X; screenRectangle.Y = (int)value.Y; } } public Vector2 ScreenSize { get { return new Vector2(screenRectangle.Width, screenRectangle.Height); } set { screenRectangle.Width = (int)value.X; screenRectangle.Height = (int)value.Y; } } public Rectangle SourceRectangle { get { return sourceRectangle; } set { sourceRectangle = value; } } public Vector2 SourcePosition { get { return new Vector2(sourceRectangle.X, sourceRectangle.Y); } set { sourceRectangle.X = (int)value.X; sourceRectangle.Y = (int)value.Y; } } public Vector2 SourceSize { get { return new Vector2(sourceRectangle.Width, sourceRectangle.Height); } set { sourceRectangle.Width = (int)value.X; sourceRectangle.Height = (int)value.Y; } } public Color Color { get { return color; } set { color = value; } } public byte Alpha { get { return color.A; } set { color = new Color(color.R, color.R, color.B, value); } } public float Rotation { get { return rotation; } set { rotation = value; } } public float Scale { get { return scale; } set { scale = value; } } #endregion #region Constructors public Sprite2DObject(string name, Texture2D tex) { Name = name; ScreenRectangle = new Rectangle(0, 0, tex.Width, tex.Height); SourceRectangle = new Rectangle(0, 0, tex.Width, tex.Height); } public Sprite2DObject(string name, Texture2D tex, Vector2 screenPosition) { Name = name; ScreenRectangle = new Rectangle( (int)screenPosition.X, (int)screenPosition.Y, tex.Width, tex.Height); SourceRectangle = new Rectangle(0, 0, tex.Width, tex.Height); } public Sprite2DObject(string name, Texture2D tex, Vector2 screenPosition, Vector2 screenSize) { Name = name; ScreenRectangle = new Rectangle( (int)screenPosition.X, (int)screenPosition.Y, (int)screenSize.X, (int)screenSize.Y); SourceRectangle = new Rectangle(0, 0, tex.Width, tex.Height); } public Sprite2DObject(string name, Vector2 screenPosition, Vector2 screenSize, Vector2 sourcePosition, Vector2 sourceSize) { Name = name; ScreenRectangle = new Rectangle( (int)screenPosition.X, (int)screenPosition.Y, (int)screenSize.X, (int)screenSize.Y); SourceRectangle = new Rectangle( (int)sourcePosition.X, (int)sourcePosition.Y, (int)sourceSize.X, (int)sourceSize.Y); } public Sprite2DObject(string name, Texture2D tex, Vector2 screenPosition, Rectangle sourceRectangle) { Name = name; ScreenRectangle = new Rectangle( (int)screenPosition.X, (int)screenPosition.Y, tex.Width, tex.Height); SourceRectangle = sourceRectangle; } public Sprite2DObject(string name, Rectangle screenRectangle, Rectangle sourceRectangle) { Name = name; ScreenRectangle = screenRectangle; SourceRectangle = sourceRectangle; } #endregion } #endregion /// <summary> /// this sprite draws an image to the 2D screen. /// </summary> public class GameSprite2D : GameSceneNode { #region Fields Texture2D texture2D = null; List<Sprite2DObject> spriteList = new List<Sprite2DObject>(); #endregion #region Properties public Texture2D TextureResource { get { return texture2D; } } #endregion /// <summary> /// draws the registered sprite objects by using the sprite batch. /// </summary> /// <param name="renderTracer"></param> protected override void OnDraw(RenderTracer renderTracer) { if (TextureResource == null) throw new InvalidOperationException("The texture is empty"); else if (TextureResource.IsDisposed ) throw new ObjectDisposedException("TextureResource"); for (int i = 0; i < spriteList.Count; i++) { Sprite2DObject sprite = spriteList[i]; if (sprite != null) { // If active visible if (sprite.Visible ) { renderTracer.SpriteBatch.Draw(TextureResource, sprite.ScreenRectangle, sprite.SourceRectangle, sprite.Color); } } } } protected override void UnloadContent() { spriteList.Clear(); base.UnloadContent(); } /// <summary> /// creates 2D sprite objects using the texture. /// </summary> /// <param name="count">sprite objects count</param> /// <param name="fileName">texture file name</param> public void Create(int count, string fileName) { for (int i = 0; i < count; i++) spriteList.Add(null); GameResourceTexture2D resource = FrameworkCore.ResourceManager.LoadTexture(fileName); texture2D = resource.Texture2D; } /// <summary> /// add a sprite object. /// </summary> /// <param name="index">an index of sprite object</param> /// <param name="name">sprite object name</param> /// <returns></returns> public Sprite2DObject AddSprite(int index, string name) { if (TextureResource == null) throw new InvalidOperationException("The texture is empty"); Sprite2DObject newSprite = new Sprite2DObject(name, TextureResource); AddSprite(index, newSprite); return newSprite; } /// <summary> /// add a sprite object. /// </summary> /// <param name="index">an index of sprite object</param> /// <param name="name">sprite object name</param> /// <param name="screenPosition"> /// 2D screen position of sprite object (pixel) /// </param> /// <returns></returns> public Sprite2DObject AddSprite(int index, string name, Vector2 screenPosition) { if (TextureResource == null) throw new InvalidOperationException("The texture is empty"); Sprite2DObject newSprite = new Sprite2DObject(name, TextureResource, screenPosition); AddSprite(index, newSprite); return newSprite; } /// <summary> /// add a sprite object. /// </summary> /// <param name="index">an index of sprite object</param> /// <param name="name">sprite object name</param> /// <param name="screenPosition"> /// 2D screen position of sprite object (pixel) /// </param> /// <param name="screenSize">2D screen size of sprite object (pixel)</param> /// <returns></returns> public Sprite2DObject AddSprite(int index, string name, Vector2 screenPosition, Vector2 screenSize) { if (TextureResource == null) throw new InvalidOperationException("The texture is empty"); Sprite2DObject newSprite = new Sprite2DObject(name, TextureResource, screenPosition, screenSize); AddSprite(index, newSprite); return newSprite; } /// <summary> /// add a sprite object. /// </summary> /// <param name="index">an index of sprite object</param> /// <param name="name">sprite object name</param> /// <param name="screenPosition"> /// 2D screen position of sprite object (pixel) /// </param> /// <param name="screenSize">2D screen size of sprite object (pixel)</param> /// <param name="sourcePosition">position of the source image (pixel)</param> /// <param name="sourceSize">size of the source image (pixel)</param> /// <returns></returns> public Sprite2DObject AddSprite(int index, string name, Vector2 screenPosition, Vector2 screenSize, Vector2 sourcePosition, Vector2 sourceSize) { if (TextureResource == null) throw new InvalidOperationException("The texture is empty"); Sprite2DObject newSprite = new Sprite2DObject(name, screenPosition, screenSize, sourcePosition, sourceSize); AddSprite(index, newSprite); return newSprite; } /// <summary> /// add a sprite object. /// </summary> /// <param name="index">an index of sprite object</param> /// <param name="name">sprite object name</param> /// <param name="screenPosition"> /// 2D screen position of sprite object (pixel) /// </param> /// <param name="sourceRectangle">a rectangle of the source image (pixel)</param> /// <returns></returns> public Sprite2DObject AddSprite(int index, string name, Vector2 screenPosition, Rectangle sourceRectangle) { if (TextureResource == null) throw new InvalidOperationException("The texture is empty"); Sprite2DObject newSprite = new Sprite2DObject(name, TextureResource, screenPosition, sourceRectangle); AddSprite(index, newSprite); return newSprite; } /// <summary> /// add a sprite object. /// </summary> /// <param name="index">an index of sprite object</param> /// <param name="name">sprite object name</param> /// <param name="screenRectangle">a rectangle of sprite object (pixel)</param> /// <param name="sourceRectangle">a rectangle of the source image (pixel)</param> /// <returns></returns> public Sprite2DObject AddSprite(int index, string name, Rectangle screenRectangle, Rectangle sourceRectangle) { if (TextureResource == null) throw new InvalidOperationException("The texture is empty"); Sprite2DObject newSprite = new Sprite2DObject(name, screenRectangle, sourceRectangle); AddSprite(index, newSprite); return newSprite; } /// <summary> /// add a sprite object. /// </summary> /// <param name="index">an index of sprite object</param> /// <param name="spriteObject">source sprite object</param> public void AddSprite(int index, Sprite2DObject spriteObject) { if (TextureResource == null) throw new InvalidOperationException("The texture is empty"); if (spriteList.Count <= index || index < 0) throw new ArgumentException( "Cannot add sprite. Invalid index : " + index.ToString()); if( spriteList[index] != null) throw new ArgumentException( "Cannot add sprite. already exist other sprite : " + index.ToString()); spriteList[index] = spriteObject; } /// <summary> /// gets the sprite object. /// </summary> /// <param name="index">an index of sprite object</param> /// <returns>sprite object</returns> public Sprite2DObject GetSprite(int index) { if( spriteList.Count >= index || index < 0) throw new ArgumentException( "Invalid index : " + index.ToString()); return spriteList[index]; } /// <summary> /// configures visibility of all sprite objects. /// </summary> /// <param name="visible">visibility flag</param> public void VisibleSprite(bool visible) { for (int i = 0; i < spriteList.Count; i++) spriteList[i].Visible = visible; } /// <summary> /// configures a visibility of each sprite object. /// </summary> /// <param name="index">an index of sprite object</param> /// <param name="visible">visibility flag</param> public void VisibleSprite(int index, bool visible) { GetSprite(index).Visible = visible; } /// <summary> /// finds an index of sprite object by object /// </summary> /// <param name="sprite"></param> /// <returns></returns> public int FindSpriteIndex(Sprite2DObject sprite) { return spriteList.IndexOf(sprite); } /// <summary> /// swaps two sprite objects and changes the priority and the /// position in the list. /// </summary> /// <param name="tex1"></param> /// <param name="tex2"></param> public void SwapSprite(Sprite2DObject tex1, Sprite2DObject tex2) { int index1 = FindSpriteIndex(tex1); // Cannot find sprite if( index1 < 0) throw new ArgumentException("Cannot find tex1"); int index2 = FindSpriteIndex(tex2); // Cannot find sprite if (index2 < 0) throw new ArgumentException("Cannot find tex2"); spriteList[index1] = tex2; spriteList[index2] = tex1; } } }
32.950787
89
0.520521
[ "MIT" ]
SimonDarksideJ/XNAGameStudio
Samples/RobotGame_ARCHIVE_2_0/RobotGame/RobotGameData/Object/GameSprite2D.cs
16,743
C#
//----------------------------------------------------------------------- // <copyright file="Database.cs" company="None"> // Copyright (c) Brandon Wallace and Jesse Calhoun. All rights reserved. // </copyright> //----------------------------------------------------------------------- namespace TQVaultAE.Data { using Microsoft.Extensions.Logging; using System; using System.Globalization; using System.IO; using System.Text; using System.Text.RegularExpressions; using TQVaultAE.Config; using TQVaultAE.Domain.Contracts.Providers; using TQVaultAE.Domain.Contracts.Services; using TQVaultAE.Domain.Entities; using TQVaultAE.Domain.Helpers; using TQVaultAE.Logs; /// <summary> /// Reads a Titan Quest database file. /// </summary> public class Database : IDatabase { private readonly ILogger Log = null; #region Database Fields /// <summary> /// Dictionary of all database info records /// </summary> private LazyConcurrentDictionary<string, Info> infoDB = new LazyConcurrentDictionary<string, Info>(); /// <summary> /// Dictionary of all text database entries /// </summary> private LazyConcurrentDictionary<string, string> textDB = new LazyConcurrentDictionary<string, string>(); /// <summary> /// Dictionary of all associated arc files in the database. /// </summary> private LazyConcurrentDictionary<string, ArcFile> arcFiles = new LazyConcurrentDictionary<string, ArcFile>(); /// <summary> /// Game language to support setting language in UI /// </summary> private string gameLanguage; private readonly IArcFileProvider arcProv; private readonly IArzFileProvider arzProv; private readonly IItemAttributeProvider ItemAttributeProvider; private readonly IGamePathService GamePathResolver; private readonly ITQDataService TQData; #endregion Database Fields /// <summary> /// Initializes a new instance of the Database class. /// </summary> public Database( ILogger<Database> log , IArcFileProvider arcFileProvider , IArzFileProvider arzFileProvider , IItemAttributeProvider itemAttributeProvider , IGamePathService gamePathResolver , ITQDataService tQData ) { this.Log = log; this.AutoDetectLanguage = Config.Settings.Default.AutoDetectLanguage; this.TQLanguage = Config.Settings.Default.TQLanguage; this.arcProv = arcFileProvider; this.arzProv = arzFileProvider; this.ItemAttributeProvider = itemAttributeProvider; this.GamePathResolver = gamePathResolver; this.TQData = tQData; this.LoadDBFile(); } #region Database Properties /// <summary> /// Gets or sets a value indicating whether the game language is being auto detected. /// </summary> public bool AutoDetectLanguage { get; set; } /// <summary> /// Gets or sets the game language from the config file. /// </summary> public string TQLanguage { get; set; } /// <summary> /// Gets the instance of the Titan Quest Database ArzFile. /// </summary> public ArzFile ArzFile { get; private set; } /// <summary> /// Gets the instance of the Immortal Throne Database ArzFile. /// </summary> public ArzFile ArzFileIT { get; private set; } /// <summary> /// Gets the instance of a custom map Database ArzFile. /// </summary> public ArzFile ArzFileMod { get; private set; } /// <summary> /// Gets the game language setting as a an English DisplayName. /// </summary> /// <remarks>Changed to property by VillageIdiot to support changing of Language in UI</remarks> public string GameLanguage { get { // Added by VillageIdiot // Check if the user configured the language if (this.gameLanguage == null) { if (!this.AutoDetectLanguage) this.gameLanguage = this.TQLanguage; } // Try to read the language from the settings file if (string.IsNullOrEmpty(this.gameLanguage)) { try { string optionsFile = GamePathResolver.TQSettingsFile; if (!File.Exists(optionsFile)) { // Try IT Folder if there is no settings file in TQ Folder optionsFile = GamePathResolver.ITSettingsFile; } if (File.Exists(optionsFile)) { var fileContent = File.ReadAllText(optionsFile); var match = Regex.Match(fileContent, @"(?i)language\s*=\s*(""(?<Language>[^""]+)""|(?<Language>[^\r\n]*))[\r\n]"); if (match.Success) { this.gameLanguage = match.Groups["Language"].Value.ToUpperInvariant(); return this.gameLanguage; } return null; } return null; } catch (IOException exception) { Log.ErrorException(exception); return null; } } // Added by VillageIdiot // We have something so we need to return it // This was added to support setting the language in the config file return this.gameLanguage; } } #endregion Database Properties #region Database Public Methods #region Database Public Static Methods /// <summary> /// Used to Extract an ARC file into the destination directory. /// The ARC file will not be added to the cache. /// </summary> /// <remarks>Added by VillageIdiot</remarks> /// <param name="arcFileName">Name of the arc file</param> /// <param name="destination">Destination path for extracted data</param> /// <returns>Returns true on success otherwise false</returns> public bool ExtractArcFile(string arcFileName, string destination) { bool result = false; if (TQDebug.DatabaseDebugLevel > 0) Log.LogDebug("Database.ExtractARCFile('{0}', '{1}')", arcFileName, destination); try { ArcFile arcFile = new ArcFile(arcFileName); // Extract the files result = arcProv.ExtractArcFile(arcFile, destination); } catch (IOException exception) { Log.LogError(exception, "Exception occurred"); result = false; } if (TQDebug.DatabaseDebugLevel > 1) Log.LogDebug("Extraction Result = {0}", result); if (TQDebug.DatabaseDebugLevel > 0) Log.LogDebug("Exiting Database.ReadARCFile()"); return result; } #endregion Database Public Static Methods /// <summary> /// Gets the Infor for a specific item id. /// </summary> /// <param name="itemId">Item ID which we are looking up. Will be normalized internally.</param> /// <returns>Returns Infor for item ID and NULL if not found.</returns> public Info GetInfo(string itemId) { if (string.IsNullOrEmpty(itemId)) return null; itemId = TQData.NormalizeRecordPath(itemId); return this.infoDB.GetOrAddAtomic(itemId, k => { DBRecordCollection record = null; // Add support for searching a custom map database if (this.ArzFileMod != null) record = arzProv.GetItem(this.ArzFileMod, k); // Try the expansion pack database first. if (record == null && this.ArzFileIT != null) record = arzProv.GetItem(this.ArzFileIT, k); // Try looking in TQ database now if (record == null || this.ArzFileIT == null) record = arzProv.GetItem(this.ArzFile, k); if (record == null) return null; return new Info(record); }); } /// <summary> /// Uses the text database to convert the tag to a name in the localized language. /// The tag is normalized to upper case internally. /// </summary> /// <param name="tagId">Tag to be looked up in the text database normalized to upper case.</param> /// <returns>Returns localized string, empty string if it cannot find a string or "?ErrorName?" in case of uncaught exception.</returns> public string GetFriendlyName(string tagId) => this.textDB.TryGetValue(tagId.ToUpperInvariant(), out var text) ? text.Value : string.Empty; /// <summary> /// Gets the formatted string for the variable attribute. /// </summary> /// <param name="variable">variable for which we are making a nice string.</param> /// <returns>Formatted string in the format of: Attribute: value</returns> public string VariableToStringNice(Variable variable) => $"{this.GetItemAttributeFriendlyText(variable.Name)}: {variable.ToStringValue()}"; /// <summary> /// Converts the item attribute to a name in the localized language /// </summary> /// <param name="itemAttribute">Item attribure to be looked up.</param> /// <param name="addVariable">Flag for whether the variable is added to the text string.</param> /// <returns>Returns localized item attribute</returns> public string GetItemAttributeFriendlyText(string itemAttribute, bool addVariable = true) { ItemAttributesData data = ItemAttributeProvider.GetAttributeData(itemAttribute); if (data == null) { this.Log.LogDebug($"Attribute unknown : {itemAttribute}"); return string.Concat("?", itemAttribute, "?"); } string attributeTextTag = ItemAttributeProvider.GetAttributeTextTag(data); if (string.IsNullOrEmpty(attributeTextTag)) { this.Log.LogDebug($"Attribute unknown : {itemAttribute}"); return string.Concat("?", itemAttribute, "?"); } string textFromTag = this.GetFriendlyName(attributeTextTag); if (string.IsNullOrEmpty(textFromTag)) { textFromTag = string.Concat("ATTR<", itemAttribute, "> TAG<"); textFromTag = string.Concat(textFromTag, attributeTextTag, ">"); } if (addVariable && data.Variable.Length > 0) textFromTag = string.Concat(textFromTag, " ", data.Variable); return textFromTag; } /// <summary> /// Load our data from the db file. /// </summary> private void LoadDBFile() { this.LoadTextDB(); this.LoadARZFile(); } /// <summary> /// Gets a DBRecord for the specified item ID string. /// </summary> /// <remarks> /// Changed by VillageIdiot /// Changed search order so that IT records have precedence of TQ records. /// Add Custom Map database. Custom Map records have precedence over IT records. /// </remarks> /// <param name="itemId">Item Id which we are looking up</param> /// <returns>Returns the DBRecord for the item Id</returns> public DBRecordCollection GetRecordFromFile(string itemId) { itemId = TQData.NormalizeRecordPath(itemId); if (this.ArzFileMod != null) { DBRecordCollection recordMod = arzProv.GetItem(this.ArzFileMod, itemId); if (recordMod != null) { // Custom Map records have highest precedence. return recordMod; } } if (this.ArzFileIT != null) { // see if it's in IT ARZ file DBRecordCollection recordIT = arzProv.GetItem(this.ArzFileIT, itemId); if (recordIT != null) { // IT file takes precedence over TQ. return recordIT; } } return arzProv.GetItem(ArzFile, itemId); } /// <summary> /// Gets a resource from the database using the resource Id. /// Modified by VillageIdiot to support loading resources from a custom map folder. /// </summary> /// <param name="resourceId">Resource which we are fetching</param> /// <returns>Retruns a byte array of the resource.</returns> public byte[] LoadResource(string resourceId) { if (TQDebug.DatabaseDebugLevel > 0) Log.LogDebug("Database.LoadResource({0})", resourceId); resourceId = TQData.NormalizeRecordPath(resourceId); if (TQDebug.DatabaseDebugLevel > 1) Log.LogDebug(" Normalized({0})", resourceId); // First we need to figure out the correct file to // open, by grabbing it off the front of the resourceID int backslashLocation = resourceId.IndexOf('\\'); // not a proper resourceID. if (backslashLocation <= 0) return null; string arcFileBase = resourceId.Substring(0, backslashLocation); if (TQDebug.DatabaseDebugLevel > 1) Log.LogDebug("arcFileBase = {0}", arcFileBase); string rootFolder; string arcFile; byte[] arcFileData = null; // Added by VillageIdiot // Check the mod folder for the image resource. if (GamePathResolver.IsCustom) { if (TQDebug.DatabaseDebugLevel > 1) Log.LogDebug("Checking Custom Resources."); rootFolder = Path.Combine(GamePathResolver.MapName, "resources"); arcFile = Path.Combine(rootFolder, Path.ChangeExtension(arcFileBase, ".arc")); arcFileData = this.ReadARCFile(arcFile, resourceId); } // We either didn't load the resource or didn't find what we were looking for so check the normal game resources. if (arcFileData == null) { // See if this guy is from Immortal Throne expansion pack. if (TQDebug.DatabaseDebugLevel > 1) Log.LogDebug("Checking IT Resources."); rootFolder = GamePathResolver.ImmortalThronePath; bool xpack = false; if (arcFileBase.ToUpperInvariant().Equals("XPACK")) { // Comes from Immortal Throne xpack = true; rootFolder = Path.Combine(rootFolder, "Resources", "XPack"); } else if (arcFileBase.ToUpperInvariant().Equals("XPACK2")) { // Comes from Ragnarok xpack = true; rootFolder = Path.Combine(rootFolder, "Resources", "XPack2"); } else if (arcFileBase.ToUpperInvariant().Equals("XPACK3")) { // Comes from Atlantis xpack = true; rootFolder = Path.Combine(rootFolder, "Resources", "XPack3"); } else if (arcFileBase.ToUpperInvariant().Equals("XPACK4")) { // Comes from Eternal Embers xpack = true; rootFolder = Path.Combine(rootFolder, "Resources", "XPack4"); } if (xpack == true) { // throw away that value and use the next field. int previousBackslash = backslashLocation; backslashLocation = resourceId.IndexOf('\\', backslashLocation + 1); if (backslashLocation <= 0) return null;// not a proper resourceID arcFileBase = resourceId.Substring(previousBackslash + 1, backslashLocation - previousBackslash - 1); resourceId = resourceId.Substring(previousBackslash + 1); } else { // Changed by VillageIdiot to search the IT resources folder for updated resources // if IT is installed otherwise just the TQ folder. rootFolder = Path.Combine(rootFolder, "Resources"); } arcFile = Path.Combine(rootFolder, Path.ChangeExtension(arcFileBase, ".arc")); arcFileData = this.ReadARCFile(arcFile, resourceId); } // Added by VillageIdiot // Maybe the arc file is in the XPack folder even though the record does not state it. // Also could be that it says xpack in the record but the file is in the root. if (arcFileData == null) { rootFolder = Path.Combine(GamePathResolver.ImmortalThronePath, "Resources", "XPack"); arcFile = Path.Combine(rootFolder, Path.ChangeExtension(arcFileBase, ".arc")); arcFileData = this.ReadARCFile(arcFile, resourceId); } // Now, let's check if the item is in Ragnarok DLC if (arcFileData == null && GamePathResolver.IsRagnarokInstalled) { rootFolder = Path.Combine(GamePathResolver.ImmortalThronePath, "Resources", "XPack2"); arcFile = Path.Combine(rootFolder, Path.ChangeExtension(arcFileBase, ".arc")); arcFileData = this.ReadARCFile(arcFile, resourceId); } if (arcFileData == null && GamePathResolver.IsAtlantisInstalled) { rootFolder = Path.Combine(GamePathResolver.ImmortalThronePath, "Resources", "XPack3"); arcFile = Path.Combine(rootFolder, Path.ChangeExtension(arcFileBase, ".arc")); arcFileData = this.ReadARCFile(arcFile, resourceId); } if (arcFileData == null && GamePathResolver.IsEmbersInstalled) { rootFolder = Path.Combine(GamePathResolver.ImmortalThronePath, "Resources", "XPack4"); arcFile = Path.Combine(rootFolder, Path.ChangeExtension(arcFileBase, ".arc")); arcFileData = this.ReadARCFile(arcFile, resourceId); } if (arcFileData == null) { // We are either vanilla TQ or have not found our resource yet. // from the original TQ folder if (TQDebug.DatabaseDebugLevel > 1) Log.LogDebug("Checking TQ Resources."); rootFolder = GamePathResolver.TQPath; rootFolder = Path.Combine(rootFolder, "Resources"); arcFile = Path.Combine(rootFolder, Path.ChangeExtension(arcFileBase, ".arc")); arcFileData = this.ReadARCFile(arcFile, resourceId); } if (TQDebug.DatabaseDebugLevel > 0) Log.LogDebug("Exiting Database.LoadResource()"); return arcFileData; } #endregion Database Public Methods #region Database Private Methods /// <summary> /// Reads data from an ARC file and puts it into a Byte array /// </summary> /// <param name="arcFileName">Name of the arc file.</param> /// <param name="dataId">Id of data which we are getting from the arc file</param> /// <returns>Byte array of the data from the arc file.</returns> private byte[] ReadARCFile(string arcFileName, string dataId) { // See if we have this arcfile already and if not create it. try { if (TQDebug.DatabaseDebugLevel > 0) Log.LogDebug("Database.ReadARCFile('{0}', '{1}')", arcFileName, dataId); ArcFile arcFile = this.arcFiles.GetOrAddAtomic(arcFileName, k => { var file = new ArcFile(k); arcProv.ReadARCToC(file);// Heavy lifting in GetOrAddAtomic return file; }); // Now retrieve the data byte[] ans = arcProv.GetData(arcFile, dataId); if (TQDebug.DatabaseDebugLevel > 0) Log.LogDebug("Exiting Database.ReadARCFile()"); return ans; } catch (Exception e) { Log.LogError(e, "Exception occurred"); throw; } } /// <summary> /// Tries to determine the name of the text database file. /// This is based on the game language and the UI language. /// Will use English if all else fails. /// </summary> /// <param name="isImmortalThrone">Signals whether we are looking for Immortal Throne files or vanilla Titan Quest files.</param> /// <returns>Path to the text db file</returns> private string FigureDBFileToUse(bool isImmortalThrone) { if (TQDebug.DatabaseDebugLevel > 0) Log.LogDebug("Database.FigureDBFileToUse({0})", isImmortalThrone); string rootFolder; if (isImmortalThrone) { if (GamePathResolver.ImmortalThronePath.Contains("Anniversary")) rootFolder = Path.Combine(GamePathResolver.ImmortalThronePath, "Text"); else rootFolder = Path.Combine(GamePathResolver.ImmortalThronePath, "Resources"); if (TQDebug.DatabaseDebugLevel > 1) { Log.LogDebug("Detecting Immortal Throne text files"); Log.LogDebug("rootFolder = {0}", rootFolder); } } else { // from the original TQ folder rootFolder = Path.Combine(GamePathResolver.TQPath, "Text"); if (TQDebug.DatabaseDebugLevel > 1) { Log.LogDebug("Detecting Titan Quest text files"); Log.LogDebug("rootFolder = {0}", rootFolder); } } // make sure the damn directory exists if (!Directory.Exists(rootFolder)) { if (TQDebug.DatabaseDebugLevel > 0) Log.LogDebug("Error - Root Folder does not exist"); return null; // silently fail } string baseFile = Path.Combine(rootFolder, "Text_"); string suffix = ".arc"; // Added explicit set to null though may not be needed string cultureID = null; // Moved this declaration since the first use is inside of the loop. string filename = null; // First see if we can use the game setting string gameLanguage = this.GameLanguage; if (TQDebug.DatabaseDebugLevel > 1) { Log.LogDebug("gameLanguage = {0}", gameLanguage == null ? "NULL" : gameLanguage); Log.LogDebug("baseFile = {0}", baseFile); } if (gameLanguage != null) { // Try this method of getting the culture if (TQDebug.DatabaseDebugLevel > 2) Log.LogDebug("Try looking up cultureID"); foreach (CultureInfo cultureInfo in CultureInfo.GetCultures(CultureTypes.NeutralCultures)) { if (TQDebug.DatabaseDebugLevel > 2) Log.LogDebug("Trying {0}", cultureInfo.EnglishName.ToUpperInvariant()); if (cultureInfo.EnglishName.ToUpperInvariant().Equals(gameLanguage.ToUpperInvariant()) || cultureInfo.DisplayName.ToUpperInvariant().Equals(gameLanguage.ToUpperInvariant())) { cultureID = cultureInfo.TwoLetterISOLanguageName; break; } } // Titan Quest doesn't use the ISO language code for some languages // Added null check to fix exception when there is no culture found. if (cultureID != null) { if (cultureID.ToUpperInvariant() == "CS") { // Force Czech to use CZ instead of CS for the 2 letter code. cultureID = "CZ"; } else if (cultureID.ToUpperInvariant() == "PT") { // Force brazilian portuguese to use BR instead of PT cultureID = "BR"; } else if (cultureID.ToUpperInvariant() == "ZH") { // Force chinese to use CH instead of ZH cultureID = "CH"; } } if (TQDebug.DatabaseDebugLevel > 1) Log.LogDebug("cultureID = {0}", cultureID); // Moved this inital check for the file into the loop // and added a check to verify that we actually have a cultureID if (cultureID != null) { filename = string.Concat(baseFile, cultureID, suffix); if (TQDebug.DatabaseDebugLevel > 1) { Log.LogDebug("Detected cultureID from gameLanguage"); Log.LogDebug("filename = {0}", filename); } if (File.Exists(filename)) { if (TQDebug.DatabaseDebugLevel > 0) Log.LogDebug("Exiting Database.FigureDBFileToUse()"); return filename; } } } // try to use the default culture for the OS cultureID = CultureInfo.CurrentUICulture.TwoLetterISOLanguageName; if (TQDebug.DatabaseDebugLevel > 1) { Log.LogDebug("Using cultureID from OS"); Log.LogDebug("cultureID = {0}", cultureID); } // Added a check to verify that we actually have a cultureID // though it may not be needed if (cultureID != null) { filename = string.Concat(baseFile, cultureID, suffix); if (TQDebug.DatabaseDebugLevel > 1) Log.LogDebug("filename = {0}", filename); if (File.Exists(filename)) { if (TQDebug.DatabaseDebugLevel > 0) Log.LogDebug("Exiting Database.FigureDBFileToUse()"); return filename; } } // Now just try EN cultureID = "EN"; filename = string.Concat(baseFile, cultureID, suffix); if (TQDebug.DatabaseDebugLevel > 1) { Log.LogDebug("Forcing English Language"); Log.LogDebug("cultureID = {0}", cultureID); Log.LogDebug("filename = {0}", filename); } if (File.Exists(filename)) { if (TQDebug.DatabaseDebugLevel > 0) Log.LogDebug("Database.Exiting FigureDBFileToUse()"); return filename; } // Now just see if we can find anything. if (TQDebug.DatabaseDebugLevel > 0) Log.LogDebug("Detection Failed - searching for files"); string[] files = Directory.GetFiles(rootFolder, "Text_??.arc"); // Added check that files is not null. if (files != null && files.Length > 0) { if (TQDebug.DatabaseDebugLevel > 1) { Log.LogDebug("Found some files"); Log.LogDebug("filename = {0}", files[0]); } if (TQDebug.DatabaseDebugLevel > 0) Log.LogDebug("Exiting Database.FigureDBFileToUse()"); return files[0]; } if (TQDebug.DatabaseDebugLevel > 0) { Log.LogDebug("Failed to determine Language file!"); Log.LogDebug("Exiting Database.FigureDBFileToUse()"); } return null; } /// <summary> /// Loads the Text database /// </summary> private void LoadTextDB() { if (TQDebug.DatabaseDebugLevel > 0) Log.LogDebug("Database.LoadTextDB()"); string databaseFile = this.FigureDBFileToUse(false); if (TQDebug.DatabaseDebugLevel > 1) { Log.LogDebug("Find Titan Quest text file"); Log.LogDebug("dbFile = {0}", databaseFile); } if (!string.IsNullOrEmpty(databaseFile)) { string fileName = Path.GetFileNameWithoutExtension(databaseFile); } if (databaseFile != null) { // Try to suck what we want into memory and then parse it. this.ParseTextDB(databaseFile, "text\\commonequipment.txt"); this.ParseTextDB(databaseFile, "text\\uniqueequipment.txt"); this.ParseTextDB(databaseFile, "text\\quest.txt"); this.ParseTextDB(databaseFile, "text\\ui.txt"); this.ParseTextDB(databaseFile, "text\\skills.txt"); this.ParseTextDB(databaseFile, "text\\monsters.txt"); // Added by VillageIdiot this.ParseTextDB(databaseFile, "text\\menu.txt"); // Added by VillageIdiot this.ParseTextDB(databaseFile, "text\\tutorial.txt"); // Immortal Throne data this.ParseTextDB(databaseFile, "text\\xcommonequipment.txt"); this.ParseTextDB(databaseFile, "text\\xuniqueequipment.txt"); this.ParseTextDB(databaseFile, "text\\xquest.txt"); this.ParseTextDB(databaseFile, "text\\xui.txt"); this.ParseTextDB(databaseFile, "text\\xskills.txt"); this.ParseTextDB(databaseFile, "text\\xmonsters.txt"); // Added by VillageIdiot this.ParseTextDB(databaseFile, "text\\xmenu.txt"); // Added by VillageIdiot this.ParseTextDB(databaseFile, "text\\xnpc.txt"); // Added by VillageIdiot this.ParseTextDB(databaseFile, "text\\modstrings.txt"); // Added by VillageIdiot if (GamePathResolver.IsRagnarokInstalled) { this.ParseTextDB(databaseFile, "text\\x2commonequipment.txt"); this.ParseTextDB(databaseFile, "text\\x2uniqueequipment.txt"); this.ParseTextDB(databaseFile, "text\\x2quest.txt"); this.ParseTextDB(databaseFile, "text\\x2ui.txt"); this.ParseTextDB(databaseFile, "text\\x2skills.txt"); this.ParseTextDB(databaseFile, "text\\x2monsters.txt"); // Added by VillageIdiot this.ParseTextDB(databaseFile, "text\\x2menu.txt"); // Added by VillageIdiot this.ParseTextDB(databaseFile, "text\\x2npc.txt"); // Added by VillageIdiot } if (GamePathResolver.IsAtlantisInstalled) { this.ParseTextDB(databaseFile, "text\\x3basegame_nonvoiced.txt"); this.ParseTextDB(databaseFile, "text\\x3items_nonvoiced.txt"); this.ParseTextDB(databaseFile, "text\\x3mainquest_nonvoiced.txt"); this.ParseTextDB(databaseFile, "text\\x3misctags_nonvoiced.txt"); this.ParseTextDB(databaseFile, "text\\x3sidequests_nonvoiced.txt"); } if (GamePathResolver.IsEmbersInstalled) { this.ParseTextDB(databaseFile, "text\\x4basegame_nonvoiced.txt"); this.ParseTextDB(databaseFile, "text\\x4items_nonvoiced.txt"); this.ParseTextDB(databaseFile, "text\\x4mainquest_nonvoiced.txt"); this.ParseTextDB(databaseFile, "text\\x4misctags_nonvoiced.txt"); this.ParseTextDB(databaseFile, "text\\x4nametags_nonvoiced.txt"); this.ParseTextDB(databaseFile, "text\\x4sidequests_nonvoiced.txt"); } } // For loading custom map text database. if (GamePathResolver.IsCustom) { databaseFile = Path.Combine(GamePathResolver.MapName, "resources", "text.arc"); if (TQDebug.DatabaseDebugLevel > 1) { Log.LogDebug("Find Custom Map text file"); Log.LogDebug("dbFile = {0}", databaseFile); } if (databaseFile != null) this.ParseTextDB(databaseFile, "text\\modstrings.txt"); } // Added this check to see if anything was loaded. if (this.textDB.Count == 0) { if (TQDebug.DatabaseDebugLevel > 0) Log.LogDebug("Exception - Could not load Text DB."); throw new FileLoadException("Could not load Text DB."); } if (TQDebug.DatabaseDebugLevel > 0) Log.LogDebug("Exiting Database.LoadTextDB()"); } /// <summary> /// Parses the text database to put the entries into a hash table. /// </summary> /// <param name="databaseFile">Database file name (arc file)</param> /// <param name="filename">Name of the text DB file within the arc file</param> private void ParseTextDB(string databaseFile, string filename) { if (TQDebug.DatabaseDebugLevel > 0) Log.LogDebug("Database.ParseTextDB({0}, {1})", databaseFile, filename); byte[] data = this.ReadARCFile(databaseFile, filename); if (data == null) { // Changed for mod support. Sometimes the text file has more entries than just the x or non-x prefix files. if (TQDebug.DatabaseDebugLevel > 0) Log.LogDebug("Error in ARC File: {0} does not contain an entry for '{1}'", databaseFile, filename); return; } // now read it like a text file // Changed to system default encoding since there might be extended ascii (or something else) in the text db. using (StreamReader reader = new StreamReader(new MemoryStream(data), Encoding.Default)) { char delimiter = '='; string line; while ((line = reader.ReadLine()) != null) { line = line.Trim(); // delete short lines if (line.Length < 2) continue; // comment line if (line.StartsWith("//", StringComparison.Ordinal)) continue; // split on the equal sign string[] fields = line.Split(delimiter); // bad line if (fields.Length < 2) continue; string label = fields[1].Trim(); // Now for the foreign languages there is a bunch of crap in here so the proper version of the adjective can be used with the proper // noun form. I don' want to code all that so this next code will just take the first version of the adjective and then // throw away all the metadata. // hguy : one expression to rule them all if (Regex.Match(label, @"^(?<Tag>\[\w+\])(?<Label>[^\\[]+)|^\[(?<Label>[^\]]+)\]$") is { Success: true } match) label = match.Groups["Label"].Value.Trim(); // If this field is already in the db, then replace it string key = fields[0].Trim().ToUpperInvariant(); this.textDB.AddOrUpdateAtomic(key, label); } } if (TQDebug.DatabaseDebugLevel > 0) Log.LogDebug("Exiting Database.ParseTextDB()"); } /// <summary> /// Loads a database arz file. /// </summary> private void LoadARZFile() { if (TQDebug.DatabaseDebugLevel > 0) Log.LogDebug("Database.LoadARZFile()"); // from the original TQ folder string file = Path.Combine(Path.Combine(GamePathResolver.TQPath, "Database"), "database.arz"); if (TQDebug.DatabaseDebugLevel > 1) { Log.LogDebug("Load Titan Quest database arz file"); Log.LogDebug("file = {0}", file); } this.ArzFile = new ArzFile(file); arzProv.Read(this.ArzFile); // now Immortal Throne expansion pack this.ArzFileIT = this.ArzFile; // Added to load a custom map database file. if (GamePathResolver.IsCustom) { file = Path.Combine(GamePathResolver.MapName, "database", $"{Path.GetFileName(GamePathResolver.MapName)}.arz"); if (TQDebug.DatabaseDebugLevel > 1) { Log.LogDebug("Load Custom Map database arz file"); Log.LogDebug("file = {0}", file); } if (File.Exists(file)) { this.ArzFileMod = new ArzFile(file); arzProv.Read(this.ArzFileMod); } else this.ArzFileMod = null; } if (TQDebug.DatabaseDebugLevel > 0) Log.LogDebug("Exiting Database.LoadARZFile()"); } #endregion Database Private Methods } }
32.02079
178
0.675399
[ "MIT" ]
AirsQ/TQVaultAE
src/TQVaultAE.Data/Database.cs
30,804
C#
using System.Collections; using System.Collections.Generic; using UnityEngine; public class Fove3DCursorhit : MonoBehaviour { private Vector3 originhit;//視点 private float origindirection;//視点までの距離の2乗 private float origindirection2;//視点までの距離の private float origindirection3;//視点までの距離の√ private Vector3 newtunnering;//トンネリング座標 private float root10 = 3.162f;//計算用の√10の値 private float kyori; // Use this for initialization void Start () { } // Update is called once per frame void Update () { FoveInterface.EyeRays eyes = FoveInterface.GetEyeRays(); RaycastHit hitLeft, hitRight; switch (FoveInterface.CheckEyesClosed()) { case Fove.EFVR_Eye.Neither: Physics.Raycast(eyes.left, out hitLeft, Mathf.Infinity); Physics.Raycast(eyes.right, out hitRight, Mathf.Infinity); if (hitLeft.point != Vector3.zero && hitRight.point != Vector3.zero) { originhit = hitLeft.point + ((hitRight.point - hitLeft.point) / 2);//視点座標を代入 //眼球の中心座標を求める //視点の座標から眼球の中心座標を引いて、眼球から視点までのベクトルを求める origindirection = originhit.x * originhit.x + originhit.y * originhit.y + originhit.z * originhit.z;//距離の2乗を計算 origindirection2 = Mathf.Sqrt(origindirection);//√計算 origindirection3 = Mathf.Sqrt(origindirection2);//√計算 newtunnering = new Vector3(originhit.x * root10 / origindirection3, originhit.y * root10 / origindirection3, originhit.z * root10 / origindirection3);//長さ10のベクトルに変換 //眼球の座標にトンネリングまでの座標を足す transform.position = newtunnering;//トンネリングを移動 kyori = newtunnering.x * newtunnering.x + newtunnering.y * newtunnering.y + newtunnering.z * newtunnering.z; Debug.Log(kyori.ToString()); } else { originhit = eyes.left.GetPoint(3.0f) + ((eyes.right.GetPoint(3.0f) - eyes.left.GetPoint(3.0f)) / 2);//視点を代入 origindirection = originhit.x * originhit.x + originhit.y * originhit.y + originhit.z * originhit.z;//距離の2乗を計算 origindirection2 = Mathf.Sqrt(origindirection); origindirection3 = Mathf.Sqrt(origindirection2); newtunnering = new Vector3(originhit.x * root10 / origindirection3, originhit.y * root10 / origindirection3, originhit.z * root10 / origindirection3);//トンネリングの座標を計算して代入 transform.position = newtunnering;//トンネリングを移動 } break; case Fove.EFVR_Eye.Left: Physics.Raycast(eyes.right, out hitRight, Mathf.Infinity); if (hitRight.point != Vector3.zero) // Vector3 is non-nullable; comparing to null is always false { originhit = hitRight.point;//視点を代入 origindirection = originhit.x * originhit.x + originhit.y * originhit.y + originhit.z * originhit.z;//距離の2乗を計算 origindirection2 = Mathf.Sqrt(origindirection); origindirection3 = Mathf.Sqrt(origindirection2); newtunnering = new Vector3(originhit.x * root10 / origindirection3, originhit.y * root10 / origindirection3, originhit.z * root10 / origindirection3);//トンネリングの座標を計算して代入 transform.position = newtunnering;//トンネリングを移動 } else { originhit = eyes.right.GetPoint(3.0f);//視点を代入 origindirection = originhit.x * originhit.x + originhit.y * originhit.y + originhit.z * originhit.z;//距離の2乗を計算 origindirection2 = Mathf.Sqrt(origindirection); origindirection3 = Mathf.Sqrt(origindirection2); newtunnering = new Vector3(originhit.x * root10 / origindirection3, originhit.y * root10 / origindirection3, originhit.z * root10 / origindirection3);//トンネリングの座標を計算して代入 transform.position = newtunnering;//トンネリングを移動 } break; case Fove.EFVR_Eye.Right: Physics.Raycast(eyes.left, out hitLeft, Mathf.Infinity); if (hitLeft.point != Vector3.zero) // Vector3 is non-nullable; comparing to null is always false { originhit = hitLeft.point;//視点を代入 origindirection = originhit.x * originhit.x + originhit.y * originhit.y + originhit.z * originhit.z;//距離の2乗を計算 origindirection2 = Mathf.Sqrt(origindirection); origindirection3 = Mathf.Sqrt(origindirection2); newtunnering = new Vector3(originhit.x * root10 / origindirection3, originhit.y * root10 / origindirection3, originhit.z * root10 / origindirection3);//トンネリングの座標を計算して代入 transform.position = newtunnering;//トンネリングを移動 } else { originhit = eyes.left.GetPoint(3.0f);//視点を代入 origindirection = originhit.x * originhit.x + originhit.y * originhit.y + originhit.z * originhit.z;//距離の2乗を計算 origindirection2 = Mathf.Sqrt(origindirection); origindirection3 = Mathf.Sqrt(origindirection2); newtunnering = new Vector3(originhit.x * root10 / origindirection3, originhit.y * root10 / origindirection3, originhit.z * root10 / origindirection3);//トンネリングの座標を計算して代入 transform.position = newtunnering;//トンネリングを移動 } break; } } }
56.029412
188
0.595101
[ "MIT" ]
Yoshiya1113/Fove
Assets/Examples/FoveCursor/Scripts/EyeCheck/miss/Fove3DCursorhit.cs
6,385
C#
namespace p04._02.Palindromes { using System; using System.Collections.Generic; using System.Linq; class Palindromes2 { static void Main(string[] args) { string[] text = Console.ReadLine() .Split(new char[] { ' ', ',', '.', '?', '!' }, StringSplitOptions .RemoveEmptyEntries); List<string> palindromes = new List<string>(); foreach (string word in text) { if (word.SequenceEqual(word.Reverse()) && !palindromes.Contains(word)) { palindromes.Add(word); } } palindromes.Sort(); Console.WriteLine(string.Join(", ", palindromes)); } } }
24.727273
62
0.459559
[ "MIT" ]
vesy53/SoftUni
Tech Module/Extended-Programming-Fundamentals/ExtendedStringAndTextProcessingLab/p04.02.Palindromes/Palindromes2.cs
818
C#
using UnityEngine; using System.Collections.Generic; namespace Mirror { /// <summary> /// Component that limits visibility of networked objects to the authority client. /// <para>Any object with this component on it will only be visible to the client that has been assigned authority for it.</para> /// <para>This would be used for spawning a non-player networked object for single client to interact with, e.g. in-game puzzles.</para> /// </summary> [DisallowMultipleComponent] [AddComponentMenu("Network/NetworkOwnerChecker")] [RequireComponent(typeof(NetworkIdentity))] [HelpURL("https://mirror-networking.com/docs/Components/NetworkOwnerChecker.html")] public class NetworkOwnerChecker : NetworkVisibility { static readonly ILogger logger = LogFactory.GetLogger(typeof(NetworkSceneChecker)); /// <summary> /// Callback used by the visibility system to determine if an observer (player) can see this object. /// <para>If this function returns true, the network connection will be added as an observer.</para> /// </summary> /// <param name="conn">Network connection of a player.</param> /// <returns>True if the client is the owner of this object.</returns> public override bool OnCheckObserver(NetworkConnection conn) { if (logger.LogEnabled()) logger.Log($"OnCheckObserver {netIdentity.connectionToClient} {conn}"); return (netIdentity.connectionToClient == conn); } /// <summary> /// Callback used by the visibility system to (re)construct the set of observers that can see this object. /// </summary> /// <param name="observers">The new set of observers for this object.</param> /// <param name="initialize">True if the set of observers is being built for the first time.</param> public override void OnRebuildObservers(HashSet<NetworkConnection> observers, bool initialize) { // Do nothing here because the authority client is always added as an observer internally. } } }
49.162791
140
0.684484
[ "MIT" ]
AW1534/Mirror
Assets/Mirror/Components/NetworkOwnerChecker.cs
2,116
C#
using System.Collections.Generic; using System.Globalization; using NUnit.Framework; namespace System.IO.Abstractions.TestingHelpers.Tests { using XFS = MockUnixSupport; [TestFixture] public class MockFileInfoTests { [Test] public void MockFileInfo_NullPath_ThrowArgumentNullException() { var fileSystem = new MockFileSystem(); TestDelegate action = () => new MockFileInfo(fileSystem, null); Assert.Throws<ArgumentNullException>(action); } [Test] public void MockFileInfo_Exists_ShouldReturnTrueIfFileExistsInMemoryFileSystem() { var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData> { { XFS.Path(@"c:\a.txt"), new MockFileData("Demo text content") }, { XFS.Path(@"c:\a\b\c.txt"), new MockFileData("Demo text content") }, }); var fileInfo = new MockFileInfo(fileSystem, XFS.Path(@"c:\a.txt")); var result = fileInfo.Exists; Assert.IsTrue(result); } [Test] public void MockFileInfo_Exists_ShouldReturnFalseIfFileDoesNotExistInMemoryFileSystem() { var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData> { { XFS.Path(@"c:\a.txt"), new MockFileData("Demo text content") }, { XFS.Path(@"c:\a\b\c.txt"), new MockFileData("Demo text content") }, }); var fileInfo = new MockFileInfo(fileSystem, XFS.Path(@"c:\foo.txt")); var result = fileInfo.Exists; Assert.IsFalse(result); } [Test] public void MockFileInfo_Exists_ShouldRetunFalseIfPathLeadsToDirectory() { var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData> { { XFS.Path(@"c:\a\b\c.txt"), new MockFileData("Demo text content") }, }); var fileInfo = new MockFileInfo(fileSystem, XFS.Path(@"c:\a\b")); var result = fileInfo.Exists; Assert.IsFalse(result); } [Test] public void MockFileInfo_Length_ShouldReturnLengthOfFileInMemoryFileSystem() { const string fileContent = "Demo text content"; var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData> { { XFS.Path(@"c:\a.txt"), new MockFileData(fileContent) }, { XFS.Path(@"c:\a\b\c.txt"), new MockFileData(fileContent) }, }); var fileInfo = new MockFileInfo(fileSystem, XFS.Path(@"c:\a.txt")); var result = fileInfo.Length; Assert.AreEqual(fileContent.Length, result); } [Test] public void MockFileInfo_Length_ShouldThrowFileNotFoundExceptionIfFileDoesNotExistInMemoryFileSystem() { const string fileContent = "Demo text content"; var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData> { { XFS.Path(@"c:\a.txt"), new MockFileData(fileContent) }, { XFS.Path(@"c:\a\b\c.txt"), new MockFileData(fileContent) }, }); var fileInfo = new MockFileInfo(fileSystem, XFS.Path(@"c:\foo.txt")); var ex = Assert.Throws<FileNotFoundException>(() => fileInfo.Length.ToString(CultureInfo.InvariantCulture)); Assert.AreEqual(XFS.Path(@"c:\foo.txt"), ex.FileName); } [Test] public void MockFileInfo_Length_ShouldThrowFileNotFoundExceptionIfPathLeadsToDirectory() { const string fileContent = "Demo text content"; var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData> { { XFS.Path(@"c:\a\b\c.txt"), new MockFileData(fileContent) }, }); var fileInfo = new MockFileInfo(fileSystem, XFS.Path(@"c:\a\b")); var ex = Assert.Throws<FileNotFoundException>(() => fileInfo.Length.ToString(CultureInfo.InvariantCulture)); Assert.AreEqual(XFS.Path(@"c:\a\b"), ex.FileName); } [Test] public void MockFileInfo_CreationTimeUtc_ShouldReturnCreationTimeUtcOfFileInMemoryFileSystem() { var creationTime = DateTime.Now.AddHours(-4); var fileData = new MockFileData("Demo text content") { CreationTime = creationTime }; var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData> { { XFS.Path(@"c:\a.txt"), fileData } }); var fileInfo = new MockFileInfo(fileSystem, XFS.Path(@"c:\a.txt")); var result = fileInfo.CreationTimeUtc; Assert.AreEqual(creationTime.ToUniversalTime(), result); } [Test] public void MockFileInfo_CreationTimeUtc_ShouldSetCreationTimeUtcOfFileInMemoryFileSystem() { var creationTime = DateTime.Now.AddHours(-4); var fileData = new MockFileData("Demo text content") { CreationTime = creationTime }; var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData> { { XFS.Path(@"c:\a.txt"), fileData } }); var fileInfo = new MockFileInfo(fileSystem, XFS.Path(@"c:\a.txt")); var newUtcTime = DateTime.UtcNow; fileInfo.CreationTimeUtc = newUtcTime; Assert.AreEqual(newUtcTime, fileInfo.CreationTimeUtc); } [Test] public void MockFileInfo_CreationTime_ShouldReturnCreationTimeOfFileInMemoryFileSystem() { var creationTime = DateTime.Now.AddHours(-4); var fileData = new MockFileData("Demo text content") { CreationTime = creationTime }; var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData> { { XFS.Path(@"c:\a.txt"), fileData } }); var fileInfo = new MockFileInfo(fileSystem, XFS.Path(@"c:\a.txt")); var result = fileInfo.CreationTime; Assert.AreEqual(creationTime, result); } [Test] public void MockFileInfo_CreationTime_ShouldSetCreationTimeOfFileInMemoryFileSystem() { var creationTime = DateTime.Now.AddHours(-4); var fileData = new MockFileData("Demo text content") { CreationTime = creationTime }; var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData> { { XFS.Path(@"c:\a.txt"), fileData } }); var fileInfo = new MockFileInfo(fileSystem, XFS.Path(@"c:\a.txt")); var newTime = DateTime.Now; fileInfo.CreationTime = newTime; Assert.AreEqual(newTime, fileInfo.CreationTime); } [Test] public void MockFileInfo_IsReadOnly_ShouldSetReadOnlyAttributeOfFileInMemoryFileSystem() { var fileData = new MockFileData("Demo text content"); var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData> { { XFS.Path(@"c:\a.txt"), fileData } }); var fileInfo = new MockFileInfo(fileSystem, XFS.Path(@"c:\a.txt")); fileInfo.IsReadOnly = true; Assert.AreEqual(FileAttributes.ReadOnly, fileData.Attributes & FileAttributes.ReadOnly); } [Test] public void MockFileInfo_IsReadOnly_ShouldSetNotReadOnlyAttributeOfFileInMemoryFileSystem() { var fileData = new MockFileData("Demo text content") { Attributes = FileAttributes.ReadOnly }; var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData> { { XFS.Path(@"c:\a.txt"), fileData } }); var fileInfo = new MockFileInfo(fileSystem, XFS.Path(@"c:\a.txt")); fileInfo.IsReadOnly = false; Assert.AreNotEqual(FileAttributes.ReadOnly, fileData.Attributes & FileAttributes.ReadOnly); } [Test] public void MockFileInfo_AppendText_ShouldAddTextToFileInMemoryFileSystem() { var fileData = new MockFileData("Demo text content"); var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData> { { XFS.Path(@"c:\a.txt"), fileData } }); var fileInfo = new MockFileInfo(fileSystem, XFS.Path(@"c:\a.txt")); using (var file = fileInfo.AppendText()) file.WriteLine("This should be at the end"); string newcontents; using (var newfile = fileInfo.OpenText()) { newcontents = newfile.ReadToEnd(); } Assert.AreEqual($"Demo text contentThis should be at the end{Environment.NewLine}", newcontents); } [Test] public void MockFileInfo_OpenWrite_ShouldAddDataToFileInMemoryFileSystem() { var fileData = new MockFileData("Demo text content"); var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData> { { XFS.Path(@"c:\a.txt"), fileData } }); var fileInfo = new MockFileInfo(fileSystem, XFS.Path(@"c:\a.txt")); var bytesToAdd = new byte[] { 65, 66, 67, 68, 69 }; using (var file = fileInfo.OpenWrite()) { file.Write(bytesToAdd, 0, bytesToAdd.Length); } string newcontents; using (var newfile = fileInfo.OpenText()) { newcontents = newfile.ReadToEnd(); } Assert.AreEqual("ABCDEtext content", newcontents); } #if NET40 [Test] public void MockFileInfo_Encrypt_ShouldSetEncryptedAttributeOfFileInMemoryFileSystem() { var fileData = new MockFileData("Demo text content"); var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData> { { XFS.Path(@"c:\a.txt"), fileData } }); var fileInfo = new MockFileInfo(fileSystem, XFS.Path(@"c:\a.txt")); fileInfo.Encrypt(); Assert.AreEqual(FileAttributes.Encrypted, fileData.Attributes & FileAttributes.Encrypted); } [Test] public void MockFileInfo_Decrypt_ShouldUnsetEncryptedAttributeOfFileInMemoryFileSystem() { var fileData = new MockFileData("Demo text content"); var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData> { { XFS.Path(@"c:\a.txt"), fileData } }); var fileInfo = new MockFileInfo(fileSystem, XFS.Path(@"c:\a.txt")); fileInfo.Encrypt(); fileInfo.Decrypt(); Assert.AreNotEqual(FileAttributes.Encrypted, fileData.Attributes & FileAttributes.Encrypted); } #endif [Test] public void MockFileInfo_LastAccessTimeUtc_ShouldReturnLastAccessTimeUtcOfFileInMemoryFileSystem() { var lastAccessTime = DateTime.Now.AddHours(-4); var fileData = new MockFileData("Demo text content") { LastAccessTime = lastAccessTime }; var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData> { { XFS.Path(@"c:\a.txt"), fileData } }); var fileInfo = new MockFileInfo(fileSystem, XFS.Path(@"c:\a.txt")); var result = fileInfo.LastAccessTimeUtc; Assert.AreEqual(lastAccessTime.ToUniversalTime(), result); } [Test] public void MockFileInfo_LastAccessTimeUtc_ShouldSetCreationTimeUtcOfFileInMemoryFileSystem() { var lastAccessTime = DateTime.Now.AddHours(-4); var fileData = new MockFileData("Demo text content") { LastAccessTime = lastAccessTime }; var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData> { { XFS.Path(@"c:\a.txt"), fileData } }); var fileInfo = new MockFileInfo(fileSystem, XFS.Path(@"c:\a.txt")); var newUtcTime = DateTime.UtcNow; fileInfo.LastAccessTimeUtc = newUtcTime; Assert.AreEqual(newUtcTime, fileInfo.LastAccessTimeUtc); } [Test] public void MockFileInfo_LastWriteTimeUtc_ShouldReturnLastWriteTimeUtcOfFileInMemoryFileSystem() { var lastWriteTime = DateTime.Now.AddHours(-4); var fileData = new MockFileData("Demo text content") { LastWriteTime = lastWriteTime }; var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData> { { XFS.Path(@"c:\a.txt"), fileData } }); var fileInfo = new MockFileInfo(fileSystem, XFS.Path(@"c:\a.txt")); var result = fileInfo.LastWriteTimeUtc; Assert.AreEqual(lastWriteTime.ToUniversalTime(), result); } [Test] public void MockFileInfo_LastWriteTimeUtc_ShouldSetLastWriteTimeUtcOfFileInMemoryFileSystem() { var lastWriteTime = DateTime.Now.AddHours(-4); var fileData = new MockFileData("Demo text content") { LastWriteTime = lastWriteTime }; var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData> { { XFS.Path(@"c:\a.txt"), fileData } }); var fileInfo = new MockFileInfo(fileSystem, XFS.Path(@"c:\a.txt")); var newUtcTime = DateTime.UtcNow; fileInfo.LastWriteTime = newUtcTime; Assert.AreEqual(newUtcTime, fileInfo.LastWriteTime); } [Test] public void MockFileInfo_GetExtension_ShouldReturnExtension() { var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData>()); var fileInfo = new MockFileInfo(fileSystem, XFS.Path(@"c:\a.txt")); var result = fileInfo.Extension; Assert.AreEqual(".txt", result); } [Test] public void MockFileInfo_GetExtensionWithoutExtension_ShouldReturnEmptyString() { var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData>()); var fileInfo = new MockFileInfo(fileSystem, XFS.Path(@"c:\a")); var result = fileInfo.Extension; Assert.AreEqual(string.Empty, result); } [Test] public void MockFileInfo_GetDirectoryName_ShouldReturnCompleteDirectoryPath() { var fileInfo = new MockFileInfo(new MockFileSystem(), XFS.Path(@"c:\temp\level1\level2\file.txt")); var result = fileInfo.DirectoryName; Assert.AreEqual(XFS.Path(@"c:\temp\level1\level2"), result); } [Test] public void MockFileInfo_GetDirectory_ShouldReturnDirectoryInfoWithCorrectPath() { var fileInfo = new MockFileInfo(new MockFileSystem(), XFS.Path(@"c:\temp\level1\level2\file.txt")); var result = fileInfo.Directory; Assert.AreEqual(XFS.Path(@"c:\temp\level1\level2"), result.FullName); } [Test] public void MockFileInfo_OpenRead_ShouldReturnByteContentOfFile() { var fileSystem = new MockFileSystem(); fileSystem.AddFile(XFS.Path(@"c:\temp\file.txt"), new MockFileData(new byte[] { 1, 2 })); var fileInfo = fileSystem.FileInfo.FromFileName(XFS.Path(@"c:\temp\file.txt")); byte[] result = new byte[2]; using (var stream = fileInfo.OpenRead()) { stream.Read(result, 0, 2); } Assert.AreEqual(new byte[] { 1, 2 }, result); } [Test] public void MockFileInfo_OpenText_ShouldReturnStringContentOfFile() { var fileSystem = new MockFileSystem(); fileSystem.AddFile(XFS.Path(@"c:\temp\file.txt"), new MockFileData(@"line 1\r\nline 2")); var fileInfo = fileSystem.FileInfo.FromFileName(XFS.Path(@"c:\temp\file.txt")); string result; using (var streamReader = fileInfo.OpenText()) { result = streamReader.ReadToEnd(); } Assert.AreEqual(@"line 1\r\nline 2", result); } [Test] public void MockFileInfo_MoveTo_NonExistentDestination_ShouldUpdateFileInfoDirectoryAndFullName() { var fileSystem = new MockFileSystem(); var sourcePath = XFS.Path(@"c:\temp\file.txt"); var destinationFolder = XFS.Path(@"c:\temp2"); var destinationPath = XFS.Path(destinationFolder + @"\file.txt"); fileSystem.AddFile(sourcePath, new MockFileData("1")); var fileInfo = fileSystem.FileInfo.FromFileName(sourcePath); fileSystem.AddDirectory(destinationFolder); fileInfo.MoveTo(destinationPath); Assert.AreEqual(fileInfo.DirectoryName, destinationFolder); Assert.AreEqual(fileInfo.FullName, destinationPath); } [Test] public void MockFileInfo_MoveTo_NonExistentDestinationFolder_ShouldThrowDirectoryNotFoundException() { var fileSystem = new MockFileSystem(); var sourcePath = XFS.Path(@"c:\temp\file.txt"); var destinationPath = XFS.Path(@"c:\temp2\file.txt"); fileSystem.AddFile(sourcePath, new MockFileData("1")); var fileInfo = fileSystem.FileInfo.FromFileName(sourcePath); Assert.Throws<DirectoryNotFoundException>(() => fileInfo.MoveTo(destinationPath)); } [Test] public void MockFileInfo_MoveTo_ExistingDestination_ShouldThrowExceptionAboutFileAlreadyExisting() { var fileSystem = new MockFileSystem(); var sourcePath = XFS.Path(@"c:\temp\file.txt"); var destinationPath = XFS.Path(@"c:\temp2\file.txt"); fileSystem.AddFile(sourcePath, new MockFileData("1")); var fileInfo = fileSystem.FileInfo.FromFileName(sourcePath); fileSystem.AddFile(destinationPath, new MockFileData("2")); Assert.Throws<IOException>(() => fileInfo.MoveTo(destinationPath)); } [Test] public void MockFileInfo_MoveTo_SameSourceAndTargetIsANoOp() { var fileSystem = new MockFileSystem(); fileSystem.AddFile(XFS.Path(@"c:\temp\file.txt"), new MockFileData(@"line 1\r\nline 2")); var fileInfo = fileSystem.FileInfo.FromFileName(XFS.Path(@"c:\temp\file.txt")); string destination = XFS.Path(XFS.Path(@"c:\temp\file.txt")); fileInfo.MoveTo(destination); Assert.AreEqual(fileInfo.FullName, destination); Assert.True(fileInfo.Exists); } [Test] public void MockFileInfo_MoveTo_SameSourceAndTargetThrowsExceptionIfSourceDoesntExist() { var fileSystem = new MockFileSystem(); var fileInfo = fileSystem.FileInfo.FromFileName(XFS.Path(@"c:\temp\file.txt")); string destination = XFS.Path(XFS.Path(@"c:\temp\file.txt")); TestDelegate action = () => fileInfo.MoveTo(destination); Assert.Throws<FileNotFoundException>(action); } [Test] public void MockFileInfo_MoveTo_ThrowsExceptionIfSourceDoesntExist() { var fileSystem = new MockFileSystem(); var fileInfo = fileSystem.FileInfo.FromFileName(XFS.Path(@"c:\temp\file.txt")); string destination = XFS.Path(XFS.Path(@"c:\temp\file2.txt")); TestDelegate action = () => fileInfo.MoveTo(destination); Assert.Throws<FileNotFoundException>(action); } [Test] public void MockFileInfo_CopyTo_ThrowsExceptionIfSourceDoesntExist() { var fileSystem = new MockFileSystem(); var fileInfo = fileSystem.FileInfo.FromFileName(XFS.Path(@"c:\temp\file.txt")); string destination = XFS.Path(XFS.Path(@"c:\temp\file2.txt")); TestDelegate action = () => fileInfo.CopyTo(destination); Assert.Throws<FileNotFoundException>(action); } [TestCase(@"..\..\..\c.txt")] [TestCase(@"c:\a\b\c.txt")] [TestCase(@"c:\a\c.txt")] [TestCase(@"c:\c.txt")] public void MockFileInfo_ToString_ShouldReturnOriginalFilePath(string path) { //Arrange var filePath = XFS.Path(path); //Act var mockFileInfo = new MockFileInfo(new MockFileSystem(), filePath); //Assert Assert.AreEqual(filePath, mockFileInfo.ToString()); } /// <summary> /// Normalize, tested with Path.GetFullPath and new FileInfo().FullName; /// </summary> [TestCaseSource(nameof(FromFileName_Paths_NormalizePaths_Cases))] public void FromFileName_Paths_NormalizePaths(string input, string expected) { // Arrange var mockFs = new MockFileSystem(); // Act var mockFileInfo = mockFs.FileInfo.FromFileName(input); var result = mockFileInfo.FullName; // Assert Assert.AreEqual(expected, result); } public static IEnumerable<string[]> FromFileName_Paths_NormalizePaths_Cases { get { yield return new[] { XFS.Path(@"c:\top\..\most\file"), XFS.Path(@"c:\most\file") }; yield return new[] { XFS.Path(@"c:\top\..\most\..\dir\file"), XFS.Path(@"c:\dir\file") }; yield return new[] { XFS.Path(@"\file"), XFS.Path(@"C:\file") }; yield return new[] { XFS.Path(@"c:\top\../..\most\file"), XFS.Path(@"c:\most\file") }; } } #if NET40 [Test] public void MockFileInfo_Replace_ShouldReplaceFileContents() { // Arrange var fileSystem = new MockFileSystem(); var path1 = XFS.Path(@"c:\temp\file1.txt"); var path2 = XFS.Path(@"c:\temp\file2.txt"); fileSystem.AddFile(path1, new MockFileData("1")); fileSystem.AddFile(path2, new MockFileData("2")); var fileInfo1 = fileSystem.FileInfo.FromFileName(path1); var fileInfo2 = fileSystem.FileInfo.FromFileName(path2); // Act fileInfo1.Replace(path2, null); Assert.AreEqual("1", fileInfo2.OpenText().ReadToEnd()); } [Test] public void MockFileInfo_Replace_ShouldCreateBackup() { // Arrange var fileSystem = new MockFileSystem(); var path1 = XFS.Path(@"c:\temp\file1.txt"); var path2 = XFS.Path(@"c:\temp\file2.txt"); var path3 = XFS.Path(@"c:\temp\file3.txt"); fileSystem.AddFile(path1, new MockFileData("1")); fileSystem.AddFile(path2, new MockFileData("2")); var fileInfo1 = fileSystem.FileInfo.FromFileName(path1); var fileInfo3 = fileSystem.FileInfo.FromFileName(path3); // Act fileInfo1.Replace(path2, path3); Assert.AreEqual("2", fileInfo3.OpenText().ReadToEnd()); } [Test] public void MockFileInfo_Replace_ShouldThrowIfDirectoryOfBackupPathDoesNotExist() { // Arrange var fileSystem = new MockFileSystem(); var path1 = XFS.Path(@"c:\temp\file1.txt"); var path2 = XFS.Path(@"c:\temp\file2.txt"); var path3 = XFS.Path(@"c:\temp\subdirectory\file3.txt"); fileSystem.AddFile(path1, new MockFileData("1")); fileSystem.AddFile(path2, new MockFileData("2")); var fileInfo1 = fileSystem.FileInfo.FromFileName(path1); // Act Assert.Throws<DirectoryNotFoundException>(() => fileInfo1.Replace(path2, path3)); } [Test] public void MockFileInfo_Replace_ShouldReturnDestinationFileInfo() { // Arrange var fileSystem = new MockFileSystem(); var path1 = XFS.Path(@"c:\temp\file1.txt"); var path2 = XFS.Path(@"c:\temp\file2.txt"); fileSystem.AddFile(path1, new MockFileData("1")); fileSystem.AddFile(path2, new MockFileData("2")); var fileInfo1 = fileSystem.FileInfo.FromFileName(path1); var fileInfo2 = fileSystem.FileInfo.FromFileName(path2); // Act var result = fileInfo1.Replace(path2, null); Assert.AreEqual(fileInfo2.FullName, result.FullName); } [Test] public void MockFileInfo_Replace_ShouldThrowIfSourceFileDoesNotExist() { // Arrange var fileSystem = new MockFileSystem(); var path1 = XFS.Path(@"c:\temp\file1.txt"); var path2 = XFS.Path(@"c:\temp\file2.txt"); fileSystem.AddFile(path2, new MockFileData("1")); var fileInfo = fileSystem.FileInfo.FromFileName(path1); Assert.Throws<FileNotFoundException>(() => fileInfo.Replace(path2, null)); } [Test] public void MockFileInfo_Replace_ShouldThrowIfDestinationFileDoesNotExist() { // Arrange var fileSystem = new MockFileSystem(); var path1 = XFS.Path(@"c:\temp\file1.txt"); var path2 = XFS.Path(@"c:\temp\file2.txt"); fileSystem.AddFile(path1, new MockFileData("1")); var fileInfo = fileSystem.FileInfo.FromFileName(path1); Assert.Throws<FileNotFoundException>(() => fileInfo.Replace(path2, null)); } #endif } }
38.658683
120
0.592472
[ "MIT" ]
KaliVi/System.IO.Abstractions
System.IO.Abstractions.TestingHelpers.Tests/MockFileInfoTests.cs
25,826
C#
using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; namespace PortalCompanionApp { 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.444444
76
0.632701
[ "MIT" ]
dylanhaskins/PowerPlatformCICD
PortalCompanionApp/Program.cs
424
C#
using System.Collections.Generic; public class PositionCalculationResult { private readonly HashSet<PositionController> possibleMovementPositions; public PositionCalculationResult (HashSet<PositionController> possibleMovementPositions) { this.possibleMovementPositions = possibleMovementPositions; } public HashSet<PositionController> getPossibleMovementPositions () { return possibleMovementPositions; } }
29.8
94
0.794183
[ "MIT" ]
RobertBleyl/chess-with-research
Assets/Scripts/Positions/PositionCalculationResult.cs
447
C#
using System; using Snowflake.Filesystem; using Snowflake.Model.Records.File; namespace Snowflake.Model.Records { public class FileRecord : IFileRecord { /// <inheritdoc/> public IMetadataCollection Metadata { get; } /// <inheritdoc/> public Guid RecordID => File.FileGuid; public IFile File { get; } /// <inheritdoc/> public string MimeType { get; } internal FileRecord(IFile file, string mimeType, IMetadataCollection metadataCollection) { this.MimeType = mimeType; this.File = file; this.Metadata = metadataCollection; } } }
23.642857
96
0.610272
[ "MPL-2.0", "MPL-2.0-no-copyleft-exception" ]
SnowflakePowered/snowflake
src/Snowflake.Framework/Model/Records/FileRecord.cs
664
C#
using Bing.Utils.Files; using Xunit; namespace Bing.Utils.Tests.Files { /// <summary> /// 测试文件大小 /// </summary> public class FileSizeTest { /// <summary> /// 测试 - 文件字节数 /// </summary> [Theory] [InlineData(FileSizeUnit.Byte, 1)] [InlineData(FileSizeUnit.K, 1024)] [InlineData(FileSizeUnit.M, 1024 * 1024)] [InlineData(FileSizeUnit.G, 1024 * 1024 * 1024)] public void Test_Size(FileSizeUnit unit, long result) { Assert.Equal(result, new FileSize(1, unit).Size); } /// <summary> /// 测试 - 测试文件大小描述 /// </summary> [Fact] public void Test_ToString() { Assert.Equal("1 B", new FileSize(1).ToString()); Assert.Equal("1 KB", new FileSize(1 * 1024).ToString()); Assert.Equal("1 MB", new FileSize(1 * 1024 * 1024).ToString()); Assert.Equal("1 GB", new FileSize(1 * 1024 * 1024 * 1024).ToString()); } /// <summary> /// 测试 - 获取文件大小,单位:K /// </summary> [Fact] public void Test_GetSizeByK() { Assert.Equal(0, new FileSize(0).GetSizeByK()); Assert.Equal(1, new FileSize(1024).GetSizeByK()); Assert.Equal(0.5, new FileSize(512).GetSizeByK()); } /// <summary> /// 测试 - 获取文件大小,单位:M /// </summary> [Fact] public void Test_GetSizeByM() { Assert.Equal(0, new FileSize(0).GetSizeByM()); Assert.Equal(1, new FileSize(1024 * 1024).GetSizeByM()); Assert.Equal(0.5, new FileSize(512 * 1024).GetSizeByM()); } /// <summary> /// 测试 - 获取文件大小,单位:G /// </summary> [Fact] public void Test_GetSizeByG() { Assert.Equal(0, new FileSize(0).GetSizeByG()); Assert.Equal(1, new FileSize(1024 * 1024 * 1024).GetSizeByG()); Assert.Equal(0.5, new FileSize(512 * 1024 * 1024).GetSizeByG()); } } }
29.457143
82
0.508729
[ "MIT" ]
brucehu123/Bing.NetCore
tests/Bing.Utils.Tests/Files/FileSizeTest.cs
2,182
C#
using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authentication.Cookies; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.Extensions.Configuration; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Security.Claims; using System.Threading.Tasks; namespace RazoreApp.Pages { public class IndexModel : PageModel { private readonly IConfiguration configuration; public IndexModel(IConfiguration configuration) { this.configuration = configuration; } public string Message { get; set; } [BindProperty, DataType(DataType.Password)] public string Password { get; set; } [BindProperty] public string UserName { get; set; } public async Task<IActionResult> OnPost() { var claims = new List<Claim> { new Claim(ClaimTypes.Name, UserName) }; var claimsIdentity = new ClaimsIdentity(claims, CookieAuthenticationDefaults.AuthenticationScheme); await HttpContext.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme, new ClaimsPrincipal(claimsIdentity)); if (HttpContext.Request.Query.ContainsKey("ReturnUrl")) { return Redirect(HttpContext.Request.Query["ReturnUrl"].ToString()); } return RedirectToPage("/admin/index"); } } }
28.844444
121
0.774268
[ "MIT" ]
blyzer/Voyager
Samples/RazoreApp/Pages/Index.cshtml.cs
1,300
C#
#pragma checksum "C:\Users\Nompumelelo\source\repos\PixiePhotos_WebApp\Views\Shared\Error.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "d6a5625cc8fb4476f348b0fe9041c550465d8bf9" // <auto-generated/> #pragma warning disable 1591 [assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.Views_Shared_Error), @"mvc.1.0.view", @"/Views/Shared/Error.cshtml")] 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; #nullable restore #line 1 "C:\Users\Nompumelelo\source\repos\PixiePhotos_WebApp\Views\_ViewImports.cshtml" using PixiePhotos_WebApp; #line default #line hidden #nullable disable #nullable restore #line 2 "C:\Users\Nompumelelo\source\repos\PixiePhotos_WebApp\Views\_ViewImports.cshtml" using PixiePhotos_WebApp.Models; #line default #line hidden #nullable disable [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"d6a5625cc8fb4476f348b0fe9041c550465d8bf9", @"/Views/Shared/Error.cshtml")] [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"10d571aea6ba7f8c746a7114dfa2ac7afaa07981", @"/Views/_ViewImports.cshtml")] public class Views_Shared_Error : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<ErrorViewModel> { #pragma warning disable 1998 public async override global::System.Threading.Tasks.Task ExecuteAsync() { #nullable restore #line 2 "C:\Users\Nompumelelo\source\repos\PixiePhotos_WebApp\Views\Shared\Error.cshtml" ViewData["Title"] = "Error"; #line default #line hidden #nullable disable WriteLiteral("\r\n<h1 class=\"text-danger\">Error.</h1>\r\n<h2 class=\"text-danger\">An error occurred while processing your request.</h2>\r\n\r\n"); #nullable restore #line 9 "C:\Users\Nompumelelo\source\repos\PixiePhotos_WebApp\Views\Shared\Error.cshtml" if (Model.ShowRequestId) { #line default #line hidden #nullable disable WriteLiteral(" <p>\r\n <strong>Request ID:</strong> <code>"); #nullable restore #line 12 "C:\Users\Nompumelelo\source\repos\PixiePhotos_WebApp\Views\Shared\Error.cshtml" Write(Model.RequestId); #line default #line hidden #nullable disable WriteLiteral("</code>\r\n </p>\r\n"); #nullable restore #line 14 "C:\Users\Nompumelelo\source\repos\PixiePhotos_WebApp\Views\Shared\Error.cshtml" } #line default #line hidden #nullable disable WriteLiteral(@" <h3>Development Mode</h3> <p> Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred. </p> <p> <strong>The Development environment shouldn't be enabled for deployed applications.</strong> It can result in displaying sensitive information from exceptions to end users. For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong> and restarting the app. </p> "); } #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<ErrorViewModel> Html { get; private set; } } } #pragma warning restore 1591
44.354167
184
0.750352
[ "MIT" ]
Candice-hub1/Pixie.Photos_WebApp
obj/Debug/netcoreapp3.1/Razor/Views/Shared/Error.cshtml.g.cs
4,258
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 gamelift-2015-10-01.normal.json service model. */ using System; using System.Collections.Generic; using System.Xml.Serialization; using System.Text; using System.IO; using Amazon.Runtime; using Amazon.Runtime.Internal; namespace Amazon.GameLift.Model { /// <summary> /// Represents the returned data in response to a request action. /// </summary> public partial class DescribeGameSessionsResponse : AmazonWebServiceResponse { private List<GameSession> _gameSessions = new List<GameSession>(); private string _nextToken; /// <summary> /// Gets and sets the property GameSessions. /// <para> /// Collection of objects containing game session properties for each session matching /// the request. /// </para> /// </summary> public List<GameSession> GameSessions { get { return this._gameSessions; } set { this._gameSessions = value; } } // Check to see if GameSessions property is set internal bool IsSetGameSessions() { return this._gameSessions != null && this._gameSessions.Count > 0; } /// <summary> /// Gets and sets the property NextToken. /// <para> /// Token that indicates where to resume retrieving results on the next call to this action. /// If no token is returned, these results represent the end of the list. /// </para> /// </summary> [AWSProperty(Min=1, Max=1024)] public string NextToken { get { return this._nextToken; } set { this._nextToken = value; } } // Check to see if NextToken property is set internal bool IsSetNextToken() { return this._nextToken != null; } } }
31.987179
106
0.633667
[ "Apache-2.0" ]
FoxBearBear/aws-sdk-net
sdk/src/Services/GameLift/Generated/Model/DescribeGameSessionsResponse.cs
2,495
C#
using System.Collections.Generic; using FairyGUI.Utils; using UnityEngine; namespace FairyGUI { /// <summary> /// GRichTextField class. /// </summary> public class GRichTextField : GTextField { /// <summary> /// /// </summary> public RichTextField richTextField { get; private set; } public GRichTextField() : base() { } override protected void CreateDisplayObject() { richTextField = new RichTextField(); richTextField.gOwner = this; displayObject = richTextField; _textField = richTextField.textField; } override protected void SetTextFieldText() { string str = _text; if (_templateVars != null) str = ParseTemplate(str); _textField.maxWidth = maxWidth; if (_ubbEnabled) richTextField.htmlText = UBBParser.inst.Parse(str); else richTextField.htmlText = str; } override protected void GetTextFieldText() { _text = richTextField.text; } /// <summary> /// /// </summary> public Dictionary<uint, Emoji> emojies { get { return richTextField.emojies; } set { richTextField.emojies = value; } } } }
24.864407
68
0.505112
[ "MIT" ]
JoliChen/FairyGUI-unity
Assets/Scripts/UI/GRichTextField.cs
1,469
C#
// ---------------------------------------------------------------------------------- // // Copyright Microsoft Corporation // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // ---------------------------------------------------------------------------------- using Microsoft.Azure.Commands.HDInsight.Commands; using Microsoft.Azure.Commands.HDInsight.Models; using Microsoft.Azure.Management.HDInsight; using System.Collections; using System.Collections.Generic; using System.Management.Automation; namespace Microsoft.Azure.Commands.HDInsight { [Cmdlet( VerbsCommon.Add, Constants.CommandNames.AzureHDInsightConfigValues), OutputType( typeof(AzureHDInsightConfig))] public class AddAzureHDInsightConfigValuesCommand : HDInsightCmdletBase { private Dictionary<string, Hashtable> _configurations; #region Input Parameter Definitions [Parameter(Position = 0, Mandatory = true, ValueFromPipeline = true, HelpMessage = "The HDInsight cluster configuration to use when creating the new cluster.")] public AzureHDInsightConfig Config { get; set; } [Parameter(HelpMessage = "Gets the Core Site configurations of this HDInsight cluster.")] public Hashtable Core { get; set; } [Parameter(HelpMessage = "Gets the Hive Site configurations of this HDInsight cluster.")] public Hashtable HiveSite { get; set; } [Parameter(HelpMessage = "Gets the Hive Env configurations of this HDInsight cluster.")] public Hashtable HiveEnv { get; set; } [Parameter(HelpMessage = "Gets the Oozie Site configurations of this HDInsight cluster.")] public Hashtable OozieSite { get; set; } [Parameter(HelpMessage = "Gets the Oozie Env configurations of this HDInsight cluster.")] public Hashtable OozieEnv { get; set; } [Parameter(HelpMessage = "Gets the WebHCat Site configurations of this HDInsight cluster.")] public Hashtable WebHCat { get; set; } [Parameter(HelpMessage = "Gets the HBase Site configurations of this HDInsight cluster.")] public Hashtable HBaseSite { get; set; } [Parameter(HelpMessage = "Gets the HBase Env configurations of this HDInsight cluster.")] public Hashtable HBaseEnv { get; set; } [Parameter(HelpMessage = "Gets the Storm Site configurations of this HDInsight cluster.")] public Hashtable Storm { get; set; } [Parameter(HelpMessage = "Gets the Yarn Site configurations of this HDInsight cluster.")] public Hashtable Yarn { get; set; } [Parameter(HelpMessage = "Gets the MapRed Site configurations of this HDInsight cluster.")] public Hashtable MapRed { get; set; } [Parameter(HelpMessage = "Gets the Tez Site configurations of this HDInsight cluster.")] public Hashtable Tez { get; set; } [Parameter(HelpMessage = "Gets the Hdfs Site configurations of this HDInsight cluster.")] public Hashtable Hdfs { get; set; } #endregion public AddAzureHDInsightConfigValuesCommand() { Core = new Hashtable(); HiveSite = new Hashtable(); HiveEnv = new Hashtable(); OozieSite = new Hashtable(); OozieEnv = new Hashtable(); WebHCat = new Hashtable(); HBaseSite = new Hashtable(); HBaseEnv = new Hashtable(); Storm = new Hashtable(); Yarn = new Hashtable(); MapRed = new Hashtable(); Tez = new Hashtable(); Hdfs = new Hashtable(); } public override void ExecuteCmdlet() { _configurations = Config.Configurations ?? new Dictionary<string, Hashtable>(); AddConfigToConfigurations(Core, ConfigurationKey.CoreSite); AddConfigToConfigurations(HiveSite, ConfigurationKey.HiveSite); AddConfigToConfigurations(HiveEnv, ConfigurationKey.HiveEnv); AddConfigToConfigurations(OozieSite, ConfigurationKey.OozieSite); AddConfigToConfigurations(OozieEnv, ConfigurationKey.OozieEnv); AddConfigToConfigurations(WebHCat, ConfigurationKey.WebHCatSite); AddConfigToConfigurations(HBaseSite, ConfigurationKey.HBaseSite); AddConfigToConfigurations(HBaseEnv, ConfigurationKey.HBaseEnv); AddConfigToConfigurations(Storm, ConfigurationKey.StormSite); AddConfigToConfigurations(Yarn, ConfigurationKey.YarnSite); AddConfigToConfigurations(MapRed, ConfigurationKey.MapRedSite); AddConfigToConfigurations(Tez, ConfigurationKey.TezSite); AddConfigToConfigurations(Hdfs, ConfigurationKey.HdfsSite); WriteObject(Config); } private void AddConfigToConfigurations(Hashtable userConfigs, string configKey) { //var userConfigs = HashtableToDictionary(configs); //if no configs of this type provided, do nothing if (userConfigs == null || userConfigs.Count == 0) { return; } Hashtable config; //if configs provided and key does not already exist, add the key with provided dictionary if (!_configurations.TryGetValue(configKey, out config)) { _configurations.Add(configKey, userConfigs); return; } //if configs provided and key already exists, add the provided values to the dictionary for the key var updatedConfig = ConcatHashtables(config, userConfigs); _configurations[configKey] = updatedConfig; } private static Hashtable ConcatHashtables(Hashtable first, Hashtable second) { foreach (DictionaryEntry item in second) { first[item.Key] = item.Value; } return first; } } }
43.064935
112
0.629976
[ "MIT" ]
LaudateCorpus1/azure-powershell
src/ResourceManager/HDInsight/Commands.HDInsight/ManagementCommands/AddAzureHDInsightConfigValuesCommand.cs
6,481
C#
using System; using System.IO; using System.Linq; using Dalion.WebAppTemplate.Api.Controllers; using Dalion.WebAppTemplate.Api.Models.Links; using Dalion.WebAppTemplate.Api.Services; using Dalion.WebAppTemplate.Configuration; using Dalion.WebAppTemplate.Utils; using FluentAssertions; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.Options; using Xunit; namespace Dalion.WebAppTemplate.Startup { public class CompositionTests : IDisposable { private readonly ServiceProvider _serviceProvider; private readonly IConfiguration _configuration; public CompositionTests() { // Load real configuration _configuration = new ConfigurationBuilder() .SetBasePath(Path.GetDirectoryName(typeof(Program).Assembly.Location)) .AddJsonFile("appsettings.json", false, true) .AddJsonFile("appsettings.Development.json", false, true) .Build(); // Build services var serviceCollection = new ServiceCollection(); var bootstrapperSettings = new BootstrapperSettings { EntryAssembly = typeof(Program).Assembly, EnvironmentName = "", UseDetailedErrors = true }; var hostingEnvironment = new FakeHostingEnvironment(); Composition.ConfigureServices(serviceCollection, hostingEnvironment, _configuration, bootstrapperSettings); // Add registrations that are performed by the WebHostStartup serviceCollection .AddSingleton<IHostingEnvironment>(hostingEnvironment) .AddSingleton(bootstrapperSettings) .AddMvc() .AddApplicationPart(typeof(DefaultController).Assembly) .AddControllersAsServices() .AddApplicationPart(typeof(Controllers.DefaultController).Assembly) .AddControllersAsServices(); // Build service provider _serviceProvider = serviceCollection.BuildServiceProvider(); } public void Dispose() { _serviceProvider?.Dispose(); } [Fact] public void CanRegisterAllMvcControllers() { var apiAssembly = typeof(DefaultController).Assembly; var apiControllers = apiAssembly.GetTypes() .Where(t => typeof(Controller).IsAssignableFrom(t)) .Where(t => t.IsClass && !t.IsAbstract) .ToList(); apiControllers.ForEach(c => { var instance = _serviceProvider.GetRequiredService(c); instance.Should().NotBeNull().And.BeAssignableTo(c); }); var uiAssembly = typeof(Controllers.DefaultController).Assembly; var uiControllers = uiAssembly.GetTypes() .Where(t => typeof(Controller).IsAssignableFrom(t)) .Where(t => t.IsClass && !t.IsAbstract) .ToList(); uiControllers.ForEach(c => { var instance = _serviceProvider.GetRequiredService(c); instance.Should().NotBeNull().And.BeAssignableTo(c); }); } [Theory] [InlineData(typeof(IApiHomeResponseLinksCreatorFactory))] [InlineData(typeof(IUserInfoResponseLinksCreatorFactory))] [InlineData(typeof(IClaimLinksCreatorFactory))] [InlineData(typeof(IApplicationUriResolver))] [InlineData(typeof(IJsonSerializer))] [InlineData(typeof(IApplicationInfoProvider))] [InlineData(typeof(IFileProvider))] [InlineData(typeof(BootstrapperSettings))] public void CanResolveType(Type requestedType) { var instance = _serviceProvider.GetRequiredService(requestedType); instance.Should().NotBeNull().And.BeAssignableTo(requestedType); } [Theory] [InlineData(typeof(IOptions<AuthenticationSettings>))] [InlineData(typeof(AuthenticationSettings))] public void CanResolveOptions(Type requestedOptionsType) { var instance = _serviceProvider.GetService(requestedOptionsType); instance.Should().NotBeNull().And.BeAssignableTo(requestedOptionsType); } //[Theory] //[InlineData(typeof(IAccessTokenAcquirer), typeof(CachingAccessTokenAcquirer))] //public void CanRegisterDecorators(Type requestedType, Type expectedType) { // var instance = _serviceProvider.GetService(requestedType); // instance.Should().NotBeNull().And.BeOfType(expectedType); //} } }
43.054054
119
0.653275
[ "MIT" ]
DavidLievrouw/DalionWebAppTemplate
src/WebAppTemplate.Tests/Startup/CompositionTests.cs
4,781
C#
using System; namespace UnityEngine.Rendering.PostProcessing { /// <summary> /// This class holds settings for the Temporal Anti-aliasing (TAA) effect. /// </summary> [UnityEngine.Scripting.Preserve] [Serializable] public sealed class TemporalAntialiasing { /// <summary> /// The diameter (in texels) inside which jitter samples are spread. Smaller values result /// in crisper but more aliased output, while larger values result in more stable but /// blurrier output. /// </summary> [Tooltip("The diameter (in texels) inside which jitter samples are spread. Smaller values result in crisper but more aliased output, while larger values result in more stable, but blurrier, output.")] [Range(0.1f, 1f)] public float jitterSpread = 0.75f; /// <summary> /// Controls the amount of sharpening applied to the color buffer. High values may introduce /// dark-border artifacts. /// </summary> [Tooltip("Controls the amount of sharpening applied to the color buffer. High values may introduce dark-border artifacts.")] [Range(0f, 3f)] public float sharpness = 0.25f; /// <summary> /// The blend coefficient for a stationary fragment. Controls the percentage of history /// sample blended into the final color. /// </summary> [Tooltip("The blend coefficient for a stationary fragment. Controls the percentage of history sample blended into the final color.")] [Range(0f, 0.99f)] public float stationaryBlending = 0.95f; /// <summary> /// The blend coefficient for a fragment with significant motion. Controls the percentage of /// history sample blended into the final color. /// </summary> [Tooltip("The blend coefficient for a fragment with significant motion. Controls the percentage of history sample blended into the final color.")] [Range(0f, 0.99f)] public float motionBlending = 0.85f; // For custom jittered matrices - use at your own risks public Func<Camera, Vector2, Matrix4x4> jitteredMatrixFunc; public Vector2 jitter { get; private set; } enum Pass { SolverDilate, SolverNoDilate } readonly RenderTargetIdentifier[] m_Mrt = new RenderTargetIdentifier[2]; bool m_ResetHistory = true; const int k_SampleCount = 8; public int sampleIndex { get; private set; } // Ping-pong between two history textures as we can't read & write the same target in the // same pass const int k_NumEyes = 2; const int k_NumHistoryTextures = 2; readonly RenderTexture[][] m_HistoryTextures = new RenderTexture[k_NumEyes][]; readonly int[] m_HistoryPingPong = new int [k_NumEyes]; public bool IsSupported() { return SystemInfo.supportedRenderTargetCount >= 2 && SystemInfo.supportsMotionVectors #if !UNITY_2017_3_OR_NEWER && !RuntimeUtilities.isVREnabled #endif && SystemInfo.graphicsDeviceType != GraphicsDeviceType.OpenGLES2; } internal DepthTextureMode GetCameraFlags() { return DepthTextureMode.Depth | DepthTextureMode.MotionVectors; } internal void ResetHistory() { m_ResetHistory = true; } Vector2 GenerateRandomOffset() { // The variance between 0 and the actual halton sequence values reveals noticeable instability // in Unity's shadow maps, so we avoid index 0. var offset = new Vector2( HaltonSeq.Get((sampleIndex & 1023) + 1, 2) - 0.5f, HaltonSeq.Get((sampleIndex & 1023) + 1, 3) - 0.5f ); if (++sampleIndex >= k_SampleCount) sampleIndex = 0; return offset; } public Matrix4x4 GetJitteredProjectionMatrix(Camera camera) { Matrix4x4 cameraProj; jitter = GenerateRandomOffset(); jitter *= jitterSpread; if (jitteredMatrixFunc != null) { cameraProj = jitteredMatrixFunc(camera, jitter); } else { cameraProj = camera.orthographic ? RuntimeUtilities.GetJitteredOrthographicProjectionMatrix(camera, jitter) : RuntimeUtilities.GetJitteredPerspectiveProjectionMatrix(camera, jitter); } jitter = new Vector2(jitter.x / camera.pixelWidth, jitter.y / camera.pixelHeight); return cameraProj; } public void ConfigureJitteredProjectionMatrix(PostProcessRenderContext context) { var camera = context.camera; camera.nonJitteredProjectionMatrix = camera.projectionMatrix; camera.projectionMatrix = GetJitteredProjectionMatrix(camera); camera.useJitteredProjectionMatrixForTransparentRendering = false; } // TODO: We'll probably need to isolate most of this for SRPs public void ConfigureStereoJitteredProjectionMatrices(PostProcessRenderContext context) { #if UNITY_2017_3_OR_NEWER var camera = context.camera; jitter = GenerateRandomOffset(); jitter *= jitterSpread; for (var eye = Camera.StereoscopicEye.Left; eye <= Camera.StereoscopicEye.Right; eye++) { // This saves off the device generated projection matrices as non-jittered context.camera.CopyStereoDeviceProjectionMatrixToNonJittered(eye); var originalProj = context.camera.GetStereoNonJitteredProjectionMatrix(eye); // Currently no support for custom jitter func, as VR devices would need to provide // original projection matrix as input along with jitter var jitteredMatrix = RuntimeUtilities.GenerateJitteredProjectionMatrixFromOriginal(context, originalProj, jitter); context.camera.SetStereoProjectionMatrix(eye, jitteredMatrix); } // jitter has to be scaled for the actual eye texture size, not just the intermediate texture size // which could be double-wide in certain stereo rendering scenarios jitter = new Vector2(jitter.x / context.screenWidth, jitter.y / context.screenHeight); camera.useJitteredProjectionMatrixForTransparentRendering = false; #endif } void GenerateHistoryName(RenderTexture rt, int id, PostProcessRenderContext context) { rt.name = "Temporal Anti-aliasing History id #" + id; if (context.stereoActive) rt.name += " for eye " + context.xrActiveEye; } RenderTexture CheckHistory(int id, PostProcessRenderContext context) { int activeEye = context.xrActiveEye; if (m_HistoryTextures[activeEye] == null) m_HistoryTextures[activeEye] = new RenderTexture[k_NumHistoryTextures]; var rt = m_HistoryTextures[activeEye][id]; if (m_ResetHistory || rt == null || !rt.IsCreated()) { RenderTexture.ReleaseTemporary(rt); rt = context.GetScreenSpaceTemporaryRT(0, context.sourceFormat); GenerateHistoryName(rt, id, context); rt.filterMode = FilterMode.Bilinear; m_HistoryTextures[activeEye][id] = rt; context.command.BlitFullscreenTriangle(context.source, rt); } else if (rt.width != context.width || rt.height != context.height) { // On size change, simply copy the old history to the new one. This looks better // than completely discarding the history and seeing a few aliased frames. var rt2 = context.GetScreenSpaceTemporaryRT(0, context.sourceFormat); GenerateHistoryName(rt2, id, context); rt2.filterMode = FilterMode.Bilinear; m_HistoryTextures[activeEye][id] = rt2; context.command.BlitFullscreenTriangle(rt, rt2); RenderTexture.ReleaseTemporary(rt); } return m_HistoryTextures[activeEye][id]; } internal void Render(PostProcessRenderContext context) { var sheet = context.propertySheets.Get(context.resources.shaders.temporalAntialiasing); var cmd = context.command; cmd.BeginSample("TemporalAntialiasing"); int pp = m_HistoryPingPong[context.xrActiveEye]; var historyRead = CheckHistory(++pp % 2, context); var historyWrite = CheckHistory(++pp % 2, context); m_HistoryPingPong[context.xrActiveEye] = ++pp % 2; const float kMotionAmplification = 100f * 60f; sheet.properties.SetVector(ShaderIDs.Jitter, jitter); sheet.properties.SetFloat(ShaderIDs.Sharpness, sharpness); sheet.properties.SetVector(ShaderIDs.FinalBlendParameters, new Vector4(stationaryBlending, motionBlending, kMotionAmplification, 0f)); sheet.properties.SetTexture(ShaderIDs.HistoryTex, historyRead); // TODO: Account for different possible RenderViewportScale value from previous frame... int pass = context.camera.orthographic ? (int)Pass.SolverNoDilate : (int)Pass.SolverDilate; m_Mrt[0] = context.destination; m_Mrt[1] = historyWrite; cmd.BlitFullscreenTriangle(context.source, m_Mrt, context.source, sheet, pass); cmd.EndSample("TemporalAntialiasing"); m_ResetHistory = false; } internal void Release() { if (m_HistoryTextures != null) { for (int i = 0; i < m_HistoryTextures.Length; i++) { if (m_HistoryTextures[i] == null) continue; for (int j = 0; j < m_HistoryTextures[i].Length; j++) { RenderTexture.ReleaseTemporary(m_HistoryTextures[i][j]); m_HistoryTextures[i][j] = null; } m_HistoryTextures[i] = null; } } sampleIndex = 0; m_HistoryPingPong[0] = 0; m_HistoryPingPong[1] = 0; ResetHistory(); } } }
40.340909
208
0.609108
[ "MIT" ]
Agameofscones/2d_slipsworth_sim
2d_Slipsworth_Sim/Library/PackageCache/com.unity.postprocessing@2.2.2/PostProcessing/Runtime/Effects/TemporalAntialiasing.cs
10,650
C#
using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; using Library.Models; namespace Library.Controllers { public class HomeController : Controller { [HttpGet("/")] public ActionResult Index() { return View(); } } }
17.133333
42
0.684825
[ "MIT" ]
shanencross/Library
Library/Controllers/HomeController.cs
257
C#
namespace MassTransit.Testing.Implementations { using System; using System.Threading; using System.Threading.Tasks; using Util; /// <summary> /// An activity indicator for publish endpoints. Utilizes a timer that restarts on publish activity. /// </summary> public class BusActivityPublishIndicator : BaseBusActivityIndicatorConnectable, ISignalResource { readonly RollingTimer _receiveIdleTimer; readonly ISignalResource _signalResource; int _activityStarted; public BusActivityPublishIndicator(ISignalResource signalResource, TimeSpan receiveIdleTimeout) { _signalResource = signalResource; _receiveIdleTimer = new RollingTimer(SignalInactivity, receiveIdleTimeout); } public BusActivityPublishIndicator(ISignalResource signalResource) : this(signalResource, TimeSpan.FromSeconds(5)) { } public BusActivityPublishIndicator(TimeSpan receiveIdleTimeout) : this(null, receiveIdleTimeout) { } public BusActivityPublishIndicator() : this(null) { } public override bool IsMet => _receiveIdleTimer.Triggered || Interlocked.CompareExchange(ref _activityStarted, int.MinValue, int.MinValue) == 0; public void Signal() { SignalInactivity(null); } public Task PrePublish<T>(PublishContext<T> context) where T : class { Interlocked.CompareExchange(ref _activityStarted, 1, 0); _receiveIdleTimer.Restart(); return Task.CompletedTask; } public Task PostPublish<T>(PublishContext<T> context) where T : class { _receiveIdleTimer.Restart(); return Task.CompletedTask; } public Task PublishFault<T>(PublishContext<T> context, Exception exception) where T : class { _receiveIdleTimer.Restart(); return Task.CompletedTask; } void SignalInactivity(object state) { _signalResource?.Signal(); ConditionUpdated(); Interlocked.CompareExchange(ref _activityStarted, 0, 1); _receiveIdleTimer.Stop(); } } }
28.783133
104
0.608204
[ "ECL-2.0", "Apache-2.0" ]
AlexanderMeier/MassTransit
src/MassTransit/Testing/Implementations/BusActivityPublishIndicator.cs
2,389
C#
/* * * (c) Copyright Ascensio System Limited 2010-2020 * * 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.Configuration; using ASC.ElasticSearch.Config; namespace ASC.ElasticSearch.Service { public class Settings { private static readonly Settings DefaultSettings; static Settings() { DefaultSettings = new Settings { Scheme = "http", Host = "localhost", Port = 9200, Period = 1, MemoryLimit = 10 * 1024 * 1024L }; var cfg = ConfigurationManagerExtension.GetSection("elastic") as ElasticSection; if (cfg == null) return; DefaultSettings = new Settings { Scheme = cfg.Scheme, Host = cfg.Host, Port = cfg.Port, Period = cfg.Period, MemoryLimit = cfg.MemoryLimit }; } public string Host { get; set; } public int Port { get; set; } public string Scheme { get; set; } public int Period { get; set; } public long MemoryLimit { get; set; } public static Settings Default { get { return DefaultSettings; } } } }
26.647059
92
0.580022
[ "Apache-2.0" ]
Ektai-Solution-Pty-Ltd/CommunityServer
module/ASC.ElasticSearch/Service/Settings.cs
1,812
C#
using Surging.Core.CPlatform; namespace Surging.Core.Codec.MessagePack { public static class ContainerBuilderExtensions { /// <summary> /// 基于MessagePack序列化 /// </summary> /// <param name="builder"></param> /// <returns></returns> public static IServiceBuilder UseMessagePackCodec(this IServiceBuilder builder) { return builder.UseCodec<MessagePackTransportMessageCodecFactory>(); } } }
28
87
0.632353
[ "MIT" ]
YangTianb/Surging.Sample
src/Core/Surging.Core.Codec.MessagePack/ContainerBuilderExtensions.cs
488
C#
using Newtonsoft.Json; namespace Nest { [JsonObject] public class InstantGet<TDocument> where TDocument : class { [JsonProperty("fields")] public FieldValues Fields { get; internal set; } [JsonProperty("found")] public bool Found { get; internal set; } [JsonProperty("_source")] [JsonConverter(typeof(SourceConverter))] public TDocument Source { get; internal set; } } }
20.684211
59
0.712468
[ "Apache-2.0" ]
Henr1k80/elasticsearch-net
src/Nest/Search/Explain/ExplainGet.cs
395
C#
using Microsoft.AspNetCore.Builder; namespace Kledex.Extensions { public static class ApplicationBuilderExtensions { public static IKledexAppBuilder UseKledex(this IApplicationBuilder app) { return new KledexAppBuilder(app); } } }
23.333333
79
0.689286
[ "Apache-2.0" ]
Magicianred/Kledex
src/Kledex/Extensions/ApplicationBuilderExtensions.cs
282
C#
using System; using System.Collections.ObjectModel; using System.ComponentModel; using System.Diagnostics; using System.Linq; using Xamarin.Forms.CustomAttributes; using Xamarin.Forms.Internals; #if UITEST using Xamarin.Forms.Core.UITests; using Xamarin.UITest; using NUnit.Framework; #endif namespace Xamarin.Forms.Controls.Issues { #if UITEST [NUnit.Framework.Category(UITestCategories.CarouselView)] [NUnit.Framework.Category(UITestCategories.UwpIgnore)] #endif [Preserve(AllMembers = true)] [Issue(IssueTracker.Github, 12574, "CarouselView Loop=True default freezes iOS app", PlatformAffected.Default)] public class Issue12574 : TestContentPage { ViewModelIssue12574 viewModel; CarouselView _carouselView; Button _btn; string carouselAutomationId = "carouselView"; string btnRemoveAutomationId = "btnRemove"; protected override void Init() { _btn = new Button { Text = "Remove Last", AutomationId = btnRemoveAutomationId }; _btn.SetBinding(Button.CommandProperty, "RemoveItemsCommand"); // Initialize ui here instead of ctor _carouselView = new CarouselView { AutomationId = carouselAutomationId, Margin = new Thickness(30), BackgroundColor = Color.Yellow, ItemTemplate = new DataTemplate(() => { var stacklayout = new StackLayout(); var labelId = new Label(); var labelText = new Label(); var labelDescription = new Label(); labelId.SetBinding(Label.TextProperty, "Id"); labelText.SetBinding(Label.TextProperty, "Text"); labelDescription.SetBinding(Label.TextProperty, "Description"); stacklayout.Children.Add(labelId); stacklayout.Children.Add(labelText); stacklayout.Children.Add(labelDescription); return stacklayout; }) }; _carouselView.SetBinding(CarouselView.ItemsSourceProperty, "Items"); this.SetBinding(Page.TitleProperty, "Title"); var layout = new Grid(); layout.RowDefinitions.Add(new RowDefinition { Height = 100 }); layout.RowDefinitions.Add(new RowDefinition()); Grid.SetRow(_carouselView, 1); layout.Children.Add(_btn); layout.Children.Add(_carouselView); BindingContext = viewModel = new ViewModelIssue12574(); Content = layout; } protected override void OnAppearing() { base.OnAppearing(); viewModel.OnAppearing(); } #if UITEST [Test] [Ignore("Ignore while fix is not ready")] public void Issue12574Test() { RunningApp.WaitForElement("0 item"); var rect = RunningApp.Query(c => c.Marked(carouselAutomationId)).First().Rect; var centerX = rect.CenterX; var rightX = rect.X - 5; RunningApp.DragCoordinates(centerX + 40, rect.CenterY, rightX, rect.CenterY); RunningApp.WaitForElement("1 item"); RunningApp.DragCoordinates(centerX + 40, rect.CenterY, rightX, rect.CenterY); RunningApp.WaitForElement("2 item"); RunningApp.Tap(btnRemoveAutomationId); RunningApp.WaitForElement("1 item"); rightX = rect.X + rect.Width - 1; RunningApp.DragCoordinates(centerX, rect.CenterY, rightX, rect.CenterY); RunningApp.WaitForElement("0 item"); } #endif } [Preserve(AllMembers = true)] class ViewModelIssue12574 : BaseViewModel1 { public ObservableCollection<ModelIssue12574> Items { get; set; } public Command LoadItemsCommand { get; set; } public Command RemoveItemsCommand { get; set; } public ViewModelIssue12574() { Title = "CarouselView Looping"; Items = new ObservableCollection<ModelIssue12574>(); LoadItemsCommand = new Command(() => ExecuteLoadItemsCommand()); RemoveItemsCommand = new Command(() => ExecuteRemoveItemsCommand()); } void ExecuteRemoveItemsCommand() { Items.Remove(Items.Last()); } void ExecuteLoadItemsCommand() { IsBusy = true; try { Items.Clear(); for (int i = 0; i < 3; i++) { Items.Add(new ModelIssue12574 { Id = Guid.NewGuid().ToString(), Text = $"{i} item", Description = "This is an item description." }); } } catch (Exception ex) { Debug.WriteLine(ex); } finally { IsBusy = false; } } public void OnAppearing() { IsBusy = true; LoadItemsCommand.Execute(null); } } [Preserve(AllMembers = true)] class ModelIssue12574 { public string Id { get; set; } public string Text { get; set; } public string Description { get; set; } } class BaseViewModel1 : INotifyPropertyChanged { public string Title { get; set; } public bool IsInitialized { get; set; } bool _isBusy; /// <summary> /// Gets or sets if VM is busy working /// </summary> public bool IsBusy { get { return _isBusy; } set { _isBusy = value; OnPropertyChanged("IsBusy"); } } //INotifyPropertyChanged Implementation public event PropertyChangedEventHandler PropertyChanged; protected void OnPropertyChanged(string propertyName) { if (PropertyChanged == null) return; PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } }
25.435897
137
0.704839
[ "MIT" ]
BK-Forks/Xamarin.Forms
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue12574.cs
4,962
C#
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="BindableRichTextBox.cs" company="WildGums"> // Copyright (c) 2008 - 2015 WildGums. All rights reserved. // </copyright> // -------------------------------------------------------------------------------------------------------------------- namespace Orc.Controls.Example.ViewModels { using System.Windows.Documents; using Catel.MVVM; public class BindableRichTextBoxViewModel : ViewModelBase { #region Constructors public BindableRichTextBoxViewModel() { FlowDoc = CreateFlowDocument("This is example text colored with AccentColor"); ClearText = new Command(OnClearText); } #endregion #region Properties public FlowDocument FlowDoc { get; set; } public bool UseAccentText { get; set; } public Command ClearText { get; set; } #endregion #region Methods private void OnClearText() { FlowDoc = CreateFlowDocument(); } private FlowDocument CreateFlowDocument(string text = null) { var flowDoc = new FlowDocument(); var exampleParagraph = new Paragraph(new Run(text ?? string.Empty)); if (UseAccentText) { exampleParagraph.Foreground = Theming.ThemeManager.Current.GetAccentColorBrush().Clone(); } flowDoc.Blocks.Add(exampleParagraph); return flowDoc; } private void OnUseAccentTextChanged() { FlowDoc = CreateFlowDocument("This is example text colored with AccentColor"); } #endregion } }
29.616667
120
0.522791
[ "MIT" ]
0matyesz0/Orc.Controls
src/Orc.Controls.Example/ViewModels/BindableRichTextBoxViewModel.cs
1,779
C#
using Hevadea.Framework.UI; using Hevadea.Registry; using Hevadea.Tiles; using Hevadea.Utils; using Hevadea.Worlds; using Microsoft.Xna.Framework; using System; using Hevadea.Framework; namespace Hevadea.WorldGenerator.LevelFeatures { public class BspDecorator : LevelFeature { public Spacing Padding { get; set; } = new Spacing(4); public int Depth { get; set; } = 3; public override string GetName() { return "Generating bsp"; } public override float GetProgress() { return 0; } public bool GenerateWall { get; set; } = false; public bool GenerateFloor { get; set; } = false; public bool GeneratePath { get; set; } = false; public Tile Wall { get; set; } = TILES.ROCK; public Tile Floor { get; set; } = TILES.DIRT; public override void Apply(Generator gen, LevelGenerator levelGen, Level level) { var rnd = new Random(gen.Seed); var bound = Padding.Apply(new Rectangle(0, 0, level.Width, level.Height)); var tree = BspTree.BuildBspTree((int)Padding.Left, (int)Padding.Top, level.Width - (int)Padding.Left - (int)Padding.Right, level.Height - (int)Padding.Top - (int)Padding.Bottom, Depth, rnd); Build(tree.Root, rnd, level); } private void Build(BspTreeNode node, Random rnd, Level level) { if (node.HasChildrens) { var c0 = node.Item0.GetCenter(); var c1 = node.Item1.GetCenter(); Build(node.Item0, rnd, level); Build(node.Item1, rnd, level); if (GeneratePath) level.PlotLine(c0.X, c0.Y, c1.X, c1.Y, Floor); } else { if (GenerateFloor) level.FillRectangle(node.X, node.Y, node.Width, node.Height, Floor); if (GenerateWall) level.Rectangle(node.X, node.Y, node.Width, node.Height, Wall); } } } }
30.971014
88
0.547496
[ "MIT" ]
maker-dev/hevadea
Game/WorldGenerator/LevelFeatures/BspDecorator.cs
2,139
C#
using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using Zenject; /// <summary> /// Alien moving with Hook /// </summary> public class AlienStateMoving : AlienState { private Alien _alien; public AlienStateMoving( Alien alien) { _alien = alien; } public override void Start() { } public override void Update () { } public override void Dispose() { } [Serializable] public class Settings { } public class Factory : Factory<AlienStateMoving> { } }
13.043478
52
0.608333
[ "MIT" ]
LebEugenius/SpaceHook
Assets/Scripts/Alien/AlienStates/AlienStateMoving.cs
602
C#
#region License /* * All content copyright Marko Lahma, unless otherwise indicated. 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. * */ #endregion using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.Logging; using Quartz.Logging; using LogLevel = Microsoft.Extensions.Logging.LogLevel; namespace Quartz.Listener { /// <summary> /// Holds a List of references to TriggerListener instances and broadcasts all /// events to them (in order). /// </summary> /// <remarks> /// <para>The broadcasting behavior of this listener to delegate listeners may be /// more convenient than registering all of the listeners directly with the /// Scheduler, and provides the flexibility of easily changing which listeners /// get notified.</para> /// </remarks> /// <seealso cref="AddListener(ITriggerListener)" /> /// <seealso cref="RemoveListener(ITriggerListener)" /> /// <seealso cref="RemoveListener(string)" /> /// <author>James House (jhouse AT revolition DOT net)</author> public class BroadcastTriggerListener : ITriggerListener { private readonly List<ITriggerListener> listeners; private readonly ILogger<BroadcastTriggerListener> logger; /// <summary> /// Construct an instance with the given name. /// </summary> /// <remarks> /// (Remember to add some delegate listeners!) /// </remarks> /// <param name="name">the name of this instance</param> public BroadcastTriggerListener(string name) { Name = name ?? throw new ArgumentNullException(nameof(name), "Listener name cannot be null!"); listeners = new List<ITriggerListener>(); logger = LogProvider.CreateLogger<BroadcastTriggerListener>(); } /// <summary> /// Construct an instance with the given name, and List of listeners. /// </summary> /// <remarks> /// </remarks> /// <param name="name">the name of this instance</param> /// <param name="listeners">the initial List of TriggerListeners to broadcast to.</param> public BroadcastTriggerListener(string name, IReadOnlyCollection<ITriggerListener> listeners) : this(name) { this.listeners.AddRange(listeners); } public string Name { get; } public void AddListener(ITriggerListener listener) { listeners.Add(listener); } public bool RemoveListener(ITriggerListener listener) { return listeners.Remove(listener); } public bool RemoveListener(string listenerName) { ITriggerListener? listener = listeners.Find(x => x.Name == listenerName); if (listener != null) { listeners.Remove(listener); return true; } return false; } public IReadOnlyList<ITriggerListener> Listeners => listeners; public Task TriggerFired( ITrigger trigger, IJobExecutionContext context, CancellationToken cancellationToken = default) { return IterateListenersInGuard(l => l.TriggerFired(trigger, context, cancellationToken), nameof(TriggerFired)); } public async Task<bool> VetoJobExecution( ITrigger trigger, IJobExecutionContext context, CancellationToken cancellationToken = default) { foreach (var listener in listeners) { if (await listener.VetoJobExecution(trigger, context, cancellationToken).ConfigureAwait(false)) { return true; } } return false; } public Task TriggerMisfired(ITrigger trigger, CancellationToken cancellationToken = default) { return IterateListenersInGuard(l => l.TriggerMisfired(trigger, cancellationToken), nameof(TriggerMisfired)); } public Task TriggerComplete( ITrigger trigger, IJobExecutionContext context, SchedulerInstruction triggerInstructionCode, CancellationToken cancellationToken = default) { return IterateListenersInGuard(l => l.TriggerComplete(trigger, context, triggerInstructionCode, cancellationToken), nameof(TriggerComplete)); } private async Task IterateListenersInGuard(Func<ITriggerListener, Task> action, string methodName) { foreach (var listener in listeners) { try { await action(listener).ConfigureAwait(false); } catch (Exception e) { if (logger.IsEnabled(LogLevel.Error)) { logger.LogError(e,"Listener {ListenerName} - method {MethodName} raised an exception: {ExceptionMessage}", listener.Name,methodName,e.Message); } } } } } }
35.666667
153
0.613361
[ "Apache-2.0" ]
BearerPipelineTest/quartznet
src/Quartz/Listener/BroadcastTriggerListener.cs
5,778
C#
/* * Square Connect API * * Client library for accessing the Square Connect APIs * * OpenAPI spec version: 2.0 * Contact: developers@squareup.com * Generated by: https://github.com/swagger-api/swagger-codegen.git */ using NUnit.Framework; using System; using System.Linq; using System.IO; using System.Collections.Generic; using Square.Connect.Api; using Square.Connect.Model; using Square.Connect.Client; using System.Reflection; namespace Square.Connect.Test { /// <summary> /// Class for testing RefundStatus /// </summary> /// <remarks> /// This file is automatically generated by Swagger Codegen. /// Please update the test case below to test the model. /// </remarks> [TestFixture] public class RefundStatusTests { // TODO uncomment below to declare an instance variable for RefundStatus //private RefundStatus instance; /// <summary> /// Setup before each test /// </summary> [SetUp] public void Init() { // TODO uncomment below to create an instance of RefundStatus //instance = new RefundStatus(); } /// <summary> /// Clean up after each test /// </summary> [TearDown] public void Cleanup() { } /// <summary> /// Test an instance of RefundStatus /// </summary> [Test] public void RefundStatusInstanceTest() { // TODO uncomment below to test "IsInstanceOfType" RefundStatus //Assert.IsInstanceOfType<RefundStatus> (instance, "variable 'instance' is a RefundStatus"); } } }
23.633803
104
0.609654
[ "Apache-2.0" ]
NimmoJustin/connect-csharp-sdk
src/Square.Connect.Test/Model/RefundStatusTests.cs
1,678
C#
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) #pragma warning disable using System; using System.Collections; using System.IO; using System.Text; using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro; using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.EdEC; using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Oiw; using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Rosstandart; using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Sec; using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9; using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators; using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; using BestHTTP.SecureProtocol.Org.BouncyCastle.Pkcs; using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Security { public sealed class PrivateKeyFactory { private PrivateKeyFactory() { } public static AsymmetricKeyParameter CreateKey( byte[] privateKeyInfoData) { return CreateKey( PrivateKeyInfo.GetInstance( Asn1Object.FromByteArray(privateKeyInfoData))); } public static AsymmetricKeyParameter CreateKey( Stream inStr) { return CreateKey( PrivateKeyInfo.GetInstance( Asn1Object.FromStream(inStr))); } public static AsymmetricKeyParameter CreateKey( PrivateKeyInfo keyInfo) { AlgorithmIdentifier algID = keyInfo.PrivateKeyAlgorithm; DerObjectIdentifier algOid = algID.Algorithm; // TODO See RSAUtil.isRsaOid in Java build if (algOid.Equals(PkcsObjectIdentifiers.RsaEncryption) || algOid.Equals(X509ObjectIdentifiers.IdEARsa) || algOid.Equals(PkcsObjectIdentifiers.IdRsassaPss) || algOid.Equals(PkcsObjectIdentifiers.IdRsaesOaep)) { RsaPrivateKeyStructure keyStructure = RsaPrivateKeyStructure.GetInstance(keyInfo.ParsePrivateKey()); return new RsaPrivateCrtKeyParameters( keyStructure.Modulus, keyStructure.PublicExponent, keyStructure.PrivateExponent, keyStructure.Prime1, keyStructure.Prime2, keyStructure.Exponent1, keyStructure.Exponent2, keyStructure.Coefficient); } // TODO? // else if (algOid.Equals(X9ObjectIdentifiers.DHPublicNumber)) else if (algOid.Equals(PkcsObjectIdentifiers.DhKeyAgreement)) { DHParameter para = new DHParameter( Asn1Sequence.GetInstance(algID.Parameters.ToAsn1Object())); DerInteger derX = (DerInteger)keyInfo.ParsePrivateKey(); BigInteger lVal = para.L; int l = lVal == null ? 0 : lVal.IntValue; DHParameters dhParams = new DHParameters(para.P, para.G, null, l); return new DHPrivateKeyParameters(derX.Value, dhParams, algOid); } else if (algOid.Equals(OiwObjectIdentifiers.ElGamalAlgorithm)) { ElGamalParameter para = new ElGamalParameter( Asn1Sequence.GetInstance(algID.Parameters.ToAsn1Object())); DerInteger derX = (DerInteger)keyInfo.ParsePrivateKey(); return new ElGamalPrivateKeyParameters( derX.Value, new ElGamalParameters(para.P, para.G)); } else if (algOid.Equals(X9ObjectIdentifiers.IdDsa)) { DerInteger derX = (DerInteger)keyInfo.ParsePrivateKey(); Asn1Encodable ae = algID.Parameters; DsaParameters parameters = null; if (ae != null) { DsaParameter para = DsaParameter.GetInstance(ae.ToAsn1Object()); parameters = new DsaParameters(para.P, para.Q, para.G); } return new DsaPrivateKeyParameters(derX.Value, parameters); } else if (algOid.Equals(X9ObjectIdentifiers.IdECPublicKey)) { X962Parameters para = X962Parameters.GetInstance(algID.Parameters.ToAsn1Object()); X9ECParameters x9; if (para.IsNamedCurve) { x9 = ECKeyPairGenerator.FindECCurveByOid((DerObjectIdentifier)para.Parameters); } else { x9 = new X9ECParameters((Asn1Sequence)para.Parameters); } ECPrivateKeyStructure ec = ECPrivateKeyStructure.GetInstance(keyInfo.ParsePrivateKey()); BigInteger d = ec.GetKey(); if (para.IsNamedCurve) { return new ECPrivateKeyParameters("EC", d, (DerObjectIdentifier)para.Parameters); } ECDomainParameters dParams = new ECDomainParameters(x9.Curve, x9.G, x9.N, x9.H, x9.GetSeed()); return new ECPrivateKeyParameters(d, dParams); } else if (algOid.Equals(CryptoProObjectIdentifiers.GostR3410x2001)) { Gost3410PublicKeyAlgParameters gostParams = Gost3410PublicKeyAlgParameters.GetInstance( algID.Parameters.ToAsn1Object()); ECDomainParameters ecP = ECGost3410NamedCurves.GetByOid(gostParams.PublicKeyParamSet); if (ecP == null) throw new ArgumentException("Unrecognized curve OID for GostR3410x2001 private key"); Asn1Object privKey = keyInfo.ParsePrivateKey(); ECPrivateKeyStructure ec; if (privKey is DerInteger) { ec = new ECPrivateKeyStructure(ecP.N.BitLength, ((DerInteger)privKey).PositiveValue); } else { ec = ECPrivateKeyStructure.GetInstance(privKey); } return new ECPrivateKeyParameters("ECGOST3410", ec.GetKey(), gostParams.PublicKeyParamSet); } else if (algOid.Equals(CryptoProObjectIdentifiers.GostR3410x94)) { Gost3410PublicKeyAlgParameters gostParams = Gost3410PublicKeyAlgParameters.GetInstance(algID.Parameters); Asn1Object privKey = keyInfo.ParsePrivateKey(); BigInteger x; if (privKey is DerInteger) { x = DerInteger.GetInstance(privKey).PositiveValue; } else { x = new BigInteger(1, Arrays.Reverse(Asn1OctetString.GetInstance(privKey).GetOctets())); } return new Gost3410PrivateKeyParameters(x, gostParams.PublicKeyParamSet); } else if (algOid.Equals(EdECObjectIdentifiers.id_X25519)) { return new X25519PrivateKeyParameters(GetRawKey(keyInfo, X25519PrivateKeyParameters.KeySize), 0); } else if (algOid.Equals(EdECObjectIdentifiers.id_X448)) { return new X448PrivateKeyParameters(GetRawKey(keyInfo, X448PrivateKeyParameters.KeySize), 0); } else if (algOid.Equals(EdECObjectIdentifiers.id_Ed25519)) { return new Ed25519PrivateKeyParameters(GetRawKey(keyInfo, Ed25519PrivateKeyParameters.KeySize), 0); } else if (algOid.Equals(EdECObjectIdentifiers.id_Ed448)) { return new Ed448PrivateKeyParameters(GetRawKey(keyInfo, Ed448PrivateKeyParameters.KeySize), 0); } else if (algOid.Equals(RosstandartObjectIdentifiers.id_tc26_gost_3410_12_512) || algOid.Equals(RosstandartObjectIdentifiers.id_tc26_gost_3410_12_256)) { Gost3410PublicKeyAlgParameters gostParams = Gost3410PublicKeyAlgParameters.GetInstance(keyInfo.PrivateKeyAlgorithm.Parameters); ECGost3410Parameters ecSpec = null; BigInteger d = null; Asn1Object p = keyInfo.PrivateKeyAlgorithm.Parameters.ToAsn1Object(); if (p is Asn1Sequence && (Asn1Sequence.GetInstance(p).Count == 2 || Asn1Sequence.GetInstance(p).Count == 3)) { ECDomainParameters ecP = ECGost3410NamedCurves.GetByOid(gostParams.PublicKeyParamSet); ecSpec = new ECGost3410Parameters( new ECNamedDomainParameters( gostParams.PublicKeyParamSet, ecP), gostParams.PublicKeyParamSet, gostParams.DigestParamSet, gostParams.EncryptionParamSet); Asn1OctetString privEnc = keyInfo.PrivateKeyData; if (privEnc.GetOctets().Length == 32 || privEnc.GetOctets().Length == 64) { byte[] dVal = Arrays.Reverse(privEnc.GetOctets()); d = new BigInteger(1, dVal); } else { Asn1Encodable privKey = keyInfo.ParsePrivateKey(); if (privKey is DerInteger) { d = DerInteger.GetInstance(privKey).PositiveValue; } else { byte[] dVal = Arrays.Reverse(Asn1OctetString.GetInstance(privKey).GetOctets()); d = new BigInteger(1, dVal); } } } else { X962Parameters parameters = X962Parameters.GetInstance(keyInfo.PrivateKeyAlgorithm.Parameters); if (parameters.IsNamedCurve) { DerObjectIdentifier oid = DerObjectIdentifier.GetInstance(parameters.Parameters); X9ECParameters ecP = ECNamedCurveTable.GetByOid(oid); if (ecP == null) { ECDomainParameters gParam = ECGost3410NamedCurves.GetByOid(oid); ecSpec = new ECGost3410Parameters(new ECNamedDomainParameters( oid, gParam.Curve, gParam.G, gParam.N, gParam.H, gParam.GetSeed()), gostParams.PublicKeyParamSet, gostParams.DigestParamSet, gostParams.EncryptionParamSet); } else { ecSpec = new ECGost3410Parameters(new ECNamedDomainParameters( oid, ecP.Curve, ecP.G, ecP.N, ecP.H, ecP.GetSeed()), gostParams.PublicKeyParamSet, gostParams.DigestParamSet, gostParams.EncryptionParamSet); } } else if (parameters.IsImplicitlyCA) { ecSpec = null; } else { X9ECParameters ecP = X9ECParameters.GetInstance(parameters.Parameters); ecSpec = new ECGost3410Parameters(new ECNamedDomainParameters( algOid, ecP.Curve, ecP.G, ecP.N, ecP.H, ecP.GetSeed()), gostParams.PublicKeyParamSet, gostParams.DigestParamSet, gostParams.EncryptionParamSet); } Asn1Encodable privKey = keyInfo.ParsePrivateKey(); if (privKey is DerInteger) { DerInteger derD = DerInteger.GetInstance(privKey); d = derD.Value; } else { ECPrivateKeyStructure ec = ECPrivateKeyStructure.GetInstance(privKey); d = ec.GetKey(); } } return new ECPrivateKeyParameters( d, new ECGost3410Parameters( ecSpec, gostParams.PublicKeyParamSet, gostParams.DigestParamSet, gostParams.EncryptionParamSet)); } else { throw new SecurityUtilityException("algorithm identifier in private key not recognised"); } } private static byte[] GetRawKey(PrivateKeyInfo keyInfo, int expectedSize) { byte[] result = Asn1OctetString.GetInstance(keyInfo.ParsePrivateKey()).GetOctets(); if (expectedSize != result.Length) throw new SecurityUtilityException("private key encoding has incorrect length"); return result; } public static AsymmetricKeyParameter DecryptKey( char[] passPhrase, EncryptedPrivateKeyInfo encInfo) { return CreateKey(PrivateKeyInfoFactory.CreatePrivateKeyInfo(passPhrase, encInfo)); } public static AsymmetricKeyParameter DecryptKey( char[] passPhrase, byte[] encryptedPrivateKeyInfoData) { return DecryptKey(passPhrase, Asn1Object.FromByteArray(encryptedPrivateKeyInfoData)); } public static AsymmetricKeyParameter DecryptKey( char[] passPhrase, Stream encryptedPrivateKeyInfoStream) { return DecryptKey(passPhrase, Asn1Object.FromStream(encryptedPrivateKeyInfoStream)); } private static AsymmetricKeyParameter DecryptKey( char[] passPhrase, Asn1Object asn1Object) { return DecryptKey(passPhrase, EncryptedPrivateKeyInfo.GetInstance(asn1Object)); } public static byte[] EncryptKey( DerObjectIdentifier algorithm, char[] passPhrase, byte[] salt, int iterationCount, AsymmetricKeyParameter key) { return EncryptedPrivateKeyInfoFactory.CreateEncryptedPrivateKeyInfo( algorithm, passPhrase, salt, iterationCount, key).GetEncoded(); } public static byte[] EncryptKey( string algorithm, char[] passPhrase, byte[] salt, int iterationCount, AsymmetricKeyParameter key) { return EncryptedPrivateKeyInfoFactory.CreateEncryptedPrivateKeyInfo( algorithm, passPhrase, salt, iterationCount, key).GetEncoded(); } } } #pragma warning restore #endif
42.571046
143
0.546193
[ "MIT" ]
Bregermann/TargetCrack
Target Crack/Assets/Best HTTP/Source/SecureProtocol/security/PrivateKeyFactory.cs
15,879
C#
using System; using System.Collections.Generic; using System.Data.Entity; using System.Data.Entity.Infrastructure; using System.Linq; using System.Net; using System.Net.Http; using System.Web.Http; using Microsoft.AspNet.Identity; using WebApiExternalAuth.Models; namespace WebApiExternalAuth.Controllers { [Authorize] [RoutePrefix("api/Todo")] public class TodoController : ApiController { private TodoDbContext db = new TodoDbContext(); // PUT api/Todo/5 [HttpPut("{id}", RouteName = "TodoItem")] public IHttpActionResult PutTodoItem(int id, TodoItemViewModel todoItemDto) { if (!ModelState.IsValid) { return Message(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState)); } if (id != todoItemDto.TodoItemId) { return StatusCode(HttpStatusCode.BadRequest); } TodoItem todoItem = todoItemDto.ToEntity(); TodoList todoList = db.TodoLists.Find(todoItem.TodoListId); if (todoList == null) { return StatusCode(HttpStatusCode.NotFound); } if (!String.Equals(todoList.UserId, User.Identity.GetUserId(), StringComparison.OrdinalIgnoreCase)) { // Trying to modify a record that does not belong to the user return StatusCode(HttpStatusCode.Unauthorized); } // Need to detach to avoid duplicate primary key exception when SaveChanges is called db.Entry(todoList).State = EntityState.Detached; db.Entry(todoItem).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { return StatusCode(HttpStatusCode.InternalServerError); } return StatusCode(HttpStatusCode.OK); } // POST api/Todo [HttpPost("")] public IHttpActionResult PostTodoItem(TodoItemViewModel todoItemDto) { if (!ModelState.IsValid) { return Message(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState)); } TodoList todoList = db.TodoLists.Find(todoItemDto.TodoListId); if (todoList == null) { return StatusCode(HttpStatusCode.NotFound); } if (!String.Equals(todoList.UserId, User.Identity.GetUserId(), StringComparison.OrdinalIgnoreCase)) { // Trying to add a record that does not belong to the user return StatusCode(HttpStatusCode.Unauthorized); } TodoItem todoItem = todoItemDto.ToEntity(); // Need to detach to avoid loop reference exception during JSON serialization db.Entry(todoList).State = EntityState.Detached; db.TodoItems.Add(todoItem); db.SaveChanges(); todoItemDto.TodoItemId = todoItem.TodoItemId; HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.Created, todoItemDto); response.Headers.Location = new Uri(Url.Link("TodoItem", new { id = todoItemDto.TodoItemId })); return Message(response); } // DELETE api/Todo/5 [HttpDelete("{id}")] public IHttpActionResult DeleteTodoItem(int id) { TodoItem todoItem = db.TodoItems.Find(id); if (todoItem == null) { return StatusCode(HttpStatusCode.NotFound); } if (!String.Equals(db.Entry(todoItem.TodoList).Entity.UserId, User.Identity.GetUserId(), StringComparison.OrdinalIgnoreCase)) { // Trying to delete a record that does not belong to the user return StatusCode(HttpStatusCode.Unauthorized); } TodoItemViewModel todoItemDto = new TodoItemViewModel(todoItem); db.TodoItems.Remove(todoItem); try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { return StatusCode(HttpStatusCode.InternalServerError); } return Content(HttpStatusCode.OK, todoItemDto); } protected override void Dispose(bool disposing) { db.Dispose(); base.Dispose(disposing); } } }
33.6
137
0.588183
[ "Apache-2.0" ]
dotnetcurry/webapi2-twitter-auth
WebApiExternalAuth/Controllers/TodoController.cs
4,538
C#
using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Runtime.CompilerServices; using System.Windows; using System.Windows.Controls; using System.Windows.Input; using System.Windows.Media; using System.Windows.Shapes; using Newtonsoft.Json; using JetBrains.Annotations; using WaveShaper.Commands; using WaveShaper.Core.Bezier; using WaveShaper.Wpf; namespace WaveShaper.Bezier { /// <summary> /// Interaction logic for BezierControl.xaml /// </summary> public partial class BezierControl : UserControl, INotifyPropertyChanged { private const double Offset = 40; private readonly List<BezierFigure> bezierFigures = new List<BezierFigure>(); private readonly Stack<List<BezierCurve>> stackUndo = new Stack<List<BezierCurve>>(); private readonly Stack<List<BezierCurve>> stackRedo = new Stack<List<BezierCurve>>(); private string currentMousePosition; private Point dragLastPoint; private bool dragIsDragged; public BezierControl() { InitializeComponent(); Loaded += OnLoaded; UndoCommand = new ActionCommand(p => { stackRedo.Push(GetCurves().ToList()); RestoreStateFromStack(stackUndo); RedoCommand.OnCanExecuteChanged(); }, p => stackUndo.Count > 0); RedoCommand = new ActionCommand(p => { stackUndo.Push(GetCurves().ToList()); RestoreStateFromStack(stackRedo); UndoCommand.OnCanExecuteChanged(); }, p => stackRedo.Count > 0); ButtonUndo.Command = UndoCommand; ButtonRedo.Command = RedoCommand; ButtonInfo.Command = new ActionCommand(p => DumpCurvesInfo(), p => true); } private Size AreaSize { get; set; } private Point AreaTopLeft { get; set; } public ActionCommand UndoCommand { get; set; } public ActionCommand RedoCommand { get; set; } public string CurrentMousePosition { get => currentMousePosition; set { if (value == currentMousePosition) return; currentMousePosition = value; OnPropertyChanged(); } } public IEnumerable<BezierCurve> GetCurves() => bezierFigures.Select(ConvertFigureToCurve).ToList(); private BezierCurve ConvertFigureToCurve(BezierFigure figure) { return new BezierCurve { Id = figure.Id, P0 = ConvertPointFromCanvas(figure.StartPoint), P1 = ConvertPointFromCanvas(figure.StartBezierPoint), P2 = ConvertPointFromCanvas(figure.EndBezierPoint), P3 = ConvertPointFromCanvas(figure.EndPoint), Next = figure.NextFigure?.Id, Prev = figure.PreviousFigure?.Id }; } private BezierFigure ConvertCurveToFigure(BezierCurve curve) { return new BezierFigure { Id = curve.Id, StartPoint = ConvertPointToCanvas(curve.P0), StartBezierPoint = ConvertPointToCanvas(curve.P1), EndBezierPoint = ConvertPointToCanvas(curve.P2), EndPoint = ConvertPointToCanvas(curve.P3) }; } internal Point ConvertPointFromCanvas(Point canvasPoint) { double x = (canvasPoint.X - AreaTopLeft.X)/AreaSize.Width; double y = 1.0 - (canvasPoint.Y - AreaTopLeft.Y)/AreaSize.Height; return new Point(x, y); } private Point ConvertPointToCanvas(Point point) { double x = point.X*AreaSize.Width + AreaTopLeft.X; double y = (1.0 - point.Y)*AreaSize.Height + AreaTopLeft.Y; return new Point(x, y); } private void OnLoaded(object sender, RoutedEventArgs routedEventArgs) { InitCanvasBorder(); if (AreaSize == default(Size)) return; AddCanvasText("0", new Point(-0.03, 0)); AddCanvasText("1", new Point(0.99, 0)); AddCanvasText("1", new Point(-0.03, 1.02)); if (!bezierFigures.Any()) ClearAndSetCurves(BezierCurve.GetIdentity(), saveCurrentState: false); } private void AddCanvasText(string text, Point normalisedPoint) { var tb = new TextBlock {Text = text, }; Canvas.Children.Add(tb); var p = ConvertPointToCanvas(normalisedPoint); Canvas.SetLeft(tb, p.X); Canvas.SetTop(tb, p.Y); } private void AddFigure(BezierFigure f) { Canvas.Children.Add(f); bezierFigures.Add(f); } private void RemoveFigure(BezierFigure f) { Canvas.Children.Remove(f); bezierFigures.Remove(f); } private void InitCanvasBorder() { Size size = this.RenderSize; Size canvaSize = Canvas.RenderSize; if (size == default(Size) || canvaSize == default(Size)) return; double min = Math.Min(size.Height, size.Width); min -= 2*Offset; AreaSize = new Size(min, min); double areaLeft = (canvaSize.Width + AreaSize.Width)/2d; double areaTop = (canvaSize.Height/2) - (AreaSize.Height/2); AreaTopLeft = new Point(areaLeft, areaTop); Canvas.Children.Add(new Line { X1 = AreaTopLeft.X, Y1 = AreaTopLeft.Y + (AreaSize.Height / 2), X2 = AreaTopLeft.X + AreaSize.Width, Y2 = AreaTopLeft.Y + (AreaSize.Height / 2), StrokeThickness = 1, Stroke = Brushes.LightGray }); Canvas.Children.Add(new Line { X1 = AreaTopLeft.X + (AreaSize.Width / 2), Y1 = AreaTopLeft.Y, X2 = AreaTopLeft.X + (AreaSize.Width / 2), Y2 = AreaTopLeft.Y + AreaSize.Height, StrokeThickness = 1, Stroke = Brushes.LightGray, }); var rect = new Rectangle { Width = AreaSize.Width, Height = AreaSize.Height, Stroke = Brushes.Black, StrokeThickness = 1 }; Canvas.Children.Add(rect); Canvas.SetLeft(rect, AreaTopLeft.X); Canvas.SetTop(rect, AreaTopLeft.Y); var m = new Matrix(); m.Translate(-AreaTopLeft.X + Offset, -AreaTopLeft.Y + Offset); CanvasTransform.Matrix = m; } private void BezierFigure_OnMouseLeftButtonUp(object sender, MouseButtonEventArgs e) { SaveStateToStack(); Point p = ConvertPointFromCanvas(e.GetPosition(Canvas)); var bf = WpfUtil.FindParent<BezierFigure>(e.Source as DependencyObject); BezierCurve bc = ConvertFigureToCurve(bf); Tuple<BezierCurve, BezierCurve> newCurves = bc.Split(p); BezierFigure bf1 = ConvertCurveToFigure(newCurves.Item1); BezierFigure bf2 = ConvertCurveToFigure(newCurves.Item2); if (bf.PreviousFigure != null) bf1.PreviousFigure = bf.PreviousFigure; bf1.NextFigure = bf2; if (bf.NextFigure != null) bf2.NextFigure = bf.NextFigure; RemoveFigure(bf); AddFigure(bf1); AddFigure(bf2); } public void SaveStateToStack(List<BezierCurve> curves = null) { curves = curves ?? GetCurves().ToList(); stackUndo.Push(curves); stackRedo.Clear(); UndoCommand.OnCanExecuteChanged(); RedoCommand.OnCanExecuteChanged(); } private void RestoreStateFromStack(Stack<List<BezierCurve>> stack) { if (stack.Count == 0) return; ClearAndSetCurves(stack.Pop(), saveCurrentState: false); } public void ClearAndSetCurves(ICollection<BezierCurve> curves, bool saveCurrentState = true) { if (saveCurrentState) SaveStateToStack(); var newFigures = curves.Select(ConvertCurveToFigure).ToDictionary(f => f.Id, f => f); foreach (var bf in bezierFigures.ToArray()) RemoveFigure(bf); foreach (BezierCurve c in curves.Where(c => c.Next != null)) // ReSharper disable once PossibleInvalidOperationException newFigures[c.Id].NextFigure = newFigures[c.Next.Value]; foreach (BezierFigure bf in newFigures.Values) AddFigure(bf); } private void Canvas_OnMouseMove(object sender, MouseEventArgs e) { Point p = e.GetPosition(Canvas); p = ConvertPointFromCanvas(p); p.X = Math.Round(p.X, 2); p.Y = Math.Round(p.Y, 2); CurrentMousePosition = $"X: {p.X:0.00}\nY: {p.Y:0.00}"; if (!dragIsDragged) return; if (e.RightButton != MouseButtonState.Pressed || !Canvas.IsMouseCaptured) return; var pos = e.GetPosition(this); var matrix = CanvasTransform.Matrix; matrix.Translate(pos.X - dragLastPoint.X, pos.Y - dragLastPoint.Y); CanvasTransform.Matrix = matrix; dragLastPoint = pos; } public event PropertyChangedEventHandler PropertyChanged; [NotifyPropertyChangedInvocator] protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } private void Canvas_OnMouseRightButtonDown(object sender, MouseButtonEventArgs e) { Canvas.CaptureMouse(); dragLastPoint = e.GetPosition(this); dragIsDragged = true; } private void Canvas_OnMouseRightButtonUp(object sender, MouseButtonEventArgs e) { Canvas.ReleaseMouseCapture(); dragIsDragged = false; } private void DumpCurvesInfo() { var curves = GetCurves().ToList(); string json = JsonConvert.SerializeObject(curves, Formatting.Indented); var r = MessageBox.Show(json, "Current curves (OK to copy)", MessageBoxButton.OKCancel, MessageBoxImage.Information); if (r == MessageBoxResult.OK) Clipboard.SetText(json); } } }
33.909375
129
0.569994
[ "MIT" ]
jenzy/WaveShaper
src/WaveShaper/Bezier/BezierControl.xaml.cs
10,853
C#
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. namespace AppInstallerCLIE2ETests { using Microsoft.Win32; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using NUnit.Framework; using System; using System.IO; [SetUpFixture] public class SetUpFixture { private static bool ShouldDisableDevModeOnExit = true; private static bool ShouldRevertDefaultFileTypeRiskOnExit = true; private static string DefaultFileTypes = string.Empty; [OneTimeSetUp] public void Setup() { // Read TestParameters and set runtime variables TestCommon.PackagedContext = TestContext.Parameters.Exists(Constants.PackagedContextParameter) && TestContext.Parameters.Get(Constants.PackagedContextParameter).Equals("true", StringComparison.OrdinalIgnoreCase); TestCommon.VerboseLogging = TestContext.Parameters.Exists(Constants.VerboseLoggingParameter) && TestContext.Parameters.Get(Constants.VerboseLoggingParameter).Equals("true", StringComparison.OrdinalIgnoreCase); TestCommon.LooseFileRegistration = TestContext.Parameters.Exists(Constants.LooseFileRegistrationParameter) && TestContext.Parameters.Get(Constants.LooseFileRegistrationParameter).Equals("true", StringComparison.OrdinalIgnoreCase); TestCommon.InvokeCommandInDesktopPackage = TestContext.Parameters.Exists(Constants.InvokeCommandInDesktopPackageParameter) && TestContext.Parameters.Get(Constants.InvokeCommandInDesktopPackageParameter).Equals("true", StringComparison.OrdinalIgnoreCase); if (TestContext.Parameters.Exists(Constants.AICLIPathParameter)) { TestCommon.AICLIPath = TestContext.Parameters.Get(Constants.AICLIPathParameter); } else { if (TestCommon.PackagedContext) { // For packaged context, default to AppExecutionAlias TestCommon.AICLIPath = "WinGetDev.exe"; } else { TestCommon.AICLIPath = TestCommon.GetTestFile("winget.exe"); } } if (TestContext.Parameters.Exists(Constants.AICLIPackagePathParameter)) { TestCommon.AICLIPackagePath = TestContext.Parameters.Get(Constants.AICLIPackagePathParameter); } else { TestCommon.AICLIPackagePath = TestCommon.GetTestFile("AppInstallerCLIPackage.appxbundle"); } if (TestCommon.LooseFileRegistration && TestCommon.InvokeCommandInDesktopPackage) { TestCommon.AICLIPath = Path.Combine(TestCommon.AICLIPackagePath, TestCommon.AICLIPath); } ShouldDisableDevModeOnExit = EnableDevMode(true); ShouldRevertDefaultFileTypeRiskOnExit = DecreaseFileTypeRisk(".exe;.msi", false); Assert.True(TestCommon.RunCommand("certutil.exe", "-addstore -f \"TRUSTEDPEOPLE\" " + TestCommon.GetTestDataFile(Constants.AppInstallerTestCert)), "Add AppInstallerTestCert"); if (TestCommon.PackagedContext) { if (TestCommon.LooseFileRegistration) { Assert.True(TestCommon.InstallMsixRegister(TestCommon.AICLIPackagePath), "InstallMsixRegister"); } else { Assert.True(TestCommon.InstallMsix(TestCommon.AICLIPackagePath), "InstallMsix"); } } if (TestContext.Parameters.Exists(Constants.StaticFileRootPathParameter)) { TestCommon.StaticFileRootPath = TestContext.Parameters.Get(Constants.StaticFileRootPathParameter); } else { TestCommon.StaticFileRootPath = Path.GetTempPath(); } if (TestContext.Parameters.Exists(Constants.PackageCertificatePathParameter)) { TestCommon.PackageCertificatePath = TestContext.Parameters.Get(Constants.PackageCertificatePathParameter); } ReadTestInstallerPaths(); TestIndexSetup.GenerateTestDirectory(); InitializeWingetSettings(); } [OneTimeTearDown] public void TearDown() { if (ShouldDisableDevModeOnExit) { EnableDevMode(false); } if (ShouldRevertDefaultFileTypeRiskOnExit) { DecreaseFileTypeRisk(DefaultFileTypes, true); } TestCommon.RunCommand("certutil.exe", $"-delstore \"TRUSTEDPEOPLE\" {Constants.AppInstallerTestCertThumbprint}"); TestCommon.PublishE2ETestLogs(); if (TestCommon.PackagedContext) { TestCommon.RemoveMsix(Constants.AICLIPackageName); } } // Returns whether there's a change to the dev mode state after execution private bool EnableDevMode(bool enable) { var appModelUnlockKey = Registry.LocalMachine.CreateSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock"); if (enable) { var value = appModelUnlockKey.GetValue("AllowDevelopmentWithoutDevLicense"); if (value == null || (Int32)value == 0) { appModelUnlockKey.SetValue("AllowDevelopmentWithoutDevLicense", 1, RegistryValueKind.DWord); return true; } } else { var value = appModelUnlockKey.GetValue("AllowDevelopmentWithoutDevLicense"); if (value != null && ((Int32)value) != 0) { appModelUnlockKey.SetValue("AllowDevelopmentWithoutDevLicense", 0, RegistryValueKind.DWord); return true; } } return false; } private bool DecreaseFileTypeRisk(string fileTypes, bool revert) { var defaultFileTypeRiskKey = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Associations"); string value = (string)defaultFileTypeRiskKey.GetValue("DefaultFileTypeRisk"); if (revert) { defaultFileTypeRiskKey.SetValue("LowRiskFileTypes", fileTypes); return false; } else { if (string.IsNullOrEmpty(value)) { DefaultFileTypes = string.Empty; defaultFileTypeRiskKey.SetValue("LowRiskFileTypes", fileTypes); } else { DefaultFileTypes = value; defaultFileTypeRiskKey.SetValue("LowRiskFileTypes", string.Concat(value, fileTypes)); } return true; } } private void ReadTestInstallerPaths() { if (TestContext.Parameters.Exists(Constants.ExeInstallerPathParameter) && File.Exists(TestContext.Parameters.Get(Constants.ExeInstallerPathParameter))) { TestCommon.ExeInstallerPath = TestContext.Parameters.Get(Constants.ExeInstallerPathParameter); } if (TestContext.Parameters.Exists(Constants.MsiInstallerPathParameter) && File.Exists(TestContext.Parameters.Get(Constants.MsiInstallerPathParameter))) { TestCommon.MsiInstallerPath = TestContext.Parameters.Get(Constants.MsiInstallerPathParameter); } if (TestContext.Parameters.Exists(Constants.MsixInstallerPathParameter) && File.Exists(TestContext.Parameters.Get(Constants.MsixInstallerPathParameter))) { TestCommon.MsixInstallerPath = TestContext.Parameters.Get(Constants.MsixInstallerPathParameter); } } public void InitializeWingetSettings() { string localAppDataPath = Environment.GetEnvironmentVariable(Constants.LocalAppData); var settingsJson = new { experimentalFeatures = new { experimentalArg = false, experimentalCmd = false, dependencies = false, directMSI = false, }, debugging = new { enableSelfInitiatedMinidump = true } }; var serializedSettingsJson = JsonConvert.SerializeObject(settingsJson, Formatting.Indented); File.WriteAllText(Path.Combine(localAppDataPath, TestCommon.SettingsJsonFilePath), serializedSettingsJson); } } }
40.721239
188
0.586222
[ "MIT" ]
BlackCatDeployment/winget-cli
src/AppInstallerCLIE2ETests/SetUpFixture.cs
9,205
C#
// <auto-generated> // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. // </auto-generated> namespace Microsoft.Azure.Management.Compute.Models { using Newtonsoft.Json; using System.Linq; /// <summary> /// Describes the gallery image definition purchase plan. This is used by /// marketplace images. /// </summary> public partial class ImagePurchasePlan { /// <summary> /// Initializes a new instance of the ImagePurchasePlan class. /// </summary> public ImagePurchasePlan() { CustomInit(); } /// <summary> /// Initializes a new instance of the ImagePurchasePlan class. /// </summary> /// <param name="name">The plan ID.</param> /// <param name="publisher">The publisher ID.</param> /// <param name="product">The product ID.</param> public ImagePurchasePlan(string name = default(string), string publisher = default(string), string product = default(string)) { Name = name; Publisher = publisher; Product = product; CustomInit(); } /// <summary> /// An initialization method that performs custom operations like setting defaults /// </summary> partial void CustomInit(); /// <summary> /// Gets or sets the plan ID. /// </summary> [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// <summary> /// Gets or sets the publisher ID. /// </summary> [JsonProperty(PropertyName = "publisher")] public string Publisher { get; set; } /// <summary> /// Gets or sets the product ID. /// </summary> [JsonProperty(PropertyName = "product")] public string Product { get; set; } } }
30.797101
133
0.588706
[ "MIT" ]
93mishra/azure-sdk-for-net
sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ImagePurchasePlan.cs
2,125
C#
namespace KeySwitchManager.Infrastructures.Storage.Spreadsheet.KeySwitches.Models { static class CellConstants { public static readonly string EmptyCellValue = string.Empty; public static readonly string NotAvailableCellValue = "n/a"; } }
33.25
81
0.74812
[ "MIT" ]
r-koubou/ArticulationManager
KeySwitchManager/Sources/Runtime/Infrastructures/Storage.Spreadsheet/KeySwitches/Models/CellConstants.cs
266
C#
using System; using System.Threading; using System.Threading.Tasks; namespace CronHostedService { public interface IIntervalService { Task Execute(DateTimeOffset ticked, double intervalSeconds, CancellationToken cancellationToken); } }
21.5
105
0.771318
[ "MIT" ]
Cisien/CronHostedService
CronHostedService/IIntervalService.cs
260
C#
using System; using HealthChecks.NpgSql; using Microsoft.Extensions.Diagnostics.HealthChecks; using System.Collections.Generic; using Npgsql; namespace Microsoft.Extensions.DependencyInjection { public static class NpgSqlHealthCheckBuilderExtensions { private const string NAME = "npgsql"; /// <summary> /// Add a health check for Postgres databases. /// </summary> /// <param name="builder">The <see cref="IHealthChecksBuilder"/>.</param> /// <param name="npgsqlConnectionString">The Postgres connection string to be used.</param> /// /// <param name="healthQuery">The query to be used in check. Optional. If <c>null</c> SELECT 1 is used.</param> /// <param name="connectionAction">An optional action to allow additional Npgsql-specific configuration.</param> /// <param name="name">The health check name. Optional. If <c>null</c> the type name 'npgsql' will be used for the name.</param> /// <param name="failureStatus"> /// The <see cref="HealthStatus"/> that should be reported when the health check fails. Optional. If <c>null</c> then /// the default status of <see cref="HealthStatus.Unhealthy"/> will be reported. /// </param> /// <param name="tags">A list of tags that can be used to filter sets of health checks. Optional.</param> /// <param name="timeout">An optional <see cref="TimeSpan"/> representing the timeout of the check.</param> /// <returns>The <see cref="IHealthChecksBuilder"/>.</returns> public static IHealthChecksBuilder AddNpgSql(this IHealthChecksBuilder builder, string npgsqlConnectionString, string healthQuery = "SELECT 1;", Action<NpgsqlConnection> connectionAction = null, string name = default, HealthStatus? failureStatus = default, IEnumerable<string> tags = default, TimeSpan? timeout = default) { return builder.AddNpgSql(_ => npgsqlConnectionString, healthQuery, connectionAction, name, failureStatus, tags, timeout); } /// <summary> /// Add a health check for Postgres databases. /// </summary> /// <param name="builder">The <see cref="IHealthChecksBuilder"/>.</param> /// <param name="connectionStringFactory">A factory to build the Postgres connection string to use.</param> /// <param name="connectionStringFactory">The Postgres connection string to be used.</param> /// <param name="name">The health check name. Optional. If <c>null</c> the type name 'npgsql' will be used for the name.</param> /// <param name="failureStatus"> /// The <see cref="HealthStatus"/> that should be reported when the health check fails. Optional. If <c>null</c> then /// the default status of <see cref="HealthStatus.Unhealthy"/> will be reported. /// </param> /// <param name="tags">A list of tags that can be used to filter sets of health checks. Optional.</param> /// <param name="timeout">An optional <see cref="TimeSpan"/> representing the timeout of the check.</param> /// <returns>The <see cref="IHealthChecksBuilder"/>.</returns> public static IHealthChecksBuilder AddNpgSql(this IHealthChecksBuilder builder, Func<IServiceProvider, string> connectionStringFactory, string healthQuery = "SELECT 1;", Action<NpgsqlConnection> connectionAction = null, string name = default, HealthStatus? failureStatus = default, IEnumerable<string> tags = default, TimeSpan? timeout = default) { if (connectionStringFactory == null) { throw new ArgumentNullException(nameof(connectionStringFactory)); } builder.Services.AddSingleton(sp => new NpgSqlHealthCheck(connectionStringFactory(sp), healthQuery, connectionAction)); return builder.Add(new HealthCheckRegistration( name ?? NAME, sp => sp.GetRequiredService<NpgSqlHealthCheck>(), failureStatus, tags, timeout)); } } }
62.476923
354
0.66757
[ "Apache-2.0" ]
isdaniel/AspNetCore.Diagnostics.HealthChecks
src/HealthChecks.NpgSql/DependencyInjection/NpgSqlHealthCheckBuilderExtensions.cs
4,061
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.IO; using System.Net.Mime; using System.Text; namespace System.Net.Mail { public abstract class AttachmentBase : IDisposable { internal bool disposed = false; private readonly MimePart _part = new MimePart(); private static readonly char[] s_contentCIDInvalidChars = new char[] { '<', '>' }; internal AttachmentBase() { } protected AttachmentBase(string fileName) { SetContentFromFile(fileName, string.Empty); } protected AttachmentBase(string fileName, string mediaType) { SetContentFromFile(fileName, mediaType); } protected AttachmentBase(string fileName, ContentType contentType) { SetContentFromFile(fileName, contentType); } protected AttachmentBase(Stream contentStream) { _part.SetContent(contentStream); } protected AttachmentBase(Stream contentStream, string mediaType) { _part.SetContent(contentStream, null, mediaType); } internal AttachmentBase(Stream contentStream, string name, string mediaType) { _part.SetContent(contentStream, name, mediaType); } protected AttachmentBase(Stream contentStream, ContentType contentType) { _part.SetContent(contentStream, contentType); } public void Dispose() { Dispose(true); } protected virtual void Dispose(bool disposing) { if (disposing && !disposed) { disposed = true; _part.Dispose(); } } internal void SetContentFromFile(string fileName, ContentType contentType) { if (fileName == null) { throw new ArgumentNullException(nameof(fileName)); } if (fileName == string.Empty) { throw new ArgumentException(SR.Format(SR.net_emptystringcall, nameof(fileName)), nameof(fileName)); } Stream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read); _part.SetContent(stream, contentType); } internal void SetContentFromFile(string fileName, string mediaType) { if (fileName == null) { throw new ArgumentNullException(nameof(fileName)); } if (fileName == string.Empty) { throw new ArgumentException(SR.Format(SR.net_emptystringcall, nameof(fileName)), nameof(fileName)); } Stream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read); _part.SetContent(stream, null, mediaType); } internal void SetContentFromString(string content, ContentType contentType) { if (content == null) { throw new ArgumentNullException(nameof(content)); } if (_part.Stream != null) { _part.Stream.Close(); } Encoding encoding; if (contentType != null && contentType.CharSet != null) { encoding = Text.Encoding.GetEncoding(contentType.CharSet); } else { if (MimeBasePart.IsAscii(content, false)) { encoding = Text.Encoding.ASCII; } else { encoding = Text.Encoding.GetEncoding(MimeBasePart.DefaultCharSet); } } byte[] buffer = encoding.GetBytes(content); _part.SetContent(new MemoryStream(buffer), contentType); if (MimeBasePart.ShouldUseBase64Encoding(encoding)) { _part.TransferEncoding = TransferEncoding.Base64; } else { _part.TransferEncoding = TransferEncoding.QuotedPrintable; } } internal void SetContentFromString(string content, Encoding encoding, string mediaType) { if (content == null) { throw new ArgumentNullException(nameof(content)); } if (_part.Stream != null) { _part.Stream.Close(); } if (mediaType == null || mediaType == string.Empty) { mediaType = MediaTypeNames.Text.Plain; } //validate the mediaType int offset = 0; try { string value = MailBnfHelper.ReadToken(mediaType, ref offset, null); if (value.Length == 0 || offset >= mediaType.Length || mediaType[offset++] != '/') throw new ArgumentException(SR.MediaTypeInvalid, nameof(mediaType)); value = MailBnfHelper.ReadToken(mediaType, ref offset, null); if (value.Length == 0 || offset < mediaType.Length) { throw new ArgumentException(SR.MediaTypeInvalid, nameof(mediaType)); } } catch (FormatException) { throw new ArgumentException(SR.MediaTypeInvalid, nameof(mediaType)); } ContentType contentType = new ContentType(mediaType); if (encoding == null) { if (MimeBasePart.IsAscii(content, false)) { encoding = Encoding.ASCII; } else { encoding = Encoding.GetEncoding(MimeBasePart.DefaultCharSet); } } contentType.CharSet = encoding.BodyName; byte[] buffer = encoding.GetBytes(content); _part.SetContent(new MemoryStream(buffer), contentType); if (MimeBasePart.ShouldUseBase64Encoding(encoding)) { _part.TransferEncoding = TransferEncoding.Base64; } else { _part.TransferEncoding = TransferEncoding.QuotedPrintable; } } internal virtual void PrepareForSending(bool allowUnicode) { _part.ResetStream(); } public Stream ContentStream { get { if (disposed) { throw new ObjectDisposedException(GetType().FullName); } return _part.Stream; } } public string ContentId { get { string cid = _part.ContentID; if (string.IsNullOrEmpty(cid)) { cid = Guid.NewGuid().ToString(); ContentId = cid; return cid; } if (cid.Length >= 2 && cid[0] == '<' && cid[cid.Length - 1] == '>') { return cid.Substring(1, cid.Length - 2); } return cid; } set { if (string.IsNullOrEmpty(value)) { _part.ContentID = null; } else { if (value.IndexOfAny(s_contentCIDInvalidChars) != -1) { throw new ArgumentException(SR.MailHeaderInvalidCID, nameof(value)); } _part.ContentID = "<" + value + ">"; } } } public ContentType ContentType { get { return _part.ContentType; } set { _part.ContentType = value; } } public TransferEncoding TransferEncoding { get { return _part.TransferEncoding; } set { _part.TransferEncoding = value; } } internal Uri ContentLocation { get { Uri uri; if (!Uri.TryCreate(_part.ContentLocation, UriKind.RelativeOrAbsolute, out uri)) { return null; } return uri; } set { _part.ContentLocation = value == null ? null : value.IsAbsoluteUri ? value.AbsoluteUri : value.OriginalString; } } internal MimePart MimePart { get { return _part; } } } public class Attachment : AttachmentBase { private string _name; private Encoding _nameEncoding; internal Attachment() { MimePart.ContentDisposition = new ContentDisposition(); } public Attachment(string fileName) : base(fileName) { Name = Path.GetFileName(fileName); MimePart.ContentDisposition = new ContentDisposition(); } public Attachment(string fileName, string mediaType) : base(fileName, mediaType) { Name = Path.GetFileName(fileName); MimePart.ContentDisposition = new ContentDisposition(); } public Attachment(string fileName, ContentType contentType) : base(fileName, contentType) { if (contentType.Name == null || contentType.Name == string.Empty) { Name = Path.GetFileName(fileName); } else { Name = contentType.Name; } MimePart.ContentDisposition = new ContentDisposition(); } public Attachment(Stream contentStream, string name) : base(contentStream, null, null) { Name = name; MimePart.ContentDisposition = new ContentDisposition(); } public Attachment(Stream contentStream, string name, string mediaType) : base(contentStream, null, mediaType) { Name = name; MimePart.ContentDisposition = new ContentDisposition(); } public Attachment(Stream contentStream, ContentType contentType) : base(contentStream, contentType) { Name = contentType.Name; MimePart.ContentDisposition = new ContentDisposition(); } internal void SetContentTypeName(bool allowUnicode) { if (!allowUnicode && _name != null && _name.Length != 0 && !MimeBasePart.IsAscii(_name, false)) { Encoding encoding = NameEncoding; if (encoding == null) { encoding = Encoding.GetEncoding(MimeBasePart.DefaultCharSet); } MimePart.ContentType.Name = MimeBasePart.EncodeHeaderValue(_name, encoding, MimeBasePart.ShouldUseBase64Encoding(encoding)); } else { MimePart.ContentType.Name = _name; } } public string Name { get { return _name; } set { Encoding nameEncoding = MimeBasePart.DecodeEncoding(value); if (nameEncoding != null) { _nameEncoding = nameEncoding; _name = MimeBasePart.DecodeHeaderValue(value); MimePart.ContentType.Name = value; } else { _name = value; SetContentTypeName(true); // This keeps ContentType.Name up to date for user viewability, but isn't necessary. // SetContentTypeName is called again by PrepareForSending() } } } public Encoding NameEncoding { get { return _nameEncoding; } set { _nameEncoding = value; if (_name != null && _name != string.Empty) { SetContentTypeName(true); } } } public ContentDisposition ContentDisposition { get { return MimePart.ContentDisposition; } } internal override void PrepareForSending(bool allowUnicode) { if (_name != null && _name != string.Empty) { SetContentTypeName(allowUnicode); } base.PrepareForSending(allowUnicode); } public static Attachment CreateAttachmentFromString(string content, string name) { Attachment a = new Attachment(); a.SetContentFromString(content, null, string.Empty); a.Name = name; return a; } public static Attachment CreateAttachmentFromString(string content, string name, Encoding contentEncoding, string mediaType) { Attachment a = new Attachment(); a.SetContentFromString(content, contentEncoding, mediaType); a.Name = name; return a; } public static Attachment CreateAttachmentFromString(string content, ContentType contentType) { Attachment a = new Attachment(); a.SetContentFromString(content, contentType); a.Name = contentType.Name; return a; } } }
29.689873
140
0.499609
[ "MIT" ]
939481896/dotnet-corefx
src/System.Net.Mail/src/System/Net/Mail/Attachment.cs
14,073
C#
using FluentAssertions; using IdentityServer.UnitTests.Common; using IdentityServer4; using IdentityServer4.Models; using IdentityServer4.Services; using IdentityServer4.Stores; using IdentityServer4.Stores.Serialization; using System; using System.Collections.Generic; using System.Security.Claims; using System.Threading.Tasks; using IdentityServer.UnitTests.Validation.Setup; using Xunit; namespace IdentityServer.UnitTests.Services.Default { public class DefaultRefreshTokenServiceTests { private DefaultRefreshTokenService _subject; private DefaultRefreshTokenStore _store; private ClaimsPrincipal _user = new IdentityServerUser("123").CreatePrincipal(); private StubClock _clock = new StubClock(); public DefaultRefreshTokenServiceTests() { _store = new DefaultRefreshTokenStore( new InMemoryPersistedGrantStore(), new PersistentGrantSerializer(), new DefaultHandleGenerationService(), TestLogger.Create<DefaultRefreshTokenStore>()); _subject = new DefaultRefreshTokenService( _store, new TestProfileService(), _clock, TestLogger.Create<DefaultRefreshTokenService>()); } [Fact] public async Task CreateRefreshToken_token_exists_in_store() { var client = new Client(); var accessToken = new Token(); var handle = await _subject.CreateRefreshTokenAsync(_user, accessToken, client); (await _store.GetRefreshTokenAsync(handle)).Should().NotBeNull(); } [Fact] public async Task CreateRefreshToken_should_match_absolute_lifetime() { var client = new Client { ClientId = "client1", RefreshTokenUsage = TokenUsage.ReUse, RefreshTokenExpiration = TokenExpiration.Absolute, AbsoluteRefreshTokenLifetime = 10 }; var handle = await _subject.CreateRefreshTokenAsync(_user, new Token(), client); var refreshToken = (await _store.GetRefreshTokenAsync(handle)); refreshToken.Should().NotBeNull(); refreshToken.Lifetime.Should().Be(client.AbsoluteRefreshTokenLifetime); } [Fact] public async Task CreateRefreshToken_should_cap_sliding_lifetime_that_exceeds_absolute_lifetime() { var client = new Client { ClientId = "client1", RefreshTokenUsage = TokenUsage.ReUse, RefreshTokenExpiration = TokenExpiration.Sliding, SlidingRefreshTokenLifetime = 100, AbsoluteRefreshTokenLifetime = 10 }; var handle = await _subject.CreateRefreshTokenAsync(_user, new Token(), client); var refreshToken = (await _store.GetRefreshTokenAsync(handle)); refreshToken.Should().NotBeNull(); refreshToken.Lifetime.Should().Be(client.AbsoluteRefreshTokenLifetime); } [Fact] public async Task CreateRefreshToken_should_match_sliding_lifetime() { var client = new Client { ClientId = "client1", RefreshTokenUsage = TokenUsage.ReUse, RefreshTokenExpiration = TokenExpiration.Sliding, SlidingRefreshTokenLifetime = 10 }; var handle = await _subject.CreateRefreshTokenAsync(_user, new Token(), client); var refreshToken = (await _store.GetRefreshTokenAsync(handle)); refreshToken.Should().NotBeNull(); refreshToken.Lifetime.Should().Be(client.SlidingRefreshTokenLifetime); } [Fact] public async Task UpdateRefreshToken_one_time_use_should_create_new_token() { var client = new Client { ClientId = "client1", RefreshTokenUsage = TokenUsage.OneTimeOnly }; var refreshToken = new RefreshToken { CreationTime = DateTime.UtcNow, Lifetime = 10, AccessToken = new Token { ClientId = client.ClientId, Audiences = { "aud" }, CreationTime = DateTime.UtcNow, Claims = new List<Claim>() { new Claim("sub", "123") } } }; var handle = await _store.StoreRefreshTokenAsync(refreshToken); (await _subject.UpdateRefreshTokenAsync(handle, refreshToken, client)) .Should().NotBeNull() .And .NotBe(handle); } [Fact] public async Task UpdateRefreshToken_sliding_with_non_zero_absolute_should_update_lifetime() { var client = new Client { ClientId = "client1", RefreshTokenUsage = TokenUsage.ReUse, RefreshTokenExpiration = TokenExpiration.Sliding, SlidingRefreshTokenLifetime = 10, AbsoluteRefreshTokenLifetime = 100 }; var now = DateTime.UtcNow; _clock.UtcNowFunc = () => now; var handle = await _store.StoreRefreshTokenAsync(new RefreshToken { CreationTime = now.AddSeconds(-10), AccessToken = new Token { ClientId = client.ClientId, Audiences = { "aud" }, CreationTime = DateTime.UtcNow, Claims = new List<Claim>() { new Claim("sub", "123") } } }); var refreshToken = await _store.GetRefreshTokenAsync(handle); var newHandle = await _subject.UpdateRefreshTokenAsync(handle, refreshToken, client); newHandle.Should().NotBeNull().And.Be(handle); var newRefreshToken = await _store.GetRefreshTokenAsync(newHandle); newRefreshToken.Should().NotBeNull(); newRefreshToken.Lifetime.Should().Be((int)(now - newRefreshToken.CreationTime).TotalSeconds + client.SlidingRefreshTokenLifetime); } [Fact] public async Task UpdateRefreshToken_lifetime_exceeds_absolute_should_be_absolute_lifetime() { var client = new Client { ClientId = "client1", RefreshTokenUsage = TokenUsage.ReUse, RefreshTokenExpiration = TokenExpiration.Sliding, SlidingRefreshTokenLifetime = 10, AbsoluteRefreshTokenLifetime = 1000 }; var now = DateTime.UtcNow; _clock.UtcNowFunc = () => now; var handle = await _store.StoreRefreshTokenAsync(new RefreshToken { CreationTime = now.AddSeconds(-1000), AccessToken = new Token { ClientId = client.ClientId, Audiences = { "aud" }, CreationTime = DateTime.UtcNow, Claims = new List<Claim>() { new Claim("sub", "123") } } }); var refreshToken = await _store.GetRefreshTokenAsync(handle); var newHandle = await _subject.UpdateRefreshTokenAsync(handle, refreshToken, client); newHandle.Should().NotBeNull().And.Be(handle); var newRefreshToken = await _store.GetRefreshTokenAsync(newHandle); newRefreshToken.Should().NotBeNull(); newRefreshToken.Lifetime.Should().Be(client.AbsoluteRefreshTokenLifetime); } [Fact] public async Task UpdateRefreshToken_sliding_with_zero_absolute_should_update_lifetime() { var client = new Client { ClientId = "client1", RefreshTokenUsage = TokenUsage.ReUse, RefreshTokenExpiration = TokenExpiration.Sliding, SlidingRefreshTokenLifetime = 10, AbsoluteRefreshTokenLifetime = 0 }; var now = DateTime.UtcNow; _clock.UtcNowFunc = () => now; var handle = await _store.StoreRefreshTokenAsync(new RefreshToken { CreationTime = now.AddSeconds(-1000), AccessToken = new Token { ClientId = client.ClientId, Audiences = { "aud" }, CreationTime = DateTime.UtcNow, Claims = new List<Claim>() { new Claim("sub", "123") } } }); var refreshToken = await _store.GetRefreshTokenAsync(handle); var newHandle = await _subject.UpdateRefreshTokenAsync(handle, refreshToken, client); newHandle.Should().NotBeNull().And.Be(handle); var newRefreshToken = await _store.GetRefreshTokenAsync(newHandle); newRefreshToken.Should().NotBeNull(); newRefreshToken.Lifetime.Should().Be((int)(now - newRefreshToken.CreationTime).TotalSeconds + client.SlidingRefreshTokenLifetime); } [Fact] public async Task UpdateRefreshToken_for_onetime_and_sliding_with_zero_absolute_should_update_lifetime() { var client = new Client { ClientId = "client1", RefreshTokenUsage = TokenUsage.OneTimeOnly, RefreshTokenExpiration = TokenExpiration.Sliding, SlidingRefreshTokenLifetime = 10, AbsoluteRefreshTokenLifetime = 0 }; var now = DateTime.UtcNow; _clock.UtcNowFunc = () => now; var handle = await _store.StoreRefreshTokenAsync(new RefreshToken { CreationTime = now.AddSeconds(-1000), AccessToken = new Token { ClientId = client.ClientId, Audiences = { "aud" }, CreationTime = DateTime.UtcNow, Claims = new List<Claim>() { new Claim("sub", "123") } } }); var refreshToken = await _store.GetRefreshTokenAsync(handle); var newHandle = await _subject.UpdateRefreshTokenAsync(handle, refreshToken, client); newHandle.Should().NotBeNull().And.NotBe(handle); var newRefreshToken = await _store.GetRefreshTokenAsync(newHandle); newRefreshToken.Should().NotBeNull(); newRefreshToken.Lifetime.Should().Be((int)(now - newRefreshToken.CreationTime).TotalSeconds + client.SlidingRefreshTokenLifetime); } [Fact] public async Task UpdateRefreshToken_one_time_use_should_consume_token_and_create_new_one_with_correct_dates() { var client = new Client { ClientId = "client1", RefreshTokenUsage = TokenUsage.OneTimeOnly }; var refreshToken = new RefreshToken { CreationTime = DateTime.UtcNow, Lifetime = 10, AccessToken = new Token { ClientId = client.ClientId, Audiences = { "aud" }, CreationTime = DateTime.UtcNow, Claims = new List<Claim>() { new Claim("sub", "123") } } }; var handle = await _store.StoreRefreshTokenAsync(refreshToken); var now = DateTime.UtcNow; _clock.UtcNowFunc = () => now; var newHandle = await _subject.UpdateRefreshTokenAsync(handle, refreshToken, client); var oldToken = await _store.GetRefreshTokenAsync(handle); var newToken = await _store.GetRefreshTokenAsync(newHandle); oldToken.ConsumedTime.Should().Be(now); newToken.ConsumedTime.Should().BeNull(); } [Fact] public async Task ValidateRefreshToken_invalid_token_should_fail() { var client = new Client { ClientId = "client1", RefreshTokenUsage = TokenUsage.OneTimeOnly }; var result = await _subject.ValidateRefreshTokenAsync("invalid", client); result.IsError.Should().BeTrue(); } [Fact] public async Task ValidateRefreshToken_client_without_allow_offline_access_should_fail() { var client = new Client { ClientId = "client1", RefreshTokenUsage = TokenUsage.OneTimeOnly }; var refreshToken = new RefreshToken { CreationTime = DateTime.UtcNow, Lifetime = 10, AccessToken = new Token { ClientId = client.ClientId, Audiences = { "aud" }, CreationTime = DateTime.UtcNow, Claims = new List<Claim>() { new Claim("sub", "123") } } }; var handle = await _store.StoreRefreshTokenAsync(refreshToken); var now = DateTime.UtcNow; _clock.UtcNowFunc = () => now; var result = await _subject.ValidateRefreshTokenAsync(handle, client); result.IsError.Should().BeTrue(); } [Fact] public async Task ValidateRefreshToken_invalid_client_binding_should_fail() { var client = new Client { ClientId = "client1", AllowOfflineAccess = true, RefreshTokenUsage = TokenUsage.OneTimeOnly }; var refreshToken = new RefreshToken { CreationTime = DateTime.UtcNow, Lifetime = 10, AccessToken = new Token { ClientId = "client2", Audiences = { "aud" }, CreationTime = DateTime.UtcNow, Claims = new List<Claim>() { new Claim("sub", "123") } } }; var handle = await _store.StoreRefreshTokenAsync(refreshToken); var now = DateTime.UtcNow; _clock.UtcNowFunc = () => now; var result = await _subject.ValidateRefreshTokenAsync(handle, client); result.IsError.Should().BeTrue(); } [Fact] public async Task ValidateRefreshToken_expired_token_should_fail() { var client = new Client { ClientId = "client1", AllowOfflineAccess = true, RefreshTokenUsage = TokenUsage.OneTimeOnly }; var refreshToken = new RefreshToken { CreationTime = DateTime.UtcNow, Lifetime = 10, AccessToken = new Token { ClientId = client.ClientId, Audiences = { "aud" }, CreationTime = DateTime.UtcNow, Claims = new List<Claim>() { new Claim("sub", "123") } } }; var handle = await _store.StoreRefreshTokenAsync(refreshToken); var now = DateTime.UtcNow.AddSeconds(20); _clock.UtcNowFunc = () => now; var result = await _subject.ValidateRefreshTokenAsync(handle, client); result.IsError.Should().BeTrue(); } [Fact] public async Task ValidateRefreshToken_consumed_token_should_fail() { var client = new Client { ClientId = "client1", AllowOfflineAccess = true, RefreshTokenUsage = TokenUsage.OneTimeOnly }; var refreshToken = new RefreshToken { CreationTime = DateTime.UtcNow, Lifetime = 10, ConsumedTime = DateTime.UtcNow, AccessToken = new Token { ClientId = client.ClientId, Audiences = { "aud" }, CreationTime = DateTime.UtcNow, Claims = new List<Claim>() { new Claim("sub", "123") } } }; var handle = await _store.StoreRefreshTokenAsync(refreshToken); var now = DateTime.UtcNow; _clock.UtcNowFunc = () => now; var result = await _subject.ValidateRefreshTokenAsync(handle, client); result.IsError.Should().BeTrue(); } [Fact] public async Task ValidateRefreshToken_valid_token_should_succeed() { var client = new Client { ClientId = "client1", AllowOfflineAccess = true, RefreshTokenUsage = TokenUsage.OneTimeOnly }; var refreshToken = new RefreshToken { CreationTime = DateTime.UtcNow, Lifetime = 10, AccessToken = new Token { ClientId = client.ClientId, Audiences = { "aud" }, CreationTime = DateTime.UtcNow, Claims = new List<Claim>() { new Claim("sub", "123") } } }; var handle = await _store.StoreRefreshTokenAsync(refreshToken); var now = DateTime.UtcNow; _clock.UtcNowFunc = () => now; var result = await _subject.ValidateRefreshTokenAsync(handle, client); result.IsError.Should().BeFalse(); } } }
34.349353
142
0.526072
[ "Apache-2.0" ]
10088/IdentityServer4
src/IdentityServer4/test/IdentityServer.UnitTests/Services/Default/DefaultRefreshTokenServiceTests.cs
18,583
C#
namespace Futurum.ApiEndpoint; public interface IMetadataDefinition { }
14.4
36
0.847222
[ "MIT" ]
futurum-dev/dotnet.futurum.apiendpoint
src/Futurum.ApiEndpoint/IMetadataDefinition.cs
72
C#
using AppCotacao.Model; using AppCotacao.Services.Utils; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace AppCotacao.UnitTest { [TestClass] public class PessoaJuridicaModelUnitTest { private const string cnpjVar = "12123123123412"; private const string cnpjWithMask = "12.123.123/1234-12"; private const string cpfVar = "12312312312"; private const string cpfWithMask = "123.123.123-12"; private PessoaJuridicaModel objeto = new PessoaJuridicaModel(); public PessoaJuridicaModelUnitTest() { objeto.CNPJ = cnpjVar; } [TestMethod] public void Testar_set_CNPJ_in_object() { Assert.AreEqual(objeto.CNPJ, cnpjVar); } [TestMethod] public void Testar_atribuicao_mascara_CNPJ() { Assert.AreEqual(MasksUtil.AddMaskCNPJ(objeto.CNPJ), cnpjWithMask); Assert.AreEqual(objeto.CNPJ, cnpjVar); } [TestMethod] public void Testar_remocao_marcarao_CNPJ() { objeto.CNPJ = cnpjWithMask; Assert.AreEqual(objeto.CNPJ, cnpjWithMask); Assert.AreEqual(MasksUtil.RemoveMaskCNPJ(objeto.CNPJ), cnpjVar); } [TestMethod] public void Testar_atribuicao_mascara_CPF() { Assert.AreEqual(MasksUtil.AddMaskCPF(cpfVar), cpfWithMask); } [TestMethod] public void Testar_remocao_marcarao_CPF() { Assert.AreEqual(MasksUtil.RemoveMaskCPF(cpfWithMask), cpfVar); } } }
27.982456
78
0.628213
[ "MIT" ]
isaacboratino/cotalist-xamarin-node
front-xamarin/AppCotacao/AppCotacao/AppCotacao.UnitTest/Shared/Model/PessoaJuridicaModelUnitTest.cs
1,597
C#
using Meel.Commands; using Meel.Parsing; using Meel.Responses; using Meel.Stations; using NUnit.Framework; using System.Buffers; using System.Text; namespace Meel.Tests.Commands { [TestFixture] public class FetchCommandTest { [Test] public void ShouldFetch() { // Arrange var station = new InMemoryStation(); var user = "Piet"; var boxName = "Existing"; var query = "1 FLAGS"; var expected = "* 1 FETCH (FLAGS (\\Draft))"; station.CreateMailbox(user, boxName); var box = station.SelectMailbox(user, boxName); var message = new ImapMessage(null, 1, MessageFlags.Draft, 0); station.AppendToMailbox(box, message); var command = new FetchCommand(station); var response = new ImapResponse(); var context = new ConnectionContext(42); context.State = SessionState.Selected; context.Username = user; context.SetSelectedMailbox(box); var requestId = new ReadOnlySequence<byte>(Encoding.ASCII.GetBytes("123")); var options = query.AsAsciiSpan(); // Act command.Execute(context, requestId, options, ref response); // Assert var txt = response.ToString(); Assert.IsNotNull(txt); StringAssert.DoesNotContain("BAD", txt); StringAssert.DoesNotContain("NO", txt); StringAssert.Contains("OK", txt); StringAssert.Contains(expected, txt); } [Test] public void ShouldNotFetchFromNonExistingMessage() { // Arrange var station = new InMemoryStation(); var user = "Piet"; var boxName = "Existing"; var query = "2 FLAGS"; station.CreateMailbox(user, boxName); var box = station.SelectMailbox(user, boxName); var message = new ImapMessage(null, 1, MessageFlags.Draft, 0); station.AppendToMailbox(box, message); var command = new FetchCommand(station); var response = new ImapResponse(); var context = new ConnectionContext(42); context.State = SessionState.Selected; context.Username = user; context.SetSelectedMailbox(box); var requestId = new ReadOnlySequence<byte>(Encoding.ASCII.GetBytes("123")); var options = query.AsAsciiSpan(); // Act command.Execute(context, requestId, options, ref response); // Assert var txt = response.ToString(); Assert.IsNotNull(txt); StringAssert.DoesNotContain("OK", txt); StringAssert.DoesNotContain("BAD", txt); StringAssert.Contains("NO", txt); } [Test] public void ShouldNotFetchFromNonExistingBox() { // Arrange var station = new InMemoryStation(); var user = "Piet"; var query = "1 FLAGS"; var command = new FetchCommand(station); var response = new ImapResponse(); var context = new ConnectionContext(42); context.SetSelectedMailbox(null); context.State = SessionState.Selected; context.Username = user; var requestId = new ReadOnlySequence<byte>(Encoding.ASCII.GetBytes("123")); var options = query.AsAsciiSpan(); // Act command.Execute(context, requestId, options, ref response); // Assert var txt = response.ToString(); Assert.IsNotNull(txt); StringAssert.DoesNotContain("OK", txt); StringAssert.DoesNotContain("BAD", txt); StringAssert.Contains("NO", txt); } [Test] public void ShouldNotFetchBeforeLogin() { // Arrange var station = new InMemoryStation(); var user = "Piet"; var query = "1 FLAGS"; var command = new FetchCommand(station); var response = new ImapResponse(); var context = new ConnectionContext(42); context.Username = user; var requestId = new ReadOnlySequence<byte>(Encoding.ASCII.GetBytes("123")); var options = query.AsAsciiSpan(); // Act command.Execute(context, requestId, options, ref response); // Assert var txt = response.ToString(); Assert.IsNotNull(txt); StringAssert.DoesNotContain("OK", txt); StringAssert.DoesNotContain("NO", txt); StringAssert.Contains("BAD", txt); } [Test] public void ShouldNotFetchAfterLogout() { // Arrange var station = new InMemoryStation(); var user = "Piet"; var query = "1 FLAGS"; var command = new SearchCommand(station); var response = new ImapResponse(); var context = new ConnectionContext(42); context.State = SessionState.Logout; context.Username = user; var requestId = new ReadOnlySequence<byte>(Encoding.ASCII.GetBytes("123")); var options = query.AsAsciiSpan(); // Act command.Execute(context, requestId, options, ref response); // Assert var txt = response.ToString(); Assert.IsNotNull(txt); StringAssert.DoesNotContain("OK", txt); StringAssert.DoesNotContain("NO", txt); StringAssert.Contains("BAD", txt); } [Test] public void ShouldReturnBadWithoutArgument() { // Arrange var station = new InMemoryStation(); var user = "Piet"; var command = new FetchCommand(station); var response = new ImapResponse(); var context = new ConnectionContext(42); context.State = SessionState.Selected; context.Username = user; var requestId = new ReadOnlySequence<byte>(Encoding.ASCII.GetBytes("123")); var options = "".AsAsciiSpan(); // Act command.Execute(context, requestId, options, ref response); // Assert var txt = response.ToString(); Assert.IsNotNull(txt); StringAssert.DoesNotContain("OK", txt); StringAssert.DoesNotContain("NO", txt); StringAssert.Contains("BAD", txt); } } }
38.360465
87
0.556835
[ "MIT" ]
ynse01/meel
Tests/Commands/FetchCommandTest.cs
6,600
C#
using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Text; namespace TeamBuilder.Models { public class Event { public Event() { this.ParticipatingEventTeams = new List<EventTeam>(); } [Key] public int Id { get; set; } [Required] [MaxLength(25)] public string Name { get; set; } [MaxLength(250)] public string Description { get; set; } public DateTime StartDate { get; set; } public DateTime EndDate { get; set; } //TODO to be after startDate public int CreatorId { get; set; } public virtual User Creator { get; set; } public virtual ICollection<EventTeam> ParticipatingEventTeams { get; set; } } }
22.388889
83
0.604218
[ "MIT" ]
LuGeorgiev/SoftUniDBAdvanced
Workshop/TeamBuilder.Models/Event.cs
808
C#
using System; using System.Windows; using System.Windows.Controls; using System.Windows.Input; using System.Windows.Media; namespace StubbornBrowser.Controls { /// <summary> /// Interaction logic for MagicBoxItem.xaml /// </summary> public partial class MagicBoxItem : UserControl { private bool _isDark; private MainWindow mainWindow; public MagicBox parent; public MagicBoxItem(string title, string url, MainWindow mw) { InitializeComponent(); Title.Content = title; Url.Content = url; Loaded += MagicBoxItem_Loaded; mainWindow = mw; } private void MagicBoxItem_Loaded(object sender, System.Windows.RoutedEventArgs e) { Title.Margin = new Thickness(30 + Url.ActualWidth,0,30,0); } public void RippleColor(Color color) { SolidColorBrush scb = new SolidColorBrush(color); Ripple.Fill = scb; } public bool IsDark { get { return _isDark; } set { _isDark = value; if (value) { Title.Foreground = Brushes.White; Url.Foreground = Brushes.White; RippleColor(Colors.White); } else { Title.Foreground = Brushes.Black; RippleColor(Colors.Black); Url.Foreground = Brushes.Black; } } } private void MagicBoxItem_OnPreviewMouseDown(object sender, MouseButtonEventArgs e) { var targetWidth = Math.Max(ActualHeight, ActualWidth * 2); StaticFunctions.AnimateFade(0, 0.1, Ripple, 0.1); Ripple.Height = 0; Ripple.Width = 0; StaticFunctions.AnimateRipple(0, targetWidth, Ripple, 0.6); } private void MagicBoxItem_OnSizeChanged(object sender, SizeChangedEventArgs e) { Url.MaxWidth = this.ActualWidth / 1.7; Title.MaxWidth = this.ActualWidth / 1.3; Title.Margin = new Thickness(30 + Url.ActualWidth, 0, 30, 0); } private void UserControl_MouseEnter(object sender, MouseEventArgs e) { if (IsDark) { StaticFunctions.AnimateColor(Colors.Transparent, Color.FromArgb(50,255,255,255), this, 0.2); } else { StaticFunctions.AnimateColor(Colors.Transparent, Colors.Gainsboro, this, 0.2); } } private void UserControl_MouseLeave(object sender, MouseEventArgs e) { if (IsDark) { StaticFunctions.AnimateColor(Color.FromArgb(50, 255, 255, 255), Colors.Transparent, this, 0.2); } else { StaticFunctions.AnimateColor(Colors.Gainsboro, Colors.Transparent, this, 0.2); } } private void UIElement_OnPreviewMouseUp(object sender, MouseButtonEventArgs e) { if (mainWindow.TabBar.getSelectedTab().form.GetType() == typeof (TabView)) { TabView tv = mainWindow.TabBar.getSelectedTab().form as TabView; tv.WebView.Load(Url.Content.ToString()); tv.HideSuggestions(); } } } }
32.429907
111
0.54121
[ "MIT" ]
Leo-23333/StubbornBrowser
StubbornBrowser/Controls/MagicBoxItem.xaml.cs
3,472
C#
using System; using System.Collections; using System.Text; using System.Data; using System.Data.SQLite; namespace FenixHelper.Data { class DataArgument { public Boolean Add(Argument argument) { Boolean response = false; Connection conn = new Connection(); conn.open(); try { int task_id = argument.Task_id; string name = argument.Name; string value = argument.Value; var query = new SQLiteCommand("INSERT INTO arguments(task_id,name,value) VALUES (@p0,@p1,@p2)", conn.connection); query.Parameters.AddWithValue("@p0", task_id); query.Parameters.AddWithValue("@p1", name); query.Parameters.AddWithValue("@p2", value); query.ExecuteNonQuery(); response = true; } catch (Exception ex) { throw ex; } conn.close(); return response; } public Boolean Update(Argument argument) { Boolean response = false; Connection conn = new Connection(); conn.open(); try { int id = argument.Id; int task_id = argument.Task_id; string name = argument.Name; string value = argument.Value; var query = new SQLiteCommand("UPDATE arguments SET task_id = @p0, name = @p1, value = @p2 WHERE id = @p3", conn.connection); query.Parameters.AddWithValue("@p0", task_id); query.Parameters.AddWithValue("@p1", name); query.Parameters.AddWithValue("@p2", value); query.Parameters.AddWithValue("@p3", id); query.ExecuteNonQuery(); response = true; } catch (Exception ex) { throw ex; } conn.close(); return response; } public Boolean Delete(int id) { Boolean response = false; Connection conn = new Connection(); conn.open(); try { var query = new SQLiteCommand("DELETE FROM arguments WHERE id = @p0", conn.connection); query.Parameters.AddWithValue("@p0", id); query.ExecuteNonQuery(); response = true; } catch (Exception ex) { throw ex; } conn.close(); return response; } public Boolean DeleteByTask(int task_id) { Boolean response = false; Connection conn = new Connection(); conn.open(); try { var query = new SQLiteCommand("DELETE FROM arguments WHERE task_id = @p0", conn.connection); query.Parameters.AddWithValue("@p0", task_id); query.ExecuteNonQuery(); response = true; } catch (Exception ex) { throw ex; } conn.close(); return response; } public ArrayList List(int task_id) { ArrayList arguments = new ArrayList(); Connection conn = new Connection(); conn.open(); var query = new SQLiteCommand("SELECT a.id,a.task_id,a.name,a.value FROM arguments a, tasks t WHERE t.id = a.task_id AND a.task_id = @p0", conn.connection); query.Parameters.AddWithValue("@p0", task_id); var reader = query.ExecuteReader(); while (reader.Read()) { Argument argument = new Argument(); if (!reader.IsDBNull(0)) { argument.Id = reader.GetInt32(0); } if (!reader.IsDBNull(1)) { argument.Task_id = reader.GetInt32(1); } if (!reader.IsDBNull(2)) { argument.Name = reader.GetString(2); } if (!reader.IsDBNull(3)) { argument.Value = reader.GetString(3); } arguments.Add(argument); } reader.Close(); conn.close(); return arguments; } public Argument Get(int id) { Argument argument = new Argument(); Connection conn = new Connection(); conn.open(); var query = new SQLiteCommand("SELECT id,task_id,name,value FROM arguments WHERE id = @p0"); query.Parameters.AddWithValue("@p0", id); var reader = query.ExecuteReader(); reader.Read(); if (reader.HasRows) { if (!reader.IsDBNull(0)) { argument.Id = reader.GetInt32(0); } if (!reader.IsDBNull(1)) { argument.Task_id = reader.GetInt32(1); } if (!reader.IsDBNull(2)) { argument.Name = reader.GetString(2); } if (!reader.IsDBNull(3)) { argument.Value = reader.GetString(3); } } reader.Close(); conn.close(); return argument; } } }
27.231884
168
0.455029
[ "MIT" ]
IsmaelHeredia/Fenix-Helper
FenixHelper/Data/DataArgument.cs
5,639
C#
// Python Tools for Visual Studio // 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. using System; using System.Text.RegularExpressions; namespace Microsoft.PythonTools.Interpreter { /// <summary> /// Provides constants used to identify interpreters that are detected from /// globally registered conda environments. /// </summary> static class CondaEnvironmentFactoryConstants { public const string ConsoleExecutable = "python.exe"; public const string WindowsExecutable = "pythonw.exe"; public const string LibrarySubPath = "lib"; public const string PathEnvironmentVariableName = "PYTHONPATH"; private static readonly Regex IdParser = new Regex( "^(?<provider>.+?)\\|(?<company>.+?)\\|(?<tag>.+?)$", RegexOptions.None, TimeSpan.FromSeconds(1) ); public static string GetInterpreterId(string company, string tag) { return String.Join( "|", CondaEnvironmentFactoryProvider.FactoryProviderName, company, tag ); } public static bool TryParseInterpreterId(string id, out string company, out string env) { company = env = null; try { var m = IdParser.Match(id); if (m.Success && m.Groups["provider"].Value == CondaEnvironmentFactoryProvider.FactoryProviderName) { company = m.Groups["company"].Value; env = m.Groups["env"].Value; return true; } return false; } catch (RegexMatchTimeoutException) { return false; } } } }
38.274194
117
0.62579
[ "Apache-2.0" ]
113771169/PTVS
Python/Product/VSInterpreters/Interpreter/CondaEnvironmentFactoryConstants.cs
2,373
C#
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. using System.Threading.Tasks; using Azure.ResourceManager.Resources; using Azure.Core.TestFramework; using NUnit.Framework; using Azure.Core; namespace Azure.ResourceManager.Cdn.Tests { public class ManagedRuleSetOperationsTests : CdnManagementTestBase { public ManagedRuleSetOperationsTests(bool isAsync) : base(isAsync)//, RecordedTestMode.Record) { } [TestCase] [RecordedTest] public async Task List() { int count = 0; Subscription subscription = await Client.GetDefaultSubscriptionAsync(); await foreach (var tempManagedRuleSetDefinition in subscription.GetManagedRuleSetsAsync()) { count++; Assert.AreEqual(tempManagedRuleSetDefinition.Type, new ResourceType("Microsoft.Cdn/CdnWebApplicationFirewallManagedRuleSets")); } Assert.AreEqual(count, 1); } } }
30.911765
143
0.663178
[ "MIT" ]
AhmedLeithy/azure-sdk-for-net
sdk/cdn/Azure.ResourceManager.Cdn/tests/Scenario/ManagedRuleSetOperationsTests.cs
1,053
C#
/** * Copyright 2015 Canada Health Infoway, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Author: $LastChangedBy: tmcgrady $ * Last modified: $LastChangedDate: 2011-05-04 15:47:15 -0400 (Wed, 04 May 2011) $ * Revision: $LastChangedRevision: 2623 $ */ /* This class was auto-generated by the message builder generator tools. */ namespace Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_02.Common.Coct_mt910102ca { using Ca.Infoway.Messagebuilder.Annotation; using Ca.Infoway.Messagebuilder.Datatype; using Ca.Infoway.Messagebuilder.Datatype.Impl; using Ca.Infoway.Messagebuilder.Datatype.Lang; using Ca.Infoway.Messagebuilder.Domainvalue; using Ca.Infoway.Messagebuilder.Model; /** * <summary>Business Name: Related Person</summary> * * <p>Important for tracking source of information for decision * making and other actions taken on behalf of a patient.</p> * <p>Describes a person (other than a health-care provider or * employee) who is providing information and making decision * on behalf of the patient, in relation to the delivery of * healthcare for the patient. E.g. Patient's mother. Also used * with a relationship of &quot;self&quot; when the patient * themselves is providing the care.</p><p>The expectation is * that the person can be found in the client registry.</p> */ [Hl7PartTypeMappingAttribute(new string[] {"COCT_MT910102CA.PersonalRelationship"})] public class RelatedPerson : MessagePartBean, Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_02.Common.Coct_mt911102ca.IActingPerson { private II id; private CV code; private PN relationshipHolderName; public RelatedPerson() { this.id = new IIImpl(); this.code = new CVImpl(); this.relationshipHolderName = new PNImpl(); } /** * <summary>Business Name: B:Related Person Identifier</summary> * * <remarks>Relationship: * COCT_MT910102CA.PersonalRelationship.id * Conformance/Cardinality: MANDATORY (1) <p>ZPB1.6 (Root)</p> * <p>ZPB1.7 (EXtension)</p> <p>ZPB2.8 (Root)</p> <p>ZPB2.9 * (EXtension)</p> <p>ZPB3.11 (Root)</p> <p>ZPB3.12 * (EXtension)</p> <p>ZPB3.18 (Root)</p> <p>ZPB3.19 * (EXtension)</p> <p>D60 (Root)</p> <p>D61 (Extension)</p> * <p>D76</p> <p>PVD.020-01 (Extension)</p> <p>PVD.020-02 * (Root)</p> <p>PharmacyProvider.444-E9 (Extension)</p> * <p>PharmacyProvider.465-E7 (Root)</p> <p>Prescriber.446-EZ * (Extension)</p> <p>PharmacyProvider.411-DB (Root)</p> * <p>ZDP.18.1 (Extension)</p> <p>ZDP.18.2 (Root)</p> * <p>ZDP.19.1 (Extension)</p> <p>ZDP.19.2 (Root)</p> * <p>ZDP.10.1 (Extension)</p> <p>ZDP.10.2 (Root)</p> * <p>Provider.PproviderExternalKey (Extension)</p> * <p>Provider.providerKey (Extension)</p> * <p>Provider.wellnetProviderId (Extension)</p> * <p>ProviderRegistration.Identifier (Extension)</p> * <p>ProviderRegistration.IdentifierDomain (part of * Extension)</p> <p>ProviderRegistrationjurisdiction (part of * Extension)</p> <p>Allows a person to be uniquely referred to * and retrieved from the client registry and is therefore * mandatory.</p> <p>A unique identifier for the responsible * person (as found in a client registry).</p></remarks> */ [Hl7XmlMappingAttribute(new string[] {"id"})] public Identifier Id { get { return this.id.Value; } set { this.id.Value = value; } } /** * <summary>Business Name: C:Responsible Person Type</summary> * * <remarks>Relationship: * COCT_MT910102CA.PersonalRelationship.code * Conformance/Cardinality: MANDATORY (1) <p>Essential for * understanding the authority to perform certain actions as * well as the context of the information and is therefore * mandatory. E.g. A 'friend' may not be able to make consent * decisions, but may be able to pick up dispenses.</p><p> * <i>The element uses CWE to allow for the capture of * Responsible Person Type concepts not presently supported by * the approved code system(s). In this case, the * human-to-human benefit of capturing additional non-coded * values outweighs the penalties of capturing some information * that will not be amenable to searching or categorizing.</i> * </p> <p>A coded value indicating how the responsible person * is related to the patient. If the code is &quot;SELF&quot;, * it indicates that the action was performed by the patient * themselves.</p></remarks> */ [Hl7XmlMappingAttribute(new string[] {"code"})] public x_SimplePersonalRelationship Code { get { return (x_SimplePersonalRelationship) this.code.Value; } set { this.code.Value = value; } } /** * <summary>Business Name: A:Related Person Name</summary> * * <remarks>Relationship: COCT_MT910102CA.RelatedPerson.name * Conformance/Cardinality: MANDATORY (1) <p>ZPB3.13</p> * <p>PVD.050-01 (PartType = Family)</p> <p>PVD.050-02 * (PartType = Given - 1st rep)</p> <p>PVD.050-03 PartType = * Given - any rep other than the first)</p> <p>PVD.050-04 * (PartType = Suffix)</p> <p>PVD.050-05 (PartType = * Prefix)</p> <p>PVD.100-01 (PartType = Family; * author/performer when supervisor is also specified)</p> * <p>PVD.100-02 (PartType = Given - 1st rep; author/performer * when supervisor is also specified )</p> <p>PVD.100-03 * PartType = Given - any rep other than the first; * author/performer when supervisor is also specified)</p> * <p>PVD.100-04 (PartType = Suffix; author/performer when * supervisor is also specified)</p> <p>PVD.100-05 (PartType = * Prefix; author/performer when supervisor is also * specified)</p> <p>D1a</p> <p>Practitioner's Name</p> * <p>04.03</p> <p>Prescriber.427-DR</p> <p>Prescribing * Physician Name</p> <p>ZPS.18.3</p> <p>ZPS.18.4</p> * <p>ZPS.18.5</p> <p>ZPS.19.3</p> <p>ZPS.19.4</p> * <p>ZPS.19.5</p> <p>ZPS.10.3</p> <p>ZPS.10.4</p> * <p>ZPS.10.5</p> <p>ProviderPreviewInfo.ProviderName</p> * <p>Used when contacting or addressing the responsible * person. Because this will be the principle means of * identifying the responsible person, it is mandatory.</p> * <p>The name by which the responsible person is known</p></remarks> */ [Hl7XmlMappingAttribute(new string[] {"relationshipHolder/name"})] public PersonName RelationshipHolderName { get { return this.relationshipHolderName.Value; } set { this.relationshipHolderName.Value = value; } } } }
51.326797
142
0.613396
[ "ECL-2.0", "Apache-2.0" ]
CanadaHealthInfoway/message-builder-dotnet
message-builder-release-r02_04_02/Main/Ca/Infoway/Messagebuilder/Model/Pcs_mr2009_r02_04_02/Common/Coct_mt910102ca/RelatedPerson.cs
7,853
C#
using ElectronicObserver.Data.Battle; using ElectronicObserver.Data.Quest; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ElectronicObserver.Data { /// <summary> /// 艦これのデータを扱う中核です。 /// </summary> public sealed class KCDatabase { #region Singleton private static readonly KCDatabase instance = new KCDatabase(); public static KCDatabase Instance => instance; #endregion /// <summary> /// 艦船のマスターデータ /// </summary> public IDDictionary<ShipDataMaster> MasterShips { get; private set; } /// <summary> /// 艦種データ /// </summary> public IDDictionary<ShipType> ShipTypes { get; private set; } /// <summary> /// 艦船グラフィックデータ /// </summary> public IDDictionary<ShipGraphicData> ShipGraphics { get; private set; } /// <summary> /// 装備のマスターデータ /// </summary> public IDDictionary<EquipmentDataMaster> MasterEquipments { get; private set; } /// <summary> /// 装備種別 /// </summary> public IDDictionary<EquipmentType> EquipmentTypes { get; private set; } /// <summary> /// 保有艦娘のデータ /// </summary> public IDDictionary<ShipData> Ships { get; private set; } /// <summary> /// 保有装備のデータ /// </summary> public IDDictionary<EquipmentData> Equipments { get; private set; } /// <summary> /// 提督・司令部データ /// </summary> public AdmiralData Admiral { get; private set; } /// <summary> /// アイテムのマスターデータ /// </summary> public IDDictionary<UseItemMaster> MasterUseItems { get; private set; } /// <summary> /// アイテムデータ /// </summary> public IDDictionary<UseItem> UseItems { get; private set; } /// <summary> /// 工廠ドックデータ /// </summary> public IDDictionary<ArsenalData> Arsenals { get; private set; } /// <summary> /// 入渠ドックデータ /// </summary> public IDDictionary<DockData> Docks { get; private set; } /// <summary> /// 艦隊データ /// </summary> public FleetManager Fleet { get; private set; } /// <summary> /// 資源データ /// </summary> public MaterialData Material { get; private set; } /// <summary> /// 任務データ /// </summary> public QuestManager Quest { get; private set; } /// <summary> /// 任務進捗データ /// </summary> public QuestProgressManager QuestProgress { get; private set; } /// <summary> /// 戦闘データ /// </summary> public BattleManager Battle { get; private set; } /// <summary> /// 海域カテゴリデータ /// </summary> public IDDictionary<MapAreaData> MapArea { get; private set; } /// <summary> /// 海域データ /// </summary> public IDDictionary<MapInfoData> MapInfo { get; private set; } /// <summary> /// 遠征データ /// </summary> public IDDictionary<MissionData> Mission { get; private set; } /// <summary> /// 艦船グループデータ /// </summary> public ShipGroupManager ShipGroup { get; private set; } /// <summary> /// 基地航空隊データ /// </summary> public IDDictionary<BaseAirCorpsData> BaseAirCorps { get; private set; } /// <summary> /// 配置転換中装備データ /// </summary> public IDDictionary<RelocationData> RelocatedEquipments { get; private set; } private KCDatabase() { MasterShips = new IDDictionary<ShipDataMaster>(); ShipTypes = new IDDictionary<ShipType>(); ShipGraphics = new IDDictionary<ShipGraphicData>(); MasterEquipments = new IDDictionary<EquipmentDataMaster>(); EquipmentTypes = new IDDictionary<EquipmentType>(); Ships = new IDDictionary<ShipData>(); Equipments = new IDDictionary<EquipmentData>(); Admiral = new AdmiralData(); MasterUseItems = new IDDictionary<UseItemMaster>(); UseItems = new IDDictionary<UseItem>(); Arsenals = new IDDictionary<ArsenalData>(); Docks = new IDDictionary<DockData>(); Fleet = new FleetManager(); Material = new MaterialData(); Quest = new QuestManager(); QuestProgress = new QuestProgressManager(); Battle = new BattleManager(); MapArea = new IDDictionary<MapAreaData>(); MapInfo = new IDDictionary<MapInfoData>(); Mission = new IDDictionary<MissionData>(); ShipGroup = new ShipGroupManager(); BaseAirCorps = new IDDictionary<BaseAirCorpsData>(); RelocatedEquipments = new IDDictionary<RelocationData>(); } public void Load() { { var temp = (ShipGroupManager)ShipGroup.Load(); if (temp != null) ShipGroup = temp; } { var temp = QuestProgress.Load(); if (temp != null) { if (QuestProgress != null) QuestProgress.RemoveEvents(); QuestProgress = temp; } } } public void Save() { ShipGroup.Save(); QuestProgress.Save(); } } }
21.166667
81
0.65245
[ "MIT" ]
fossabot/ElectronicObserverExtended
ElectronicObserver/Data/KCDatabase.cs
4,950
C#
using System; using System.IO; using System.Threading; using System.Threading.Tasks; namespace StreamAbstractions { public class StreamWrapper : IStream { private readonly Stream _stream; public StreamWrapper(Stream stream) { _stream = stream; } public long Position { get => _stream.Position; set => _stream.Position = value; } public long Length => _stream.Length; public bool CanWrite => _stream.CanWrite; public bool CanTimeout => _stream.CanTimeout; public bool CanSeek => _stream.CanSeek; public bool CanRead => _stream.CanRead; public int ReadTimeout { get => _stream.ReadTimeout; set => _stream.ReadTimeout = value; } public int WriteTimeout { get => _stream.WriteTimeout; set => _stream.WriteTimeout = value; } public static Stream Synchronized(Stream stream) => Stream.Synchronized(stream); public IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state) => _stream.BeginRead(buffer, offset, count, callback, state); public IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state) => _stream.BeginWrite(buffer, offset, count, callback, state); public void Close() => _stream.Close(); public void CopyTo(Stream destination) => _stream.CopyTo(destination); public void CopyTo(Stream destination, int bufferSize) => _stream.CopyTo(destination, bufferSize); public Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) => _stream.CopyToAsync(destination, bufferSize, cancellationToken); public Task CopyToAsync(Stream destination, int bufferSize) => _stream.CopyToAsync(destination, bufferSize); public Task CopyToAsync(Stream destination) => _stream.CopyToAsync(destination); public void Dispose() => _stream.Dispose(); public int EndRead(IAsyncResult asyncResult) => _stream.EndRead(asyncResult); public void EndWrite(IAsyncResult asyncResult) => _stream.EndWrite(asyncResult); public void Flush() => _stream.Flush(); public Task FlushAsync() => _stream.FlushAsync(); public Task FlushAsync(CancellationToken cancellationToken) => _stream.FlushAsync(cancellationToken); public int Read(byte[] buffer, int offset, int count) => _stream.Read(buffer, offset, count); public Task<int> ReadAsync(byte[] buffer, int offset, int count) => _stream.ReadAsync(buffer, offset, count); public Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) => _stream.ReadAsync(buffer, offset, count, cancellationToken); public int ReadByte() => _stream.ReadByte(); public long Seek(long offset, SeekOrigin origin) => _stream.Seek(offset, origin); public void SetLength(long value) => _stream.SetLength(value); public void Write(byte[] buffer, int offset, int count) => _stream.Write(buffer, offset, count); public Task WriteAsync(byte[] buffer, int offset, int count) => _stream.WriteAsync(buffer, offset, count); public Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) => _stream.WriteAsync(buffer, offset, count, cancellationToken); public void WriteByte(byte value) => _stream.WriteByte(value); } }
37.030928
173
0.674833
[ "MIT" ]
Yakudo/StreamAbstractions
Src/StreamAbstractions/StreamWrapper.cs
3,594
C#
#region S# License /****************************************************************************************** NOTICE!!! This program and source code is owned and licensed by StockSharp, LLC, www.stocksharp.com Viewing or use of this code requires your acceptance of the license agreement found at https://github.com/StockSharp/StockSharp/blob/master/LICENSE Removal of this comment is a violation of the license agreement. Project: StockSharp.Messages.Messages File: ExecutionMessage.cs Created: 2015, 11, 11, 2:32 PM Copyright 2010 by StockSharp, LLC *******************************************************************************************/ #endregion S# License namespace StockSharp.Messages { using System; using System.ComponentModel; using System.Runtime.Serialization; using Ecng.Common; using Ecng.Serialization; using StockSharp.Localization; /// <summary> /// The types of data that contain information in <see cref="ExecutionMessage"/>. /// </summary> [System.Runtime.Serialization.DataContract] [Serializable] public enum ExecutionTypes { /// <summary> /// Tick trade. /// </summary> [EnumMember] Tick, /// <summary> /// Transaction. /// </summary> [EnumMember] Transaction, /// <summary> /// Obsolete. /// </summary> [EnumMember] [Obsolete] Obsolete, /// <summary> /// Order log. /// </summary> [EnumMember] OrderLog, } /// <summary> /// The message contains information about the execution. /// </summary> [Serializable] [System.Runtime.Serialization.DataContract] public sealed class ExecutionMessage : Message { /// <summary> /// Security ID. /// </summary> [DataMember] [DisplayNameLoc(LocalizedStrings.SecurityIdKey)] [DescriptionLoc(LocalizedStrings.SecurityIdKey, true)] [MainCategory] public SecurityId SecurityId { get; set; } /// <summary> /// Portfolio name. /// </summary> [DataMember] [DisplayNameLoc(LocalizedStrings.PortfolioKey)] [DescriptionLoc(LocalizedStrings.PortfolioNameKey)] [MainCategory] public string PortfolioName { get; set; } /// <summary> /// Client code assigned by the broker. /// </summary> [DataMember] [MainCategory] [DisplayNameLoc(LocalizedStrings.ClientCodeKey)] [DescriptionLoc(LocalizedStrings.ClientCodeDescKey)] public string ClientCode { get; set; } /// <summary> /// Broker firm code. /// </summary> [DataMember] [MainCategory] [CategoryLoc(LocalizedStrings.Str2593Key)] [DisplayNameLoc(LocalizedStrings.BrokerKey)] [DescriptionLoc(LocalizedStrings.Str2619Key)] public string BrokerCode { get; set; } /// <summary> /// The depositary where the physical security. /// </summary> [DisplayNameLoc(LocalizedStrings.DepoKey)] [DescriptionLoc(LocalizedStrings.DepoNameKey)] [MainCategory] public string DepoName { get; set; } /// <summary> /// Server time. /// </summary> [DataMember] [DisplayNameLoc(LocalizedStrings.ServerTimeKey)] [DescriptionLoc(LocalizedStrings.ServerTimeKey, true)] [MainCategory] public DateTimeOffset ServerTime { get; set; } /// <summary> /// Transaction ID. /// </summary> [DataMember] [DisplayNameLoc(LocalizedStrings.TransactionKey)] [DescriptionLoc(LocalizedStrings.TransactionIdKey, true)] [MainCategory] public long TransactionId { get; set; } /// <summary> /// ID of original transaction, for which this message is the answer. /// </summary> [DataMember] [DisplayNameLoc(LocalizedStrings.OriginalTransactionKey)] [DescriptionLoc(LocalizedStrings.OriginalTransactionIdKey)] [MainCategory] public long OriginalTransactionId { get; set; } /// <summary> /// Data type, information about which is contained in the <see cref="ExecutionMessage"/>. /// </summary> [DataMember] [DisplayNameLoc(LocalizedStrings.DataTypeKey)] [DescriptionLoc(LocalizedStrings.Str110Key)] [MainCategory] [Nullable] public ExecutionTypes? ExecutionType { get; set; } /// <summary> /// Is the action an order cancellation. /// </summary> [DataMember] [DisplayNameLoc(LocalizedStrings.CancelKey)] [DescriptionLoc(LocalizedStrings.IsActionOrderCancellationKey)] [MainCategory] public bool IsCancelled { get; set; } /// <summary> /// Order ID. /// </summary> [DataMember] [DisplayNameLoc(LocalizedStrings.OrderIdKey)] [DescriptionLoc(LocalizedStrings.OrderIdKey, true)] [MainCategory] [Nullable] public long? OrderId { get; set; } /// <summary> /// Order ID (as string, if electronic board does not use numeric order ID representation). /// </summary> [DataMember] [DisplayNameLoc(LocalizedStrings.OrderIdStringKey)] [DescriptionLoc(LocalizedStrings.OrderIdStringDescKey)] [MainCategory] public string OrderStringId { get; set; } /// <summary> /// Board order id. Uses in case of <see cref="ExecutionMessage.OrderId"/> and <see cref="ExecutionMessage.OrderStringId"/> is a brokerage system ids. /// </summary> [DataMember] [DisplayNameLoc(LocalizedStrings.Str117Key)] [DescriptionLoc(LocalizedStrings.Str118Key)] [MainCategory] public string OrderBoardId { get; set; } ///// <summary> ///// Derived order ID (e.g., conditional order generated a real exchange order). ///// </summary> //[DataMember] //[DisplayNameLoc(LocalizedStrings.DerivedKey)] //[DescriptionLoc(LocalizedStrings.DerivedOrderIdKey)] //[MainCategory] //[Nullable] //public long? DerivedOrderId { get; set; } ///// <summary> ///// Derived order ID (e.g., conditional order generated a real exchange order). ///// </summary> //[DataMember] //[DisplayNameLoc(LocalizedStrings.DerivedStringKey)] //[DescriptionLoc(LocalizedStrings.DerivedStringDescKey)] //[MainCategory] //public string DerivedOrderStringId { get; set; } /// <summary> /// Is the message contains order info. /// </summary> public bool HasOrderInfo { get; set; } /// <summary> /// Is the message contains trade info. /// </summary> public bool HasTradeInfo { get; set; } /// <summary> /// Order price. /// </summary> [DataMember] [DisplayNameLoc(LocalizedStrings.PriceKey)] [DescriptionLoc(LocalizedStrings.OrderPriceKey)] [MainCategory] public decimal OrderPrice { get; set; } /// <summary> /// Number of contracts in the order. /// </summary> [DataMember] [DisplayNameLoc(LocalizedStrings.VolumeOrderKey)] [DescriptionLoc(LocalizedStrings.OrderVolumeKey)] [MainCategory] [Nullable] public decimal? OrderVolume { get; set; } /// <summary> /// Number of contracts in the trade. /// </summary> [DataMember] [DisplayNameLoc(LocalizedStrings.VolumeTradeKey)] [DescriptionLoc(LocalizedStrings.TradeVolumeKey)] [MainCategory] [Nullable] public decimal? TradeVolume { get; set; } /// <summary> /// Visible quantity of contracts in order. /// </summary> [DataMember] [DisplayNameLoc(LocalizedStrings.VisibleVolumeKey)] [DescriptionLoc(LocalizedStrings.Str127Key)] [MainCategory] [Nullable] public decimal? VisibleVolume { get; set; } /// <summary> /// Order side (buy or sell). /// </summary> [DataMember] [DisplayNameLoc(LocalizedStrings.Str128Key)] [DescriptionLoc(LocalizedStrings.Str129Key)] [MainCategory] public Sides Side { get; set; } /// <summary> /// Order contracts remainder. /// </summary> [DataMember] [DisplayNameLoc(LocalizedStrings.Str130Key)] [DescriptionLoc(LocalizedStrings.Str131Key)] [MainCategory] [Nullable] public decimal? Balance { get; set; } /// <summary> /// Order type. /// </summary> [DataMember] [DisplayNameLoc(LocalizedStrings.Str132Key)] [DescriptionLoc(LocalizedStrings.Str133Key)] [MainCategory] public OrderTypes? OrderType { get; set; } /// <summary> /// System order status. /// </summary> [DataMember] [Browsable(false)] [Nullable] public long? OrderStatus { get; set; } /// <summary> /// Order state. /// </summary> [DataMember] [DisplayNameLoc(LocalizedStrings.StateKey)] [DescriptionLoc(LocalizedStrings.Str134Key)] [MainCategory] [Nullable] public OrderStates? OrderState { get; set; } /// <summary> /// Placed order comment. /// </summary> [DataMember] [DisplayNameLoc(LocalizedStrings.Str135Key)] [DescriptionLoc(LocalizedStrings.Str136Key)] [MainCategory] public string Comment { get; set; } /// <summary> /// Message for order (created by the trading system when registered, changed or cancelled). /// </summary> [DisplayNameLoc(LocalizedStrings.Str137Key)] [DescriptionLoc(LocalizedStrings.Str138Key)] [MainCategory] public string SystemComment { get; set; } /// <summary> /// Is a system trade. /// </summary> [DataMember] [DisplayNameLoc(LocalizedStrings.Str139Key)] [DescriptionLoc(LocalizedStrings.Str140Key)] [MainCategory] [Nullable] public bool? IsSystem { get; set; } /// <summary> /// Order expiry time. The default is <see langword="null" />, which mean (GTC). /// </summary> /// <remarks> /// If the value is equal <see langword="null" />, order will be GTC (good til cancel). Or uses exact date. /// </remarks> [DataMember] [DisplayNameLoc(LocalizedStrings.Str141Key)] [DescriptionLoc(LocalizedStrings.Str142Key)] [MainCategory] public DateTimeOffset? ExpiryDate { get; set; } /// <summary> /// Limit order execution condition. /// </summary> [DisplayNameLoc(LocalizedStrings.Str143Key)] [DescriptionLoc(LocalizedStrings.Str144Key)] [MainCategory] [Nullable] public TimeInForce? TimeInForce { get; set; } /// <summary> /// Trade ID. /// </summary> [DataMember] [DisplayNameLoc(LocalizedStrings.OrderIdKey)] [DescriptionLoc(LocalizedStrings.Str145Key)] [MainCategory] [Nullable] public long? TradeId { get; set; } /// <summary> /// Trade ID (as string, if electronic board does not use numeric order ID representation). /// </summary> [DataMember] [DisplayNameLoc(LocalizedStrings.OrderIdStringKey)] [DescriptionLoc(LocalizedStrings.Str146Key)] [MainCategory] public string TradeStringId { get; set; } /// <summary> /// Trade price. /// </summary> [DataMember] [DisplayNameLoc(LocalizedStrings.PriceKey)] [DescriptionLoc(LocalizedStrings.Str147Key)] [MainCategory] [Nullable] public decimal? TradePrice { get; set; } /// <summary> /// System trade status. /// </summary> [DataMember] [Browsable(false)] [Nullable] public int? TradeStatus { get; set; } /// <summary> /// Deal initiator (seller or buyer). /// </summary> [DataMember] [DisplayNameLoc(LocalizedStrings.Str148Key)] [DescriptionLoc(LocalizedStrings.Str149Key)] [MainCategory] [Nullable] public Sides? OriginSide { get; set; } /// <summary> /// Number of open positions (open interest). /// </summary> [DataMember] [DisplayNameLoc(LocalizedStrings.Str150Key)] [DescriptionLoc(LocalizedStrings.Str151Key)] [MainCategory] [Nullable] public decimal? OpenInterest { get; set; } /// <summary> /// Error registering/cancelling order. /// </summary> [DisplayNameLoc(LocalizedStrings.Str152Key)] [DescriptionLoc(LocalizedStrings.Str153Key, true)] [MainCategory] public Exception Error { get; set; } /// <summary> /// Order condition (e.g., stop- and algo- orders parameters). /// </summary> [DisplayNameLoc(LocalizedStrings.Str154Key)] [DescriptionLoc(LocalizedStrings.Str155Key)] [CategoryLoc(LocalizedStrings.Str156Key)] public OrderCondition Condition { get; set; } ///// <summary> ///// Является ли сообщение последним в запрашиваемом пакете (только для исторических сделок). ///// </summary> //[DataMember] //[DisplayName("Последний")] //[Description("Является ли сообщение последним в запрашиваемом пакете (только для исторических сделок).")] //[MainCategory] //public bool IsFinished { get; set; } /// <summary> /// Is tick uptrend or downtrend in price. Uses only <see cref="ExecutionType"/> for <see cref="ExecutionTypes.Tick"/>. /// </summary> [DataMember] [DisplayNameLoc(LocalizedStrings.Str157Key)] [DescriptionLoc(LocalizedStrings.Str158Key)] [MainCategory] [Nullable] public bool? IsUpTick { get; set; } /// <summary> /// Commission (broker, exchange etc.). Uses when <see cref="ExecutionType"/> set to <see cref="ExecutionTypes.Transaction"/>. /// </summary> [DataMember] [DisplayNameLoc(LocalizedStrings.Str159Key)] [DescriptionLoc(LocalizedStrings.Str160Key)] [MainCategory] [Nullable] public decimal? Commission { get; set; } /// <summary> /// Network latency. Uses when <see cref="ExecutionType"/> set to <see cref="ExecutionTypes.Transaction"/>. /// </summary> [DataMember] [DisplayNameLoc(LocalizedStrings.Str161Key)] [DescriptionLoc(LocalizedStrings.Str162Key)] [MainCategory] [Nullable] public TimeSpan? Latency { get; set; } /// <summary> /// Slippage in trade price. Uses when <see cref="ExecutionType"/> set to <see cref="ExecutionTypes.Transaction"/>. /// </summary> [DataMember] [DisplayNameLoc(LocalizedStrings.Str163Key)] [DescriptionLoc(LocalizedStrings.Str164Key)] [MainCategory] [Nullable] public decimal? Slippage { get; set; } /// <summary> /// User order id. Uses when <see cref="ExecutionType"/> set to <see cref="ExecutionTypes.Transaction"/>. /// </summary> [DataMember] [DisplayNameLoc(LocalizedStrings.Str165Key)] [DescriptionLoc(LocalizedStrings.Str166Key)] [MainCategory] public string UserOrderId { get; set; } /// <summary> /// Trading security currency. /// </summary> [DataMember] [DisplayNameLoc(LocalizedStrings.CurrencyKey)] [DescriptionLoc(LocalizedStrings.Str382Key)] [MainCategory] [Nullable] public CurrencyTypes? Currency { get; set; } /// <summary> /// The profit, realized by trade. /// </summary> [DataMember] [DisplayNameLoc(LocalizedStrings.PnLKey)] [DescriptionLoc(LocalizedStrings.PnLKey, true)] [MainCategory] [Nullable] public decimal? PnL { get; set; } /// <summary> /// The position, generated by order or trade. /// </summary> [DataMember] [DisplayNameLoc(LocalizedStrings.Str862Key)] [DescriptionLoc(LocalizedStrings.Str862Key, true)] [MainCategory] [Nullable] public decimal? Position { get; set; } /// <summary> /// Is the order of market-maker. /// </summary> [DataMember] [DisplayNameLoc(LocalizedStrings.MarketMakerKey)] [DescriptionLoc(LocalizedStrings.MarketMakerOrderKey, true)] public bool? IsMarketMaker { get; set; } /// <summary> /// Initializes a new instance of the <see cref="ExecutionMessage"/>. /// </summary> public ExecutionMessage() : base(MessageTypes.Execution) { } /// <summary> /// Returns a string that represents the current object. /// </summary> /// <returns>A string that represents the current object.</returns> public override string ToString() { return base.ToString() + $",T(S)={ServerTime:yyyy/MM/dd HH:mm:ss.fff},({ExecutionType}),Sec={SecurityId},Ord={OrderId}/{TransactionId}/{OriginalTransactionId},Fail={Error},Price={OrderPrice},OrdVol={OrderVolume},TrVol={TradeVolume},Bal={Balance},TId={TradeId},Pf={PortfolioName},TPrice={TradePrice},UId={UserOrderId},State={OrderState}"; } /// <summary> /// Create a copy of <see cref="ExecutionMessage"/>. /// </summary> /// <returns>Copy.</returns> public override Message Clone() { var clone = new ExecutionMessage { Balance = Balance, Comment = Comment, Condition = Condition.CloneNullable(), ClientCode = ClientCode, BrokerCode = BrokerCode, Currency = Currency, ServerTime = ServerTime, DepoName = DepoName, Error = Error, ExpiryDate = ExpiryDate, IsSystem = IsSystem, LocalTime = LocalTime, OpenInterest = OpenInterest, OrderId = OrderId, OrderStringId = OrderStringId, OrderBoardId = OrderBoardId, ExecutionType = ExecutionType, IsCancelled = IsCancelled, //Action = Action, OrderState = OrderState, OrderStatus = OrderStatus, OrderType = OrderType, OriginSide = OriginSide, PortfolioName = PortfolioName, OrderPrice = OrderPrice, SecurityId = SecurityId, Side = Side, SystemComment = SystemComment, TimeInForce = TimeInForce, TradeId = TradeId, TradeStringId = TradeStringId, TradePrice = TradePrice, TradeStatus = TradeStatus, TransactionId = TransactionId, OriginalTransactionId = OriginalTransactionId, OrderVolume = OrderVolume, TradeVolume = TradeVolume, //IsFinished = IsFinished, VisibleVolume = VisibleVolume, IsUpTick = IsUpTick, Commission = Commission, Latency = Latency, Slippage = Slippage, UserOrderId = UserOrderId, //DerivedOrderId = DerivedOrderId, //DerivedOrderStringId = DerivedOrderStringId, PnL = PnL, Position = Position, HasTradeInfo = HasTradeInfo, HasOrderInfo = HasOrderInfo, IsMarketMaker = IsMarketMaker }; this.CopyExtensionInfo(clone); return clone; } } }
28.19702
340
0.69074
[ "Apache-2.0" ]
gridgentoo/StockSharp.ADO.Net
Messages/ExecutionMessage.cs
17,190
C#
using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerController : MonoBehaviour { public delegate void PlayerSurvivalTimeEvent(float time); public event PlayerSurvivalTimeEvent PlayerSurvival; private float _aliveTime; public float Speed; private float _fireRate = .5f; private float _nextFireTime = 0.0F; public GameObject Bullet; private bool _bulletFired = true; public Animator CharacterAnimator; // Start is called before the first frame update void Start() { } void OnTriggerEnter2D(Collider2D collider) { if (Globals.CurGameState == GameState.PlayingGame) { if (collider.gameObject.tag == "Ghost") { Globals.Health--; Destroy(collider.gameObject); //if (Globals.Health <= 0) // PlayerSurvival(_aliveTime); } } } // Update is called once per frame void Update() { if (Globals.CurGameState == GameState.PlayingGame) { _aliveTime += Time.deltaTime; Vector3 vel = new Vector3(); vel.x = Input.GetAxis("Horizontal"); vel.y = Input.GetAxis("Vertical"); Vector3.Normalize(vel); vel *= Speed; if (vel != Vector3.zero && !CharacterAnimator.GetBool("IsWalking")) { UnityEngine.Debug.Log("Setting IsWalking to true"); CharacterAnimator.SetBool("IsWalking", true); } else if (CharacterAnimator.GetBool("IsWalking") && vel == Vector3.zero) { UnityEngine.Debug.Log("Setting IsWalking to false"); CharacterAnimator.SetBool("IsWalking", false); } float x, y; GetComponent<Rigidbody2D>().velocity = vel; x = Mathf.Clamp(transform.position.x, -4.5f, 4.5f); y = Mathf.Clamp(transform.position.y, -3.0f, 3.0f); transform.position = new Vector3(x, y, 0); Vector2 offset; Vector3 mouse = Input.mousePosition; Vector3 screenPoint = Camera.main.WorldToScreenPoint(transform.localPosition); float angle=0.0f; //rotation if (Input.GetJoystickNames().Length > 0) { offset = new Vector2(Input.GetAxis("4"), Input.GetAxis("5")); angle = Mathf.Atan2(offset.y, offset.x) * Mathf.Rad2Deg - 90.0f; } else { offset = new Vector2(mouse.x - screenPoint.x, mouse.y - screenPoint.y); angle = Mathf.Atan2(offset.y, offset.x) * Mathf.Rad2Deg - 90.0f; } transform.rotation = Quaternion.Euler(0, 0, angle); if (_bulletFired) { _nextFireTime += Time.deltaTime; if (_nextFireTime >= _fireRate) _bulletFired = false; } if (Input.GetButton("Fire1") && !_bulletFired) { //spawn bullet Globals.BulletAudioSource.Play(); GameObject bullet = (GameObject)Instantiate(Bullet, transform.position, transform.rotation); _nextFireTime -= _fireRate; _bulletFired = true; } } } }
28.008197
108
0.54463
[ "MIT" ]
gusenov/ghost-arena-unity
Ghost Arena/Assets/Scripts/PlayerController.cs
3,419
C#
using System.Diagnostics.CodeAnalysis; using System.Linq; using EbnfCompiler.AST.Impl; using EbnfCompiler.Compiler; using Moq; using NUnit.Framework; namespace EbnfCompiler.AST.UnitTests { [TestFixture, ExcludeFromCodeCoverage] public class NodeTests { private IDebugTracer _tracer; [SetUp] public void Setup() { _tracer = new Mock<IDebugTracer>().Object; } [Test] public void SyntaxNode_WhenToStringCalled_ReturnsCorrectString() { // Arranged: var stmtNodeMock = new Mock<IStatementNode>(); stmtNodeMock.Setup(node=> node.ToString()).Returns(()=> "<S> ::= \"a\" ."); var syntaxNode = new SyntaxNode(new Token(), _tracer); syntaxNode.AppendStatement(stmtNodeMock.Object); // Act: var actual = syntaxNode.ToString(); // Assert: Assert.That(actual, Is.EqualTo("<S> ::= \"a\" .\r\n")); } [Test] public void StatementNode_WhenToStringCalled_ReturnsCorrectString() { // Arranged: var exprNodeMock = new Mock<IExpressionNode>(); exprNodeMock.Setup(node => node.ToString()).Returns(() => "\"a\""); var stmtNode = new StatementNode(new Token(TokenKind.Identifier, "<S>"), _tracer) { Expression = exprNodeMock.Object }; // Act: var actual = stmtNode.ToString(); // Assert: Assert.That(actual, Is.EqualTo("<S> ::= \"a\" .")); } [Test] public void StatementNode_WhenValidTree_CalculatesCorrectFirstSet() { // Arrange: var tracer = new Mock<IDebugTracer>().Object; var tree = BuildTree(tracer); // Act: var firstSetS = tree.Statements.First(p => p.ProdName == "<S>").FirstSet; var firstSetT = tree.Statements.First(p => p.ProdName == "<T>").FirstSet; var firstSetU = tree.Statements.First(p => p.ProdName == "<U>").FirstSet; // Assert: Assert.That(firstSetS.ToString(), Is.EqualTo("[ a ]")); Assert.That(firstSetT.ToString(), Is.EqualTo("[ b,$EPSILON$ ]")); Assert.That(firstSetU.ToString(), Is.EqualTo("[ c ]")); } private ISyntaxNode BuildTree(IDebugTracer tracer) { using var sb = new SyntaxBuilder(tracer); sb.Syntax( sb.Statement("<S>", sb.Expression( sb.Term( sb.Factor(sb.Terminal("a")), sb.Factor(sb.ProdRef("<T>")), sb.Factor(sb.ProdRef("<U>")) ) ) ), sb.Statement("<T>", sb.Expression( sb.Term( sb.Factor( sb.Option( sb.Expression( sb.Term( sb.Factor(sb.Terminal("b")) ) ) ) ) ) ) ), sb.Statement("<U>", sb.Expression( sb.Term( sb.Factor( sb.Kleene( sb.Expression( sb.Term( sb.Factor(sb.Terminal("c")) ) ) ) ) ) ) ) ); return sb.BuildTree(); } [Test] public void ExpressionNode_WhenToStringCalled_ReturnsCorrectString() { // Arranged: var termNodeMock1 = new Mock<ITermNode>(); termNodeMock1.Setup(node => node.ToString()).Returns(() => "<U>"); var termNodeMock2 = new Mock<ITermNode>(); termNodeMock2.Setup(node => node.ToString()).Returns(() => "<T>"); var exprNode = new ExpressionNode(new Token(), _tracer); exprNode.AppendTerm(termNodeMock1.Object); exprNode.AppendTerm(termNodeMock2.Object); // Act: var actual = exprNode.ToString(); // Assert: Assert.That(actual, Is.EqualTo("<U> | <T>")); } [Test] public void TermNode_WhenToStringCalled_ReturnsCorrectString() { // Arranged: var factNodeMock1 = new Mock<IFactorNode>(); factNodeMock1.Setup(node => node.ToString()).Returns(() => "<T>"); var factNodeMock2 = new Mock<IFactorNode>(); factNodeMock2.Setup(node => node.ToString()).Returns(() => "<U>"); var termNode = new TermNode(new Token(TokenKind.String, "\"a\""), _tracer); termNode.AppendFactor(factNodeMock1.Object); termNode.AppendFactor(factNodeMock2.Object); // Act: var actual = termNode.ToString(); // Assert: Assert.That(actual, Is.EqualTo("<T> <U>")); } [Test] public void FactorNode_WithIdentifier_ReturnsCorrectString() { // Arranged: var prodRefNode = new Mock<IProdRefNode>(); prodRefNode.Setup(terminalNode => terminalNode.AstNodeType).Returns(AstNodeType.ProdRef); prodRefNode.Setup(terminalNode => terminalNode.ToString()).Returns(() => "<T>"); var factNode = new FactorNode(new Token(TokenKind.Identifier, "T"), _tracer) { FactorExpr = prodRefNode.Object }; // Act: var actual = factNode.ToString(); // Assert: Assert.That(actual, Is.EqualTo("<T>")); } [Test] public void FactorNode_WithTerminal_ReturnsCorrectString() { // Arranged: var terminalNodeMock = new Mock<ITerminalNode>(); terminalNodeMock.Setup(node => node.AstNodeType).Returns(AstNodeType.Expression); terminalNodeMock.Setup(node => node.ToString()).Returns(() => "\"a\""); var factNode = new FactorNode(new Token(TokenKind.String, "a"), _tracer) { FactorExpr = terminalNodeMock.Object }; // Act: var actual = factNode.ToString(); // Assert: Assert.That(actual, Is.EqualTo("\"a\"")); } [Test] public void FactorNode_WithParens_ReturnsCorrectString() { // Arranged: var parenNodeMock = new Mock<IParenNode>(); parenNodeMock.Setup(node => node.AstNodeType).Returns(AstNodeType.Expression); parenNodeMock.Setup(node => node.ToString()).Returns(() => "( <U> )"); var factNode = new FactorNode(new Token(), _tracer); factNode.FactorExpr = parenNodeMock.Object; // Act: var actual = factNode.ToString(); // Assert: Assert.That(actual, Is.EqualTo("( <U> )")); } [Test] public void ProdRefNode_WithIdentifier_ReturnsCorrectString() { // Arranged: var node = new ProdRefNode(new Token(TokenKind.Identifier, "<T>"), _tracer); // Act: var actual = node.ToString(); // Assert: Assert.That(actual, Is.EqualTo("<T>")); } [Test] public void TerminalNode_WithString_ReturnsCorrectString() { // Arranged: var node = new TerminalNode(new Token(TokenKind.String, "a"), _tracer); // Act: var actual = node.ToString(); // Assert: Assert.That(actual, Is.EqualTo("\"a\"")); } [Test] public void ParenNode_WithExpression_ReturnsCorrectString() { // Arranged: var exprNodeMock = new Mock<IExpressionNode>(); exprNodeMock.Setup(exprNode => exprNode.AstNodeType).Returns(AstNodeType.Expression); exprNodeMock.Setup(exprNode => exprNode.ToString()).Returns(() => "<T>"); var node = new ParenNode(new Token(TokenKind.LeftParen, "("), _tracer) {Expression = exprNodeMock.Object}; // Act: var actual = node.ToString(); // Assert: Assert.That(actual, Is.EqualTo("( <T> )")); } [Test] public void OptionNode_WithExpression_ReturnsCorrectString() { // Arranged: var exprNodeMock = new Mock<IExpressionNode>(); exprNodeMock.Setup(exprNode => exprNode.AstNodeType).Returns(AstNodeType.Expression); exprNodeMock.Setup(exprNode => exprNode.ToString()).Returns(() => "<T>"); var node = new OptionNode(new Token(TokenKind.LeftBracket, "["), _tracer) {Expression = exprNodeMock.Object}; // Act: var actual = node.ToString(); // Assert: Assert.That(actual, Is.EqualTo("[ <T> ]")); } [Test] public void KleeneNode_WithExpression_ReturnsCorrectString() { // Arranged: var exprNodeMock = new Mock<IExpressionNode>(); exprNodeMock.Setup(exprNode => exprNode.AstNodeType).Returns(AstNodeType.Expression); exprNodeMock.Setup(exprNode => exprNode.ToString()).Returns(() => "<T>"); var node = new KleeneNode(new Token(TokenKind.LeftBrace, "("), _tracer) {Expression = exprNodeMock.Object}; // Act: var actual = node.ToString(); // Assert: Assert.That(actual, Is.EqualTo("{ <T> }")); } [Test] public void ActionNode__ReturnsCorrectString() { // Arranged: var node = new ActionNode(new Token(TokenKind.Action, "#Action#"), _tracer); // Act: var actual = node.ToString(); // Assert: Assert.That(actual, Is.EqualTo("#Action#")); } } }
31.821782
123
0.536092
[ "MIT" ]
ngdrascal/ebnfcompiler
UnitTests/EbnfCompiler.AST.UnitTests/NodeTests.cs
9,644
C#
using System; using System.IO; using System.Threading; using System.Windows; using Hardcodet.Wpf.TaskbarNotification; using WinGistsConfiguration.Configuration; namespace Uploader { public partial class App : Application { private static UploaderIcon icon; private static Executor executor; protected override void OnStartup(StartupEventArgs startupEvent){ String[] args = startupEvent.Args; icon = new UploaderIcon(); try{ ConfigurationManager.Configuration = ConfigurationManager.LoadConfigurationFromFile(); if (IsValidInput(args)){ InitializeExecutor(args[0]); if (ConfigurationManager.ShowBubbleNotifications){ EnableNotifications(); } executor.Execute(); } } catch (Exception exception){ icon.ShowErrorBallon("An error occured: "+exception.InnerException.Message); } Current.Shutdown(); } private static void InitializeExecutor(String filepath){ var executionConfiguration = new ExecutionConfiguration { Filepath = filepath, Configuration = ConfigurationManager.LoadConfigurationFromFile() }; executor = new Executor(executionConfiguration); } private static void EnableNotifications(){ executor.OnError += icon.ShowErrorBallon; executor.OnNotify += icon.ShowStandardBaloon; executor.OnFinish += icon.ShowStandardBaloon; } private static Boolean IsValidInput(String[] args){ if (args.Length != 1){ throw new Exception("Invalid number of input arguments."); } if (!File.Exists(args[0])){ throw new Exception("Error: File " + args + " does not exist."); } return true; } } }
33.409836
102
0.578508
[ "MIT" ]
hschroedl/win-gists
Uploader/App.xaml.cs
2,040
C#
using Kernel.Config; using System; using System.Reflection; namespace Kernel.Lang.Attribute { [AttributeUsage(AttributeTargets.Field, AllowMultiple = true)] public abstract class ValidateAttribute : System.Attribute { public virtual bool Validate(FieldInfo fieldInfo, object fieldValue, Type configType, object configValue, string name, ConfigFieldInfo[] confFieldInfos) { return true; } } public class ConsoleOutputErrorBlock : IDisposable { public ConsoleOutputErrorBlock() { #if CODE_GEN Console.ForegroundColor = ConsoleColor.Red; #endif } public void Dispose() { #if CODE_GEN Console.ResetColor(); #endif } } }
22
155
0.72434
[ "MIT" ]
hsiuqnav/configMgr
configMgr/Assets/Scripts/Manager/Config/Attribute/ValidateAttribute.cs
684
C#
using System; using System.Collections.Generic; using Microsoft.EntityFrameworkCore.Migrations; namespace tibs.stem.Migrations { public partial class AlterProductGroupTable : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropColumn( name: "ProductGroupCode", table: "ProductGroup"); migrationBuilder.AddColumn<string>( name: "AttributeData", table: "ProductGroup", nullable: true); migrationBuilder.AddColumn<int>( name: "FamilyId", table: "ProductGroup", nullable: true); migrationBuilder.CreateIndex( name: "IX_ProductGroup_FamilyId", table: "ProductGroup", column: "FamilyId"); migrationBuilder.AddForeignKey( name: "FK_ProductGroup_ProductFamily_FamilyId", table: "ProductGroup", column: "FamilyId", principalTable: "ProductFamily", principalColumn: "Id", onDelete: ReferentialAction.Restrict); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_ProductGroup_ProductFamily_FamilyId", table: "ProductGroup"); migrationBuilder.DropIndex( name: "IX_ProductGroup_FamilyId", table: "ProductGroup"); migrationBuilder.DropColumn( name: "AttributeData", table: "ProductGroup"); migrationBuilder.DropColumn( name: "FamilyId", table: "ProductGroup"); migrationBuilder.AddColumn<string>( name: "ProductGroupCode", table: "ProductGroup", nullable: false, defaultValue: ""); } } }
31.292308
71
0.546706
[ "Apache-2.0" ]
realvino/Core-2.0
src/tibs.stem.EntityFrameworkCore/Migrations/20170913180653_Alter-ProductGroup-Table.cs
2,036
C#
namespace Microsoft.Protocols.TestSuites.MS_OXNSPI { using System; /// <summary> /// A class indicates the response body of GetProps request /// </summary> public class GetTemplateInfoResponseBody : AddressBookResponseBodyBase { /// <summary> /// Gets or sets an unsigned integer that specifies the return status of the operation. /// </summary> public uint ErrorCode { get; set; } /// <summary> /// Gets or sets an unsigned integer that specifies the code page that the server used to express string properties. /// </summary> public uint CodePage { get; set; } /// <summary> /// Gets or sets a value indicating whether the Row field is present. /// </summary> public bool HasRow { get; set; } /// <summary> /// Gets or sets a AddressBookPropValueList structure that specifies the information that the client request. /// </summary> public AddressBookPropValueList? Row { get; set; } /// <summary> /// Parse the response data into response body. /// </summary> /// <param name="rawData">The raw data of response</param> /// <returns>The response body of the request</returns> public static GetTemplateInfoResponseBody Parse(byte[] rawData) { GetTemplateInfoResponseBody responseBody = new GetTemplateInfoResponseBody(); int index = 0; responseBody.StatusCode = BitConverter.ToUInt32(rawData, index); index += sizeof(uint); responseBody.ErrorCode = BitConverter.ToUInt32(rawData, index); index += sizeof(uint); responseBody.CodePage = BitConverter.ToUInt32(rawData, index); index += sizeof(uint); responseBody.HasRow = BitConverter.ToBoolean(rawData, index); index += sizeof(bool); if (responseBody.HasRow) { responseBody.Row = AddressBookPropValueList.Parse(rawData, ref index); } else { responseBody.Row = null; } responseBody.AuxiliaryBufferSize = BitConverter.ToUInt32(rawData, index); index += 4; responseBody.AuxiliaryBuffer = new byte[responseBody.AuxiliaryBufferSize]; Array.Copy(rawData, index, responseBody.AuxiliaryBuffer, 0, responseBody.AuxiliaryBufferSize); return responseBody; } } }
40.203125
125
0.592305
[ "MIT" ]
ChangDu2021/Interop-TestSuites
ExchangeMAPI/Source/MS-OXNSPI/Adapter/Helper/Structure/ResponseBody/GetTemplateInfoResponseBody.cs
2,573
C#
using System; using System.Globalization; using System.Linq; namespace Memoria.Prime.CSV { public static class CsvParser { public static Boolean Boolean(String raw) { switch (raw[0]) { case '1': return true; case '0': return false; default: throw new NotSupportedException(raw); } } private const NumberStyles NumberStyle = NumberStyles.Integer | NumberStyles.AllowLeadingWhite | NumberStyles.AllowTrailingWhite; public static Byte ByteOrMinusOne(String raw) { if (raw.Contains("-1")) return System.Byte.MaxValue; return Byte(raw); } public static Byte Byte(String raw) { return System.Byte.Parse(raw, NumberStyle, CultureInfo.InvariantCulture); } public static Int16 Int16(String raw) { return System.Int16.Parse(raw, NumberStyle, CultureInfo.InvariantCulture); } public static Int32 Int32(String raw) { return System.Int32.Parse(raw, NumberStyle, CultureInfo.InvariantCulture); } public static UInt16 UInt16(String raw) { return System.UInt16.Parse(raw, NumberStyle, CultureInfo.InvariantCulture); } public static UInt32 UInt32(String raw) { return System.UInt32.Parse(raw, NumberStyle, CultureInfo.InvariantCulture); } public static UInt64 UInt64(String raw) { return System.UInt64.Parse(raw, NumberStyle, CultureInfo.InvariantCulture); } public static T EnumValue<T>(String raw) where T : struct { Int32 bracketIndex = raw.IndexOf('('); UInt64 value; if (bracketIndex >= 0) { Int32 nextBracket = raw.IndexOf(')', bracketIndex + 2); if (nextBracket < 0) throw new CsvParseException($"Cannot find closing bracket: {raw}"); String subString = raw.Substring(bracketIndex + 1, nextBracket - bracketIndex - 1); value = System.UInt64.Parse(subString, NumberStyle, CultureInfo.InvariantCulture); } else { if (!System.UInt64.TryParse(raw, NumberStyle, CultureInfo.InvariantCulture, out value)) throw new CsvParseException($"Cannot cast {raw} to {TypeCache<T>.Type.FullName}"); } return Caster<UInt64, T>.Cast(value); } public static Byte[] ByteArray(String raw) { if (System.String.IsNullOrEmpty(raw)) return new Byte[0]; return raw.Split(',').Select(Byte).ToArray(); } public static String String(String raw) { if (raw == "<null>") return null; if (raw == "\"\"") return System.String.Empty; return raw; } } }
30.382353
137
0.544046
[ "MIT" ]
Albeoris/Memoria
Memoria.Prime/CSV/CsvParser.cs
3,101
C#
namespace ApplicationCore.Contract.Responses { public class LoginResponse { public string AccessToken { get; set; } public string UserName { get; set; } } }
23
47
0.652174
[ "MIT" ]
Plemiona-2-5/api
TribalWars/src/ApplicationCore/Contract/Responses/LoginResponse.cs
184
C#
/* * Copyright (c) Contributors, http://aurora-sim.org/, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the Aurora-Sim Project nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ using System.Collections.Generic; using System.Reflection; using Nini.Config; using OpenMetaverse; namespace Aurora.Framework { public delegate void RaycastCallback( bool hitYN, Vector3 collisionPoint, uint localid, float distance, Vector3 normal); public delegate void RayCallback(List<ContactResult> list); public struct ContactResult { public uint ConsumerID; public float Depth; public Vector3 Normal; public Vector3 Pos; } public delegate void OnCollisionEvent(PhysicsActor actor, PhysicsActor collidedActor, ContactPoint contact); public abstract class PhysicsScene { public virtual float TimeDilation { get { return 1.0f; } set { } } public virtual float StepTime { get { return 0; } } public virtual bool IsThreaded { get { return false; } } public virtual bool DisableCollisions { get; set; } public virtual List<PhysicsObject> ActiveObjects { get { return null; } } public virtual bool UseUnderWaterPhysics { get { return false; } } public virtual int StatPhysicsTaintTime { get; protected set; } public virtual int StatPhysicsMoveTime { get; protected set; } public virtual int StatCollisionOptimizedTime { get; protected set; } public virtual int StatSendCollisionsTime { get; protected set; } public virtual int StatAvatarUpdatePosAndVelocity { get; protected set; } public virtual int StatPrimUpdatePosAndVelocity { get; protected set; } public virtual int StatUnlockedArea { get; protected set; } public virtual int StatFindContactsTime { get; protected set; } public virtual int StatContactLoopTime { get; protected set; } public virtual int StatCollisionAccountingTime { get; protected set; } public abstract void Initialise(IMesher meshmerizer, RegionInfo region, IRegistryCore registry); public abstract void PostInitialise(IConfigSource config); public abstract PhysicsCharacter AddAvatar(string avName, Vector3 position, Quaternion rotation, Vector3 size, bool isFlying, uint LocalID, UUID UUID); public abstract void RemoveAvatar(PhysicsCharacter actor); public abstract void RemovePrim(PhysicsObject prim); public abstract void DeletePrim(PhysicsObject prim); public abstract PhysicsObject AddPrimShape(ISceneChildEntity entity); public abstract void Simulate(float timeStep); public virtual void GetResults() { } public abstract void SetTerrain(ITerrainChannel channel, short[] heightMap); public abstract void SetWaterLevel(double height, short[] map); public abstract void Dispose(); public abstract Dictionary<uint, float> GetTopColliders(); /// <summary> /// True if the physics plugin supports raycasting against the physics scene /// </summary> public virtual bool SupportsRayCast() { return false; } /// <summary> /// Queue a raycast against the physics scene. /// The provided callback method will be called when the raycast is complete /// /// Many physics engines don't support collision testing at the same time as /// manipulating the physics scene, so we queue the request up and callback /// a custom method when the raycast is complete. /// This allows physics engines that give an immediate result to callback immediately /// and ones that don't, to callback when it gets a result back. /// /// ODE for example will not allow you to change the scene while collision testing or /// it asserts, 'opteration not valid for locked space'. This includes adding a ray to the scene. /// /// This is named RayCastWorld to not conflict with modrex's Raycast method. /// </summary> /// <param name = "position">Origin of the ray</param> /// <param name = "direction">Direction of the ray</param> /// <param name = "length">Length of ray in meters</param> /// <param name = "retMethod">Method to call when the raycast is complete</param> public virtual void RaycastWorld(Vector3 position, Vector3 direction, float length, RaycastCallback retMethod) { if (retMethod != null) retMethod(false, Vector3.Zero, 0, 999999999999f, Vector3.Zero); } public virtual void RaycastWorld(Vector3 position, Vector3 direction, float length, int Count, RayCallback retMethod) { if (retMethod != null) retMethod(new List<ContactResult>()); } public virtual List<ContactResult> RaycastWorld(Vector3 position, Vector3 direction, float length, int Count) { return new List<ContactResult>(); } public virtual void SetGravityForce(bool enabled, float forceX, float forceY, float forceZ) { } public virtual float[] GetGravityForce() { return new float[3] {0, 0, 0}; } public virtual void AddGravityPoint(bool isApplyingForces, Vector3 position, float forceX, float forceY, float forceZ, float gravForce, float radius, int identifier) { } public virtual void UpdatesLoop() { } } public class NullPhysicsScene : PhysicsScene { private static int m_workIndicator; public override bool DisableCollisions { get { return false; } set { } } public override bool UseUnderWaterPhysics { get { return false; } } public override void Initialise(IMesher meshmerizer, RegionInfo region, IRegistryCore registry) { // Does nothing right now } public override void PostInitialise(IConfigSource config) { } public override PhysicsCharacter AddAvatar(string avName, Vector3 position, Quaternion rotation, Vector3 size, bool isFlying, uint localID, UUID UUID) { MainConsole.Instance.InfoFormat("[PHYSICS]: NullPhysicsScene : AddAvatar({0})", position); return new NullCharacterPhysicsActor(); } public override void RemoveAvatar(PhysicsCharacter actor) { } public override void RemovePrim(PhysicsObject prim) { } public override void DeletePrim(PhysicsObject prim) { } public override void SetWaterLevel(double height, short[] map) { } /* public override PhysicsActor AddPrim(Vector3 position, Vector3 size, Quaternion rotation) { MainConsole.Instance.InfoFormat("NullPhysicsScene : AddPrim({0},{1})", position, size); return PhysicsActor.Null; } */ public override PhysicsObject AddPrimShape(ISceneChildEntity entity) { return new NullObjectPhysicsActor(); } public override void Simulate(float timeStep) { m_workIndicator = (m_workIndicator + 1)%10; } public override void SetTerrain(ITerrainChannel channel, short[] heightMap) { MainConsole.Instance.InfoFormat("[PHYSICS]: NullPhysicsScene : SetTerrain({0} items)", heightMap.Length); } public override void Dispose() { } public override Dictionary<uint, float> GetTopColliders() { Dictionary<uint, float> returncolliders = new Dictionary<uint, float>(); return returncolliders; } } }
33.726688
119
0.591381
[ "BSD-3-Clause" ]
BillyWarrhol/Aurora-Sim
Aurora/Framework/Physics/PhysicsScene.cs
10,489
C#
/* * This file was autogenerated by the Kinetica schema processor. * * DO NOT EDIT DIRECTLY. */ using System.Collections.Generic; namespace kinetica { /// <summary>A set of parameters for <see /// cref="Kinetica.showTableMetadata(IList{string},IDictionary{string, string})" /// />. /// <br /> /// Retrieves the user provided metadata for the specified /// tables.</summary> public class ShowTableMetadataRequest : KineticaData { /// <summary>Names of tables whose metadata will be fetched, in /// [schema_name.]table_name format, using standard <a /// href="../../../concepts/tables/#table-name-resolution" /// target="_top">name resolution rules</a>. All provided tables must /// exist, or an error is returned. </summary> public IList<string> table_names { get; set; } = new List<string>(); /// <summary>Optional parameters. The default value is an empty {@link /// Dictionary}.</summary> public IDictionary<string, string> options { get; set; } = new Dictionary<string, string>(); /// <summary>Constructs a ShowTableMetadataRequest object with default /// parameters.</summary> public ShowTableMetadataRequest() { } /// <summary>Constructs a ShowTableMetadataRequest object with the /// specified parameters.</summary> /// /// <param name="table_names">Names of tables whose metadata will be /// fetched, in [schema_name.]table_name format, using standard <a /// href="../../../concepts/tables/#table-name-resolution" /// target="_top">name resolution rules</a>. All provided tables must /// exist, or an error is returned. </param> /// <param name="options">Optional parameters. The default value is an /// empty {@link Dictionary}.</param> /// public ShowTableMetadataRequest( IList<string> table_names, IDictionary<string, string> options = null) { this.table_names = table_names ?? new List<string>(); this.options = options ?? new Dictionary<string, string>(); } // end constructor } // end class ShowTableMetadataRequest /// <summary>A set of results returned by <see /// cref="Kinetica.showTableMetadata(IList{string},IDictionary{string, string})" /// />.</summary> public class ShowTableMetadataResponse : KineticaData { /// <summary>Value of <paramref /// cref="ShowTableMetadataRequest.table_names" />. </summary> public IList<string> table_names { get; set; } = new List<string>(); /// <summary>A list of maps which contain the metadata of the tables in /// the order the tables are listed in <paramref /// cref="ShowTableMetadataRequest.table_names" />. Each map has /// (metadata attribute name, metadata attribute value) pairs. /// </summary> public IList<IDictionary<string, string>> metadata_maps { get; set; } = new List<IDictionary<string, string>>(); /// <summary>Additional information. </summary> public IDictionary<string, string> info { get; set; } = new Dictionary<string, string>(); } // end class ShowTableMetadataResponse } // end namespace kinetica
38.390805
120
0.628743
[ "MIT" ]
kineticadb/kinetica-api-cs
Kinetica/Protocol/ShowTableMetadata.cs
3,340
C#
/* * Copyright 2018 JDCLOUD.COM * * 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. * * NAT-Gateway * NAT网关相关接口 * * OpenAPI spec version: v1 * Contact: * * NOTE: This class is auto generated by the jdcloud code generator program. */ using JDCloudSDK.Core.Client; using JDCloudSDK.Core.Http; using System; using System.Collections.Generic; using System.Text; namespace JDCloudSDK.Vpc.Client { /// <summary> /// 查询NAT网关信息详情接口 /// </summary> public class DescribeNatGatewayExecutor : JdcloudExecutor { /// <summary> /// 查询NAT网关信息详情接口接口的Http 请求方法 /// </summary> public override string Method { get { return "GET"; } } /// <summary> /// 查询NAT网关信息详情接口接口的Http资源请求路径 /// </summary> public override string Url { get { return "/regions/{regionId}/natGateways/{natGatewayId}"; } } } }
24.883333
76
0.630275
[ "Apache-2.0" ]
jdcloud-api/jdcloud-sdk-net
sdk/src/Service/Vpc/Client/DescribeNatGatewayExecutor.cs
1,597
C#
namespace System.IO.Abstractions.Benchmarks { using BenchmarkDotNet.Running; using System.Reflection; class Program { public static void Main(string[] args) { BenchmarkRunner.Run(typeof(Program).Assembly); } } }
19.285714
58
0.622222
[ "MIT" ]
BrianMcBrayer/System.IO.Abstractions
benchmarks/System.IO.Abstractions.Benchmarks/Program.cs
272
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // // System.Net.HttpEndPointListener // // Author: // Gonzalo Paniagua Javier (gonzalo.mono@gmail.com) // // Copyright (c) 2005 Novell, Inc. (http://www.novell.com) // Copyright (c) 2012 Xamarin, Inc. (http://xamarin.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.Net; using System.Net.Sockets; using System.Security.Cryptography.X509Certificates; using System.Threading; namespace SpaceWizards.HttpListener { internal sealed class HttpEndPointListener { private readonly HttpListener _listener; private readonly IPEndPoint _endpoint; private readonly Socket _socket; private readonly Dictionary<HttpConnection, HttpConnection> _unregisteredConnections; private Dictionary<ListenerPrefix, HttpListener> _prefixes; private List<ListenerPrefix>? _unhandledPrefixes; // host = '*' private List<ListenerPrefix>? _allPrefixes; // host = '+' private X509Certificate? _cert; private bool _secure; public HttpEndPointListener(HttpListener listener, IPAddress addr, int port, bool secure) { _listener = listener; if (secure) { _secure = secure; _cert = _listener.LoadCertificateAndKey (addr, port); } _endpoint = new IPEndPoint(addr, port); _socket = new Socket(addr.AddressFamily, SocketType.Stream, ProtocolType.Tcp); _socket.Bind(_endpoint); _socket.Listen(500); SocketAsyncEventArgs args = new SocketAsyncEventArgs(); args.UserToken = this; args.Completed += OnAccept; Accept(args); _prefixes = new Dictionary<ListenerPrefix, HttpListener>(); _unregisteredConnections = new Dictionary<HttpConnection, HttpConnection>(); } internal HttpListener Listener { get { return _listener; } } private void Accept(SocketAsyncEventArgs e) { e.AcceptSocket = null; bool asyn; try { asyn = _socket.AcceptAsync(e); } catch (ObjectDisposedException) { // Once the listener starts running, it kicks off an async accept, // and each subsequent accept initiates the next async accept. At // point if the listener is torn down, the socket will be disposed // and the AcceptAsync on the socket can fail with an ODE. Far from // ideal, but for now just eat such exceptions. return; } if (!asyn) { ProcessAccept(e); } } private static void ProcessAccept(SocketAsyncEventArgs args) { HttpEndPointListener epl = (HttpEndPointListener)args.UserToken!; Socket? accepted = args.SocketError == SocketError.Success ? args.AcceptSocket : null; epl.Accept(args); if (accepted == null) return; if (epl._secure && epl._cert == null) { accepted.Close(); return; } HttpConnection conn; try { conn = new HttpConnection(accepted, epl, epl._secure, epl._cert!); } catch { accepted.Close(); return; } lock (epl._unregisteredConnections) { epl._unregisteredConnections[conn] = conn; } conn.BeginReadRequest(); } private static void OnAccept(object? sender, SocketAsyncEventArgs e) { ProcessAccept(e); } internal void RemoveConnection(HttpConnection conn) { lock (_unregisteredConnections) { _unregisteredConnections.Remove(conn); } } public bool BindContext(HttpListenerContext context) { HttpListenerRequest req = context.Request; ListenerPrefix? prefix; HttpListener? listener = SearchListener(req.Url, out prefix); if (listener == null) return false; context._listener = listener; context.Connection.Prefix = prefix; return true; } public void UnbindContext(HttpListenerContext context) { if (context == null || context.Request == null) return; context._listener!.UnregisterContext(context); } private HttpListener? SearchListener(Uri? uri, out ListenerPrefix? prefix) { prefix = null; if (uri == null) return null; string host = uri.Host; int port = uri.Port; string path = WebUtility.UrlDecode(uri.AbsolutePath); string pathSlash = path[path.Length - 1] == '/' ? path : path + "/"; HttpListener? bestMatch = null; int bestLength = -1; if (host != null && host != "") { Dictionary<ListenerPrefix, HttpListener> localPrefixes = _prefixes; foreach (ListenerPrefix p in localPrefixes.Keys) { string ppath = p.Path!; if (ppath.Length < bestLength) continue; if (p.Host != host || p.Port != port) continue; if (path.StartsWith(ppath, StringComparison.Ordinal) || pathSlash.StartsWith(ppath, StringComparison.Ordinal)) { bestLength = ppath.Length; bestMatch = localPrefixes[p]; prefix = p; } } if (bestLength != -1) return bestMatch; } List<ListenerPrefix>? list = _unhandledPrefixes; bestMatch = MatchFromList(host, path, list, out prefix); if (path != pathSlash && bestMatch == null) bestMatch = MatchFromList(host, pathSlash, list, out prefix); if (bestMatch != null) return bestMatch; list = _allPrefixes; bestMatch = MatchFromList(host, path, list, out prefix); if (path != pathSlash && bestMatch == null) bestMatch = MatchFromList(host, pathSlash, list, out prefix); if (bestMatch != null) return bestMatch; return null; } private HttpListener? MatchFromList(string? host, string path, List<ListenerPrefix>? list, out ListenerPrefix? prefix) { prefix = null; if (list == null) return null; HttpListener? bestMatch = null; int bestLength = -1; foreach (ListenerPrefix p in list) { string ppath = p.Path!; if (ppath.Length < bestLength) continue; if (path.StartsWith(ppath, StringComparison.Ordinal)) { bestLength = ppath.Length; bestMatch = p._listener; prefix = p; } } return bestMatch; } private void AddSpecial(List<ListenerPrefix> list, ListenerPrefix prefix) { if (list == null) return; foreach (ListenerPrefix p in list) { if (p.Path == prefix.Path) throw new HttpListenerException((int)HttpStatusCode.BadRequest, SR.Format(SR.net_listener_already, prefix)); } list.Add(prefix); } private bool RemoveSpecial(List<ListenerPrefix> list, ListenerPrefix prefix) { if (list == null) return false; int c = list.Count; for (int i = 0; i < c; i++) { ListenerPrefix p = list[i]; if (p.Path == prefix.Path) { list.RemoveAt(i); return true; } } return false; } private void CheckIfRemove() { if (_prefixes.Count > 0) return; List<ListenerPrefix>? list = _unhandledPrefixes; if (list != null && list.Count > 0) return; list = _allPrefixes; if (list != null && list.Count > 0) return; HttpEndPointManager.RemoveEndPoint(this, _endpoint); } public void Close() { _socket.Close(); lock (_unregisteredConnections) { // Clone the list because RemoveConnection can be called from Close var connections = new List<HttpConnection>(_unregisteredConnections.Keys); foreach (HttpConnection c in connections) c.Close(true); _unregisteredConnections.Clear(); } } public void AddPrefix(ListenerPrefix prefix, HttpListener listener) { List<ListenerPrefix>? current; List<ListenerPrefix> future; if (prefix.Host == "*") { do { current = _unhandledPrefixes; future = current != null ? new List<ListenerPrefix>(current) : new List<ListenerPrefix>(); prefix._listener = listener; AddSpecial(future, prefix); } while (Interlocked.CompareExchange(ref _unhandledPrefixes, future, current) != current); return; } if (prefix.Host == "+") { do { current = _allPrefixes; future = current != null ? new List<ListenerPrefix>(current) : new List<ListenerPrefix>(); prefix._listener = listener; AddSpecial(future, prefix); } while (Interlocked.CompareExchange(ref _allPrefixes, future, current) != current); return; } Dictionary<ListenerPrefix, HttpListener> prefs, p2; do { prefs = _prefixes; if (prefs.ContainsKey(prefix)) { throw new HttpListenerException((int)HttpStatusCode.BadRequest, SR.Format(SR.net_listener_already, prefix)); } p2 = new Dictionary<ListenerPrefix, HttpListener>(prefs); p2[prefix] = listener; } while (Interlocked.CompareExchange(ref _prefixes, p2, prefs) != prefs); } public void RemovePrefix(ListenerPrefix prefix, HttpListener listener) { List<ListenerPrefix>? current; List<ListenerPrefix> future; if (prefix.Host == "*") { do { current = _unhandledPrefixes; future = current != null ? new List<ListenerPrefix>(current) : new List<ListenerPrefix>(); if (!RemoveSpecial(future, prefix)) break; // Prefix not found } while (Interlocked.CompareExchange(ref _unhandledPrefixes, future, current) != current); CheckIfRemove(); return; } if (prefix.Host == "+") { do { current = _allPrefixes; future = current != null ? new List<ListenerPrefix>(current) : new List<ListenerPrefix>(); if (!RemoveSpecial(future, prefix)) break; // Prefix not found } while (Interlocked.CompareExchange(ref _allPrefixes, future, current) != current); CheckIfRemove(); return; } Dictionary<ListenerPrefix, HttpListener> prefs, p2; do { prefs = _prefixes; if (!prefs.ContainsKey(prefix)) break; p2 = new Dictionary<ListenerPrefix, HttpListener>(prefs); p2.Remove(prefix); } while (Interlocked.CompareExchange(ref _prefixes, p2, prefs) != prefs); CheckIfRemove(); } } }
34.254321
130
0.531608
[ "MIT" ]
space-wizards/ManagedHttpListener
src/System/Net/Managed/HttpEndPointListener.cs
13,873
C#
namespace Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801 { using Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.PowerShell; /// <summary>AppServiceCertificateOrder resource specific properties</summary> [System.ComponentModel.TypeConverter(typeof(AppServiceCertificateOrderPropertiesTypeConverter))] public partial class AppServiceCertificateOrderProperties { /// <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> /// Deserializes a <see cref="global::System.Collections.IDictionary" /> into a new instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.AppServiceCertificateOrderProperties" /// />. /// </summary> /// <param name="content">The global::System.Collections.IDictionary content that should be used.</param> internal AppServiceCertificateOrderProperties(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); if (returnNow) { return; } // actually deserialize ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).Intermediate = (Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.ICertificateDetails) content.GetValueForProperty("Intermediate",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).Intermediate, Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.CertificateDetailsTypeConverter.ConvertFrom); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).Root = (Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.ICertificateDetails) content.GetValueForProperty("Root",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).Root, Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.CertificateDetailsTypeConverter.ConvertFrom); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SignedCertificate = (Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.ICertificateDetails) content.GetValueForProperty("SignedCertificate",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SignedCertificate, Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.CertificateDetailsTypeConverter.ConvertFrom); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).AppServiceCertificateNotRenewableReason = (string[]) content.GetValueForProperty("AppServiceCertificateNotRenewableReason",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).AppServiceCertificateNotRenewableReason, __y => TypeConverterExtensions.SelectToArray<string>(__y, global::System.Convert.ToString)); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).AutoRenew = (bool?) content.GetValueForProperty("AutoRenew",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).AutoRenew, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).Certificate = (Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesCertificates) content.GetValueForProperty("Certificate",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).Certificate, Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.AppServiceCertificateOrderPropertiesCertificatesTypeConverter.ConvertFrom); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).Csr = (string) content.GetValueForProperty("Csr",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).Csr, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).DistinguishedName = (string) content.GetValueForProperty("DistinguishedName",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).DistinguishedName, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).DomainVerificationToken = (string) content.GetValueForProperty("DomainVerificationToken",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).DomainVerificationToken, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).ExpirationTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationTime",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).ExpirationTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).IsPrivateKeyExternal = (bool?) content.GetValueForProperty("IsPrivateKeyExternal",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).IsPrivateKeyExternal, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).KeySize = (int?) content.GetValueForProperty("KeySize",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).KeySize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).LastCertificateIssuanceTime = (global::System.DateTime?) content.GetValueForProperty("LastCertificateIssuanceTime",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).LastCertificateIssuanceTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).NextAutoRenewalTimeStamp = (global::System.DateTime?) content.GetValueForProperty("NextAutoRenewalTimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).NextAutoRenewalTimeStamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).ProductType = (Microsoft.Azure.PowerShell.Cmdlets.Functions.Support.CertificateProductType) content.GetValueForProperty("ProductType",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).ProductType, Microsoft.Azure.PowerShell.Cmdlets.Functions.Support.CertificateProductType.CreateFrom); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Functions.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Functions.Support.ProvisioningState.CreateFrom); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SerialNumber, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Functions.Support.CertificateOrderStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Functions.Support.CertificateOrderStatus.CreateFrom); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).ValidityInYear = (int?) content.GetValueForProperty("ValidityInYear",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).ValidityInYear, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).RootSerialNumber = (string) content.GetValueForProperty("RootSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).RootSerialNumber, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).IntermediateIssuer = (string) content.GetValueForProperty("IntermediateIssuer",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).IntermediateIssuer, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).IntermediateNotBefore = (global::System.DateTime?) content.GetValueForProperty("IntermediateNotBefore",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).IntermediateNotBefore, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).IntermediateRawData = (string) content.GetValueForProperty("IntermediateRawData",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).IntermediateRawData, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).IntermediateSerialNumber = (string) content.GetValueForProperty("IntermediateSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).IntermediateSerialNumber, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).IntermediateSignatureAlgorithm = (string) content.GetValueForProperty("IntermediateSignatureAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).IntermediateSignatureAlgorithm, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).IntermediateSubject = (string) content.GetValueForProperty("IntermediateSubject",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).IntermediateSubject, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).IntermediateThumbprint = (string) content.GetValueForProperty("IntermediateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).IntermediateThumbprint, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).IntermediateVersion = (int?) content.GetValueForProperty("IntermediateVersion",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).IntermediateVersion, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).RootIssuer = (string) content.GetValueForProperty("RootIssuer",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).RootIssuer, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).RootNotAfter = (global::System.DateTime?) content.GetValueForProperty("RootNotAfter",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).RootNotAfter, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).RootNotBefore = (global::System.DateTime?) content.GetValueForProperty("RootNotBefore",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).RootNotBefore, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).RootRawData = (string) content.GetValueForProperty("RootRawData",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).RootRawData, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).IntermediateNotAfter = (global::System.DateTime?) content.GetValueForProperty("IntermediateNotAfter",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).IntermediateNotAfter, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).RootSignatureAlgorithm = (string) content.GetValueForProperty("RootSignatureAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).RootSignatureAlgorithm, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).RootSubject = (string) content.GetValueForProperty("RootSubject",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).RootSubject, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).RootThumbprint = (string) content.GetValueForProperty("RootThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).RootThumbprint, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).RootVersion = (int?) content.GetValueForProperty("RootVersion",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).RootVersion, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SignedCertificateIssuer = (string) content.GetValueForProperty("SignedCertificateIssuer",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SignedCertificateIssuer, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SignedCertificateNotAfter = (global::System.DateTime?) content.GetValueForProperty("SignedCertificateNotAfter",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SignedCertificateNotAfter, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SignedCertificateNotBefore = (global::System.DateTime?) content.GetValueForProperty("SignedCertificateNotBefore",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SignedCertificateNotBefore, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SignedCertificateRawData = (string) content.GetValueForProperty("SignedCertificateRawData",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SignedCertificateRawData, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SignedCertificateSerialNumber = (string) content.GetValueForProperty("SignedCertificateSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SignedCertificateSerialNumber, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SignedCertificateSignatureAlgorithm = (string) content.GetValueForProperty("SignedCertificateSignatureAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SignedCertificateSignatureAlgorithm, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SignedCertificateSubject = (string) content.GetValueForProperty("SignedCertificateSubject",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SignedCertificateSubject, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SignedCertificateThumbprint = (string) content.GetValueForProperty("SignedCertificateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SignedCertificateThumbprint, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SignedCertificateVersion = (int?) content.GetValueForProperty("SignedCertificateVersion",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SignedCertificateVersion, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); AfterDeserializeDictionary(content); } /// <summary> /// Deserializes a <see cref="global::System.Management.Automation.PSObject" /> into a new instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.AppServiceCertificateOrderProperties" /// />. /// </summary> /// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param> internal AppServiceCertificateOrderProperties(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); if (returnNow) { return; } // actually deserialize ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).Intermediate = (Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.ICertificateDetails) content.GetValueForProperty("Intermediate",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).Intermediate, Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.CertificateDetailsTypeConverter.ConvertFrom); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).Root = (Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.ICertificateDetails) content.GetValueForProperty("Root",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).Root, Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.CertificateDetailsTypeConverter.ConvertFrom); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SignedCertificate = (Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.ICertificateDetails) content.GetValueForProperty("SignedCertificate",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SignedCertificate, Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.CertificateDetailsTypeConverter.ConvertFrom); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).AppServiceCertificateNotRenewableReason = (string[]) content.GetValueForProperty("AppServiceCertificateNotRenewableReason",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).AppServiceCertificateNotRenewableReason, __y => TypeConverterExtensions.SelectToArray<string>(__y, global::System.Convert.ToString)); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).AutoRenew = (bool?) content.GetValueForProperty("AutoRenew",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).AutoRenew, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).Certificate = (Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesCertificates) content.GetValueForProperty("Certificate",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).Certificate, Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.AppServiceCertificateOrderPropertiesCertificatesTypeConverter.ConvertFrom); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).Csr = (string) content.GetValueForProperty("Csr",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).Csr, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).DistinguishedName = (string) content.GetValueForProperty("DistinguishedName",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).DistinguishedName, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).DomainVerificationToken = (string) content.GetValueForProperty("DomainVerificationToken",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).DomainVerificationToken, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).ExpirationTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationTime",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).ExpirationTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).IsPrivateKeyExternal = (bool?) content.GetValueForProperty("IsPrivateKeyExternal",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).IsPrivateKeyExternal, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).KeySize = (int?) content.GetValueForProperty("KeySize",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).KeySize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).LastCertificateIssuanceTime = (global::System.DateTime?) content.GetValueForProperty("LastCertificateIssuanceTime",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).LastCertificateIssuanceTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).NextAutoRenewalTimeStamp = (global::System.DateTime?) content.GetValueForProperty("NextAutoRenewalTimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).NextAutoRenewalTimeStamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).ProductType = (Microsoft.Azure.PowerShell.Cmdlets.Functions.Support.CertificateProductType) content.GetValueForProperty("ProductType",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).ProductType, Microsoft.Azure.PowerShell.Cmdlets.Functions.Support.CertificateProductType.CreateFrom); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Functions.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Functions.Support.ProvisioningState.CreateFrom); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SerialNumber, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Functions.Support.CertificateOrderStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Functions.Support.CertificateOrderStatus.CreateFrom); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).ValidityInYear = (int?) content.GetValueForProperty("ValidityInYear",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).ValidityInYear, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).RootSerialNumber = (string) content.GetValueForProperty("RootSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).RootSerialNumber, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).IntermediateIssuer = (string) content.GetValueForProperty("IntermediateIssuer",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).IntermediateIssuer, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).IntermediateNotBefore = (global::System.DateTime?) content.GetValueForProperty("IntermediateNotBefore",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).IntermediateNotBefore, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).IntermediateRawData = (string) content.GetValueForProperty("IntermediateRawData",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).IntermediateRawData, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).IntermediateSerialNumber = (string) content.GetValueForProperty("IntermediateSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).IntermediateSerialNumber, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).IntermediateSignatureAlgorithm = (string) content.GetValueForProperty("IntermediateSignatureAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).IntermediateSignatureAlgorithm, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).IntermediateSubject = (string) content.GetValueForProperty("IntermediateSubject",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).IntermediateSubject, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).IntermediateThumbprint = (string) content.GetValueForProperty("IntermediateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).IntermediateThumbprint, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).IntermediateVersion = (int?) content.GetValueForProperty("IntermediateVersion",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).IntermediateVersion, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).RootIssuer = (string) content.GetValueForProperty("RootIssuer",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).RootIssuer, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).RootNotAfter = (global::System.DateTime?) content.GetValueForProperty("RootNotAfter",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).RootNotAfter, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).RootNotBefore = (global::System.DateTime?) content.GetValueForProperty("RootNotBefore",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).RootNotBefore, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).RootRawData = (string) content.GetValueForProperty("RootRawData",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).RootRawData, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).IntermediateNotAfter = (global::System.DateTime?) content.GetValueForProperty("IntermediateNotAfter",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).IntermediateNotAfter, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).RootSignatureAlgorithm = (string) content.GetValueForProperty("RootSignatureAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).RootSignatureAlgorithm, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).RootSubject = (string) content.GetValueForProperty("RootSubject",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).RootSubject, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).RootThumbprint = (string) content.GetValueForProperty("RootThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).RootThumbprint, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).RootVersion = (int?) content.GetValueForProperty("RootVersion",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).RootVersion, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SignedCertificateIssuer = (string) content.GetValueForProperty("SignedCertificateIssuer",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SignedCertificateIssuer, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SignedCertificateNotAfter = (global::System.DateTime?) content.GetValueForProperty("SignedCertificateNotAfter",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SignedCertificateNotAfter, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SignedCertificateNotBefore = (global::System.DateTime?) content.GetValueForProperty("SignedCertificateNotBefore",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SignedCertificateNotBefore, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SignedCertificateRawData = (string) content.GetValueForProperty("SignedCertificateRawData",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SignedCertificateRawData, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SignedCertificateSerialNumber = (string) content.GetValueForProperty("SignedCertificateSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SignedCertificateSerialNumber, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SignedCertificateSignatureAlgorithm = (string) content.GetValueForProperty("SignedCertificateSignatureAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SignedCertificateSignatureAlgorithm, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SignedCertificateSubject = (string) content.GetValueForProperty("SignedCertificateSubject",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SignedCertificateSubject, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SignedCertificateThumbprint = (string) content.GetValueForProperty("SignedCertificateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SignedCertificateThumbprint, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SignedCertificateVersion = (int?) content.GetValueForProperty("SignedCertificateVersion",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderPropertiesInternal)this).SignedCertificateVersion, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); AfterDeserializePSObject(content); } /// <summary> /// Deserializes a <see cref="global::System.Collections.IDictionary" /> into an instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.AppServiceCertificateOrderProperties" /// />. /// </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.Functions.Models.Api20190801.IAppServiceCertificateOrderProperties" /// />. /// </returns> public static Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AppServiceCertificateOrderProperties(content); } /// <summary> /// Deserializes a <see cref="global::System.Management.Automation.PSObject" /> into an instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.AppServiceCertificateOrderProperties" /// />. /// </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.Functions.Models.Api20190801.IAppServiceCertificateOrderProperties" /// />. /// </returns> public static Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServiceCertificateOrderProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AppServiceCertificateOrderProperties(content); } /// <summary> /// Creates a new instance of <see cref="AppServiceCertificateOrderProperties" />, 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.Functions.Models.Api20190801.IAppServiceCertificateOrderProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.Json.JsonNode.Parse(jsonText)); /// <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.Functions.Runtime.SerializationMode.IncludeAll)?.ToString(); } /// AppServiceCertificateOrder resource specific properties [System.ComponentModel.TypeConverter(typeof(AppServiceCertificateOrderPropertiesTypeConverter))] public partial interface IAppServiceCertificateOrderProperties { } }
216.843049
573
0.819195
[ "MIT" ]
Arsasana/azure-powershell
src/Functions/generated/api/Models/Api20190801/AppServiceCertificateOrderProperties.PowerShell.cs
48,134
C#
namespace QuickCrypt { /// <summary> /// Service to generate byte collection as a "key". /// </summary> public interface IKeyGenerator { /// <summary> /// Create unique key byte collection. /// </summary> /// <returns>Unique byte collection.</returns> byte[] Generate(); } }
22.666667
55
0.55
[ "MIT" ]
sethsteenken/QuickCrypt
src/QuickCrypt/Services/IKeyGenerator.cs
342
C#
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated from a template. // // Manual changes to this file may cause unexpected behavior in your application. // Manual changes to this file will be overwritten if the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ using System; using System.Data.Objects; using System.Data.Objects.DataClasses; using System.Data.EntityClient; using System.ComponentModel; using System.Xml.Serialization; using System.Runtime.Serialization; using Sparkle.Entities; [assembly: EdmSchemaAttribute()] #region EDM Relationship Metadata [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Activities_Companies", "Companies", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.Company), "Activities", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Activity), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Activities_User", "Users", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "Activities", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Activity), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Ads_AdsCategories", "AdCategories", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.AdCategory), "Ads", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Ad), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Ads_Users", "Users", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "Ads", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Ad), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_TimelineItems_AdTimeline", "Ads", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.Ad), "TimelineItems", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.TimelineItem), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Pictures_Album", "Albums", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Album), "Pictures", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Picture), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_CompaniesNews_Company", "Companies", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.Company), "CompanyNews", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.CompanyNew), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_CompaniesVisits_Company", "Companies", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Company), "CompaniesVisits", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.CompaniesVisit), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_CompanyAdmins_Companies", "Companies", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Company), "CompanyAdmins", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.CompanyAdmin), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_CompanySkills_Companies", "Companies", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Company), "CompanySkills", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.CompanySkill), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_ExchangeMaterials_Companies", "Companies", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Company), "ExchangeMaterials", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.ExchangeMaterial), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_ExchangeSkills_Companies", "Companies", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Company), "ExchangeSkills", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.ExchangeSkill), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_ExchangeSurfaces_Companies", "Companies", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Company), "ExchangeSurfaces", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.ExchangeSurface), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Invited_Company", "Companies", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Company), "Invited", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Invited), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Places_Companies", "Companies", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.Company), "Places", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Place), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Teams_Companies", "Companies", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Company), "Teams", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Team), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_TimelineItems_CompanyTimeline", "Companies", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.Company), "TimelineItems", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.TimelineItem), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Users_Companies", "Companies", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Company), "Users", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.User), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_CompaniesVisits_User", "Users", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "CompaniesVisits", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.CompaniesVisit), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_CompanyAdmins_User", "Users", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "CompanyAdmins", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.CompanyAdmin), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_CompanyNews_User", "Users", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "CompanyNews", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.CompanyNew), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_CompanySkills_Skill", "Skills", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Skill), "CompanySkills", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.CompanySkill), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Contacts_Contact", "Users", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "Contacts", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Contact), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Contacts_User", "Users", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "Contacts", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Contact), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Events_EventCategories", "EventCategories", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.EventCategory), "Events", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Event), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_EventMembers_User", "Users", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "EventMembers", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.EventMember), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_RegisteredToEvent_eura_Events", "Events", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Event), "EventMembers", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.EventMember), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Events_User", "Users", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "Events", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Event), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_TimelineItems_EventTimeline", "Events", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.Event), "TimelineItems", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.TimelineItem), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_ExchangeMaterials_User", "Users", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "ExchangeMaterials", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.ExchangeMaterial), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_ExchangeSkills_CreatedBy", "Users", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "ExchangeSkills", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.ExchangeSkill), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_ExchangeSkills_Skill", "Skills", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Skill), "ExchangeSkills", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.ExchangeSkill), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_ExchangeSurfaces_User", "Users", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "ExchangeSurfaces", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.ExchangeSurface), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_GroupCategories_ParentCategory", "GroupCategories", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.GroupCategory), "GroupCategories1", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.GroupCategory), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Groups_Group", "GroupCategories", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.GroupCategory), "Groups", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Group), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_GroupMembers_User", "Users", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "GroupMembers", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.GroupMember), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_GroupsMembers_Group", "Groups", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Group), "GroupMembers", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.GroupMember), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Groups_CreatedBy", "Users", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "Groups", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Group), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_TimelineItems_GroupTimeline", "Groups", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.Group), "TimelineItems", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.TimelineItem), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_InformationNotes_User", "Users", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "InformationNotes", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.InformationNote), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Interests_User", "Users", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "Interests", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Interest), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_UserInterests_Interest", "Interests", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Interest), "UserInterests", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.UserInterest), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Invited_Inviter", "Users", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "Invited", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Invited), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Invited_User", "Users", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.User), "Invited", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Invited), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_JobByBusiness_Job", "Jobs", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Job), "JobByBusiness", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.JobByBusiness), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Users_Jobs", "Jobs", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.Job), "Users", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.User), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Links_Users", "Users", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.User), "Links", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Link), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_ListItems_Lists", "Lists", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.List), "ListItems", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.ListItem), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_ListItems_Users", "Users", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "ListItems", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.ListItem), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Lists_User", "Users", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "Lists", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.List), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Live_Users", "Users", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "Live", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Live), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_LostItems_User", "Users", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "LostItems", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.LostItem), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_MenuPlanning_Menus", "Menus", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Menu), "MenuPlanning", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.MenuPlanning), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Messages_FromUser", "Users", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "Messages", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Message), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Messages_ToUser", "Users", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "Messages", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Message), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Places_PlaceCategories", "PlaceCategories", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.PlaceCategory), "Places", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Place), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_PlacesHistory_Places", "Places", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Place), "PlaceHistory", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.PlaceHistory), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_PollAnswers_PollChoices", "PollChoices", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.PollChoice), "PollAnswers", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.PollAnswer), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_PollAnswers_Polls", "Polls", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Poll), "PollAnswers", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.PollAnswer), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_PollChoices_Polls", "Polls", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Poll), "PollChoices", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.PollChoice), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_ProjectMembers_Project", "Projects", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Project), "ProjectMembers", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.ProjectMember), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_TimelineItems_ProjectTimeline", "Projects", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.Project), "TimelineItems", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.TimelineItem), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Recreations_Users", "Users", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "Recreations", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Recreation), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_UserRecreations_Recreation", "Recreations", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Recreation), "UserRecreations", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.UserRecreation), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Users_Relationship", "Relationship", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.Relationship), "Users", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.User), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_UserSkills_Skill", "Skills", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Skill), "UserSkills", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.UserSkill), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_TeamMembers_User", "Users", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "TeamMembers", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.TeamMember), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_TeamsMembers_Team", "Teams", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Team), "TeamMembers", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.TeamMember), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_TimelineItems_TeamTimeline", "Teams", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.Team), "TimelineItems", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.TimelineItem), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_TimelineItemComments_TimelineItem", "TimelineItems", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.TimelineItem), "TimelineItemComments", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.TimelineItemComment), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_TimelineItems_PostedBy", "Users", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "TimelineItems", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.TimelineItem), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_TimelineItems_UserTimeline", "Users", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.User), "TimelineItems", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.TimelineItem), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_TouchCommunicationItems_TouchCommunication", "TouchCommunications", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.TouchCommunication), "TouchCommunicationItems", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.TouchCommunicationItem), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_UserInterests_User", "Users", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "UserInterests", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.UserInterest), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_UserRecreations_User", "Users", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "UserRecreations", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.UserRecreation), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_UserSkills_User", "Users", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "UserSkills", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.UserSkill), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_UsersVisits_Profile", "Users", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "UsersVisits", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.UsersVisit), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_UsersVisits_User", "Users", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "UsersVisits", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.UsersVisit), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_SeekFriends_Seeker", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "SeekFriend", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.SeekFriend), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_SeekFriends_Target", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "SeekFriend", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.SeekFriend), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_ProjectMembers_User", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "ProjectMember", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.ProjectMember), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Users_aspnetUsers", "aspnet_Users", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.AspnetUsers), "User", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.User), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK__aspnet_Me__UserI__190BB0C3", "aspnet_Users", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.AspnetUsers), "aspnet_Membership", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.AspnetMembership), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_TimelineItemComments_User", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "TimelineItemComment", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.TimelineItemComment), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Notifications_User", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "Notification", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.Notification), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Events_Company", "Company", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.Company), "Event", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Event), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Events_Group", "Group", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.Group), "Event", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Event), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Events_Place", "Place", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.Place), "Event", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Event), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Events_Project", "Project", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.Project), "Event", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Event), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Events_Team", "Team", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.Team), "Event", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Event), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Places_ParentPlace", "Place", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.Place), "Place1", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Place), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_DevicePlanning_DeviceId", "Device", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Device), "DevicePlanning", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.DevicePlanning), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_AchievementsCompanies_Achievement", "Achievement", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Achievement), "AchievementsCompany", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.AchievementsCompany), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_AchievementsCompanies_Company", "Company", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Company), "AchievementsCompany", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.AchievementsCompany), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_AchievementsUsers_Achievement", "Achievement", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Achievement), "AchievementsUser", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.AchievementsUser), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_AchievementsUsers_User", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "AchievementsUser", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.AchievementsUser), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_RegisterRequests_ReplyUserId", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.User), "RegisterRequest", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.RegisterRequest), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_RegisterRequests_ValidatedByUserId", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.User), "RegisterRequest", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.RegisterRequest), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Achievements_NetworkId", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.Network), "Achievement", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Achievement), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_AdCategories_NetworkId", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.Network), "AdCategory", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.AdCategory), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Buildings_NetworkId", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Network), "Building", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Building), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Companies_NetworkId", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Network), "Company", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Company), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_DeviceConfiguration_NetworkId", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Network), "DeviceConfiguration", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.DeviceConfiguration), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Devices_NetworkId", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Network), "Device", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Device), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_EventCategories_NetworkId", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.Network), "EventCategory", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.EventCategory), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Events_NetworkId", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Network), "Event", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Event), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_ExchangeMaterials_NetworkId", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Network), "ExchangeMaterial", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.ExchangeMaterial), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_ExchangeSkills_NetworkId", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Network), "ExchangeSkill", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.ExchangeSkill), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_ExchangeSurfaces_NetworkId", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Network), "ExchangeSurface", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.ExchangeSurface), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Groups_NetworkId", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Network), "Group", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Group), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_InformationNotes_NetworkId", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Network), "InformationNote", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.InformationNote), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Live_NetworkId", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Network), "Live", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Live), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_LostItems_NetworkId", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Network), "LostItem", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.LostItem), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Numbers_NetworkId", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Network), "Number", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Number), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Places_NetworkId", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Network), "Place", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Place), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_RegisterRequests_NetworkId", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Network), "RegisterRequest", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.RegisterRequest), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_RequestsForProposal_NetworkId", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Network), "RequestForProposal", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.RequestForProposal), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_TimelineItems_NetworkId", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Network), "TimelineItem", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.TimelineItem), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_TouchCommunications_NetworkId", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Network), "TouchCommunication", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.TouchCommunication), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_CareerOpportunities_Company", "Company", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Company), "CareerOpportunity", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.CareerOpportunity), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_CareerOpportunities_Network", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Network), "CareerOpportunity", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.CareerOpportunity), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_CareerOpportunities_User", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "CareerOpportunity", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.CareerOpportunity), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_SocialNetworkCompanySubscriptions_Company", "Company", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Company), "SocialNetworkCompanySubscription", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.SocialNetworkCompanySubscription), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_SocialNetworkStates_Network", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Network), "SocialNetworkState", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.SocialNetworkState), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_SocialNetworkConnections_User", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "SocialNetworkConnection", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.SocialNetworkConnection), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_SocialNetworkUserSubscriptions_User", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "SocialNetworkUserSubscription", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.SocialNetworkUserSubscription), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_SocialNetworkCompanySubscriptions_SocialNetworkConnection", "SocialNetworkConnection", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.SocialNetworkConnection), "SocialNetworkCompanySubscription", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.SocialNetworkCompanySubscription), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_SocialNetworkUserSubscriptions_SocialNetworkConnection", "SocialNetworkConnection", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.SocialNetworkConnection), "SocialNetworkUserSubscription", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.SocialNetworkUserSubscription), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Users_NetworkId", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Network), "User", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.User), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Resumes_NetworkId", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Network), "Resume", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Resume), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_CompanyContacts_FromCompanyId", "Company", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.Company), "CompanyContact", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.CompanyContact), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_CompanyContacts_ToCompanyId", "Company", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.Company), "CompanyContact", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.CompanyContact), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_CompanyContacts_FromUserId", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.User), "CompanyContact", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.CompanyContact), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_CreateNetworkRequests_NetworkId", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Network), "CreateNetworkRequest", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.CreateNetworkRequest), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_ResumeSkills_Resumes", "Resume", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Resume), "ResumeSkill", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.ResumeSkill), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_ResumeSkills_Skills", "Skill", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Skill), "ResumeSkill", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.ResumeSkill), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_StatsCounterHits_Network", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.Network), "StatsCounterHit", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.StatsCounterHit), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_StatsCounterHits_Counter", "StatsCounter", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.StatsCounter), "StatsCounterHit", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.StatsCounterHit), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_StatsCounterHits_User", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.User), "StatsCounterHit", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.StatsCounterHit), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_CompanyRequests_Company", "Company", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.Company), "CompanyRequest", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.CompanyRequest), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "PK_dbo_CompanyRequestMessages_CompanyRequest", "CompanyRequest", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.CompanyRequest), "CompanyRequestMessage", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.CompanyRequestMessage), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "PK_dbo_CompanyRequestMessages_FromUser", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.User), "CompanyRequestMessage", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.CompanyRequestMessage), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_CompanyRequests_ApprovedByUser", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.User), "CompanyRequest", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.CompanyRequest), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_CompanyRequests_Network", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Network), "CompanyRequest", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.CompanyRequest), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_CompanyRequests_BlockedByUser", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.User), "CompanyRequest", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.CompanyRequest), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_CompanyRequests_Category", "CompanyCategory", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.CompanyCategory), "CompanyRequest", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.CompanyRequest), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Networks_Type", "NetworkType", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.NetworkType), "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Network), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_Clubs_CreatedByUser", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "Club", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Club), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_Clubs_Network", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.Network), "Club", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Club), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_UserActionKeysUser", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "UserActionKey", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.UserActionKey), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_EventPublicMembers_Event", "Event", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Event), "EventPublicMember", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.EventPublicMember), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_TimelineItemSkills_Skill", "Skill", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Skill), "TimelineItemSkill", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.TimelineItemSkill), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_TimelineItemSkills_TimelineItem", "TimelineItem", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.TimelineItem), "TimelineItemSkill", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.TimelineItemSkill), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_TimelineItemSkills_CreatedBy", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "TimelineItemSkill", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.TimelineItemSkill), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_TimelineItemSkills_DeletedBy", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.User), "TimelineItemSkill", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.TimelineItemSkill), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_TimelineItems_DeletedBy", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.User), "TimelineItem", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.TimelineItem), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_GroupSkills_Groups", "Group", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Group), "GroupSkill", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.GroupSkill), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_GroupSkills_Skills", "Skill", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Skill), "GroupSkill", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.GroupSkill), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_GroupSkills_CreatedBy", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "GroupSkill", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.GroupSkill), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_GroupSkills_DeletedBy", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.User), "GroupSkill", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.GroupSkill), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_GroupInterests_CreatedBy", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "GroupInterest", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.GroupInterest), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_GroupInterests_DeletedBy", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.User), "GroupInterest", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.GroupInterest), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_GroupInterests_Group", "Group", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Group), "GroupInterest", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.GroupInterest), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_GroupInterests_Skill", "Interest", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Interest), "GroupInterest", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.GroupInterest), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_GroupRecreations_CreatedBy", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "GroupRecreation", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.GroupRecreation), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_GroupRecreations_DeletedBy", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.User), "GroupRecreation", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.GroupRecreation), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_GroupRecreations_Group", "Group", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Group), "GroupRecreation", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.GroupRecreation), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_GroupRecreations_Skill", "Recreation", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Recreation), "GroupRecreation", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.GroupRecreation), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_RegisterRequests_Company", "Company", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.Company), "RegisterRequest", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.RegisterRequest), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_RegisterRequests_AcceptedInvitation", "Invited", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.Invited), "RegisterRequest", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.RegisterRequest), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_EmailMessages_User", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.User), "EmailMessage", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.EmailMessage), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_EmailMessages_Network", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Network), "EmailMessage", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.EmailMessage), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_UserEmailChangeRequests_ActingUser", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "UserEmailChangeRequest", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.UserEmailChangeRequest), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_UserEmailChangeRequests_ConcernedUser", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "UserEmailChangeRequest", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.UserEmailChangeRequest), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_UserEmailChangeRequests_Networks", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Network), "UserEmailChangeRequest", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.UserEmailChangeRequest), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_InboundEmailMessages_Network", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Network), "InboundEmailMessage", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.InboundEmailMessage), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_TimelineItems_InboundEmailId", "InboundEmailMessage", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.InboundEmailMessage), "TimelineItem", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.TimelineItem), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Likes_TimelineItems", "TimelineItem", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.TimelineItem), "Like", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.TimelineItemLike), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Likes_User", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "Like", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.TimelineItemLike), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_LikeComments_User", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "LikeComment", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.TimelineItemCommentLike), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_LikesComment_TimelineItemComments", "TimelineItemComment", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.TimelineItemComment), "LikeComment", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.TimelineItemCommentLike), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_GroupsMembers_AcceptedBy", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.User), "GroupMember", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.GroupMember), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_GroupsMembers_InvitedBy", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.User), "GroupMember", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.GroupMember), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_Companies_UserFirstChange", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.User), "Company", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Company), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_Companies_UserLastChange", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.User), "Company", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Company), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_UserProfileFields_ProfileFields", "ProfileField", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.ProfileField), "UserProfileField", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.UserProfileField), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_UserProfileFields_Users", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "UserProfileField", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.UserProfileField), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_ProfileFieldsAvailiableValues_ProfileFields", "ProfileField", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.ProfileField), "ProfileFieldsAvailiableValue", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.ProfileFieldsAvailiableValue), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_ApplyRequests_Network", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Network), "ApplyRequest", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.ApplyRequest), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_ApplyRequests_CreatedCompany", "Company", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.Company), "ApplyRequest", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.ApplyRequest), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_ApplyRequests_CreatedUser", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.User), "ApplyRequest", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.ApplyRequest), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_ApplyRequests_AcceptedByUser", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.User), "ApplyRequest", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.ApplyRequest), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_ApplyRequests_RefusedByUser", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.User), "ApplyRequest", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.ApplyRequest), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_ApplyRequests_JoinCompany", "Company", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.Company), "ApplyRequest", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.ApplyRequest), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_CompanyProfileFields_Users", "Company", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Company), "CompanyProfileField", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.CompanyProfileField), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_CompanyProfileFields_ProfileFields", "ProfileField", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.ProfileField), "CompanyProfileField", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.CompanyProfileField), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_Subscriptions_AppliesToCompany", "Company", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.Company), "Subscription", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Subscription), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_Subscriptions_OwnerCompany", "Company", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.Company), "Subscription", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Subscription), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_Subscriptions_AppliesToUser", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.User), "Subscription", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Subscription), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_Subscriptions_OwnerUser", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.User), "Subscription", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Subscription), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_Subscriptions_Template", "SubscriptionTemplate", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.SubscriptionTemplate), "Subscription", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Subscription), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_SubscriptionTemplates_Network", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Network), "SubscriptionTemplate", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.SubscriptionTemplate), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_Subscriptions_Network", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Network), "Subscription", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Subscription), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_StripeTransactions_Networks", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Network), "StripeTransaction", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.StripeTransaction), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_StripeTransactions_Users", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "StripeTransaction", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.StripeTransaction), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "StripeSubscriptions", "StripeTransaction", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.StripeTransaction), "Subscription", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Subscription))] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_TagDefinitions_Networks", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Network), "TagDefinition", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.TagDefinition), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_TagDefinitions_TagCategories", "TagCategory", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.TagCategory), "TagDefinition", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.TagDefinition), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_TagDefinitions_Users", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "TagDefinition", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.TagDefinition), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_PartnerResources_Networks", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Network), "PartnerResource", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.PartnerResource), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_PartnerResources_CreatedByUser", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "PartnerResource", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.PartnerResource), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_PartnerResources_DeletedByUser", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.User), "PartnerResource", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.PartnerResource), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_PartnerResourcesProfileFields_PartnerResources", "PartnerResource", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.PartnerResource), "PartnerResourceProfileField", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.PartnerResourceProfileField), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_PartnerResourcesProfileFields_ProfileFields", "ProfileField", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.ProfileField), "PartnerResourceProfileField", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.PartnerResourceProfileField), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_PartnerResourceTags_PartnerResources", "PartnerResource", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.PartnerResource), "PartnerResourceTag", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.PartnerResourceTag), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_PartnerResourceTags_TagDefinitions", "TagDefinition", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.TagDefinition), "PartnerResourceTag", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.PartnerResourceTag), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_TimelineItems_PartnerResources", "PartnerResource", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.PartnerResource), "TimelineItem", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.TimelineItem), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_PartnerResources_ApprovedByUser", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.User), "PartnerResource", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.PartnerResource), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_SubscriptionNotifications_Subscriptions", "Subscription", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Subscription), "SubscriptionNotification", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.SubscriptionNotification), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_ApplyRequests_DeletedByUser", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.User), "ApplyRequest", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.ApplyRequest), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_ApplyRequests_InvitedByUser", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.User), "ApplyRequest", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.ApplyRequest), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_CompanyCategories_Networks", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Network), "CompanyCategory", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.CompanyCategory), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_CompanyRelationships_MasterCompany", "Company", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Company), "CompanyRelationship", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.CompanyRelationship), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_CompanyRelationships_SlaveCompany", "Company", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Company), "CompanyRelationship", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.CompanyRelationship), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_CompanyRelationships_CompanyRelationshipTypes", "CompanyRelationshipType", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.CompanyRelationshipType), "CompanyRelationship", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.CompanyRelationship), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_CompanyRelationshipTypes_Networks", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Network), "CompanyRelationshipType", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.CompanyRelationshipType), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Companies_Category", "CompanyCategory", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.CompanyCategory), "Company", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Company), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_CompanyPlaces_Companies", "Company", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Company), "CompanyPlace", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.CompanyPlace), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_CompanyPlaces_Places", "Place", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Place), "CompanyPlace", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.CompanyPlace), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_PlaceProfileFields_Places", "Place", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Place), "PlaceProfileField", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.PlaceProfileField), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_PlaceProfileFields_ProfileFields", "ProfileField", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.ProfileField), "PlaceProfileField", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.PlaceProfileField), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_TagCategories_Network", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.Network), "TagCategory", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.TagCategory), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_CompanyTags_Companies", "Company", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Company), "CompanyTag", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.CompanyTag), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_CompanyTags_CreatedByUser", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "CompanyTag", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.CompanyTag), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_CompanyTags_DeletedByUser", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.User), "CompanyTag", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.CompanyTag), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_CompanyTags_Tags", "TagDefinition", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.TagDefinition), "CompanyTag", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.CompanyTag), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Invited_DeletedByUser", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.User), "Invited", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Invited), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_UserTags_Tags", "TagDefinition", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.TagDefinition), "UserTag", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.UserTag), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_UserTags_Companies", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "UserTag", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.UserTag), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_UserTags_CreatedByUser", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "UserTag", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.UserTag), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_UserTags_DeletedByUser", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.User), "UserTag", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.UserTag), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_GroupTags_Relation", "Group", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Group), "GroupTag", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.GroupTag), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_GroupTags_CreatedByUser", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "GroupTag", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.GroupTag), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_GroupTags_DeletedByUser", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.User), "GroupTag", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.GroupTag), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_GroupTags_Tag", "TagDefinition", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.TagDefinition), "GroupTag", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.GroupTag), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_TimelineItemTags_Tag", "TagDefinition", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.TagDefinition), "TimelineItemTag", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.TimelineItemTag), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_TimelineItemTags_Relation", "TimelineItem", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.TimelineItem), "TimelineItemTag", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.TimelineItemTag), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_TimelineItemTags_CreatedByUser", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "TimelineItemTag", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.TimelineItemTag), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_TimelineItemTags_DeletedByUser", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.User), "TimelineItemTag", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.TimelineItemTag), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Ads_CloseUser", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.User), "Ad", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Ad), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Ads_NetworkId", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.Network), "Ad", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Ad), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Ads_ValidationUser", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.User), "Ad", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Ad), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_AdTags_Relation", "Ad", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Ad), "AdTag", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.AdTag), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_AdTags_CreatedByUser", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "AdTag", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.AdTag), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_AdTags_DeletedByUser", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.User), "AdTag", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.AdTag), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_AdTags_Tag", "TagDefinition", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.TagDefinition), "AdTag", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.AdTag), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_Activities_Ad", "Ad", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.Ad), "Activity", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Activity), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_Hints_Network", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Sparkle.Entities.Networks.Network), "Hint", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Hint), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_HintsToUsers_Hint", "Hint", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Hint), "HintsToUser", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.HintsToUser), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_HintsToUsers_User", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "HintsToUser", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.HintsToUser), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_UserPresences_User", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.User), "UserPresence", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.UserPresence), true)] [assembly: EdmRelationshipAttribute("NetworksModel", "FK_dbo_Network", "Network", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Sparkle.Entities.Networks.Network), "Page", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Sparkle.Entities.Networks.Page), true)] #endregion namespace Sparkle.Entities.Networks { #region Contexts /// <summary> /// No Metadata Documentation available. /// </summary> [global::System.CodeDom.Compiler.GeneratedCode("EdmxTool", "1.0.0.0")] public partial class NetworksEntities : ObjectContext { #region Constructors /// <summary> /// Initializes a new NetworksEntities object using the connection string found in the 'NetworksEntities' section of the application configuration file. /// </summary> public NetworksEntities() : base("name=NetworksEntities", "NetworksEntities") { this.ContextOptions.LazyLoadingEnabled = true; OnContextCreated(); } /// <summary> /// Initialize a new NetworksEntities object. /// </summary> public NetworksEntities(string connectionString) : base(connectionString, "NetworksEntities") { this.ContextOptions.LazyLoadingEnabled = true; OnContextCreated(); } /// <summary> /// Initialize a new NetworksEntities object. /// </summary> public NetworksEntities(EntityConnection connection) : base(connection, "NetworksEntities") { this.ContextOptions.LazyLoadingEnabled = true; OnContextCreated(); } #endregion #region Partial Methods partial void OnContextCreated(); #endregion #region ObjectSet Properties /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<Achievement> Achievements { get { if ((_Achievements == null)) { _Achievements = base.CreateObjectSet<Achievement>("Achievements"); } return _Achievements; } } private ObjectSet<Achievement> _Achievements; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<Activity> Activities { get { if ((_Activities == null)) { _Activities = base.CreateObjectSet<Activity>("Activities"); } return _Activities; } } private ObjectSet<Activity> _Activities; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<AdCategory> AdCategories { get { if ((_AdCategories == null)) { _AdCategories = base.CreateObjectSet<AdCategory>("AdCategories"); } return _AdCategories; } } private ObjectSet<AdCategory> _AdCategories; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<Ad> Ads { get { if ((_Ads == null)) { _Ads = base.CreateObjectSet<Ad>("Ads"); } return _Ads; } } private ObjectSet<Ad> _Ads; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<Album> Albums { get { if ((_Albums == null)) { _Albums = base.CreateObjectSet<Album>("Albums"); } return _Albums; } } private ObjectSet<Album> _Albums; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<Building> Buildings { get { if ((_Buildings == null)) { _Buildings = base.CreateObjectSet<Building>("Buildings"); } return _Buildings; } } private ObjectSet<Building> _Buildings; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<Company> Companies { get { if ((_Companies == null)) { _Companies = base.CreateObjectSet<Company>("Companies"); } return _Companies; } } private ObjectSet<Company> _Companies; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<CompaniesVisit> CompaniesVisits { get { if ((_CompaniesVisits == null)) { _CompaniesVisits = base.CreateObjectSet<CompaniesVisit>("CompaniesVisits"); } return _CompaniesVisits; } } private ObjectSet<CompaniesVisit> _CompaniesVisits; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<CompanyAdmin> CompanyAdmins { get { if ((_CompanyAdmins == null)) { _CompanyAdmins = base.CreateObjectSet<CompanyAdmin>("CompanyAdmins"); } return _CompanyAdmins; } } private ObjectSet<CompanyAdmin> _CompanyAdmins; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<CompanyNew> CompanyNews { get { if ((_CompanyNews == null)) { _CompanyNews = base.CreateObjectSet<CompanyNew>("CompanyNews"); } return _CompanyNews; } } private ObjectSet<CompanyNew> _CompanyNews; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<CompanySkill> CompanySkills { get { if ((_CompanySkills == null)) { _CompanySkills = base.CreateObjectSet<CompanySkill>("CompanySkills"); } return _CompanySkills; } } private ObjectSet<CompanySkill> _CompanySkills; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<Contact> Contacts { get { if ((_Contacts == null)) { _Contacts = base.CreateObjectSet<Contact>("Contacts"); } return _Contacts; } } private ObjectSet<Contact> _Contacts; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<Device> Devices { get { if ((_Devices == null)) { _Devices = base.CreateObjectSet<Device>("Devices"); } return _Devices; } } private ObjectSet<Device> _Devices; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<EventCategory> EventCategories { get { if ((_EventCategories == null)) { _EventCategories = base.CreateObjectSet<EventCategory>("EventCategories"); } return _EventCategories; } } private ObjectSet<EventCategory> _EventCategories; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<EventMember> EventMembers { get { if ((_EventMembers == null)) { _EventMembers = base.CreateObjectSet<EventMember>("EventMembers"); } return _EventMembers; } } private ObjectSet<EventMember> _EventMembers; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<Event> Events { get { if ((_Events == null)) { _Events = base.CreateObjectSet<Event>("Events"); } return _Events; } } private ObjectSet<Event> _Events; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<ExchangeMaterial> ExchangeMaterials { get { if ((_ExchangeMaterials == null)) { _ExchangeMaterials = base.CreateObjectSet<ExchangeMaterial>("ExchangeMaterials"); } return _ExchangeMaterials; } } private ObjectSet<ExchangeMaterial> _ExchangeMaterials; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<ExchangeSkill> ExchangeSkills { get { if ((_ExchangeSkills == null)) { _ExchangeSkills = base.CreateObjectSet<ExchangeSkill>("ExchangeSkills"); } return _ExchangeSkills; } } private ObjectSet<ExchangeSkill> _ExchangeSkills; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<ExchangeSurface> ExchangeSurfaces { get { if ((_ExchangeSurfaces == null)) { _ExchangeSurfaces = base.CreateObjectSet<ExchangeSurface>("ExchangeSurfaces"); } return _ExchangeSurfaces; } } private ObjectSet<ExchangeSurface> _ExchangeSurfaces; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<GroupCategory> GroupCategories { get { if ((_GroupCategories == null)) { _GroupCategories = base.CreateObjectSet<GroupCategory>("GroupCategories"); } return _GroupCategories; } } private ObjectSet<GroupCategory> _GroupCategories; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<GroupMember> GroupMembers { get { if ((_GroupMembers == null)) { _GroupMembers = base.CreateObjectSet<GroupMember>("GroupMembers"); } return _GroupMembers; } } private ObjectSet<GroupMember> _GroupMembers; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<Group> Groups { get { if ((_Groups == null)) { _Groups = base.CreateObjectSet<Group>("Groups"); } return _Groups; } } private ObjectSet<Group> _Groups; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<InformationNote> InformationNotes { get { if ((_InformationNotes == null)) { _InformationNotes = base.CreateObjectSet<InformationNote>("InformationNotes"); } return _InformationNotes; } } private ObjectSet<InformationNote> _InformationNotes; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<Interest> Interests { get { if ((_Interests == null)) { _Interests = base.CreateObjectSet<Interest>("Interests"); } return _Interests; } } private ObjectSet<Interest> _Interests; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<Invited> Inviteds { get { if ((_Inviteds == null)) { _Inviteds = base.CreateObjectSet<Invited>("Inviteds"); } return _Inviteds; } } private ObjectSet<Invited> _Inviteds; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<JobByBusiness> JobByBusinesses { get { if ((_JobByBusinesses == null)) { _JobByBusinesses = base.CreateObjectSet<JobByBusiness>("JobByBusinesses"); } return _JobByBusinesses; } } private ObjectSet<JobByBusiness> _JobByBusinesses; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<Job> Jobs { get { if ((_Jobs == null)) { _Jobs = base.CreateObjectSet<Job>("Jobs"); } return _Jobs; } } private ObjectSet<Job> _Jobs; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<Link> Links { get { if ((_Links == null)) { _Links = base.CreateObjectSet<Link>("Links"); } return _Links; } } private ObjectSet<Link> _Links; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<ListItem> ListItems { get { if ((_ListItems == null)) { _ListItems = base.CreateObjectSet<ListItem>("ListItems"); } return _ListItems; } } private ObjectSet<ListItem> _ListItems; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<List> Lists { get { if ((_Lists == null)) { _Lists = base.CreateObjectSet<List>("Lists"); } return _Lists; } } private ObjectSet<List> _Lists; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<Live> Lives { get { if ((_Lives == null)) { _Lives = base.CreateObjectSet<Live>("Lives"); } return _Lives; } } private ObjectSet<Live> _Lives; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<LostItem> LostItems { get { if ((_LostItems == null)) { _LostItems = base.CreateObjectSet<LostItem>("LostItems"); } return _LostItems; } } private ObjectSet<LostItem> _LostItems; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<MenuPlanning> MenuPlannings { get { if ((_MenuPlannings == null)) { _MenuPlannings = base.CreateObjectSet<MenuPlanning>("MenuPlannings"); } return _MenuPlannings; } } private ObjectSet<MenuPlanning> _MenuPlannings; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<Menu> Menus { get { if ((_Menus == null)) { _Menus = base.CreateObjectSet<Menu>("Menus"); } return _Menus; } } private ObjectSet<Menu> _Menus; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<Message> Messages { get { if ((_Messages == null)) { _Messages = base.CreateObjectSet<Message>("Messages"); } return _Messages; } } private ObjectSet<Message> _Messages; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<Notification> Notifications { get { if ((_Notifications == null)) { _Notifications = base.CreateObjectSet<Notification>("Notifications"); } return _Notifications; } } private ObjectSet<Notification> _Notifications; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<Number> Numbers { get { if ((_Numbers == null)) { _Numbers = base.CreateObjectSet<Number>("Numbers"); } return _Numbers; } } private ObjectSet<Number> _Numbers; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<Picture> Pictures { get { if ((_Pictures == null)) { _Pictures = base.CreateObjectSet<Picture>("Pictures"); } return _Pictures; } } private ObjectSet<Picture> _Pictures; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<PlaceCategory> PlaceCategories { get { if ((_PlaceCategories == null)) { _PlaceCategories = base.CreateObjectSet<PlaceCategory>("PlaceCategories"); } return _PlaceCategories; } } private ObjectSet<PlaceCategory> _PlaceCategories; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<PlaceHistory> PlaceHistories { get { if ((_PlaceHistories == null)) { _PlaceHistories = base.CreateObjectSet<PlaceHistory>("PlaceHistories"); } return _PlaceHistories; } } private ObjectSet<PlaceHistory> _PlaceHistories; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<Place> Places { get { if ((_Places == null)) { _Places = base.CreateObjectSet<Place>("Places"); } return _Places; } } private ObjectSet<Place> _Places; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<PollAnswer> PollAnswers { get { if ((_PollAnswers == null)) { _PollAnswers = base.CreateObjectSet<PollAnswer>("PollAnswers"); } return _PollAnswers; } } private ObjectSet<PollAnswer> _PollAnswers; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<PollChoice> PollChoices { get { if ((_PollChoices == null)) { _PollChoices = base.CreateObjectSet<PollChoice>("PollChoices"); } return _PollChoices; } } private ObjectSet<PollChoice> _PollChoices; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<Poll> Polls { get { if ((_Polls == null)) { _Polls = base.CreateObjectSet<Poll>("Polls"); } return _Polls; } } private ObjectSet<Poll> _Polls; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<ProjectMember> ProjectMembers { get { if ((_ProjectMembers == null)) { _ProjectMembers = base.CreateObjectSet<ProjectMember>("ProjectMembers"); } return _ProjectMembers; } } private ObjectSet<ProjectMember> _ProjectMembers; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<Project> Projects { get { if ((_Projects == null)) { _Projects = base.CreateObjectSet<Project>("Projects"); } return _Projects; } } private ObjectSet<Project> _Projects; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<Recreation> Recreations { get { if ((_Recreations == null)) { _Recreations = base.CreateObjectSet<Recreation>("Recreations"); } return _Recreations; } } private ObjectSet<Recreation> _Recreations; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<Relationship> Relationships { get { if ((_Relationships == null)) { _Relationships = base.CreateObjectSet<Relationship>("Relationships"); } return _Relationships; } } private ObjectSet<Relationship> _Relationships; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<SeekFriend> SeekFriends { get { if ((_SeekFriends == null)) { _SeekFriends = base.CreateObjectSet<SeekFriend>("SeekFriends"); } return _SeekFriends; } } private ObjectSet<SeekFriend> _SeekFriends; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<Skill> Skills { get { if ((_Skills == null)) { _Skills = base.CreateObjectSet<Skill>("Skills"); } return _Skills; } } private ObjectSet<Skill> _Skills; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<TeamMember> TeamMembers { get { if ((_TeamMembers == null)) { _TeamMembers = base.CreateObjectSet<TeamMember>("TeamMembers"); } return _TeamMembers; } } private ObjectSet<TeamMember> _TeamMembers; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<Team> Teams { get { if ((_Teams == null)) { _Teams = base.CreateObjectSet<Team>("Teams"); } return _Teams; } } private ObjectSet<Team> _Teams; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<TimelineItemComment> TimelineItemComments { get { if ((_TimelineItemComments == null)) { _TimelineItemComments = base.CreateObjectSet<TimelineItemComment>("TimelineItemComments"); } return _TimelineItemComments; } } private ObjectSet<TimelineItemComment> _TimelineItemComments; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<TimelineItem> TimelineItems { get { if ((_TimelineItems == null)) { _TimelineItems = base.CreateObjectSet<TimelineItem>("TimelineItems"); } return _TimelineItems; } } private ObjectSet<TimelineItem> _TimelineItems; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<TouchCommunicationItem> TouchCommunicationItems { get { if ((_TouchCommunicationItems == null)) { _TouchCommunicationItems = base.CreateObjectSet<TouchCommunicationItem>("TouchCommunicationItems"); } return _TouchCommunicationItems; } } private ObjectSet<TouchCommunicationItem> _TouchCommunicationItems; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<TouchCommunication> TouchCommunications { get { if ((_TouchCommunications == null)) { _TouchCommunications = base.CreateObjectSet<TouchCommunication>("TouchCommunications"); } return _TouchCommunications; } } private ObjectSet<TouchCommunication> _TouchCommunications; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<UserInterest> UserInterests { get { if ((_UserInterests == null)) { _UserInterests = base.CreateObjectSet<UserInterest>("UserInterests"); } return _UserInterests; } } private ObjectSet<UserInterest> _UserInterests; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<UserRecreation> UserRecreations { get { if ((_UserRecreations == null)) { _UserRecreations = base.CreateObjectSet<UserRecreation>("UserRecreations"); } return _UserRecreations; } } private ObjectSet<UserRecreation> _UserRecreations; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<User> Users { get { if ((_Users == null)) { _Users = base.CreateObjectSet<User>("Users"); } return _Users; } } private ObjectSet<User> _Users; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<UserSkill> UserSkills { get { if ((_UserSkills == null)) { _UserSkills = base.CreateObjectSet<UserSkill>("UserSkills"); } return _UserSkills; } } private ObjectSet<UserSkill> _UserSkills; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<UsersVisit> UsersVisits { get { if ((_UsersVisits == null)) { _UsersVisits = base.CreateObjectSet<UsersVisit>("UsersVisits"); } return _UsersVisits; } } private ObjectSet<UsersVisit> _UsersVisits; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<AspnetUsers> AspnetUser { get { if ((_AspnetUser == null)) { _AspnetUser = base.CreateObjectSet<AspnetUsers>("AspnetUser"); } return _AspnetUser; } } private ObjectSet<AspnetUsers> _AspnetUser; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<AspnetMembership> AspnetMemberships { get { if ((_AspnetMemberships == null)) { _AspnetMemberships = base.CreateObjectSet<AspnetMembership>("AspnetMemberships"); } return _AspnetMemberships; } } private ObjectSet<AspnetMembership> _AspnetMemberships; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<DevicePlanning> DevicePlannings { get { if ((_DevicePlannings == null)) { _DevicePlannings = base.CreateObjectSet<DevicePlanning>("DevicePlannings"); } return _DevicePlannings; } } private ObjectSet<DevicePlanning> _DevicePlannings; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<DeviceConfiguration> DeviceConfigurations { get { if ((_DeviceConfigurations == null)) { _DeviceConfigurations = base.CreateObjectSet<DeviceConfiguration>("DeviceConfigurations"); } return _DeviceConfigurations; } } private ObjectSet<DeviceConfiguration> _DeviceConfigurations; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<AchievementsCompany> AchievementsCompanies { get { if ((_AchievementsCompanies == null)) { _AchievementsCompanies = base.CreateObjectSet<AchievementsCompany>("AchievementsCompanies"); } return _AchievementsCompanies; } } private ObjectSet<AchievementsCompany> _AchievementsCompanies; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<AchievementsUser> AchievementsUsers { get { if ((_AchievementsUsers == null)) { _AchievementsUsers = base.CreateObjectSet<AchievementsUser>("AchievementsUsers"); } return _AchievementsUsers; } } private ObjectSet<AchievementsUser> _AchievementsUsers; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<RegisterRequest> RegisterRequests { get { if ((_RegisterRequests == null)) { _RegisterRequests = base.CreateObjectSet<RegisterRequest>("RegisterRequests"); } return _RegisterRequests; } } private ObjectSet<RegisterRequest> _RegisterRequests; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<RequestForProposal> RequestsForProposal { get { if ((_RequestsForProposal == null)) { _RequestsForProposal = base.CreateObjectSet<RequestForProposal>("RequestsForProposal"); } return _RequestsForProposal; } } private ObjectSet<RequestForProposal> _RequestsForProposal; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<UserSetting> UserSettings { get { if ((_UserSettings == null)) { _UserSettings = base.CreateObjectSet<UserSetting>("UserSettings"); } return _UserSettings; } } private ObjectSet<UserSetting> _UserSettings; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<EventPublicMember> EventPublicMembers { get { if ((_EventPublicMembers == null)) { _EventPublicMembers = base.CreateObjectSet<EventPublicMember>("EventPublicMembers"); } return _EventPublicMembers; } } private ObjectSet<EventPublicMember> _EventPublicMembers; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<CreateNetworkRequest> CreateNetworkRequests { get { if ((_CreateNetworkRequests == null)) { _CreateNetworkRequests = base.CreateObjectSet<CreateNetworkRequest>("CreateNetworkRequests"); } return _CreateNetworkRequests; } } private ObjectSet<CreateNetworkRequest> _CreateNetworkRequests; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<Network> Networks { get { if ((_Networks == null)) { _Networks = base.CreateObjectSet<Network>("Networks"); } return _Networks; } } private ObjectSet<Network> _Networks; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<CareerOpportunity> CareerOpportunities { get { if ((_CareerOpportunities == null)) { _CareerOpportunities = base.CreateObjectSet<CareerOpportunity>("CareerOpportunities"); } return _CareerOpportunities; } } private ObjectSet<CareerOpportunity> _CareerOpportunities; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<SocialNetworkCompanySubscription> SocialNetworkCompanySubscriptions { get { if ((_SocialNetworkCompanySubscriptions == null)) { _SocialNetworkCompanySubscriptions = base.CreateObjectSet<SocialNetworkCompanySubscription>("SocialNetworkCompanySubscriptions"); } return _SocialNetworkCompanySubscriptions; } } private ObjectSet<SocialNetworkCompanySubscription> _SocialNetworkCompanySubscriptions; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<SocialNetworkConnection> SocialNetworkConnections { get { if ((_SocialNetworkConnections == null)) { _SocialNetworkConnections = base.CreateObjectSet<SocialNetworkConnection>("SocialNetworkConnections"); } return _SocialNetworkConnections; } } private ObjectSet<SocialNetworkConnection> _SocialNetworkConnections; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<SocialNetworkState> SocialNetworkStates { get { if ((_SocialNetworkStates == null)) { _SocialNetworkStates = base.CreateObjectSet<SocialNetworkState>("SocialNetworkStates"); } return _SocialNetworkStates; } } private ObjectSet<SocialNetworkState> _SocialNetworkStates; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<SocialNetworkUserSubscription> SocialNetworkUserSubscriptions { get { if ((_SocialNetworkUserSubscriptions == null)) { _SocialNetworkUserSubscriptions = base.CreateObjectSet<SocialNetworkUserSubscription>("SocialNetworkUserSubscriptions"); } return _SocialNetworkUserSubscriptions; } } private ObjectSet<SocialNetworkUserSubscription> _SocialNetworkUserSubscriptions; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<CompanyContact> CompanyContacts { get { if ((_CompanyContacts == null)) { _CompanyContacts = base.CreateObjectSet<CompanyContact>("CompanyContacts"); } return _CompanyContacts; } } private ObjectSet<CompanyContact> _CompanyContacts; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<Resume> Resumes { get { if ((_Resumes == null)) { _Resumes = base.CreateObjectSet<Resume>("Resumes"); } return _Resumes; } } private ObjectSet<Resume> _Resumes; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<ResumeSkill> ResumeSkills { get { if ((_ResumeSkills == null)) { _ResumeSkills = base.CreateObjectSet<ResumeSkill>("ResumeSkills"); } return _ResumeSkills; } } private ObjectSet<ResumeSkill> _ResumeSkills; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<StatsCounterHit> StatsCounterHits { get { if ((_StatsCounterHits == null)) { _StatsCounterHits = base.CreateObjectSet<StatsCounterHit>("StatsCounterHits"); } return _StatsCounterHits; } } private ObjectSet<StatsCounterHit> _StatsCounterHits; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<StatsCounter> StatsCounters { get { if ((_StatsCounters == null)) { _StatsCounters = base.CreateObjectSet<StatsCounter>("StatsCounters"); } return _StatsCounters; } } private ObjectSet<StatsCounter> _StatsCounters; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<CompanyCategory> CompanyCategories { get { if ((_CompanyCategories == null)) { _CompanyCategories = base.CreateObjectSet<CompanyCategory>("CompanyCategories"); } return _CompanyCategories; } } private ObjectSet<CompanyCategory> _CompanyCategories; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<NetworkType> NetworkTypes { get { if ((_NetworkTypes == null)) { _NetworkTypes = base.CreateObjectSet<NetworkType>("NetworkTypes"); } return _NetworkTypes; } } private ObjectSet<NetworkType> _NetworkTypes; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<CompanyRequestMessage> CompanyRequestMessages { get { if ((_CompanyRequestMessages == null)) { _CompanyRequestMessages = base.CreateObjectSet<CompanyRequestMessage>("CompanyRequestMessages"); } return _CompanyRequestMessages; } } private ObjectSet<CompanyRequestMessage> _CompanyRequestMessages; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<CompanyRequest> CompanyRequests { get { if ((_CompanyRequests == null)) { _CompanyRequests = base.CreateObjectSet<CompanyRequest>("CompanyRequests"); } return _CompanyRequests; } } private ObjectSet<CompanyRequest> _CompanyRequests; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<Club> Clubs { get { if ((_Clubs == null)) { _Clubs = base.CreateObjectSet<Club>("Clubs"); } return _Clubs; } } private ObjectSet<Club> _Clubs; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<UserActionKey> UserActionKeys { get { if ((_UserActionKeys == null)) { _UserActionKeys = base.CreateObjectSet<UserActionKey>("UserActionKeys"); } return _UserActionKeys; } } private ObjectSet<UserActionKey> _UserActionKeys; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<TimelineItemSkill> TimelineItemSkills { get { if ((_TimelineItemSkills == null)) { _TimelineItemSkills = base.CreateObjectSet<TimelineItemSkill>("TimelineItemSkills"); } return _TimelineItemSkills; } } private ObjectSet<TimelineItemSkill> _TimelineItemSkills; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<GroupSkill> GroupSkills { get { if ((_GroupSkills == null)) { _GroupSkills = base.CreateObjectSet<GroupSkill>("GroupSkills"); } return _GroupSkills; } } private ObjectSet<GroupSkill> _GroupSkills; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<GroupInterest> GroupInterests { get { if ((_GroupInterests == null)) { _GroupInterests = base.CreateObjectSet<GroupInterest>("GroupInterests"); } return _GroupInterests; } } private ObjectSet<GroupInterest> _GroupInterests; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<GroupRecreation> GroupRecreations { get { if ((_GroupRecreations == null)) { _GroupRecreations = base.CreateObjectSet<GroupRecreation>("GroupRecreations"); } return _GroupRecreations; } } private ObjectSet<GroupRecreation> _GroupRecreations; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<EmailMessage> EmailMessages { get { if ((_EmailMessages == null)) { _EmailMessages = base.CreateObjectSet<EmailMessage>("EmailMessages"); } return _EmailMessages; } } private ObjectSet<EmailMessage> _EmailMessages; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<UserEmailChangeRequest> UserEmailChangeRequests { get { if ((_UserEmailChangeRequests == null)) { _UserEmailChangeRequests = base.CreateObjectSet<UserEmailChangeRequest>("UserEmailChangeRequests"); } return _UserEmailChangeRequests; } } private ObjectSet<UserEmailChangeRequest> _UserEmailChangeRequests; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<InboundEmailMessage> InboundEmailMessages { get { if ((_InboundEmailMessages == null)) { _InboundEmailMessages = base.CreateObjectSet<InboundEmailMessage>("InboundEmailMessages"); } return _InboundEmailMessages; } } private ObjectSet<InboundEmailMessage> _InboundEmailMessages; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<TimelineItemLike> TimelineItemLikes { get { if ((_TimelineItemLikes == null)) { _TimelineItemLikes = base.CreateObjectSet<TimelineItemLike>("TimelineItemLikes"); } return _TimelineItemLikes; } } private ObjectSet<TimelineItemLike> _TimelineItemLikes; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<TimelineItemCommentLike> TimelineItemCommentLikes { get { if ((_TimelineItemCommentLikes == null)) { _TimelineItemCommentLikes = base.CreateObjectSet<TimelineItemCommentLike>("TimelineItemCommentLikes"); } return _TimelineItemCommentLikes; } } private ObjectSet<TimelineItemCommentLike> _TimelineItemCommentLikes; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<UsersView> UsersViews { get { if ((_UsersViews == null)) { _UsersViews = base.CreateObjectSet<UsersView>("UsersViews"); } return _UsersViews; } } private ObjectSet<UsersView> _UsersViews; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<ProfileField> ProfileFields { get { if ((_ProfileFields == null)) { _ProfileFields = base.CreateObjectSet<ProfileField>("ProfileFields"); } return _ProfileFields; } } private ObjectSet<ProfileField> _ProfileFields; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<UserProfileField> UserProfileFields { get { if ((_UserProfileFields == null)) { _UserProfileFields = base.CreateObjectSet<UserProfileField>("UserProfileFields"); } return _UserProfileFields; } } private ObjectSet<UserProfileField> _UserProfileFields; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<ProfileFieldsAvailiableValue> ProfileFieldsAvailiableValues { get { if ((_ProfileFieldsAvailiableValues == null)) { _ProfileFieldsAvailiableValues = base.CreateObjectSet<ProfileFieldsAvailiableValue>("ProfileFieldsAvailiableValues"); } return _ProfileFieldsAvailiableValues; } } private ObjectSet<ProfileFieldsAvailiableValue> _ProfileFieldsAvailiableValues; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<ApplyRequest> ApplyRequests { get { if ((_ApplyRequests == null)) { _ApplyRequests = base.CreateObjectSet<ApplyRequest>("ApplyRequests"); } return _ApplyRequests; } } private ObjectSet<ApplyRequest> _ApplyRequests; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<CompanyProfileField> CompanyProfileFields { get { if ((_CompanyProfileFields == null)) { _CompanyProfileFields = base.CreateObjectSet<CompanyProfileField>("CompanyProfileFields"); } return _CompanyProfileFields; } } private ObjectSet<CompanyProfileField> _CompanyProfileFields; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<Subscription> Subscriptions { get { if ((_Subscriptions == null)) { _Subscriptions = base.CreateObjectSet<Subscription>("Subscriptions"); } return _Subscriptions; } } private ObjectSet<Subscription> _Subscriptions; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<SubscriptionTemplate> SubscriptionTemplates { get { if ((_SubscriptionTemplates == null)) { _SubscriptionTemplates = base.CreateObjectSet<SubscriptionTemplate>("SubscriptionTemplates"); } return _SubscriptionTemplates; } } private ObjectSet<SubscriptionTemplate> _SubscriptionTemplates; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<StripeTransaction> StripeTransactions { get { if ((_StripeTransactions == null)) { _StripeTransactions = base.CreateObjectSet<StripeTransaction>("StripeTransactions"); } return _StripeTransactions; } } private ObjectSet<StripeTransaction> _StripeTransactions; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<TagCategory> TagCategories { get { if ((_TagCategories == null)) { _TagCategories = base.CreateObjectSet<TagCategory>("TagCategories"); } return _TagCategories; } } private ObjectSet<TagCategory> _TagCategories; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<TagDefinition> TagDefinitions { get { if ((_TagDefinitions == null)) { _TagDefinitions = base.CreateObjectSet<TagDefinition>("TagDefinitions"); } return _TagDefinitions; } } private ObjectSet<TagDefinition> _TagDefinitions; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<PartnerResource> PartnerResources { get { if ((_PartnerResources == null)) { _PartnerResources = base.CreateObjectSet<PartnerResource>("PartnerResources"); } return _PartnerResources; } } private ObjectSet<PartnerResource> _PartnerResources; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<PartnerResourceProfileField> PartnerResourceProfileFields { get { if ((_PartnerResourceProfileFields == null)) { _PartnerResourceProfileFields = base.CreateObjectSet<PartnerResourceProfileField>("PartnerResourceProfileFields"); } return _PartnerResourceProfileFields; } } private ObjectSet<PartnerResourceProfileField> _PartnerResourceProfileFields; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<PartnerResourceTag> PartnerResourceTags { get { if ((_PartnerResourceTags == null)) { _PartnerResourceTags = base.CreateObjectSet<PartnerResourceTag>("PartnerResourceTags"); } return _PartnerResourceTags; } } private ObjectSet<PartnerResourceTag> _PartnerResourceTags; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<ActiveUsersViewLight> ActiveUsersViewLights { get { if ((_ActiveUsersViewLights == null)) { _ActiveUsersViewLights = base.CreateObjectSet<ActiveUsersViewLight>("ActiveUsersViewLights"); } return _ActiveUsersViewLights; } } private ObjectSet<ActiveUsersViewLight> _ActiveUsersViewLights; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<ActiveUsersViewLightEx> ActiveUsersViewLightExes { get { if ((_ActiveUsersViewLightExes == null)) { _ActiveUsersViewLightExes = base.CreateObjectSet<ActiveUsersViewLightEx>("ActiveUsersViewLightExes"); } return _ActiveUsersViewLightExes; } } private ObjectSet<ActiveUsersViewLightEx> _ActiveUsersViewLightExes; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<SubscriptionNotification> SubscriptionNotifications { get { if ((_SubscriptionNotifications == null)) { _SubscriptionNotifications = base.CreateObjectSet<SubscriptionNotification>("SubscriptionNotifications"); } return _SubscriptionNotifications; } } private ObjectSet<SubscriptionNotification> _SubscriptionNotifications; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<CompanyRelationship> CompanyRelationships { get { if ((_CompanyRelationships == null)) { _CompanyRelationships = base.CreateObjectSet<CompanyRelationship>("CompanyRelationships"); } return _CompanyRelationships; } } private ObjectSet<CompanyRelationship> _CompanyRelationships; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<CompanyRelationshipType> CompanyRelationshipTypes { get { if ((_CompanyRelationshipTypes == null)) { _CompanyRelationshipTypes = base.CreateObjectSet<CompanyRelationshipType>("CompanyRelationshipTypes"); } return _CompanyRelationshipTypes; } } private ObjectSet<CompanyRelationshipType> _CompanyRelationshipTypes; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<CompanyPlace> CompanyPlaces { get { if ((_CompanyPlaces == null)) { _CompanyPlaces = base.CreateObjectSet<CompanyPlace>("CompanyPlaces"); } return _CompanyPlaces; } } private ObjectSet<CompanyPlace> _CompanyPlaces; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<PlaceProfileField> PlaceProfileFields { get { if ((_PlaceProfileFields == null)) { _PlaceProfileFields = base.CreateObjectSet<PlaceProfileField>("PlaceProfileFields"); } return _PlaceProfileFields; } } private ObjectSet<PlaceProfileField> _PlaceProfileFields; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<CompanyTag> CompanyTags { get { if ((_CompanyTags == null)) { _CompanyTags = base.CreateObjectSet<CompanyTag>("CompanyTags"); } return _CompanyTags; } } private ObjectSet<CompanyTag> _CompanyTags; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<UserTag> UserTags { get { if ((_UserTags == null)) { _UserTags = base.CreateObjectSet<UserTag>("UserTags"); } return _UserTags; } } private ObjectSet<UserTag> _UserTags; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<GroupTag> GroupTags { get { if ((_GroupTags == null)) { _GroupTags = base.CreateObjectSet<GroupTag>("GroupTags"); } return _GroupTags; } } private ObjectSet<GroupTag> _GroupTags; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<TimelineItemTag> TimelineItemTags { get { if ((_TimelineItemTags == null)) { _TimelineItemTags = base.CreateObjectSet<TimelineItemTag>("TimelineItemTags"); } return _TimelineItemTags; } } private ObjectSet<TimelineItemTag> _TimelineItemTags; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<AdTag> AdTags { get { if ((_AdTags == null)) { _AdTags = base.CreateObjectSet<AdTag>("AdTags"); } return _AdTags; } } private ObjectSet<AdTag> _AdTags; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<Hint> Hints { get { if ((_Hints == null)) { _Hints = base.CreateObjectSet<Hint>("Hints"); } return _Hints; } } private ObjectSet<Hint> _Hints; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<HintsToUser> HintsToUsers { get { if ((_HintsToUsers == null)) { _HintsToUsers = base.CreateObjectSet<HintsToUser>("HintsToUsers"); } return _HintsToUsers; } } private ObjectSet<HintsToUser> _HintsToUsers; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<ApiKey> ApiKeys { get { if ((_ApiKeys == null)) { _ApiKeys = base.CreateObjectSet<ApiKey>("ApiKeys"); } return _ApiKeys; } } private ObjectSet<ApiKey> _ApiKeys; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<UserPresence> UserPresences { get { if ((_UserPresences == null)) { _UserPresences = base.CreateObjectSet<UserPresence>("UserPresences"); } return _UserPresences; } } private ObjectSet<UserPresence> _UserPresences; /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectSet<Page> Pages { get { if ((_Pages == null)) { _Pages = base.CreateObjectSet<Page>("Pages"); } return _Pages; } } private ObjectSet<Page> _Pages; #endregion #region AddTo Methods /// <summary> /// Deprecated Method for adding a new object to the Achievements EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToAchievements(Achievement achievement) { base.AddObject("Achievements", achievement); } /// <summary> /// Deprecated Method for adding a new object to the Activities EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToActivities(Activity activity) { base.AddObject("Activities", activity); } /// <summary> /// Deprecated Method for adding a new object to the AdCategories EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToAdCategories(AdCategory adCategory) { base.AddObject("AdCategories", adCategory); } /// <summary> /// Deprecated Method for adding a new object to the Ads EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToAds(Ad ad) { base.AddObject("Ads", ad); } /// <summary> /// Deprecated Method for adding a new object to the Albums EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToAlbums(Album album) { base.AddObject("Albums", album); } /// <summary> /// Deprecated Method for adding a new object to the Buildings EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToBuildings(Building building) { base.AddObject("Buildings", building); } /// <summary> /// Deprecated Method for adding a new object to the Companies EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToCompanies(Company company) { base.AddObject("Companies", company); } /// <summary> /// Deprecated Method for adding a new object to the CompaniesVisits EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToCompaniesVisits(CompaniesVisit companiesVisit) { base.AddObject("CompaniesVisits", companiesVisit); } /// <summary> /// Deprecated Method for adding a new object to the CompanyAdmins EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToCompanyAdmins(CompanyAdmin companyAdmin) { base.AddObject("CompanyAdmins", companyAdmin); } /// <summary> /// Deprecated Method for adding a new object to the CompanyNews EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToCompanyNews(CompanyNew companyNew) { base.AddObject("CompanyNews", companyNew); } /// <summary> /// Deprecated Method for adding a new object to the CompanySkills EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToCompanySkills(CompanySkill companySkill) { base.AddObject("CompanySkills", companySkill); } /// <summary> /// Deprecated Method for adding a new object to the Contacts EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToContacts(Contact contact) { base.AddObject("Contacts", contact); } /// <summary> /// Deprecated Method for adding a new object to the Devices EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToDevices(Device device) { base.AddObject("Devices", device); } /// <summary> /// Deprecated Method for adding a new object to the EventCategories EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToEventCategories(EventCategory eventCategory) { base.AddObject("EventCategories", eventCategory); } /// <summary> /// Deprecated Method for adding a new object to the EventMembers EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToEventMembers(EventMember eventMember) { base.AddObject("EventMembers", eventMember); } /// <summary> /// Deprecated Method for adding a new object to the Events EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToEvents(Event @event) { base.AddObject("Events", @event); } /// <summary> /// Deprecated Method for adding a new object to the ExchangeMaterials EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToExchangeMaterials(ExchangeMaterial exchangeMaterial) { base.AddObject("ExchangeMaterials", exchangeMaterial); } /// <summary> /// Deprecated Method for adding a new object to the ExchangeSkills EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToExchangeSkills(ExchangeSkill exchangeSkill) { base.AddObject("ExchangeSkills", exchangeSkill); } /// <summary> /// Deprecated Method for adding a new object to the ExchangeSurfaces EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToExchangeSurfaces(ExchangeSurface exchangeSurface) { base.AddObject("ExchangeSurfaces", exchangeSurface); } /// <summary> /// Deprecated Method for adding a new object to the GroupCategories EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToGroupCategories(GroupCategory groupCategory) { base.AddObject("GroupCategories", groupCategory); } /// <summary> /// Deprecated Method for adding a new object to the GroupMembers EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToGroupMembers(GroupMember groupMember) { base.AddObject("GroupMembers", groupMember); } /// <summary> /// Deprecated Method for adding a new object to the Groups EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToGroups(Group group) { base.AddObject("Groups", group); } /// <summary> /// Deprecated Method for adding a new object to the InformationNotes EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToInformationNotes(InformationNote informationNote) { base.AddObject("InformationNotes", informationNote); } /// <summary> /// Deprecated Method for adding a new object to the Interests EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToInterests(Interest interest) { base.AddObject("Interests", interest); } /// <summary> /// Deprecated Method for adding a new object to the Inviteds EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToInviteds(Invited invited) { base.AddObject("Inviteds", invited); } /// <summary> /// Deprecated Method for adding a new object to the JobByBusinesses EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToJobByBusinesses(JobByBusiness jobByBusiness) { base.AddObject("JobByBusinesses", jobByBusiness); } /// <summary> /// Deprecated Method for adding a new object to the Jobs EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToJobs(Job job) { base.AddObject("Jobs", job); } /// <summary> /// Deprecated Method for adding a new object to the Links EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToLinks(Link link) { base.AddObject("Links", link); } /// <summary> /// Deprecated Method for adding a new object to the ListItems EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToListItems(ListItem listItem) { base.AddObject("ListItems", listItem); } /// <summary> /// Deprecated Method for adding a new object to the Lists EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToLists(List list) { base.AddObject("Lists", list); } /// <summary> /// Deprecated Method for adding a new object to the Lives EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToLives(Live live) { base.AddObject("Lives", live); } /// <summary> /// Deprecated Method for adding a new object to the LostItems EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToLostItems(LostItem lostItem) { base.AddObject("LostItems", lostItem); } /// <summary> /// Deprecated Method for adding a new object to the MenuPlannings EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToMenuPlannings(MenuPlanning menuPlanning) { base.AddObject("MenuPlannings", menuPlanning); } /// <summary> /// Deprecated Method for adding a new object to the Menus EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToMenus(Menu menu) { base.AddObject("Menus", menu); } /// <summary> /// Deprecated Method for adding a new object to the Messages EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToMessages(Message message) { base.AddObject("Messages", message); } /// <summary> /// Deprecated Method for adding a new object to the Notifications EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToNotifications(Notification notification) { base.AddObject("Notifications", notification); } /// <summary> /// Deprecated Method for adding a new object to the Numbers EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToNumbers(Number number) { base.AddObject("Numbers", number); } /// <summary> /// Deprecated Method for adding a new object to the Pictures EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToPictures(Picture picture) { base.AddObject("Pictures", picture); } /// <summary> /// Deprecated Method for adding a new object to the PlaceCategories EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToPlaceCategories(PlaceCategory placeCategory) { base.AddObject("PlaceCategories", placeCategory); } /// <summary> /// Deprecated Method for adding a new object to the PlaceHistories EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToPlaceHistories(PlaceHistory placeHistory) { base.AddObject("PlaceHistories", placeHistory); } /// <summary> /// Deprecated Method for adding a new object to the Places EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToPlaces(Place place) { base.AddObject("Places", place); } /// <summary> /// Deprecated Method for adding a new object to the PollAnswers EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToPollAnswers(PollAnswer pollAnswer) { base.AddObject("PollAnswers", pollAnswer); } /// <summary> /// Deprecated Method for adding a new object to the PollChoices EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToPollChoices(PollChoice pollChoice) { base.AddObject("PollChoices", pollChoice); } /// <summary> /// Deprecated Method for adding a new object to the Polls EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToPolls(Poll poll) { base.AddObject("Polls", poll); } /// <summary> /// Deprecated Method for adding a new object to the ProjectMembers EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToProjectMembers(ProjectMember projectMember) { base.AddObject("ProjectMembers", projectMember); } /// <summary> /// Deprecated Method for adding a new object to the Projects EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToProjects(Project project) { base.AddObject("Projects", project); } /// <summary> /// Deprecated Method for adding a new object to the Recreations EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToRecreations(Recreation recreation) { base.AddObject("Recreations", recreation); } /// <summary> /// Deprecated Method for adding a new object to the Relationships EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToRelationships(Relationship relationship) { base.AddObject("Relationships", relationship); } /// <summary> /// Deprecated Method for adding a new object to the SeekFriends EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToSeekFriends(SeekFriend seekFriend) { base.AddObject("SeekFriends", seekFriend); } /// <summary> /// Deprecated Method for adding a new object to the Skills EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToSkills(Skill skill) { base.AddObject("Skills", skill); } /// <summary> /// Deprecated Method for adding a new object to the TeamMembers EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToTeamMembers(TeamMember teamMember) { base.AddObject("TeamMembers", teamMember); } /// <summary> /// Deprecated Method for adding a new object to the Teams EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToTeams(Team team) { base.AddObject("Teams", team); } /// <summary> /// Deprecated Method for adding a new object to the TimelineItemComments EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToTimelineItemComments(TimelineItemComment timelineItemComment) { base.AddObject("TimelineItemComments", timelineItemComment); } /// <summary> /// Deprecated Method for adding a new object to the TimelineItems EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToTimelineItems(TimelineItem timelineItem) { base.AddObject("TimelineItems", timelineItem); } /// <summary> /// Deprecated Method for adding a new object to the TouchCommunicationItems EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToTouchCommunicationItems(TouchCommunicationItem touchCommunicationItem) { base.AddObject("TouchCommunicationItems", touchCommunicationItem); } /// <summary> /// Deprecated Method for adding a new object to the TouchCommunications EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToTouchCommunications(TouchCommunication touchCommunication) { base.AddObject("TouchCommunications", touchCommunication); } /// <summary> /// Deprecated Method for adding a new object to the UserInterests EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToUserInterests(UserInterest userInterest) { base.AddObject("UserInterests", userInterest); } /// <summary> /// Deprecated Method for adding a new object to the UserRecreations EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToUserRecreations(UserRecreation userRecreation) { base.AddObject("UserRecreations", userRecreation); } /// <summary> /// Deprecated Method for adding a new object to the Users EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToUsers(User user) { base.AddObject("Users", user); } /// <summary> /// Deprecated Method for adding a new object to the UserSkills EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToUserSkills(UserSkill userSkill) { base.AddObject("UserSkills", userSkill); } /// <summary> /// Deprecated Method for adding a new object to the UsersVisits EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToUsersVisits(UsersVisit usersVisit) { base.AddObject("UsersVisits", usersVisit); } /// <summary> /// Deprecated Method for adding a new object to the AspnetUser EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToAspnetUser(AspnetUsers aspnetUsers) { base.AddObject("AspnetUser", aspnetUsers); } /// <summary> /// Deprecated Method for adding a new object to the AspnetMemberships EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToAspnetMemberships(AspnetMembership aspnetMembership) { base.AddObject("AspnetMemberships", aspnetMembership); } /// <summary> /// Deprecated Method for adding a new object to the DevicePlannings EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToDevicePlannings(DevicePlanning devicePlanning) { base.AddObject("DevicePlannings", devicePlanning); } /// <summary> /// Deprecated Method for adding a new object to the DeviceConfigurations EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToDeviceConfigurations(DeviceConfiguration deviceConfiguration) { base.AddObject("DeviceConfigurations", deviceConfiguration); } /// <summary> /// Deprecated Method for adding a new object to the AchievementsCompanies EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToAchievementsCompanies(AchievementsCompany achievementsCompany) { base.AddObject("AchievementsCompanies", achievementsCompany); } /// <summary> /// Deprecated Method for adding a new object to the AchievementsUsers EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToAchievementsUsers(AchievementsUser achievementsUser) { base.AddObject("AchievementsUsers", achievementsUser); } /// <summary> /// Deprecated Method for adding a new object to the RegisterRequests EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToRegisterRequests(RegisterRequest registerRequest) { base.AddObject("RegisterRequests", registerRequest); } /// <summary> /// Deprecated Method for adding a new object to the RequestsForProposal EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToRequestsForProposal(RequestForProposal requestForProposal) { base.AddObject("RequestsForProposal", requestForProposal); } /// <summary> /// Deprecated Method for adding a new object to the UserSettings EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToUserSettings(UserSetting userSetting) { base.AddObject("UserSettings", userSetting); } /// <summary> /// Deprecated Method for adding a new object to the EventPublicMembers EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToEventPublicMembers(EventPublicMember eventPublicMember) { base.AddObject("EventPublicMembers", eventPublicMember); } /// <summary> /// Deprecated Method for adding a new object to the CreateNetworkRequests EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToCreateNetworkRequests(CreateNetworkRequest createNetworkRequest) { base.AddObject("CreateNetworkRequests", createNetworkRequest); } /// <summary> /// Deprecated Method for adding a new object to the Networks EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToNetworks(Network network) { base.AddObject("Networks", network); } /// <summary> /// Deprecated Method for adding a new object to the CareerOpportunities EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToCareerOpportunities(CareerOpportunity careerOpportunity) { base.AddObject("CareerOpportunities", careerOpportunity); } /// <summary> /// Deprecated Method for adding a new object to the SocialNetworkCompanySubscriptions EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToSocialNetworkCompanySubscriptions(SocialNetworkCompanySubscription socialNetworkCompanySubscription) { base.AddObject("SocialNetworkCompanySubscriptions", socialNetworkCompanySubscription); } /// <summary> /// Deprecated Method for adding a new object to the SocialNetworkConnections EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToSocialNetworkConnections(SocialNetworkConnection socialNetworkConnection) { base.AddObject("SocialNetworkConnections", socialNetworkConnection); } /// <summary> /// Deprecated Method for adding a new object to the SocialNetworkStates EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToSocialNetworkStates(SocialNetworkState socialNetworkState) { base.AddObject("SocialNetworkStates", socialNetworkState); } /// <summary> /// Deprecated Method for adding a new object to the SocialNetworkUserSubscriptions EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToSocialNetworkUserSubscriptions(SocialNetworkUserSubscription socialNetworkUserSubscription) { base.AddObject("SocialNetworkUserSubscriptions", socialNetworkUserSubscription); } /// <summary> /// Deprecated Method for adding a new object to the CompanyContacts EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToCompanyContacts(CompanyContact companyContact) { base.AddObject("CompanyContacts", companyContact); } /// <summary> /// Deprecated Method for adding a new object to the Resumes EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToResumes(Resume resume) { base.AddObject("Resumes", resume); } /// <summary> /// Deprecated Method for adding a new object to the ResumeSkills EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToResumeSkills(ResumeSkill resumeSkill) { base.AddObject("ResumeSkills", resumeSkill); } /// <summary> /// Deprecated Method for adding a new object to the StatsCounterHits EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToStatsCounterHits(StatsCounterHit statsCounterHit) { base.AddObject("StatsCounterHits", statsCounterHit); } /// <summary> /// Deprecated Method for adding a new object to the StatsCounters EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToStatsCounters(StatsCounter statsCounter) { base.AddObject("StatsCounters", statsCounter); } /// <summary> /// Deprecated Method for adding a new object to the CompanyCategories EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToCompanyCategories(CompanyCategory companyCategory) { base.AddObject("CompanyCategories", companyCategory); } /// <summary> /// Deprecated Method for adding a new object to the NetworkTypes EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToNetworkTypes(NetworkType networkType) { base.AddObject("NetworkTypes", networkType); } /// <summary> /// Deprecated Method for adding a new object to the CompanyRequestMessages EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToCompanyRequestMessages(CompanyRequestMessage companyRequestMessage) { base.AddObject("CompanyRequestMessages", companyRequestMessage); } /// <summary> /// Deprecated Method for adding a new object to the CompanyRequests EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToCompanyRequests(CompanyRequest companyRequest) { base.AddObject("CompanyRequests", companyRequest); } /// <summary> /// Deprecated Method for adding a new object to the Clubs EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToClubs(Club club) { base.AddObject("Clubs", club); } /// <summary> /// Deprecated Method for adding a new object to the UserActionKeys EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToUserActionKeys(UserActionKey userActionKey) { base.AddObject("UserActionKeys", userActionKey); } /// <summary> /// Deprecated Method for adding a new object to the TimelineItemSkills EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToTimelineItemSkills(TimelineItemSkill timelineItemSkill) { base.AddObject("TimelineItemSkills", timelineItemSkill); } /// <summary> /// Deprecated Method for adding a new object to the GroupSkills EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToGroupSkills(GroupSkill groupSkill) { base.AddObject("GroupSkills", groupSkill); } /// <summary> /// Deprecated Method for adding a new object to the GroupInterests EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToGroupInterests(GroupInterest groupInterest) { base.AddObject("GroupInterests", groupInterest); } /// <summary> /// Deprecated Method for adding a new object to the GroupRecreations EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToGroupRecreations(GroupRecreation groupRecreation) { base.AddObject("GroupRecreations", groupRecreation); } /// <summary> /// Deprecated Method for adding a new object to the EmailMessages EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToEmailMessages(EmailMessage emailMessage) { base.AddObject("EmailMessages", emailMessage); } /// <summary> /// Deprecated Method for adding a new object to the UserEmailChangeRequests EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToUserEmailChangeRequests(UserEmailChangeRequest userEmailChangeRequest) { base.AddObject("UserEmailChangeRequests", userEmailChangeRequest); } /// <summary> /// Deprecated Method for adding a new object to the InboundEmailMessages EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToInboundEmailMessages(InboundEmailMessage inboundEmailMessage) { base.AddObject("InboundEmailMessages", inboundEmailMessage); } /// <summary> /// Deprecated Method for adding a new object to the TimelineItemLikes EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToTimelineItemLikes(TimelineItemLike timelineItemLike) { base.AddObject("TimelineItemLikes", timelineItemLike); } /// <summary> /// Deprecated Method for adding a new object to the TimelineItemCommentLikes EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToTimelineItemCommentLikes(TimelineItemCommentLike timelineItemCommentLike) { base.AddObject("TimelineItemCommentLikes", timelineItemCommentLike); } /// <summary> /// Deprecated Method for adding a new object to the UsersViews EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToUsersViews(UsersView usersView) { base.AddObject("UsersViews", usersView); } /// <summary> /// Deprecated Method for adding a new object to the ProfileFields EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToProfileFields(ProfileField profileField) { base.AddObject("ProfileFields", profileField); } /// <summary> /// Deprecated Method for adding a new object to the UserProfileFields EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToUserProfileFields(UserProfileField userProfileField) { base.AddObject("UserProfileFields", userProfileField); } /// <summary> /// Deprecated Method for adding a new object to the ProfileFieldsAvailiableValues EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToProfileFieldsAvailiableValues(ProfileFieldsAvailiableValue profileFieldsAvailiableValue) { base.AddObject("ProfileFieldsAvailiableValues", profileFieldsAvailiableValue); } /// <summary> /// Deprecated Method for adding a new object to the ApplyRequests EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToApplyRequests(ApplyRequest applyRequest) { base.AddObject("ApplyRequests", applyRequest); } /// <summary> /// Deprecated Method for adding a new object to the CompanyProfileFields EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToCompanyProfileFields(CompanyProfileField companyProfileField) { base.AddObject("CompanyProfileFields", companyProfileField); } /// <summary> /// Deprecated Method for adding a new object to the Subscriptions EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToSubscriptions(Subscription subscription) { base.AddObject("Subscriptions", subscription); } /// <summary> /// Deprecated Method for adding a new object to the SubscriptionTemplates EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToSubscriptionTemplates(SubscriptionTemplate subscriptionTemplate) { base.AddObject("SubscriptionTemplates", subscriptionTemplate); } /// <summary> /// Deprecated Method for adding a new object to the StripeTransactions EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToStripeTransactions(StripeTransaction stripeTransaction) { base.AddObject("StripeTransactions", stripeTransaction); } /// <summary> /// Deprecated Method for adding a new object to the TagCategories EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToTagCategories(TagCategory tagCategory) { base.AddObject("TagCategories", tagCategory); } /// <summary> /// Deprecated Method for adding a new object to the TagDefinitions EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToTagDefinitions(TagDefinition tagDefinition) { base.AddObject("TagDefinitions", tagDefinition); } /// <summary> /// Deprecated Method for adding a new object to the PartnerResources EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToPartnerResources(PartnerResource partnerResource) { base.AddObject("PartnerResources", partnerResource); } /// <summary> /// Deprecated Method for adding a new object to the PartnerResourceProfileFields EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToPartnerResourceProfileFields(PartnerResourceProfileField partnerResourceProfileField) { base.AddObject("PartnerResourceProfileFields", partnerResourceProfileField); } /// <summary> /// Deprecated Method for adding a new object to the PartnerResourceTags EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToPartnerResourceTags(PartnerResourceTag partnerResourceTag) { base.AddObject("PartnerResourceTags", partnerResourceTag); } /// <summary> /// Deprecated Method for adding a new object to the ActiveUsersViewLights EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToActiveUsersViewLights(ActiveUsersViewLight activeUsersViewLight) { base.AddObject("ActiveUsersViewLights", activeUsersViewLight); } /// <summary> /// Deprecated Method for adding a new object to the ActiveUsersViewLightExes EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToActiveUsersViewLightExes(ActiveUsersViewLightEx activeUsersViewLightEx) { base.AddObject("ActiveUsersViewLightExes", activeUsersViewLightEx); } /// <summary> /// Deprecated Method for adding a new object to the SubscriptionNotifications EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToSubscriptionNotifications(SubscriptionNotification subscriptionNotification) { base.AddObject("SubscriptionNotifications", subscriptionNotification); } /// <summary> /// Deprecated Method for adding a new object to the CompanyRelationships EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToCompanyRelationships(CompanyRelationship companyRelationship) { base.AddObject("CompanyRelationships", companyRelationship); } /// <summary> /// Deprecated Method for adding a new object to the CompanyRelationshipTypes EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToCompanyRelationshipTypes(CompanyRelationshipType companyRelationshipType) { base.AddObject("CompanyRelationshipTypes", companyRelationshipType); } /// <summary> /// Deprecated Method for adding a new object to the CompanyPlaces EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToCompanyPlaces(CompanyPlace companyPlace) { base.AddObject("CompanyPlaces", companyPlace); } /// <summary> /// Deprecated Method for adding a new object to the PlaceProfileFields EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToPlaceProfileFields(PlaceProfileField placeProfileField) { base.AddObject("PlaceProfileFields", placeProfileField); } /// <summary> /// Deprecated Method for adding a new object to the CompanyTags EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToCompanyTags(CompanyTag companyTag) { base.AddObject("CompanyTags", companyTag); } /// <summary> /// Deprecated Method for adding a new object to the UserTags EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToUserTags(UserTag userTag) { base.AddObject("UserTags", userTag); } /// <summary> /// Deprecated Method for adding a new object to the GroupTags EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToGroupTags(GroupTag groupTag) { base.AddObject("GroupTags", groupTag); } /// <summary> /// Deprecated Method for adding a new object to the TimelineItemTags EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToTimelineItemTags(TimelineItemTag timelineItemTag) { base.AddObject("TimelineItemTags", timelineItemTag); } /// <summary> /// Deprecated Method for adding a new object to the AdTags EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToAdTags(AdTag adTag) { base.AddObject("AdTags", adTag); } /// <summary> /// Deprecated Method for adding a new object to the Hints EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToHints(Hint hint) { base.AddObject("Hints", hint); } /// <summary> /// Deprecated Method for adding a new object to the HintsToUsers EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToHintsToUsers(HintsToUser hintsToUser) { base.AddObject("HintsToUsers", hintsToUser); } /// <summary> /// Deprecated Method for adding a new object to the ApiKeys EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToApiKeys(ApiKey apiKey) { base.AddObject("ApiKeys", apiKey); } /// <summary> /// Deprecated Method for adding a new object to the UserPresences EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToUserPresences(UserPresence userPresence) { base.AddObject("UserPresences", userPresence); } /// <summary> /// Deprecated Method for adding a new object to the Pages EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead. /// </summary> public void AddToPages(Page page) { base.AddObject("Pages", page); } #endregion #region Function Imports /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="networkId">No Metadata Documentation available.</param> public ObjectResult<GetEventStatsPerMonth_Result> GetEventStatsPerMonth(Nullable<int> networkId) { ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("networkId", networkId); } else { networkIdParameter = new ObjectParameter("networkId", typeof(int)); } return base.ExecuteFunction<GetEventStatsPerMonth_Result>("GetEventStatsPerMonth", networkIdParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectResult<GetNewsletterStatsRow> GetNewsletterStats() { return base.ExecuteFunction<GetNewsletterStatsRow>("GetNewsletterStats"); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="networkId">No Metadata Documentation available.</param> public ObjectResult<GetNewsletterStatsRow> GetNetworksNewsletterStats(Nullable<int> networkId) { ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("NetworkId", networkId); } else { networkIdParameter = new ObjectParameter("NetworkId", typeof(int)); } return base.ExecuteFunction<GetNewsletterStatsRow>("GetNetworksNewsletterStats", networkIdParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="userId">No Metadata Documentation available.</param> /// <param name="networkId">No Metadata Documentation available.</param> public ObjectResult<GetUsersConversations_Result> GetUsersConversations(Nullable<int> userId, Nullable<int> networkId) { ObjectParameter userIdParameter; if (userId.HasValue) { userIdParameter = new ObjectParameter("userId", userId); } else { userIdParameter = new ObjectParameter("userId", typeof(int)); } ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("networkId", networkId); } else { networkIdParameter = new ObjectParameter("networkId", typeof(int)); } return base.ExecuteFunction<GetUsersConversations_Result>("GetUsersConversations", userIdParameter, networkIdParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="myUserId">No Metadata Documentation available.</param> /// <param name="otherUserId">No Metadata Documentation available.</param> /// <param name="messageId">No Metadata Documentation available.</param> public int MarkMessagesReadUntil(Nullable<int> myUserId, Nullable<int> otherUserId, Nullable<int> messageId) { ObjectParameter myUserIdParameter; if (myUserId.HasValue) { myUserIdParameter = new ObjectParameter("myUserId", myUserId); } else { myUserIdParameter = new ObjectParameter("myUserId", typeof(int)); } ObjectParameter otherUserIdParameter; if (otherUserId.HasValue) { otherUserIdParameter = new ObjectParameter("otherUserId", otherUserId); } else { otherUserIdParameter = new ObjectParameter("otherUserId", typeof(int)); } ObjectParameter messageIdParameter; if (messageId.HasValue) { messageIdParameter = new ObjectParameter("messageId", messageId); } else { messageIdParameter = new ObjectParameter("messageId", typeof(int)); } return base.ExecuteFunction("MarkMessagesReadUntil", myUserIdParameter, otherUserIdParameter, messageIdParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="ids">No Metadata Documentation available.</param> public int MarkActivitiesAsReadByIds(string ids) { ObjectParameter idsParameter; if (ids != null) { idsParameter = new ObjectParameter("ids", ids); } else { idsParameter = new ObjectParameter("ids", typeof(string)); } return base.ExecuteFunction("MarkActivitiesAsReadByIds", idsParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="networkId">No Metadata Documentation available.</param> /// <param name="importedIdExpression">No Metadata Documentation available.</param> public ObjectResult<GetTimelineItemIdsByImportedIdExpression_Result> GetTimelineItemIdsByImportedIdExpression(Nullable<int> networkId, string importedIdExpression) { ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("networkId", networkId); } else { networkIdParameter = new ObjectParameter("networkId", typeof(int)); } ObjectParameter importedIdExpressionParameter; if (importedIdExpression != null) { importedIdExpressionParameter = new ObjectParameter("importedIdExpression", importedIdExpression); } else { importedIdExpressionParameter = new ObjectParameter("importedIdExpression", typeof(string)); } return base.ExecuteFunction<GetTimelineItemIdsByImportedIdExpression_Result>("GetTimelineItemIdsByImportedIdExpression", networkIdParameter, importedIdExpressionParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="networkId">No Metadata Documentation available.</param> /// <param name="importedIdExpression">No Metadata Documentation available.</param> public ObjectResult<GetTimelineCommentIdsByImportedIdExpression_Result> GetTimelineCommentIdsByImportedIdExpression(Nullable<int> networkId, string importedIdExpression) { ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("networkId", networkId); } else { networkIdParameter = new ObjectParameter("networkId", typeof(int)); } ObjectParameter importedIdExpressionParameter; if (importedIdExpression != null) { importedIdExpressionParameter = new ObjectParameter("importedIdExpression", importedIdExpression); } else { importedIdExpressionParameter = new ObjectParameter("importedIdExpression", typeof(string)); } return base.ExecuteFunction<GetTimelineCommentIdsByImportedIdExpression_Result>("GetTimelineCommentIdsByImportedIdExpression", networkIdParameter, importedIdExpressionParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="networkId">No Metadata Documentation available.</param> public ObjectResult<GetExportableListOfUsers_Result> GetExportableListOfUsers(Nullable<int> networkId) { ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("networkId", networkId); } else { networkIdParameter = new ObjectParameter("networkId", typeof(int)); } return base.ExecuteFunction<GetExportableListOfUsers_Result>("GetExportableListOfUsers", networkIdParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="networkId">No Metadata Documentation available.</param> public ObjectResult<CompanyCategory> GetCompanyCategoriesUsedInNetwork(Nullable<int> networkId) { ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("networkId", networkId); } else { networkIdParameter = new ObjectParameter("networkId", typeof(int)); } return base.ExecuteFunction<CompanyCategory>("GetCompanyCategoriesUsedInNetwork", networkIdParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="mergeOption"></param> /// <param name="networkId">No Metadata Documentation available.</param> public ObjectResult<CompanyCategory> GetCompanyCategoriesUsedInNetwork(Nullable<int> networkId, MergeOption mergeOption) { ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("networkId", networkId); } else { networkIdParameter = new ObjectParameter("networkId", typeof(int)); } return base.ExecuteFunction<CompanyCategory>("GetCompanyCategoriesUsedInNetwork", mergeOption, networkIdParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="networkId">No Metadata Documentation available.</param> public ObjectResult<Job> GetJobsUsedInNetwork(Nullable<int> networkId) { ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("networkId", networkId); } else { networkIdParameter = new ObjectParameter("networkId", typeof(int)); } return base.ExecuteFunction<Job>("GetJobsUsedInNetwork", networkIdParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="mergeOption"></param> /// <param name="networkId">No Metadata Documentation available.</param> public ObjectResult<Job> GetJobsUsedInNetwork(Nullable<int> networkId, MergeOption mergeOption) { ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("networkId", networkId); } else { networkIdParameter = new ObjectParameter("networkId", typeof(int)); } return base.ExecuteFunction<Job>("GetJobsUsedInNetwork", mergeOption, networkIdParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="networkId">No Metadata Documentation available.</param> /// <param name="dateMax">No Metadata Documentation available.</param> public ObjectResult<Nullable<int>> GetTimelineItemsListId(Nullable<int> networkId, Nullable<System.DateTime> dateMax) { ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("networkId", networkId); } else { networkIdParameter = new ObjectParameter("networkId", typeof(int)); } ObjectParameter dateMaxParameter; if (dateMax.HasValue) { dateMaxParameter = new ObjectParameter("dateMax", dateMax); } else { dateMaxParameter = new ObjectParameter("dateMax", typeof(System.DateTime)); } return base.ExecuteFunction<Nullable<int>>("GetTimelineItemsListId", networkIdParameter, dateMaxParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="minId">No Metadata Documentation available.</param> /// <param name="maxId">No Metadata Documentation available.</param> public ObjectResult<TimelineItem> GetRangedTimelineItem(Nullable<int> minId, Nullable<int> maxId) { ObjectParameter minIdParameter; if (minId.HasValue) { minIdParameter = new ObjectParameter("minId", minId); } else { minIdParameter = new ObjectParameter("minId", typeof(int)); } ObjectParameter maxIdParameter; if (maxId.HasValue) { maxIdParameter = new ObjectParameter("maxId", maxId); } else { maxIdParameter = new ObjectParameter("maxId", typeof(int)); } return base.ExecuteFunction<TimelineItem>("GetRangedTimelineItem", minIdParameter, maxIdParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="mergeOption"></param> /// <param name="minId">No Metadata Documentation available.</param> /// <param name="maxId">No Metadata Documentation available.</param> public ObjectResult<TimelineItem> GetRangedTimelineItem(Nullable<int> minId, Nullable<int> maxId, MergeOption mergeOption) { ObjectParameter minIdParameter; if (minId.HasValue) { minIdParameter = new ObjectParameter("minId", minId); } else { minIdParameter = new ObjectParameter("minId", typeof(int)); } ObjectParameter maxIdParameter; if (maxId.HasValue) { maxIdParameter = new ObjectParameter("maxId", maxId); } else { maxIdParameter = new ObjectParameter("maxId", typeof(int)); } return base.ExecuteFunction<TimelineItem>("GetRangedTimelineItem", mergeOption, minIdParameter, maxIdParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> public ObjectResult<Nullable<int>> GetTimelineItemLikeCount() { return base.ExecuteFunction<Nullable<int>>("GetTimelineItemLikeCount"); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="networkId">No Metadata Documentation available.</param> /// <param name="wallId">No Metadata Documentation available.</param> public ObjectResult<TimelineItem> GetWallItemById(Nullable<int> networkId, Nullable<int> wallId) { ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("networkId", networkId); } else { networkIdParameter = new ObjectParameter("networkId", typeof(int)); } ObjectParameter wallIdParameter; if (wallId.HasValue) { wallIdParameter = new ObjectParameter("wallId", wallId); } else { wallIdParameter = new ObjectParameter("wallId", typeof(int)); } return base.ExecuteFunction<TimelineItem>("GetWallItemById", networkIdParameter, wallIdParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="mergeOption"></param> /// <param name="networkId">No Metadata Documentation available.</param> /// <param name="wallId">No Metadata Documentation available.</param> public ObjectResult<TimelineItem> GetWallItemById(Nullable<int> networkId, Nullable<int> wallId, MergeOption mergeOption) { ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("networkId", networkId); } else { networkIdParameter = new ObjectParameter("networkId", typeof(int)); } ObjectParameter wallIdParameter; if (wallId.HasValue) { wallIdParameter = new ObjectParameter("wallId", wallId); } else { wallIdParameter = new ObjectParameter("wallId", typeof(int)); } return base.ExecuteFunction<TimelineItem>("GetWallItemById", mergeOption, networkIdParameter, wallIdParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="networkId">No Metadata Documentation available.</param> public ObjectResult<TimelineItem> GetLastFiveRegistrants(Nullable<int> networkId) { ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("networkId", networkId); } else { networkIdParameter = new ObjectParameter("networkId", typeof(int)); } return base.ExecuteFunction<TimelineItem>("GetLastFiveRegistrants", networkIdParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="mergeOption"></param> /// <param name="networkId">No Metadata Documentation available.</param> public ObjectResult<TimelineItem> GetLastFiveRegistrants(Nullable<int> networkId, MergeOption mergeOption) { ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("networkId", networkId); } else { networkIdParameter = new ObjectParameter("networkId", typeof(int)); } return base.ExecuteFunction<TimelineItem>("GetLastFiveRegistrants", mergeOption, networkIdParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="networkId">No Metadata Documentation available.</param> public ObjectResult<Nullable<int>> GetCompaniesPublicationToValidate(Nullable<int> networkId) { ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("networkId", networkId); } else { networkIdParameter = new ObjectParameter("networkId", typeof(int)); } return base.ExecuteFunction<Nullable<int>>("GetCompaniesPublicationToValidate", networkIdParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="networkId">No Metadata Documentation available.</param> /// <param name="dateMax">No Metadata Documentation available.</param> public ObjectResult<Nullable<int>> GetTimelineListPublicId(Nullable<int> networkId, Nullable<System.DateTime> dateMax) { ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("networkId", networkId); } else { networkIdParameter = new ObjectParameter("networkId", typeof(int)); } ObjectParameter dateMaxParameter; if (dateMax.HasValue) { dateMaxParameter = new ObjectParameter("dateMax", dateMax); } else { dateMaxParameter = new ObjectParameter("dateMax", typeof(System.DateTime)); } return base.ExecuteFunction<Nullable<int>>("GetTimelineListPublicId", networkIdParameter, dateMaxParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="networkId">No Metadata Documentation available.</param> /// <param name="dateMax">No Metadata Documentation available.</param> public ObjectResult<Nullable<int>> GetTimelineListIdPublic(Nullable<int> networkId, Nullable<System.DateTime> dateMax) { ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("networkId", networkId); } else { networkIdParameter = new ObjectParameter("networkId", typeof(int)); } ObjectParameter dateMaxParameter; if (dateMax.HasValue) { dateMaxParameter = new ObjectParameter("dateMax", dateMax); } else { dateMaxParameter = new ObjectParameter("dateMax", typeof(System.DateTime)); } return base.ExecuteFunction<Nullable<int>>("GetTimelineListIdPublic", networkIdParameter, dateMaxParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="networkId">No Metadata Documentation available.</param> /// <param name="dateMax">No Metadata Documentation available.</param> public ObjectResult<Nullable<int>> GetTimelineListIdCompaniesNews(Nullable<int> networkId, Nullable<System.DateTime> dateMax) { ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("networkId", networkId); } else { networkIdParameter = new ObjectParameter("networkId", typeof(int)); } ObjectParameter dateMaxParameter; if (dateMax.HasValue) { dateMaxParameter = new ObjectParameter("dateMax", dateMax); } else { dateMaxParameter = new ObjectParameter("dateMax", typeof(System.DateTime)); } return base.ExecuteFunction<Nullable<int>>("GetTimelineListIdCompaniesNews", networkIdParameter, dateMaxParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="networkId">No Metadata Documentation available.</param> /// <param name="dateMax">No Metadata Documentation available.</param> /// <param name="companyId">No Metadata Documentation available.</param> public ObjectResult<Nullable<int>> GetTimelineListIdCompany(Nullable<int> networkId, Nullable<System.DateTime> dateMax, Nullable<int> companyId) { ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("networkId", networkId); } else { networkIdParameter = new ObjectParameter("networkId", typeof(int)); } ObjectParameter dateMaxParameter; if (dateMax.HasValue) { dateMaxParameter = new ObjectParameter("dateMax", dateMax); } else { dateMaxParameter = new ObjectParameter("dateMax", typeof(System.DateTime)); } ObjectParameter companyIdParameter; if (companyId.HasValue) { companyIdParameter = new ObjectParameter("companyId", companyId); } else { companyIdParameter = new ObjectParameter("companyId", typeof(int)); } return base.ExecuteFunction<Nullable<int>>("GetTimelineListIdCompany", networkIdParameter, dateMaxParameter, companyIdParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="networkId">No Metadata Documentation available.</param> /// <param name="dateMax">No Metadata Documentation available.</param> /// <param name="companyId">No Metadata Documentation available.</param> public ObjectResult<Nullable<int>> GetTimelineListIdCompanyNetwork(Nullable<int> networkId, Nullable<System.DateTime> dateMax, Nullable<int> companyId) { ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("networkId", networkId); } else { networkIdParameter = new ObjectParameter("networkId", typeof(int)); } ObjectParameter dateMaxParameter; if (dateMax.HasValue) { dateMaxParameter = new ObjectParameter("dateMax", dateMax); } else { dateMaxParameter = new ObjectParameter("dateMax", typeof(System.DateTime)); } ObjectParameter companyIdParameter; if (companyId.HasValue) { companyIdParameter = new ObjectParameter("companyId", companyId); } else { companyIdParameter = new ObjectParameter("companyId", typeof(int)); } return base.ExecuteFunction<Nullable<int>>("GetTimelineListIdCompanyNetwork", networkIdParameter, dateMaxParameter, companyIdParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="networkId">No Metadata Documentation available.</param> /// <param name="dateMax">No Metadata Documentation available.</param> /// <param name="eventId">No Metadata Documentation available.</param> public ObjectResult<Nullable<int>> GetTimelineListIdEvent(Nullable<int> networkId, Nullable<System.DateTime> dateMax, Nullable<int> eventId) { ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("networkId", networkId); } else { networkIdParameter = new ObjectParameter("networkId", typeof(int)); } ObjectParameter dateMaxParameter; if (dateMax.HasValue) { dateMaxParameter = new ObjectParameter("dateMax", dateMax); } else { dateMaxParameter = new ObjectParameter("dateMax", typeof(System.DateTime)); } ObjectParameter eventIdParameter; if (eventId.HasValue) { eventIdParameter = new ObjectParameter("eventId", eventId); } else { eventIdParameter = new ObjectParameter("eventId", typeof(int)); } return base.ExecuteFunction<Nullable<int>>("GetTimelineListIdEvent", networkIdParameter, dateMaxParameter, eventIdParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="networkId">No Metadata Documentation available.</param> /// <param name="dateMax">No Metadata Documentation available.</param> /// <param name="companyId">No Metadata Documentation available.</param> public ObjectResult<Nullable<int>> GetTimelineListIdExternalCompany(Nullable<int> networkId, Nullable<System.DateTime> dateMax, Nullable<int> companyId) { ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("networkId", networkId); } else { networkIdParameter = new ObjectParameter("networkId", typeof(int)); } ObjectParameter dateMaxParameter; if (dateMax.HasValue) { dateMaxParameter = new ObjectParameter("dateMax", dateMax); } else { dateMaxParameter = new ObjectParameter("dateMax", typeof(System.DateTime)); } ObjectParameter companyIdParameter; if (companyId.HasValue) { companyIdParameter = new ObjectParameter("companyId", companyId); } else { companyIdParameter = new ObjectParameter("companyId", typeof(int)); } return base.ExecuteFunction<Nullable<int>>("GetTimelineListIdExternalCompany", networkIdParameter, dateMaxParameter, companyIdParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="networkId">No Metadata Documentation available.</param> /// <param name="dateMax">No Metadata Documentation available.</param> /// <param name="groupId">No Metadata Documentation available.</param> public ObjectResult<Nullable<int>> GetTimelineListIdGroup(Nullable<int> networkId, Nullable<System.DateTime> dateMax, Nullable<int> groupId) { ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("networkId", networkId); } else { networkIdParameter = new ObjectParameter("networkId", typeof(int)); } ObjectParameter dateMaxParameter; if (dateMax.HasValue) { dateMaxParameter = new ObjectParameter("dateMax", dateMax); } else { dateMaxParameter = new ObjectParameter("dateMax", typeof(System.DateTime)); } ObjectParameter groupIdParameter; if (groupId.HasValue) { groupIdParameter = new ObjectParameter("groupId", groupId); } else { groupIdParameter = new ObjectParameter("groupId", typeof(int)); } return base.ExecuteFunction<Nullable<int>>("GetTimelineListIdGroup", networkIdParameter, dateMaxParameter, groupIdParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="networkId">No Metadata Documentation available.</param> /// <param name="dateMax">No Metadata Documentation available.</param> public ObjectResult<TimelineItem> GetTimelineListIdPeopleNews(Nullable<int> networkId, Nullable<System.DateTime> dateMax) { ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("networkId", networkId); } else { networkIdParameter = new ObjectParameter("networkId", typeof(int)); } ObjectParameter dateMaxParameter; if (dateMax.HasValue) { dateMaxParameter = new ObjectParameter("dateMax", dateMax); } else { dateMaxParameter = new ObjectParameter("dateMax", typeof(System.DateTime)); } return base.ExecuteFunction<TimelineItem>("GetTimelineListIdPeopleNews", networkIdParameter, dateMaxParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="mergeOption"></param> /// <param name="networkId">No Metadata Documentation available.</param> /// <param name="dateMax">No Metadata Documentation available.</param> public ObjectResult<TimelineItem> GetTimelineListIdPeopleNews(Nullable<int> networkId, Nullable<System.DateTime> dateMax, MergeOption mergeOption) { ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("networkId", networkId); } else { networkIdParameter = new ObjectParameter("networkId", typeof(int)); } ObjectParameter dateMaxParameter; if (dateMax.HasValue) { dateMaxParameter = new ObjectParameter("dateMax", dateMax); } else { dateMaxParameter = new ObjectParameter("dateMax", typeof(System.DateTime)); } return base.ExecuteFunction<TimelineItem>("GetTimelineListIdPeopleNews", mergeOption, networkIdParameter, dateMaxParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="networkId">No Metadata Documentation available.</param> /// <param name="dateMax">No Metadata Documentation available.</param> /// <param name="placeId">No Metadata Documentation available.</param> public ObjectResult<Nullable<int>> GetTimelineListIdPlace(Nullable<int> networkId, Nullable<System.DateTime> dateMax, Nullable<int> placeId) { ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("networkId", networkId); } else { networkIdParameter = new ObjectParameter("networkId", typeof(int)); } ObjectParameter dateMaxParameter; if (dateMax.HasValue) { dateMaxParameter = new ObjectParameter("dateMax", dateMax); } else { dateMaxParameter = new ObjectParameter("dateMax", typeof(System.DateTime)); } ObjectParameter placeIdParameter; if (placeId.HasValue) { placeIdParameter = new ObjectParameter("placeId", placeId); } else { placeIdParameter = new ObjectParameter("placeId", typeof(int)); } return base.ExecuteFunction<Nullable<int>>("GetTimelineListIdPlace", networkIdParameter, dateMaxParameter, placeIdParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="networkId">No Metadata Documentation available.</param> /// <param name="dateMax">No Metadata Documentation available.</param> /// <param name="userId">No Metadata Documentation available.</param> public ObjectResult<Nullable<int>> GetTimelineListIdPrivate(Nullable<int> networkId, Nullable<System.DateTime> dateMax, Nullable<int> userId) { ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("networkId", networkId); } else { networkIdParameter = new ObjectParameter("networkId", typeof(int)); } ObjectParameter dateMaxParameter; if (dateMax.HasValue) { dateMaxParameter = new ObjectParameter("dateMax", dateMax); } else { dateMaxParameter = new ObjectParameter("dateMax", typeof(System.DateTime)); } ObjectParameter userIdParameter; if (userId.HasValue) { userIdParameter = new ObjectParameter("userId", userId); } else { userIdParameter = new ObjectParameter("userId", typeof(int)); } return base.ExecuteFunction<Nullable<int>>("GetTimelineListIdPrivate", networkIdParameter, dateMaxParameter, userIdParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="networkId">No Metadata Documentation available.</param> /// <param name="dateMax">No Metadata Documentation available.</param> /// <param name="userId">No Metadata Documentation available.</param> /// <param name="isContact">No Metadata Documentation available.</param> public ObjectResult<Nullable<int>> GetTimelineListIdProfile(Nullable<int> networkId, Nullable<System.DateTime> dateMax, Nullable<int> userId, Nullable<int> isContact) { ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("networkId", networkId); } else { networkIdParameter = new ObjectParameter("networkId", typeof(int)); } ObjectParameter dateMaxParameter; if (dateMax.HasValue) { dateMaxParameter = new ObjectParameter("dateMax", dateMax); } else { dateMaxParameter = new ObjectParameter("dateMax", typeof(System.DateTime)); } ObjectParameter userIdParameter; if (userId.HasValue) { userIdParameter = new ObjectParameter("userId", userId); } else { userIdParameter = new ObjectParameter("userId", typeof(int)); } ObjectParameter isContactParameter; if (isContact.HasValue) { isContactParameter = new ObjectParameter("isContact", isContact); } else { isContactParameter = new ObjectParameter("isContact", typeof(int)); } return base.ExecuteFunction<Nullable<int>>("GetTimelineListIdProfile", networkIdParameter, dateMaxParameter, userIdParameter, isContactParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="networkId">No Metadata Documentation available.</param> /// <param name="dateMax">No Metadata Documentation available.</param> /// <param name="projectId">No Metadata Documentation available.</param> public ObjectResult<Nullable<int>> GetTimelineListIdProject(Nullable<int> networkId, Nullable<System.DateTime> dateMax, Nullable<int> projectId) { ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("networkId", networkId); } else { networkIdParameter = new ObjectParameter("networkId", typeof(int)); } ObjectParameter dateMaxParameter; if (dateMax.HasValue) { dateMaxParameter = new ObjectParameter("dateMax", dateMax); } else { dateMaxParameter = new ObjectParameter("dateMax", typeof(System.DateTime)); } ObjectParameter projectIdParameter; if (projectId.HasValue) { projectIdParameter = new ObjectParameter("projectId", projectId); } else { projectIdParameter = new ObjectParameter("projectId", typeof(int)); } return base.ExecuteFunction<Nullable<int>>("GetTimelineListIdProject", networkIdParameter, dateMaxParameter, projectIdParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="networkId">No Metadata Documentation available.</param> /// <param name="dateMax">No Metadata Documentation available.</param> /// <param name="teamId">No Metadata Documentation available.</param> public ObjectResult<Nullable<int>> GetTimelineListIdTeam(Nullable<int> networkId, Nullable<System.DateTime> dateMax, Nullable<int> teamId) { ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("networkId", networkId); } else { networkIdParameter = new ObjectParameter("networkId", typeof(int)); } ObjectParameter dateMaxParameter; if (dateMax.HasValue) { dateMaxParameter = new ObjectParameter("dateMax", dateMax); } else { dateMaxParameter = new ObjectParameter("dateMax", typeof(System.DateTime)); } ObjectParameter teamIdParameter; if (teamId.HasValue) { teamIdParameter = new ObjectParameter("teamId", teamId); } else { teamIdParameter = new ObjectParameter("teamId", typeof(int)); } return base.ExecuteFunction<Nullable<int>>("GetTimelineListIdTeam", networkIdParameter, dateMaxParameter, teamIdParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="networkId">No Metadata Documentation available.</param> /// <param name="dateMax">No Metadata Documentation available.</param> public ObjectResult<Nullable<int>> GetTimelineListIdExternalCompanies(Nullable<int> networkId, Nullable<System.DateTime> dateMax) { ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("networkId", networkId); } else { networkIdParameter = new ObjectParameter("networkId", typeof(int)); } ObjectParameter dateMaxParameter; if (dateMax.HasValue) { dateMaxParameter = new ObjectParameter("dateMax", dateMax); } else { dateMaxParameter = new ObjectParameter("dateMax", typeof(System.DateTime)); } return base.ExecuteFunction<Nullable<int>>("GetTimelineListIdExternalCompanies", networkIdParameter, dateMaxParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="networkId">No Metadata Documentation available.</param> /// <param name="dateMax">No Metadata Documentation available.</param> /// <param name="skillId">No Metadata Documentation available.</param> public ObjectResult<Nullable<int>> GetTimelineListIdTopic(Nullable<int> networkId, Nullable<System.DateTime> dateMax, Nullable<int> skillId) { ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("networkId", networkId); } else { networkIdParameter = new ObjectParameter("networkId", typeof(int)); } ObjectParameter dateMaxParameter; if (dateMax.HasValue) { dateMaxParameter = new ObjectParameter("dateMax", dateMax); } else { dateMaxParameter = new ObjectParameter("dateMax", typeof(System.DateTime)); } ObjectParameter skillIdParameter; if (skillId.HasValue) { skillIdParameter = new ObjectParameter("skillId", skillId); } else { skillIdParameter = new ObjectParameter("skillId", typeof(int)); } return base.ExecuteFunction<Nullable<int>>("GetTimelineListIdTopic", networkIdParameter, dateMaxParameter, skillIdParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="networkId">No Metadata Documentation available.</param> /// <param name="dateMax">No Metadata Documentation available.</param> /// <param name="content">No Metadata Documentation available.</param> public ObjectResult<Nullable<int>> GetTimelineListIdByContent(Nullable<int> networkId, Nullable<System.DateTime> dateMax, string content) { ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("networkId", networkId); } else { networkIdParameter = new ObjectParameter("networkId", typeof(int)); } ObjectParameter dateMaxParameter; if (dateMax.HasValue) { dateMaxParameter = new ObjectParameter("dateMax", dateMax); } else { dateMaxParameter = new ObjectParameter("dateMax", typeof(System.DateTime)); } ObjectParameter contentParameter; if (content != null) { contentParameter = new ObjectParameter("content", content); } else { contentParameter = new ObjectParameter("content", typeof(string)); } return base.ExecuteFunction<Nullable<int>>("GetTimelineListIdByContent", networkIdParameter, dateMaxParameter, contentParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="applicationName">No Metadata Documentation available.</param> /// <param name="userName">No Metadata Documentation available.</param> /// <param name="currentTimeUtc">No Metadata Documentation available.</param> public int aspnet_Membership_LockUser(string applicationName, string userName, Nullable<System.DateTime> currentTimeUtc) { ObjectParameter applicationNameParameter; if (applicationName != null) { applicationNameParameter = new ObjectParameter("ApplicationName", applicationName); } else { applicationNameParameter = new ObjectParameter("ApplicationName", typeof(string)); } ObjectParameter userNameParameter; if (userName != null) { userNameParameter = new ObjectParameter("UserName", userName); } else { userNameParameter = new ObjectParameter("UserName", typeof(string)); } ObjectParameter currentTimeUtcParameter; if (currentTimeUtc.HasValue) { currentTimeUtcParameter = new ObjectParameter("CurrentTimeUtc", currentTimeUtc); } else { currentTimeUtcParameter = new ObjectParameter("CurrentTimeUtc", typeof(System.DateTime)); } return base.ExecuteFunction("aspnet_Membership_LockUser", applicationNameParameter, userNameParameter, currentTimeUtcParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="networkId">No Metadata Documentation available.</param> public ObjectResult<Nullable<int>> GetMembershipLockedOutUserIds(Nullable<int> networkId) { ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("networkId", networkId); } else { networkIdParameter = new ObjectParameter("networkId", typeof(int)); } return base.ExecuteFunction<Nullable<int>>("GetMembershipLockedOutUserIds", networkIdParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="groupId">No Metadata Documentation available.</param> /// <param name="userId">No Metadata Documentation available.</param> /// <param name="networkId">No Metadata Documentation available.</param> public ObjectResult<GroupMember> GetActualGroupMembers(Nullable<int> groupId, Nullable<int> userId, Nullable<int> networkId) { ObjectParameter groupIdParameter; if (groupId.HasValue) { groupIdParameter = new ObjectParameter("groupId", groupId); } else { groupIdParameter = new ObjectParameter("groupId", typeof(int)); } ObjectParameter userIdParameter; if (userId.HasValue) { userIdParameter = new ObjectParameter("userId", userId); } else { userIdParameter = new ObjectParameter("userId", typeof(int)); } ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("networkId", networkId); } else { networkIdParameter = new ObjectParameter("networkId", typeof(int)); } return base.ExecuteFunction<GroupMember>("GetActualGroupMembers", groupIdParameter, userIdParameter, networkIdParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="mergeOption"></param> /// <param name="groupId">No Metadata Documentation available.</param> /// <param name="userId">No Metadata Documentation available.</param> /// <param name="networkId">No Metadata Documentation available.</param> public ObjectResult<GroupMember> GetActualGroupMembers(Nullable<int> groupId, Nullable<int> userId, Nullable<int> networkId, MergeOption mergeOption) { ObjectParameter groupIdParameter; if (groupId.HasValue) { groupIdParameter = new ObjectParameter("groupId", groupId); } else { groupIdParameter = new ObjectParameter("groupId", typeof(int)); } ObjectParameter userIdParameter; if (userId.HasValue) { userIdParameter = new ObjectParameter("userId", userId); } else { userIdParameter = new ObjectParameter("userId", typeof(int)); } ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("networkId", networkId); } else { networkIdParameter = new ObjectParameter("networkId", typeof(int)); } return base.ExecuteFunction<GroupMember>("GetActualGroupMembers", mergeOption, groupIdParameter, userIdParameter, networkIdParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="groupId">No Metadata Documentation available.</param> /// <param name="userId">No Metadata Documentation available.</param> /// <param name="status">No Metadata Documentation available.</param> public ObjectResult<GroupMember> GetActualGroupMembersByStatus(Nullable<int> groupId, Nullable<int> userId, Nullable<int> status) { ObjectParameter groupIdParameter; if (groupId.HasValue) { groupIdParameter = new ObjectParameter("groupId", groupId); } else { groupIdParameter = new ObjectParameter("groupId", typeof(int)); } ObjectParameter userIdParameter; if (userId.HasValue) { userIdParameter = new ObjectParameter("userId", userId); } else { userIdParameter = new ObjectParameter("userId", typeof(int)); } ObjectParameter statusParameter; if (status.HasValue) { statusParameter = new ObjectParameter("status", status); } else { statusParameter = new ObjectParameter("status", typeof(int)); } return base.ExecuteFunction<GroupMember>("GetActualGroupMembersByStatus", groupIdParameter, userIdParameter, statusParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="mergeOption"></param> /// <param name="groupId">No Metadata Documentation available.</param> /// <param name="userId">No Metadata Documentation available.</param> /// <param name="status">No Metadata Documentation available.</param> public ObjectResult<GroupMember> GetActualGroupMembersByStatus(Nullable<int> groupId, Nullable<int> userId, Nullable<int> status, MergeOption mergeOption) { ObjectParameter groupIdParameter; if (groupId.HasValue) { groupIdParameter = new ObjectParameter("groupId", groupId); } else { groupIdParameter = new ObjectParameter("groupId", typeof(int)); } ObjectParameter userIdParameter; if (userId.HasValue) { userIdParameter = new ObjectParameter("userId", userId); } else { userIdParameter = new ObjectParameter("userId", typeof(int)); } ObjectParameter statusParameter; if (status.HasValue) { statusParameter = new ObjectParameter("status", status); } else { statusParameter = new ObjectParameter("status", typeof(int)); } return base.ExecuteFunction<GroupMember>("GetActualGroupMembersByStatus", mergeOption, groupIdParameter, userIdParameter, statusParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="dateFromUtc">No Metadata Documentation available.</param> /// <param name="dateToUtc">No Metadata Documentation available.</param> public ObjectResult<GetEmailSendStatsByHour_Result> GetEmailSendStatsByHour(Nullable<System.DateTime> dateFromUtc, Nullable<System.DateTime> dateToUtc) { ObjectParameter dateFromUtcParameter; if (dateFromUtc.HasValue) { dateFromUtcParameter = new ObjectParameter("dateFromUtc", dateFromUtc); } else { dateFromUtcParameter = new ObjectParameter("dateFromUtc", typeof(System.DateTime)); } ObjectParameter dateToUtcParameter; if (dateToUtc.HasValue) { dateToUtcParameter = new ObjectParameter("dateToUtc", dateToUtc); } else { dateToUtcParameter = new ObjectParameter("dateToUtc", typeof(System.DateTime)); } return base.ExecuteFunction<GetEmailSendStatsByHour_Result>("GetEmailSendStatsByHour", dateFromUtcParameter, dateToUtcParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="dateFromUtc">No Metadata Documentation available.</param> /// <param name="dateToUtc">No Metadata Documentation available.</param> public ObjectResult<GetEmailSendStatsByMinute_Result> GetEmailSendStatsByMinute(Nullable<System.DateTime> dateFromUtc, Nullable<System.DateTime> dateToUtc) { ObjectParameter dateFromUtcParameter; if (dateFromUtc.HasValue) { dateFromUtcParameter = new ObjectParameter("dateFromUtc", dateFromUtc); } else { dateFromUtcParameter = new ObjectParameter("dateFromUtc", typeof(System.DateTime)); } ObjectParameter dateToUtcParameter; if (dateToUtc.HasValue) { dateToUtcParameter = new ObjectParameter("dateToUtc", dateToUtc); } else { dateToUtcParameter = new ObjectParameter("dateToUtc", typeof(System.DateTime)); } return base.ExecuteFunction<GetEmailSendStatsByMinute_Result>("GetEmailSendStatsByMinute", dateFromUtcParameter, dateToUtcParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="dateFromUtc">No Metadata Documentation available.</param> /// <param name="dateToUtc">No Metadata Documentation available.</param> public ObjectResult<GetEmailSendStatsByHour_Result> GetEmailSendStatsByDay(Nullable<System.DateTime> dateFromUtc, Nullable<System.DateTime> dateToUtc) { ObjectParameter dateFromUtcParameter; if (dateFromUtc.HasValue) { dateFromUtcParameter = new ObjectParameter("dateFromUtc", dateFromUtc); } else { dateFromUtcParameter = new ObjectParameter("dateFromUtc", typeof(System.DateTime)); } ObjectParameter dateToUtcParameter; if (dateToUtc.HasValue) { dateToUtcParameter = new ObjectParameter("dateToUtc", dateToUtc); } else { dateToUtcParameter = new ObjectParameter("dateToUtc", typeof(System.DateTime)); } return base.ExecuteFunction<GetEmailSendStatsByHour_Result>("GetEmailSendStatsByDay", dateFromUtcParameter, dateToUtcParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="networkId">No Metadata Documentation available.</param> public ObjectResult<TimelineItemSkill> GetTimelineSkillsListIdForCount(Nullable<int> networkId) { ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("networkId", networkId); } else { networkIdParameter = new ObjectParameter("networkId", typeof(int)); } return base.ExecuteFunction<TimelineItemSkill>("GetTimelineSkillsListIdForCount", networkIdParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="mergeOption"></param> /// <param name="networkId">No Metadata Documentation available.</param> public ObjectResult<TimelineItemSkill> GetTimelineSkillsListIdForCount(Nullable<int> networkId, MergeOption mergeOption) { ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("networkId", networkId); } else { networkIdParameter = new ObjectParameter("networkId", typeof(int)); } return base.ExecuteFunction<TimelineItemSkill>("GetTimelineSkillsListIdForCount", mergeOption, networkIdParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="userId">No Metadata Documentation available.</param> public ObjectResult<Nullable<int>> GetUsersContactIds(Nullable<int> userId) { ObjectParameter userIdParameter; if (userId.HasValue) { userIdParameter = new ObjectParameter("userId", userId); } else { userIdParameter = new ObjectParameter("userId", typeof(int)); } return base.ExecuteFunction<Nullable<int>>("GetUsersContactIds", userIdParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="networkId">No Metadata Documentation available.</param> public ObjectResult<Nullable<int>> CountCompleteUserProfiles(Nullable<int> networkId) { ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("networkId", networkId); } else { networkIdParameter = new ObjectParameter("networkId", typeof(int)); } return base.ExecuteFunction<Nullable<int>>("CountCompleteUserProfiles", networkIdParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="networkId">No Metadata Documentation available.</param> public ObjectResult<GetCompaniesAccessLevelReport_Result> GetCompaniesAccessLevelReport(Nullable<int> networkId) { ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("networkId", networkId); } else { networkIdParameter = new ObjectParameter("networkId", typeof(int)); } return base.ExecuteFunction<GetCompaniesAccessLevelReport_Result>("GetCompaniesAccessLevelReport", networkIdParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="textId">No Metadata Documentation available.</param> public ObjectResult<TextValue> GetTextValueByTextId(Nullable<int> textId) { ObjectParameter textIdParameter; if (textId.HasValue) { textIdParameter = new ObjectParameter("textId", textId); } else { textIdParameter = new ObjectParameter("textId", typeof(int)); } return base.ExecuteFunction<TextValue>("GetTextValueByTextId", textIdParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="textId">No Metadata Documentation available.</param> /// <param name="culture">No Metadata Documentation available.</param> /// <param name="title">No Metadata Documentation available.</param> /// <param name="value">No Metadata Documentation available.</param> /// <param name="date">No Metadata Documentation available.</param> /// <param name="userId">No Metadata Documentation available.</param> public ObjectResult<Nullable<int>> SetTextValue(Nullable<int> textId, string culture, string title, string value, Nullable<System.DateTime> date, Nullable<int> userId) { ObjectParameter textIdParameter; if (textId.HasValue) { textIdParameter = new ObjectParameter("textId", textId); } else { textIdParameter = new ObjectParameter("textId", typeof(int)); } ObjectParameter cultureParameter; if (culture != null) { cultureParameter = new ObjectParameter("culture", culture); } else { cultureParameter = new ObjectParameter("culture", typeof(string)); } ObjectParameter titleParameter; if (title != null) { titleParameter = new ObjectParameter("title", title); } else { titleParameter = new ObjectParameter("title", typeof(string)); } ObjectParameter valueParameter; if (value != null) { valueParameter = new ObjectParameter("value", value); } else { valueParameter = new ObjectParameter("value", typeof(string)); } ObjectParameter dateParameter; if (date.HasValue) { dateParameter = new ObjectParameter("date", date); } else { dateParameter = new ObjectParameter("date", typeof(System.DateTime)); } ObjectParameter userIdParameter; if (userId.HasValue) { userIdParameter = new ObjectParameter("userId", userId); } else { userIdParameter = new ObjectParameter("userId", typeof(int)); } return base.ExecuteFunction<Nullable<int>>("SetTextValue", textIdParameter, cultureParameter, titleParameter, valueParameter, dateParameter, userIdParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="networkId">No Metadata Documentation available.</param> public int DeleteNotSubmittedApplyRequests(Nullable<int> networkId) { ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("networkId", networkId); } else { networkIdParameter = new ObjectParameter("networkId", typeof(int)); } return base.ExecuteFunction("DeleteNotSubmittedApplyRequests", networkIdParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="networkId">No Metadata Documentation available.</param> public ObjectResult<GetTopSkills_Result> GetTopSkills(Nullable<int> networkId) { ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("networkId", networkId); } else { networkIdParameter = new ObjectParameter("networkId", typeof(int)); } return base.ExecuteFunction<GetTopSkills_Result>("GetTopSkills", networkIdParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="userId">No Metadata Documentation available.</param> /// <param name="day">No Metadata Documentation available.</param> /// <param name="time">No Metadata Documentation available.</param> public int UpdateUserPresence(Nullable<int> userId, Nullable<System.DateTime> day, Nullable<System.DateTime> time) { ObjectParameter userIdParameter; if (userId.HasValue) { userIdParameter = new ObjectParameter("UserId", userId); } else { userIdParameter = new ObjectParameter("UserId", typeof(int)); } ObjectParameter dayParameter; if (day.HasValue) { dayParameter = new ObjectParameter("Day", day); } else { dayParameter = new ObjectParameter("Day", typeof(System.DateTime)); } ObjectParameter timeParameter; if (time.HasValue) { timeParameter = new ObjectParameter("Time", time); } else { timeParameter = new ObjectParameter("Time", typeof(System.DateTime)); } return base.ExecuteFunction("UpdateUserPresence", userIdParameter, dayParameter, timeParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="networkId">No Metadata Documentation available.</param> public ObjectResult<GetUserPresenceStats_Result> GetUserPresenceStats(Nullable<int> networkId) { ObjectParameter networkIdParameter; if (networkId.HasValue) { networkIdParameter = new ObjectParameter("NetworkId", networkId); } else { networkIdParameter = new ObjectParameter("NetworkId", typeof(int)); } return base.ExecuteFunction<GetUserPresenceStats_Result>("GetUserPresenceStats", networkIdParameter); } /// <summary> /// No Metadata Documentation available. /// </summary> /// <param name="deleteJobId">No Metadata Documentation available.</param> /// <param name="targetJobId">No Metadata Documentation available.</param> public ObjectResult<DeleteJob_Result> DeleteJob(Nullable<int> deleteJobId, Nullable<int> targetJobId) { ObjectParameter deleteJobIdParameter; if (deleteJobId.HasValue) { deleteJobIdParameter = new ObjectParameter("deleteJobId", deleteJobId); } else { deleteJobIdParameter = new ObjectParameter("deleteJobId", typeof(int)); } ObjectParameter targetJobIdParameter; if (targetJobId.HasValue) { targetJobIdParameter = new ObjectParameter("targetJobId", targetJobId); } else { targetJobIdParameter = new ObjectParameter("targetJobId", typeof(int)); } return base.ExecuteFunction<DeleteJob_Result>("DeleteJob", deleteJobIdParameter, targetJobIdParameter); } #endregion } #endregion }
52.145134
425
0.635556
[ "MPL-2.0" ]
SparkleNetworks/SparkleNetworks
src/Sparkle.Data.Entity/Networks/Model/NetworksModel.cs
274,859
C#
using System; namespace AltaPay.Service { public enum PaymentSource { eCommerce, eCommerce_without3ds, mobi, moto, mail_order, telephone_order } }
10.4375
26
0.712575
[ "MIT" ]
AltaPay/sdk-csharp
AltaPayApi/AltaPayApi/Service/Requests/Common/PaymentSource.cs
167
C#