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 UnityEngine; using UnityEngine.EventSystems; using System.Collections.Generic; [RequireComponent(typeof(PlayerController))] [RequireComponent(typeof(GunController))] public class Player : MonoBehaviour { public float moveSpeed = 5f; private PlayerController controller; private Camera viewCamera; private GunController gunController; private PauseManager pauseManager; private List<GameObject> walls; private LivingEntity livingEntity; private GameOverManager gameOver; private GameModeManager gameModeManager; void Start() { controller = GetComponent<PlayerController>(); gunController = GetComponent<GunController> (); livingEntity = GetComponent<LivingEntity> (); gameModeManager = GameObject.Find ("GameManager").GetComponent<GameModeManager> (); gameOver = GameObject.Find ("GameManager").GetComponent<GameOverManager> (); pauseManager = GameObject.Find ("GameManager").GetComponent<PauseManager> (); viewCamera = Camera.main; walls = new List<GameObject>(); livingEntity.deathEvent += OnDeath; } void OnDeath() { if (gameModeManager.gameMode == "default") { gameOver.GameOver (true); } else { gameOver.GameOver (false); } } void Update() { MovementInput (); RotationInput (); WeaponInput (); ResetPosition (); CheckWalls (); } void MovementInput() { Vector3 moveInput = new Vector3 (Input.GetAxisRaw("Horizontal"), 0f, Input.GetAxisRaw("Vertical")); Vector3 moveVelocity = moveInput.normalized * moveSpeed; // Normalizing will give us the direction of the input controller.Move (moveVelocity); } void RotationInput() { Ray ray = viewCamera.ScreenPointToRay (Input.mousePosition); // returns a ray from the camera to the mouse position Plane groundPlane = new Plane (Vector3.up, transform.position); // generate a plane programmatically, looking up at 0,0,0 float rayDistance; if (groundPlane.Raycast (ray, out rayDistance)) { // takes a Ray and will give out a variable (rayDistance). Returns true if the ray intersects with the ground plane Vector3 point = ray.GetPoint(rayDistance); //Debug.DrawLine (ray.origin, point, Color.red); controller.LookAt(point); } } void WeaponInput() { // If LMB is being pressed down, shoot if (Input.GetMouseButton (0)) { if(!pauseManager.gameIsPaused) { gunController.Shoot (); } } } void ResetPosition() { if (transform.position.y < -10f) { transform.position = new Vector3 (0f, 3f, 0f); } } void CheckWalls() { foreach (GameObject wall in walls) { Material material = wall.GetComponent<Renderer> ().material; // Make it opaque [11] material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.One); material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.Zero); material.SetInt("_ZWrite", 1); material.DisableKeyword("_ALPHATEST_ON"); material.DisableKeyword("_ALPHABLEND_ON"); material.DisableKeyword("_ALPHAPREMULTIPLY_ON"); material.renderQueue = -1; // Change the colour wall.GetComponent<Renderer> ().material.color = new Color (material.color.r, material.color.g, material.color.b, 1f); } walls = new List<GameObject> (); Vector3 myPosition = Camera.main.transform.position; Vector3 rayDirection = Camera.main.transform.forward; int rayLengthMeters = 100; // [10] RaycastHit[] hitInfo = Physics.RaycastAll (myPosition, rayDirection, rayLengthMeters, LayerMask.GetMask ("Unwalkable")); for (int i = 0; i < hitInfo.Length; i++) { hitInfo[i].transform.gameObject.layer = 9; walls.Add (hitInfo[i].transform.gameObject); } foreach (GameObject wall in walls) { Material material = wall.GetComponent<Renderer> ().material; // Make it transparent [11] material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.One); material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.OneMinusSrcAlpha); material.SetInt("_ZWrite", 0); material.DisableKeyword("_ALPHATEST_ON"); material.DisableKeyword("_ALPHABLEND_ON"); material.EnableKeyword("_ALPHAPREMULTIPLY_ON"); material.renderQueue = 3000; // Change the colour wall.GetComponent<Renderer> ().material.color = new Color (material.color.r, material.color.g, material.color.b, 0f); } } }
33.148438
167
0.729201
[ "MIT" ]
ReesMorris/black-earth
Assets/Scripts/Entities/Player.cs
4,245
C#
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // [MANDATORY] The following GUID is used as a unique identifier of the plugin. Generate a fresh one for your plugin! [assembly: Guid("141704e0-505c-492c-9e74-3b85f1c05d12")] // [MANDATORY] The assembly versioning //Should be incremented for each new release build of a plugin [assembly: AssemblyVersion("1.0.0.1")] [assembly: AssemblyFileVersion("1.0.0.1")] // [MANDATORY] The name of your plugin [assembly: AssemblyTitle("MyPlugin")] // [MANDATORY] A short description of your plugin [assembly: AssemblyDescription("This is the description of my plugin. It should contain all relevant description of what the plugin is about.")] // The following attributes are not required for the plugin per se, but are required by the official manifest meta data // Your name [assembly: AssemblyCompany("MyCompanyOrName")] // The product name that this plugin is part of [assembly: AssemblyProduct("MyPluginProduct")] [assembly: AssemblyCopyright("")] // The minimum Version of N.I.N.A. that this plugin is compatible with [assembly: AssemblyMetadata("MinimumApplicationVersion", "2.0.0.2020")] // The license your plugin code is using [assembly: AssemblyMetadata("License", "MPL-2.0")] // The url to the license [assembly: AssemblyMetadata("LicenseURL", "https://www.mozilla.org/en-US/MPL/2.0/")] // The repository where your pluggin is hosted [assembly: AssemblyMetadata("Repository", "https://bitbucket.org/Isbeorn/nina.plugin.template/")] // The following attributes are optional for the official manifest meta data //[Optional] Your plugin homepage URL - omit if not applicaple [assembly: AssemblyMetadata("Homepage", "")] //[Optional] Common tags that quickly describe your plugin [assembly: AssemblyMetadata("Tags", "Template,Sequencer")] //[Optional] A link that will show a log of all changes in between your plugin's versions [assembly: AssemblyMetadata("ChangelogURL", "https://bitbucket.org/Isbeorn/nina.plugin.template/commits/branch/master")] //[Optional] The url to a featured logo that will be displayed in the plugin list next to the name [assembly: AssemblyMetadata("FeaturedImageURL", "")] //[Optional] A url to an example screenshot of your plugin in action [assembly: AssemblyMetadata("ScreenshotURL", "")] //[Optional] An additional url to an example example screenshot of your plugin in action [assembly: AssemblyMetadata("AltScreenshotURL", "")] //[Optional] An in-depth description of your plugin [assembly: AssemblyMetadata("LongDescription", @"An in-depth description of your plugin")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // [Unused] [assembly: AssemblyConfiguration("")] // [Unused] [assembly: AssemblyTrademark("")] // [Unused] [assembly: AssemblyCulture("")]
44.088235
144
0.763175
[ "Unlicense" ]
ghilios/NINA.Joko.Plugins.MaxemUlator
NINA.Plugin.Template/NINA.Plugin.Template/Properties/AssemblyInfo.cs
3,000
C#
namespace MercadoPago.Client.Payment { using System; /// <summary> /// Flight information. /// </summary> public class PaymentRouteRequest { /// <summary> /// Derpature. /// </summary> public string Departure { get; set; } /// <summary> /// Destination. /// </summary> public string Destination { get; set; } /// <summary> /// Departure date. /// </summary> public DateTime? DepartureDateTime { get; set; } /// <summary> /// Arrival date. /// </summary> public DateTime? ArrivalDateTime { get; set; } /// <summary> /// Company. /// </summary> public string Company { get; set; } } }
21.583333
56
0.487773
[ "MIT" ]
hdlopez/sdk-dotnet
src/MercadoPago/Client/Payment/PaymentRouteRequest.cs
779
C#
using NBi.Core.Scalar.Conversion; using NUnit.Framework; using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Text; using System.Threading.Tasks; namespace NBi.Testing.Unit.Core.Scalar.Conversion { public class TextToDateTimeConverterTest { [Test] [TestCase("fr-fr")] [TestCase("en-us")] [TestCase("jp-jp")] [TestCase("ru-ru")] [TestCase("ko-ko")] public void Execute_ValidDateTime_Date(string culture) { var cultureInfo = new CultureInfo(culture); var text = (new DateTime(2018, 1, 6, 5, 12, 25)).ToString(cultureInfo.DateTimeFormat.ShortDatePattern + " " + cultureInfo.DateTimeFormat.LongTimePattern, cultureInfo.DateTimeFormat); Console.WriteLine(text); var converter = new TextToDateTimeConverter(cultureInfo, DateTime.MinValue); var newValue = converter.Execute(text); Assert.That(newValue, Is.TypeOf<DateTime>()); Assert.That(newValue, Is.EqualTo(new DateTime(2018, 01, 6, 5, 12, 25))); } [Test] [TestCase("06 Janvier 2018", "fr-fr")] [TestCase("06/01/2018", "fr-fr")] [TestCase("06-JAN", "en-us")] public void Execute_InvalidDate_Date(string text, string culture) { var cultureInfo = new CultureInfo(culture); var converter = new TextToDateTimeConverter(cultureInfo, DateTime.MinValue); var newValue = converter.Execute(text); Assert.That(newValue, Is.TypeOf<DateTime>()); Assert.That(newValue, Is.EqualTo(DateTime.MinValue)); } [Test] [TestCase("06 Janvier 2018", "fr-fr")] [TestCase("06/01/2018", "fr-fr")] [TestCase("06-JAN", "en-us")] public void Execute_InvalidDate_Null(string text, string culture) { var cultureInfo = new CultureInfo(culture); var converter = new TextToDateTimeConverter(cultureInfo, null); var newValue = converter.Execute(text); Assert.That(newValue, Is.Null); } } }
37.034483
194
0.621508
[ "Apache-2.0" ]
CoolsJoris/NBi
NBi.Testing/Unit/Core/Scalar/Conversion/TextToDateTimeConverterTest.cs
2,150
C#
namespace OkonkwoOandaV20.TradeLibrary.DataTypes.Transaction { public class MarketOrderTransaction : Transaction { public string instrument { get; set; } public double units { get; set; } public string timeInForce { get; set; } public double? priceBound { get; set; } public string positionFill { get; set; } public MarketOrderTradeClose tradeClose { get; set; } public MarketOrderPositionCloseout longPositionCloseout { get; set; } public MarketOrderPositionCloseout shortPositionCloseout { get; set; } public MarketOrderMarginCloseout marginCloseout { get; set; } public MarketOrderDelayedTradeClose delayedTradeClose { get; set; } public string reason { get; set; } public ClientExtensions clientExtensions { get; set; } public TakeProfitDetails takeProfitOnFill { get; set; } public StopLossDetails stopLossOnFill { get; set; } public TrailingStopLossDetails trailingStopLossOnFill { get; set; } public ClientExtensions tradeClientExtensions { get; set; } } }
46.521739
76
0.717757
[ "Apache-2.0" ]
svopex/SierraChartOandaV20
OkonkwoOandaV20/TradeLibrary/DataTypes/Transaction/MarketOrderTransaction.cs
1,072
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Figures { class Circle : AbstractFigure, IPrint { /// <summary> /// Ширина /// </summary> double radius; /// <summary> /// Основной конструктор /// </summary> /// <param name="pr">Радиус</param> public Circle(double pr) { this.radius = pr; this.Type = "Круг"; } public override double Area() { double Result = Math.PI * this.radius * this.radius; return Result; } public void Print() { Console.WriteLine(this.ToString()); } } }
20.394737
64
0.503226
[ "MIT" ]
Pugletka/IU5
Term 3/Basic components of Internet technologies/Lab 2/Lab 2/Circle.cs
812
C#
/* Copyright (C) 2013-present The DataCentric Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ using System.Collections.Generic; using System.Xml.Serialization; namespace DataCentric { /// <summary>Definition of a single element within type declaration.</summary> public class ElementDecl : ParamDecl { /// <summary> /// Flag indicating a hidden element. /// /// Hidden elements are present in the API but hidden in the user interface, /// except in developer mode. /// </summary> public YesNo? Hidden { get; set; } /// <summary> /// Optional flag indicating if the element is additive. For additive elements, /// total column can be shown in the user interface. /// /// This field has no effect on the API and affects only the user interface. /// </summary> public YesNo? Additive { get; set; } /// <summary> /// Provides the ability to group the elements in the user interface. /// /// This field has no effect on the API and affects only the user interface. /// </summary> public string Category { get; set; } /// <summary> /// Formatting string for the element applied in the user interface. /// /// TODO - specify formatting convention and accepted format strings. /// </summary> public string Format { get; set; } /// <summary> /// Flag indicating an output element. /// /// Output elements will be readonly in the user interface. They can only be populated through the API. /// /// TODO - this duplicates ModificationType, need to consolidate. /// </summary> public YesNo? Output { get; set; } /// <summary> /// Specify the name of the element for which the current element as an alternate. /// /// In the user interface, only one of the alternate elements can be provided. /// The default element to be provided is the one for which alternates are specified, /// while the alternates have to be selected explicitly. /// </summary> public string AlternateOf { get; set; } } }
36.891892
111
0.639194
[ "Apache-2.0" ]
datacentricorg/datacentric-cs
cs/src/DataCentric/Schema/Declaration/ElementDecl.cs
2,732
C#
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Extensions; using System; using zipkin4net.Propagation; namespace zipkin4net.Middleware { public static class TracingMiddleware { public static void UseTracing(this IApplicationBuilder app, string serviceName, Func<HttpContext, string> getRpc = null, Func<PathString, bool> routeFilter = null) { getRpc = getRpc ?? (context => context.Request.Method); routeFilter = routeFilter ?? (context => true); var extractor = Propagations.B3String.Extractor<IHeaderDictionary>((carrier, key) => carrier[key]); app.Use(async (context, next) => { var request = context.Request; var traceContext = extractor.Extract(request.Headers); var trace = traceContext == null ? Trace.Create() : Trace.CreateFromId(traceContext); Trace.Current = trace; if (routeFilter(request.Path)) { using (var serverTrace = new ServerTrace(serviceName, getRpc(context))) { if (request.Host.HasValue) { trace.Record(Annotations.Tag("http.host", request.Host.ToString())); trace.Record(Annotations.Tag("http.uri", UriHelper.GetDisplayUrl(request))); } trace.Record(Annotations.Tag("http.path", request.Path)); await serverTrace.TracedActionAsync(next()); } } else { await next.Invoke(); } }); } } }
39.574468
112
0.519892
[ "Apache-2.0" ]
JTOne123/zipkin4net
Src/zipkin4net.middleware.aspnetcore/Src/TracingMiddleware.cs
1,816
C#
using System; using System.Xml.Serialization; using System.ComponentModel.DataAnnotations; using BroadWorksConnector.Ocip.Validation; using System.Collections.Generic; namespace BroadWorksConnector.Ocip.Models { /// <summary> /// Response to SystemCallProcessingPolicyProfileBroadWorksAnywhereProfileGetRequest22. /// <see cref="SystemCallProcessingPolicyProfileBroadWorksAnywhereProfileGetRequest22"/> /// </summary> [Serializable] [XmlRoot(Namespace = "")] [Groups(@"[{""__type"":""Sequence:#BroadWorksConnector.Ocip.Validation"",""id"":""7f663d5135470c33ca64b0eed3c3aa0c:2943""}]")] public class SystemCallProcessingPolicyProfileBroadWorksAnywhereProfileGetResponse22 : BroadWorksConnector.Ocip.Models.C.OCIDataResponse { private bool _useCLIDPolicy; [XmlElement(ElementName = "useCLIDPolicy", IsNullable = false, Namespace = "")] [Group(@"7f663d5135470c33ca64b0eed3c3aa0c:2943")] public bool UseCLIDPolicy { get => _useCLIDPolicy; set { UseCLIDPolicySpecified = true; _useCLIDPolicy = value; } } [XmlIgnore] protected bool UseCLIDPolicySpecified { get; set; } private BroadWorksConnector.Ocip.Models.GroupCLIDPolicy _clidPolicy; [XmlElement(ElementName = "clidPolicy", IsNullable = false, Namespace = "")] [Group(@"7f663d5135470c33ca64b0eed3c3aa0c:2943")] public BroadWorksConnector.Ocip.Models.GroupCLIDPolicy ClidPolicy { get => _clidPolicy; set { ClidPolicySpecified = true; _clidPolicy = value; } } [XmlIgnore] protected bool ClidPolicySpecified { get; set; } private bool _allowAlternateNumbersForRedirectingIdentity; [XmlElement(ElementName = "allowAlternateNumbersForRedirectingIdentity", IsNullable = false, Namespace = "")] [Group(@"7f663d5135470c33ca64b0eed3c3aa0c:2943")] public bool AllowAlternateNumbersForRedirectingIdentity { get => _allowAlternateNumbersForRedirectingIdentity; set { AllowAlternateNumbersForRedirectingIdentitySpecified = true; _allowAlternateNumbersForRedirectingIdentity = value; } } [XmlIgnore] protected bool AllowAlternateNumbersForRedirectingIdentitySpecified { get; set; } private bool _useGroupName; [XmlElement(ElementName = "useGroupName", IsNullable = false, Namespace = "")] [Group(@"7f663d5135470c33ca64b0eed3c3aa0c:2943")] public bool UseGroupName { get => _useGroupName; set { UseGroupNameSpecified = true; _useGroupName = value; } } [XmlIgnore] protected bool UseGroupNameSpecified { get; set; } private bool _blockCallingNameForExternalCalls; [XmlElement(ElementName = "blockCallingNameForExternalCalls", IsNullable = false, Namespace = "")] [Group(@"7f663d5135470c33ca64b0eed3c3aa0c:2943")] public bool BlockCallingNameForExternalCalls { get => _blockCallingNameForExternalCalls; set { BlockCallingNameForExternalCallsSpecified = true; _blockCallingNameForExternalCalls = value; } } [XmlIgnore] protected bool BlockCallingNameForExternalCallsSpecified { get; set; } private bool _allowConfigurableCLIDForRedirectingIdentity; [XmlElement(ElementName = "allowConfigurableCLIDForRedirectingIdentity", IsNullable = false, Namespace = "")] [Group(@"7f663d5135470c33ca64b0eed3c3aa0c:2943")] public bool AllowConfigurableCLIDForRedirectingIdentity { get => _allowConfigurableCLIDForRedirectingIdentity; set { AllowConfigurableCLIDForRedirectingIdentitySpecified = true; _allowConfigurableCLIDForRedirectingIdentity = value; } } [XmlIgnore] protected bool AllowConfigurableCLIDForRedirectingIdentitySpecified { get; set; } private bool _allowDepartmentCLIDNameOverride; [XmlElement(ElementName = "allowDepartmentCLIDNameOverride", IsNullable = false, Namespace = "")] [Group(@"7f663d5135470c33ca64b0eed3c3aa0c:2943")] public bool AllowDepartmentCLIDNameOverride { get => _allowDepartmentCLIDNameOverride; set { AllowDepartmentCLIDNameOverrideSpecified = true; _allowDepartmentCLIDNameOverride = value; } } [XmlIgnore] protected bool AllowDepartmentCLIDNameOverrideSpecified { get; set; } private BroadWorksConnector.Ocip.Models.EnterpriseInternalCallsCLIDPolicy _enterpriseCallsCLIDPolicy; [XmlElement(ElementName = "enterpriseCallsCLIDPolicy", IsNullable = false, Namespace = "")] [Group(@"7f663d5135470c33ca64b0eed3c3aa0c:2943")] public BroadWorksConnector.Ocip.Models.EnterpriseInternalCallsCLIDPolicy EnterpriseCallsCLIDPolicy { get => _enterpriseCallsCLIDPolicy; set { EnterpriseCallsCLIDPolicySpecified = true; _enterpriseCallsCLIDPolicy = value; } } [XmlIgnore] protected bool EnterpriseCallsCLIDPolicySpecified { get; set; } private BroadWorksConnector.Ocip.Models.EnterpriseInternalCallsCLIDPolicy _enterpriseGroupCallsCLIDPolicy; [XmlElement(ElementName = "enterpriseGroupCallsCLIDPolicy", IsNullable = false, Namespace = "")] [Group(@"7f663d5135470c33ca64b0eed3c3aa0c:2943")] public BroadWorksConnector.Ocip.Models.EnterpriseInternalCallsCLIDPolicy EnterpriseGroupCallsCLIDPolicy { get => _enterpriseGroupCallsCLIDPolicy; set { EnterpriseGroupCallsCLIDPolicySpecified = true; _enterpriseGroupCallsCLIDPolicy = value; } } [XmlIgnore] protected bool EnterpriseGroupCallsCLIDPolicySpecified { get; set; } private BroadWorksConnector.Ocip.Models.ServiceProviderInternalCallsCLIDPolicy _serviceProviderGroupCallsCLIDPolicy; [XmlElement(ElementName = "serviceProviderGroupCallsCLIDPolicy", IsNullable = false, Namespace = "")] [Group(@"7f663d5135470c33ca64b0eed3c3aa0c:2943")] public BroadWorksConnector.Ocip.Models.ServiceProviderInternalCallsCLIDPolicy ServiceProviderGroupCallsCLIDPolicy { get => _serviceProviderGroupCallsCLIDPolicy; set { ServiceProviderGroupCallsCLIDPolicySpecified = true; _serviceProviderGroupCallsCLIDPolicy = value; } } [XmlIgnore] protected bool ServiceProviderGroupCallsCLIDPolicySpecified { get; set; } private bool _useCallLimitsPolicy; [XmlElement(ElementName = "useCallLimitsPolicy", IsNullable = false, Namespace = "")] [Group(@"7f663d5135470c33ca64b0eed3c3aa0c:2943")] public bool UseCallLimitsPolicy { get => _useCallLimitsPolicy; set { UseCallLimitsPolicySpecified = true; _useCallLimitsPolicy = value; } } [XmlIgnore] protected bool UseCallLimitsPolicySpecified { get; set; } private bool _useMaxSimultaneousCalls; [XmlElement(ElementName = "useMaxSimultaneousCalls", IsNullable = false, Namespace = "")] [Group(@"7f663d5135470c33ca64b0eed3c3aa0c:2943")] public bool UseMaxSimultaneousCalls { get => _useMaxSimultaneousCalls; set { UseMaxSimultaneousCallsSpecified = true; _useMaxSimultaneousCalls = value; } } [XmlIgnore] protected bool UseMaxSimultaneousCallsSpecified { get; set; } private int _maxSimultaneousCalls; [XmlElement(ElementName = "maxSimultaneousCalls", IsNullable = false, Namespace = "")] [Group(@"7f663d5135470c33ca64b0eed3c3aa0c:2943")] [MinInclusive(1)] [MaxInclusive(999999)] public int MaxSimultaneousCalls { get => _maxSimultaneousCalls; set { MaxSimultaneousCallsSpecified = true; _maxSimultaneousCalls = value; } } [XmlIgnore] protected bool MaxSimultaneousCallsSpecified { get; set; } private bool _useMaxSimultaneousVideoCalls; [XmlElement(ElementName = "useMaxSimultaneousVideoCalls", IsNullable = false, Namespace = "")] [Group(@"7f663d5135470c33ca64b0eed3c3aa0c:2943")] public bool UseMaxSimultaneousVideoCalls { get => _useMaxSimultaneousVideoCalls; set { UseMaxSimultaneousVideoCallsSpecified = true; _useMaxSimultaneousVideoCalls = value; } } [XmlIgnore] protected bool UseMaxSimultaneousVideoCallsSpecified { get; set; } private int _maxSimultaneousVideoCalls; [XmlElement(ElementName = "maxSimultaneousVideoCalls", IsNullable = false, Namespace = "")] [Group(@"7f663d5135470c33ca64b0eed3c3aa0c:2943")] [MinInclusive(1)] [MaxInclusive(999999)] public int MaxSimultaneousVideoCalls { get => _maxSimultaneousVideoCalls; set { MaxSimultaneousVideoCallsSpecified = true; _maxSimultaneousVideoCalls = value; } } [XmlIgnore] protected bool MaxSimultaneousVideoCallsSpecified { get; set; } private bool _useMaxConcurrentRedirectedCalls; [XmlElement(ElementName = "useMaxConcurrentRedirectedCalls", IsNullable = false, Namespace = "")] [Group(@"7f663d5135470c33ca64b0eed3c3aa0c:2943")] public bool UseMaxConcurrentRedirectedCalls { get => _useMaxConcurrentRedirectedCalls; set { UseMaxConcurrentRedirectedCallsSpecified = true; _useMaxConcurrentRedirectedCalls = value; } } [XmlIgnore] protected bool UseMaxConcurrentRedirectedCallsSpecified { get; set; } private int _maxConcurrentRedirectedCalls; [XmlElement(ElementName = "maxConcurrentRedirectedCalls", IsNullable = false, Namespace = "")] [Group(@"7f663d5135470c33ca64b0eed3c3aa0c:2943")] [MinInclusive(1)] [MaxInclusive(999999)] public int MaxConcurrentRedirectedCalls { get => _maxConcurrentRedirectedCalls; set { MaxConcurrentRedirectedCallsSpecified = true; _maxConcurrentRedirectedCalls = value; } } [XmlIgnore] protected bool MaxConcurrentRedirectedCallsSpecified { get; set; } private int _maxRedirectionDepth; [XmlElement(ElementName = "maxRedirectionDepth", IsNullable = false, Namespace = "")] [Group(@"7f663d5135470c33ca64b0eed3c3aa0c:2943")] [MinInclusive(1)] [MaxInclusive(100)] public int MaxRedirectionDepth { get => _maxRedirectionDepth; set { MaxRedirectionDepthSpecified = true; _maxRedirectionDepth = value; } } [XmlIgnore] protected bool MaxRedirectionDepthSpecified { get; set; } private bool _useTranslationRoutingPolicy; [XmlElement(ElementName = "useTranslationRoutingPolicy", IsNullable = false, Namespace = "")] [Group(@"7f663d5135470c33ca64b0eed3c3aa0c:2943")] public bool UseTranslationRoutingPolicy { get => _useTranslationRoutingPolicy; set { UseTranslationRoutingPolicySpecified = true; _useTranslationRoutingPolicy = value; } } [XmlIgnore] protected bool UseTranslationRoutingPolicySpecified { get; set; } private BroadWorksConnector.Ocip.Models.NetworkUsageSelection _networkUsageSelection; [XmlElement(ElementName = "networkUsageSelection", IsNullable = false, Namespace = "")] [Group(@"7f663d5135470c33ca64b0eed3c3aa0c:2943")] public BroadWorksConnector.Ocip.Models.NetworkUsageSelection NetworkUsageSelection { get => _networkUsageSelection; set { NetworkUsageSelectionSpecified = true; _networkUsageSelection = value; } } [XmlIgnore] protected bool NetworkUsageSelectionSpecified { get; set; } private bool _enableEnterpriseExtensionDialing; [XmlElement(ElementName = "enableEnterpriseExtensionDialing", IsNullable = false, Namespace = "")] [Group(@"7f663d5135470c33ca64b0eed3c3aa0c:2943")] public bool EnableEnterpriseExtensionDialing { get => _enableEnterpriseExtensionDialing; set { EnableEnterpriseExtensionDialingSpecified = true; _enableEnterpriseExtensionDialing = value; } } [XmlIgnore] protected bool EnableEnterpriseExtensionDialingSpecified { get; set; } private bool _enforceGroupCallingLineIdentityRestriction; [XmlElement(ElementName = "enforceGroupCallingLineIdentityRestriction", IsNullable = false, Namespace = "")] [Group(@"7f663d5135470c33ca64b0eed3c3aa0c:2943")] public bool EnforceGroupCallingLineIdentityRestriction { get => _enforceGroupCallingLineIdentityRestriction; set { EnforceGroupCallingLineIdentityRestrictionSpecified = true; _enforceGroupCallingLineIdentityRestriction = value; } } [XmlIgnore] protected bool EnforceGroupCallingLineIdentityRestrictionSpecified { get; set; } private bool _enforceEnterpriseCallingLineIdentityRestriction; [XmlElement(ElementName = "enforceEnterpriseCallingLineIdentityRestriction", IsNullable = false, Namespace = "")] [Group(@"7f663d5135470c33ca64b0eed3c3aa0c:2943")] public bool EnforceEnterpriseCallingLineIdentityRestriction { get => _enforceEnterpriseCallingLineIdentityRestriction; set { EnforceEnterpriseCallingLineIdentityRestrictionSpecified = true; _enforceEnterpriseCallingLineIdentityRestriction = value; } } [XmlIgnore] protected bool EnforceEnterpriseCallingLineIdentityRestrictionSpecified { get; set; } private bool _allowEnterpriseGroupCallTypingForPrivateDialingPlan; [XmlElement(ElementName = "allowEnterpriseGroupCallTypingForPrivateDialingPlan", IsNullable = false, Namespace = "")] [Group(@"7f663d5135470c33ca64b0eed3c3aa0c:2943")] public bool AllowEnterpriseGroupCallTypingForPrivateDialingPlan { get => _allowEnterpriseGroupCallTypingForPrivateDialingPlan; set { AllowEnterpriseGroupCallTypingForPrivateDialingPlanSpecified = true; _allowEnterpriseGroupCallTypingForPrivateDialingPlan = value; } } [XmlIgnore] protected bool AllowEnterpriseGroupCallTypingForPrivateDialingPlanSpecified { get; set; } private bool _allowEnterpriseGroupCallTypingForPublicDialingPlan; [XmlElement(ElementName = "allowEnterpriseGroupCallTypingForPublicDialingPlan", IsNullable = false, Namespace = "")] [Group(@"7f663d5135470c33ca64b0eed3c3aa0c:2943")] public bool AllowEnterpriseGroupCallTypingForPublicDialingPlan { get => _allowEnterpriseGroupCallTypingForPublicDialingPlan; set { AllowEnterpriseGroupCallTypingForPublicDialingPlanSpecified = true; _allowEnterpriseGroupCallTypingForPublicDialingPlan = value; } } [XmlIgnore] protected bool AllowEnterpriseGroupCallTypingForPublicDialingPlanSpecified { get; set; } private bool _overrideCLIDRestrictionForPrivateCallCategory; [XmlElement(ElementName = "overrideCLIDRestrictionForPrivateCallCategory", IsNullable = false, Namespace = "")] [Group(@"7f663d5135470c33ca64b0eed3c3aa0c:2943")] public bool OverrideCLIDRestrictionForPrivateCallCategory { get => _overrideCLIDRestrictionForPrivateCallCategory; set { OverrideCLIDRestrictionForPrivateCallCategorySpecified = true; _overrideCLIDRestrictionForPrivateCallCategory = value; } } [XmlIgnore] protected bool OverrideCLIDRestrictionForPrivateCallCategorySpecified { get; set; } private bool _useEnterpriseCLIDForPrivateCallCategory; [XmlElement(ElementName = "useEnterpriseCLIDForPrivateCallCategory", IsNullable = false, Namespace = "")] [Group(@"7f663d5135470c33ca64b0eed3c3aa0c:2943")] public bool UseEnterpriseCLIDForPrivateCallCategory { get => _useEnterpriseCLIDForPrivateCallCategory; set { UseEnterpriseCLIDForPrivateCallCategorySpecified = true; _useEnterpriseCLIDForPrivateCallCategory = value; } } [XmlIgnore] protected bool UseEnterpriseCLIDForPrivateCallCategorySpecified { get; set; } private bool _useIncomingCLIDPolicy; [XmlElement(ElementName = "useIncomingCLIDPolicy", IsNullable = false, Namespace = "")] [Group(@"7f663d5135470c33ca64b0eed3c3aa0c:2943")] public bool UseIncomingCLIDPolicy { get => _useIncomingCLIDPolicy; set { UseIncomingCLIDPolicySpecified = true; _useIncomingCLIDPolicy = value; } } [XmlIgnore] protected bool UseIncomingCLIDPolicySpecified { get; set; } private bool _enableDialableCallerID; [XmlElement(ElementName = "enableDialableCallerID", IsNullable = false, Namespace = "")] [Group(@"7f663d5135470c33ca64b0eed3c3aa0c:2943")] public bool EnableDialableCallerID { get => _enableDialableCallerID; set { EnableDialableCallerIDSpecified = true; _enableDialableCallerID = value; } } [XmlIgnore] protected bool EnableDialableCallerIDSpecified { get; set; } private bool _includeRedirectionsInMaximumNumberOfConcurrentCalls; [XmlElement(ElementName = "includeRedirectionsInMaximumNumberOfConcurrentCalls", IsNullable = false, Namespace = "")] [Group(@"7f663d5135470c33ca64b0eed3c3aa0c:2943")] public bool IncludeRedirectionsInMaximumNumberOfConcurrentCalls { get => _includeRedirectionsInMaximumNumberOfConcurrentCalls; set { IncludeRedirectionsInMaximumNumberOfConcurrentCallsSpecified = true; _includeRedirectionsInMaximumNumberOfConcurrentCalls = value; } } [XmlIgnore] protected bool IncludeRedirectionsInMaximumNumberOfConcurrentCallsSpecified { get; set; } private bool _useUserPhoneNumberForGroupCallsWhenInternalCLIDUnavailable; [XmlElement(ElementName = "useUserPhoneNumberForGroupCallsWhenInternalCLIDUnavailable", IsNullable = false, Namespace = "")] [Group(@"7f663d5135470c33ca64b0eed3c3aa0c:2943")] public bool UseUserPhoneNumberForGroupCallsWhenInternalCLIDUnavailable { get => _useUserPhoneNumberForGroupCallsWhenInternalCLIDUnavailable; set { UseUserPhoneNumberForGroupCallsWhenInternalCLIDUnavailableSpecified = true; _useUserPhoneNumberForGroupCallsWhenInternalCLIDUnavailable = value; } } [XmlIgnore] protected bool UseUserPhoneNumberForGroupCallsWhenInternalCLIDUnavailableSpecified { get; set; } private bool _useUserPhoneNumberForEnterpriseCallsWhenInternalCLIDUnavailable; [XmlElement(ElementName = "useUserPhoneNumberForEnterpriseCallsWhenInternalCLIDUnavailable", IsNullable = false, Namespace = "")] [Group(@"7f663d5135470c33ca64b0eed3c3aa0c:2943")] public bool UseUserPhoneNumberForEnterpriseCallsWhenInternalCLIDUnavailable { get => _useUserPhoneNumberForEnterpriseCallsWhenInternalCLIDUnavailable; set { UseUserPhoneNumberForEnterpriseCallsWhenInternalCLIDUnavailableSpecified = true; _useUserPhoneNumberForEnterpriseCallsWhenInternalCLIDUnavailable = value; } } [XmlIgnore] protected bool UseUserPhoneNumberForEnterpriseCallsWhenInternalCLIDUnavailableSpecified { get; set; } } }
37.353659
140
0.651416
[ "MIT" ]
JTOne123/broadworks-connector-net
BroadworksConnector/Ocip/Models/SystemCallProcessingPolicyProfileBroadWorksAnywhereProfileGetResponse22.cs
21,441
C#
public enum State { Idle, Edit }
8
17
0.575
[ "MIT" ]
Vlashious/AiPZSiIA
Lab4/Server/Shared/States.cs
40
C#
using System.IO; using CP77.CR2W.Reflection; using FastMember; using static CP77.CR2W.Types.Enums; namespace CP77.CR2W.Types { [REDMeta] public class AIbehaviorUnmountImmediatelyNodeDefinition : AIbehaviorDecoratorNodeDefinition { [Ordinal(0)] [RED("mountData")] public CHandle<AIArgumentMapping> MountData { get; set; } public AIbehaviorUnmountImmediatelyNodeDefinition(CR2WFile cr2w, CVariable parent, string name) : base(cr2w, parent, name) { } } }
29.875
129
0.759414
[ "MIT" ]
Eingin/CP77Tools
CP77.CR2W/Types/cp77/AIbehaviorUnmountImmediatelyNodeDefinition.cs
463
C#
#region using System.Security.Cryptography.X509Certificates; #endregion namespace Kombit.Samples.CHTestSigningService.Code { /// <summary> /// Defines an API which is responsible for updating a token /// </summary> public interface ITokenSigningService { /// <summary> /// Updates a token and sign it. The updated token must be valid. /// </summary> /// <param name="message">A base64 SAML2 response message to update</param> /// <param name="signingCertificate">The signing certificate which will be used to sign the updated token.</param> /// <param name="decryptionCertificate"> /// A certificate which will be used to decrypt a token when the input message is /// encrypted /// </param> /// <returns></returns> string UpdateToken(string message, X509Certificate2 signingCertificate, X509Certificate2 decryptionCertificate); } }
37.076923
123
0.656639
[ "MIT" ]
Safewhere/CHTestSigningService
Kombit.Samples.CHTestSigningService/Code/ITokenSigningService.cs
966
C#
using Microsoft.AspNetCore.Builder; namespace ApiWebApp.Middleware { public static class PathAuthorizationPolicyMiddlewareExtensions { public static IApplicationBuilder UsePathAuthorizationPolicyMiddleware(this IApplicationBuilder builder, PathAuthorizationPolicyMiddlewareOptions options) { return builder.UseMiddleware<PathAuthorizationPolicyMiddleware>(options); } } }
35.083333
162
0.781473
[ "MIT" ]
ghstahl/Asp.Net-Core-2.1-app-as-a-tenant
src/ApiWebApp/Middleware/PathAuthorizationPolicyMiddlewareExtensions.cs
423
C#
using LanguageExt; using LanguageExt.TypeClasses; using System.Diagnostics.Contracts; using System.Runtime.CompilerServices; using System.Threading.Tasks; using static LanguageExt.TypeClass; namespace LanguageExt.ClassInstances { /// <summary> /// Equality and ordering /// </summary> public struct OrdLst<OrdA, A> : Ord<Lst<A>> where OrdA : struct, Ord<A> { public static readonly OrdLst<OrdA, A> Inst = default(OrdLst<OrdA, A>); /// <summary> /// Equality test /// </summary> /// <param name="x">The left hand side of the equality operation</param> /// <param name="y">The right hand side of the equality operation</param> /// <returns>True if x and y are equal</returns> [Pure] public bool Equals(Lst<A> x, Lst<A> y) => default(EqLst<OrdA, A>).Equals(x, y); /// <summary> /// Compare two values /// </summary> /// <param name="x">Left hand side of the compare operation</param> /// <param name="y">Right hand side of the compare operation</param> /// <returns> /// if x greater than y : 1 /// if x less than y : -1 /// if x equals y : 0 /// </returns> [Pure] public int Compare(Lst<A> mx, Lst<A> my) { var cmp = mx.Count.CompareTo(my.Count); if (cmp == 0) { using var xiter = mx.GetEnumerator(); using var yiter = my.GetEnumerator(); while (xiter.MoveNext() && yiter.MoveNext()) { cmp = default(OrdA).Compare(xiter.Current, yiter.Current); if (cmp != 0) return cmp; } return 0; } else { return cmp; } } /// <summary> /// Get the hash-code of the provided value /// </summary> /// <returns>Hash code of x</returns> [Pure] public int GetHashCode(Lst<A> x) => x.GetHashCode(); [Pure] [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task<bool> EqualsAsync(Lst<A> x, Lst<A> y) => Equals(x, y).AsTask(); [Pure] [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task<int> GetHashCodeAsync(Lst<A> x) => GetHashCode(x).AsTask(); [Pure] [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task<int> CompareAsync(Lst<A> x, Lst<A> y) => Compare(x, y).AsTask(); } /// <summary> /// Equality and ordering /// </summary> public struct OrdLst<A> : Ord<Lst<A>> { public static readonly OrdLst<A> Inst = default(OrdLst<A>); /// <summary> /// Equality test /// </summary> /// <param name="x">The left hand side of the equality operation</param> /// <param name="y">The right hand side of the equality operation</param> /// <returns>True if x and y are equal</returns> [Pure] public bool Equals(Lst<A> x, Lst<A> y) => default(OrdLst<OrdDefault<A>, A>).Equals(x, y); /// <summary> /// Compare two values /// </summary> /// <param name="x">Left hand side of the compare operation</param> /// <param name="y">Right hand side of the compare operation</param> /// <returns> /// if x greater than y : 1 /// if x less than y : -1 /// if x equals y : 0 /// </returns> [Pure] public int Compare(Lst<A> x, Lst<A> y) => default(OrdLst<OrdDefault<A>, A>).Compare(x, y); /// <summary> /// Get the hash-code of the provided value /// </summary> /// <returns>Hash code of x</returns> [Pure] public int GetHashCode(Lst<A> x) => default(OrdLst<OrdDefault<A>, A>).GetHashCode(x); [Pure] [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task<bool> EqualsAsync(Lst<A> x, Lst<A> y) => Equals(x, y).AsTask(); [Pure] [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task<int> GetHashCodeAsync(Lst<A> x) => GetHashCode(x).AsTask(); [Pure] [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task<int> CompareAsync(Lst<A> x, Lst<A> y) => Compare(x, y).AsTask(); } }
33.166667
81
0.521739
[ "MIT" ]
Bagoum/language-ext
LanguageExt.Core/ClassInstances/Ord/OrdLst.cs
4,579
C#
using Autossential.Core.Enums; using Autossential.Shared.Utils; using System.Windows; namespace Autossential.Activities.Design.Controls { // Interaction logic for CryptographyBaseControl.xaml public partial class CryptographyBaseControl { public CryptographyBaseControl() { InitializeComponent(); cbAlgorithms.ItemsSource = EnumUtil.EnumAsDictionary<SymmetricAlgorithms>(); cbAlgorithms.DisplayMemberPath = "Key"; cbAlgorithms.SelectedValuePath = "Value"; } #region DependencyProperty : KeyToolTipProperty public string KeyToolTip { get => (string)GetValue(KeyToolTipProperty); set => SetValue(KeyToolTipProperty, value); } public static readonly DependencyProperty KeyToolTipProperty = DependencyProperty.Register(nameof(KeyToolTip), typeof(string), typeof(CryptographyBaseControl), new PropertyMetadata(default(string))); #endregion } }
33.833333
150
0.6867
[ "MIT" ]
Autossential/Autossential.Activities-2.x
Autossential.Activities.Design/Controls/CryptographyBaseControl.xaml.cs
1,017
C#
using System; using System.Collections.Generic; using System.Text; namespace HTTPv3.Quic { public class QuicListener { } }
12.454545
33
0.708029
[ "MIT" ]
httpv3/QuicDotNet
src/HTTPv3.Quic.Core/HTTPv3.Quic.Core/QuicListener.cs
139
C#
using DownKyi.Core.BiliApi.Models; using Newtonsoft.Json; using System.Collections.Generic; namespace DownKyi.Core.BiliApi.Users.Models { // https://api.bilibili.com/x/relation/followers?vmid={mid}&pn={pn}&ps={ps} // https://api.bilibili.com/x/relation/followings?vmid={mid}&pn={pn}&ps={ps}&order_type={orderType} public class RelationFollowOrigin : BaseModel { [JsonProperty("data")] public RelationFollow Data { get; set; } } public class RelationFollow : BaseModel { [JsonProperty("list")] public List<RelationFollowInfo> List { get; set; } //[JsonProperty("re_version")] //public long reVersion { get; set; } [JsonProperty("total")] public int Total { get; set; } } }
29.692308
103
0.643782
[ "Apache-2.0" ]
light-come/downkyiX
src/DownKyi.Core/BiliApi/Users/Models/RelationFollow.cs
774
C#
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // <auto-generated/> #nullable disable using System; using System.ComponentModel; namespace Azure.Search.Documents.Indexes.Models { /// <summary> Defines the type of a datasource. </summary> public readonly partial struct SearchIndexerDataSourceType : IEquatable<SearchIndexerDataSourceType> { private readonly string _value; /// <summary> Initializes a new instance of <see cref="SearchIndexerDataSourceType"/>. </summary> /// <exception cref="ArgumentNullException"> <paramref name="value"/> is null. </exception> public SearchIndexerDataSourceType(string value) { _value = value ?? throw new ArgumentNullException(nameof(value)); } private const string AzureSqlValue = "azuresql"; private const string CosmosDbValue = "cosmosdb"; private const string AzureBlobValue = "azureblob"; private const string AzureTableValue = "azuretable"; private const string MySqlValue = "mysql"; private const string AdlsGen2Value = "adlsgen2"; /// <summary> Indicates an Azure SQL datasource. </summary> public static SearchIndexerDataSourceType AzureSql { get; } = new SearchIndexerDataSourceType(AzureSqlValue); /// <summary> Indicates a CosmosDB datasource. </summary> public static SearchIndexerDataSourceType CosmosDb { get; } = new SearchIndexerDataSourceType(CosmosDbValue); /// <summary> Indicates an Azure Blob datasource. </summary> public static SearchIndexerDataSourceType AzureBlob { get; } = new SearchIndexerDataSourceType(AzureBlobValue); /// <summary> Indicates an Azure Table datasource. </summary> public static SearchIndexerDataSourceType AzureTable { get; } = new SearchIndexerDataSourceType(AzureTableValue); /// <summary> Indicates a MySql datasource. </summary> public static SearchIndexerDataSourceType MySql { get; } = new SearchIndexerDataSourceType(MySqlValue); /// <summary> Indicates an ADLS Gen2 datasource. </summary> public static SearchIndexerDataSourceType AdlsGen2 { get; } = new SearchIndexerDataSourceType(AdlsGen2Value); /// <summary> Determines if two <see cref="SearchIndexerDataSourceType"/> values are the same. </summary> public static bool operator ==(SearchIndexerDataSourceType left, SearchIndexerDataSourceType right) => left.Equals(right); /// <summary> Determines if two <see cref="SearchIndexerDataSourceType"/> values are not the same. </summary> public static bool operator !=(SearchIndexerDataSourceType left, SearchIndexerDataSourceType right) => !left.Equals(right); /// <summary> Converts a string to a <see cref="SearchIndexerDataSourceType"/>. </summary> public static implicit operator SearchIndexerDataSourceType(string value) => new SearchIndexerDataSourceType(value); /// <inheritdoc /> [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is SearchIndexerDataSourceType other && Equals(other); /// <inheritdoc /> public bool Equals(SearchIndexerDataSourceType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); /// <inheritdoc /> [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value?.GetHashCode() ?? 0; /// <inheritdoc /> public override string ToString() => _value; } }
56.125
146
0.710468
[ "MIT" ]
93mishra/azure-sdk-for-net
sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerDataSourceType.cs
3,592
C#
using System; using System.Collections; using System.Collections.Generic; using System.Linq; using Handelabra.Sentinels.Engine.Controller; using Handelabra.Sentinels.Engine.Model; namespace Cauldron.TheMistressOfFate { public class HourDevourerCardController : TheMistressOfFateUtilityCardController { public HourDevourerCardController(Card card, TurnTakerController turnTakerController) : base(card, turnTakerController) { } } }
26.055556
127
0.780384
[ "MIT" ]
qoala/CauldronMods
Controller/Villains/TheMistressOfFate/Cards/HourDevourerCardController.cs
471
C#
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // <auto-generated/> #nullable disable using System.Collections.Generic; using Azure.Core; using Azure.Iot.TimeSeriesInsights.Models; namespace Azure.Iot.TimeSeriesInsights { /// <summary> Time series instance that is returned by instances search call. Returned instance matched the search request and contains highlighted text to be displayed to the user if it is set to &apos;true&apos;. </summary> public partial class InstanceHit { /// <summary> Initializes a new instance of InstanceHit. </summary> internal InstanceHit() { TimeSeriesId = new ChangeTrackingList<object>(); HierarchyIds = new ChangeTrackingList<string>(); } /// <summary> Initializes a new instance of InstanceHit. </summary> /// <param name="timeSeriesId"> Time series ID of the time series instance that matched the search request. </param> /// <param name="name"> Name of the time series instance that matched the search request. May be null. </param> /// <param name="typeId"> Represents the type that time series instance which matched the search request belongs to. Never null. </param> /// <param name="hierarchyIds"> List of time series hierarchy IDs that time series instance which matched the search request belongs to. Cannot be used to lookup hierarchies. May be null. </param> /// <param name="highlights"> Highlighted text of time series instance to be displayed to the user. Highlighting inserts &lt;hit&gt; and &lt;/hit&gt; tags in the portions of text that matched the search string. Do not use any of the highlighted properties to do further API calls. </param> internal InstanceHit(IReadOnlyList<object> timeSeriesId, string name, string typeId, IReadOnlyList<string> hierarchyIds, InstanceHitHighlights highlights) { TimeSeriesId = timeSeriesId; Name = name; TypeId = typeId; HierarchyIds = hierarchyIds; Highlights = highlights; } /// <summary> Time series ID of the time series instance that matched the search request. </summary> public IReadOnlyList<object> TimeSeriesId { get; } /// <summary> Name of the time series instance that matched the search request. May be null. </summary> public string Name { get; } /// <summary> Represents the type that time series instance which matched the search request belongs to. Never null. </summary> public string TypeId { get; } /// <summary> List of time series hierarchy IDs that time series instance which matched the search request belongs to. Cannot be used to lookup hierarchies. May be null. </summary> public IReadOnlyList<string> HierarchyIds { get; } /// <summary> Highlighted text of time series instance to be displayed to the user. Highlighting inserts &lt;hit&gt; and &lt;/hit&gt; tags in the portions of text that matched the search string. Do not use any of the highlighted properties to do further API calls. </summary> public InstanceHitHighlights Highlights { get; } } }
62.980392
297
0.702055
[ "MIT" ]
abatishchev/azure-sdk-for-ne
sdk/timeseriesinsights/Azure.Iot.TimeSeriesInsights/src/Generated/Models/InstanceHit.cs
3,212
C#
namespace StockDataBL.Migrations { using System; using System.Data.Entity.Migrations; public partial class InitialCreate : DbMigration { public override void Up() { } public override void Down() { } } }
16.764706
52
0.547368
[ "Unlicense" ]
krefs17/app-gielda
WindowsFormsApp2/StockDataBL/Migrations/201907271309315_InitialCreate.cs
285
C#
namespace WHMS.Web.ViewModels.Products { using System.ComponentModel.DataAnnotations; using WHMS.Data.Models.Products; using WHMS.Services.Mapping; public class ManufacturerViewModel : IMapFrom<Manufacturer> { public int Id { get; set; } [Required] [Display(Name = "Manufacturer name")] public string Name { get; set; } } }
22.588235
63
0.653646
[ "MIT" ]
jivkopiskov/WHMS
src/Web/WHMS.Web.ViewModels/Products/ManufacturerViewModel.cs
386
C#
using System; using System.Collections.Generic; using System.Linq; using App.Data.Entities; using App.Data.Interfaces; using FluentAssertions; using Moq; using Testing.Common.Helpers; using Xunit; namespace App.TestingSample { public class SampleUnitTest { private readonly IEnumerable<Person> _persons = new List<Person> { new Person { Identification = "123456-1234A", FirstName = "Peter", LastName = "Yutani" }, new Person { Identification = "123456-1234B", FirstName = "Bishop", LastName = "Yutani" } }; private readonly IEnumerable<Pet> _pets = new List<Pet> { new Pet { Identification = Guid.NewGuid(), FullName = "Spot" }, new Pet { Identification = Guid.NewGuid(), FullName = "Bella" } }; private readonly IEnumerable<Hobby> _hobbies = new List<Hobby> { new Hobby { Identifier = Guid.NewGuid(), Name = "Badminton" }, new Hobby { Identifier = Guid.NewGuid(), Name = "Curling" } }; private readonly Mock<ISampleDbContext> _mockDbContext; public SampleUnitTest() { _mockDbContext = MockDbContextBuilder .BuildMockDbContext<ISampleDbContext>() .AttachMockDbSetToSetMethodCall(MockDbContextBuilder.BuildMockDbSet(_persons)) .AttachMockDbSetToPropertyCall(MockDbContextBuilder.BuildMockDbSet(_pets), context => context.Pets) .AttachMockDbSetToModelCall(MockDbContextBuilder.BuildMockDbSet(_hobbies), "Hobbies"); } [Fact] public void SetMethod_ShouldBeMockedCorrectly() { // Act var result = _mockDbContext.Object .Set<Person>() .Where(p => p.Identification == "123456-1234A") .ToList(); // Assert result.Should().BeEquivalentTo(_persons.First()); } [Fact] public void EntityProperty_ShouldBeMockedCorrectly() { // Act var result = _mockDbContext.Object .Pets .Where(p => p.FullName == "Bella"); // Assert result.Should().BeEquivalentTo(_pets.Skip(1).First()); } [Fact] public void Model_ShouldBeMockedCorrectly() { // Act var result = _mockDbContext.Object .Model["Hobbies"]; // Assert result.Should().BeEquivalentTo(_hobbies); } } }
27.233645
115
0.50652
[ "MIT" ]
jolmari/efcore-mock-dbcontext
MockDbContext/App.TestingSample/SampleUnitTest.cs
2,914
C#
using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerController : MonoBehaviour { /// <summary> /// Camera /// </summary> public Transform viewPoint; public float mouseSensitivity = 1f; private float verticalRotationStore; private Vector2 mouseInput; void Start() { } void Update() { mouseInput = new Vector2(Input.GetAxisRaw("Mouse X"), Input.GetAxisRaw("Mouse Y") * mouseSensitivity); transform.rotation = Quaternion.Euler(transform.rotation.eulerAngles.x, transform.rotation.eulerAngles.y + mouseInput.x, transform.rotation.eulerAngles.z); } }
25.166667
114
0.61457
[ "MIT" ]
VladiPanda/Multiplayer-FPS-prototype
Multiplayer FPS/Assets/Scripts/PlayerController.cs
755
C#
using System; using System.IO; using System.Text; using System.Text.Json; using System.Text.Json.Serialization; using System.Collections.Generic ; namespace console { class Program { static void Main(string[] args) { String input = ""; while(!input.Equals("3")){ Console.WriteLine("Welcome to you bank"); Console.WriteLine("1. View Accounts\n2. View account by number\n3. Exit"); Console.Write(">"); input = Console.ReadLine(); if(input.Equals("1")){ var accounts = ReadAccounts(); Console.Write(AccountsFormater(accounts)); } else if(input.Equals("2")){ var accounts = ReadAccounts(); Console.WriteLine("Insert id for account\n>"); input = Console.ReadLine(); int inputAsNumber = Int32.Parse(input); foreach(var account in accounts){ if(account.Number.Equals(inputAsNumber)){ Console.Write(AccountFormater(account)); } } } } } static string AccountFormater(Account account){ string fancyString = "+--------+---------+-----------+-------+\n"+ "| Number | Balance | Label | Owner |\n"+ "+--------+---------+-----------+-------+\n"; fancyString += account.niceFormat(); fancyString += "+--------+---------+-----------+-------+\n"; return fancyString; } static string AccountsFormater(IEnumerable<Account> accounts){ string fancyString = "+--------+---------+-----------+-------+\n"+ "| Number | Balance | Label | Owner |\n"+ "+--------+---------+-----------+-------+\n"; foreach(var account in accounts) fancyString += account.niceFormat(); fancyString += "+--------+---------+-----------+-------+\n"; return fancyString; } static IEnumerable<Account> ReadAccounts() { String file = "../../data/account.json"; using (StreamReader r = new StreamReader(file)) { string data = r.ReadToEnd(); var json = JsonSerializer.Deserialize<Account[]>( data, new JsonSerializerOptions { PropertyNameCaseInsensitive = true } ); return json; } } public class Account { public int Number { get; set; } public int Balance { get; set; } public string Label { get; set; } public int Owner { get; set; } public override string ToString() { return JsonSerializer.Serialize<Account>(this); } public string niceFormat(){ return String.Format("| {0,6} | {1,7} | {2,9} | {3,5} |\n", Number, Balance, Label, Owner); } }} }
32.683168
103
0.425932
[ "MIT" ]
MarcusFSorensen/websoft
work/s07/console/Program.cs
3,303
C#
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) #pragma warning disable using System; using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Tsp { public class Accuracy : Asn1Encodable { private readonly DerInteger seconds; private readonly DerInteger millis; private readonly DerInteger micros; // constants protected const int MinMillis = 1; protected const int MaxMillis = 999; protected const int MinMicros = 1; protected const int MaxMicros = 999; public Accuracy( DerInteger seconds, DerInteger millis, DerInteger micros) { if (null != millis) { int millisValue = millis.IntValueExact; if (millisValue < MinMillis || millisValue > MaxMillis) throw new ArgumentException("Invalid millis field : not in (1..999)"); } if (null != micros) { int microsValue = micros.IntValueExact; if (microsValue < MinMicros || microsValue > MaxMicros) throw new ArgumentException("Invalid micros field : not in (1..999)"); } this.seconds = seconds; this.millis = millis; this.micros = micros; } private Accuracy( Asn1Sequence seq) { for (int i = 0; i < seq.Count; ++i) { // seconds if (seq[i] is DerInteger) { seconds = (DerInteger) seq[i]; } else if (seq[i] is Asn1TaggedObject) { Asn1TaggedObject extra = (Asn1TaggedObject)seq[i]; switch (extra.TagNo) { case 0: millis = DerInteger.GetInstance(extra, false); int millisValue = millis.IntValueExact; if (millisValue < MinMillis || millisValue > MaxMillis) throw new ArgumentException("Invalid millis field : not in (1..999)"); break; case 1: micros = DerInteger.GetInstance(extra, false); int microsValue = micros.IntValueExact; if (microsValue < MinMicros || microsValue > MaxMicros) throw new ArgumentException("Invalid micros field : not in (1..999)"); break; default: throw new ArgumentException("Invalid tag number"); } } } } public static Accuracy GetInstance(object obj) { if (obj is Accuracy) return (Accuracy)obj; if (obj == null) return null; return new Accuracy(Asn1Sequence.GetInstance(obj)); } public DerInteger Seconds { get { return seconds; } } public DerInteger Millis { get { return millis; } } public DerInteger Micros { get { return micros; } } /** * <pre> * Accuracy ::= SEQUENCE { * seconds INTEGER OPTIONAL, * millis [0] INTEGER (1..999) OPTIONAL, * micros [1] INTEGER (1..999) OPTIONAL * } * </pre> */ public override Asn1Object ToAsn1Object() { Asn1EncodableVector v = new Asn1EncodableVector(); v.AddOptional(seconds); v.AddOptionalTagged(false, 0, millis); v.AddOptionalTagged(false, 1, micros); return new DerSequence(v); } } } #pragma warning restore #endif
29.28
98
0.532514
[ "MIT" ]
Bregermann/TargetCrack
Target Crack/Assets/Best HTTP/Source/SecureProtocol/asn1/tsp/Accuracy.cs
3,660
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 Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Infrastructure { /// <summary> /// <para> /// Interface for extensions that are stored in <see cref="DbContextOptions.Extensions" />. /// </para> /// <para> /// This interface is typically used by database providers (and other extensions). It is generally /// not used in application code. /// </para> /// </summary> /// <remarks> /// See <see href="https://aka.ms/efcore-docs-providers">Implementation of database providers and extensions</see> /// for more information. /// </remarks> public interface IDbContextOptionsExtension { /// <summary> /// Information/metadata about the extension. /// </summary> DbContextOptionsExtensionInfo Info { get; } /// <summary> /// Adds the services required to make the selected options work. This is used when there /// is no external <see cref="IServiceProvider" /> and EF is maintaining its own service /// provider internally. This allows database providers (and other extensions) to register their /// required services when EF is creating an service provider. /// </summary> /// <param name="services"> The collection to add services to. </param> void ApplyServices(IServiceCollection services); /// <summary> /// Gives the extension a chance to validate that all options in the extension are valid. /// Most extensions do not have invalid combinations and so this will be a no-op. /// If options are invalid, then an exception should be thrown. /// </summary> /// <param name="options"> The options being validated. </param> void Validate(IDbContextOptions options); } }
43.744681
122
0.634241
[ "MIT" ]
CameronAavik/efcore
src/EFCore/Infrastructure/IDbContextOptionsExtension.cs
2,056
C#
using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Diagnostics; using System.Globalization; using System.Text; using System.Threading; namespace Microsoft.CodeAnalysis { internal static partial class NullableExtensions { [DebuggerDisplay("{WrappedSymbol,nq}, Nullability = {Nullability,nq}")] private abstract class TypeSymbolWithNullableAnnotation : ITypeSymbol { internal ITypeSymbol WrappedSymbol { get; } internal NullableAnnotation Nullability { get; } protected TypeSymbolWithNullableAnnotation(ITypeSymbol wrappedSymbol, NullableAnnotation nullability) { Debug.Assert(!(wrappedSymbol is TypeSymbolWithNullableAnnotation)); WrappedSymbol = wrappedSymbol; Nullability = nullability; } bool IEquatable<ISymbol>.Equals(ISymbol other) { return Equals(other, SymbolEqualityComparer.Default); } public bool Equals(ISymbol other, SymbolEqualityComparer equalityComparer) { if (other is TypeSymbolWithNullableAnnotation otherWrappingSymbol) { return this.Nullability == otherWrappingSymbol.Nullability && this.WrappedSymbol.Equals(otherWrappingSymbol.WrappedSymbol, equalityComparer); } else if (other is ITypeSymbol) { // Somebody is trying to compare a nullable-wrapped symbol with a regular compiler symbol. By rule Equals must be reflexive, // and since the compiler's Equals won't respect us as being equal, we can't return anything other than false. Flagging this with an assert // is helpful while moving features over, because this comparison might be the reason a feature isn't working right. However, for now disabling // the assert is easiest because we can't update the whole codebase at once. Enabling the assert is tracked in https://github.com/dotnet/roslyn/issues/36045. // Debug.Fail($"A {nameof(TypeSymbolWithNullableAnnotation)} was compared to a regular symbol. This comparison is disallowed."); // We are also going to cheat further: for now, we'll just throw away nullability and compare, because if a core feature (like the type inferrerr) is updated // but other features aren't, we want to keep those working. return this.WrappedSymbol.Equals(other); } else { return false; } } public override bool Equals(object obj) { return this.Equals(obj as ISymbol, SymbolEqualityComparer.Default); } public override int GetHashCode() { // As a transition mechanism, we allow ourselves to be compared to non-wrapped // symbols and we compare with the existing compiler equality and just throw away our // top-level nullability. Because of that, we can't incorporate the top-level nullability // into our hash code, because if we did we couldn't be both simultaneously equal to // something that has top level nullability and something that doesn't. return this.WrappedSymbol.GetHashCode(); } #region ITypeSymbol Implementation Forwards public TypeKind TypeKind => WrappedSymbol.TypeKind; public INamedTypeSymbol BaseType => WrappedSymbol.BaseType; public ImmutableArray<INamedTypeSymbol> Interfaces => WrappedSymbol.Interfaces; public ImmutableArray<INamedTypeSymbol> AllInterfaces => WrappedSymbol.AllInterfaces; public bool IsReferenceType => WrappedSymbol.IsReferenceType; public bool IsValueType => WrappedSymbol.IsValueType; public bool IsAnonymousType => WrappedSymbol.IsAnonymousType; public bool IsTupleType => WrappedSymbol.IsTupleType; public ITypeSymbol OriginalDefinition => WrappedSymbol.OriginalDefinition; public SpecialType SpecialType => WrappedSymbol.SpecialType; public bool IsRefLikeType => WrappedSymbol.IsRefLikeType; public bool IsUnmanagedType => WrappedSymbol.IsUnmanagedType; public bool IsReadOnly => WrappedSymbol.IsReadOnly; public bool IsNamespace => WrappedSymbol.IsNamespace; public bool IsType => WrappedSymbol.IsType; public SymbolKind Kind => WrappedSymbol.Kind; public string Language => WrappedSymbol.Language; public string Name => WrappedSymbol.Name; public string MetadataName => WrappedSymbol.MetadataName; public ISymbol ContainingSymbol => WrappedSymbol.ContainingSymbol; public IAssemblySymbol ContainingAssembly => WrappedSymbol.ContainingAssembly; public IModuleSymbol ContainingModule => WrappedSymbol.ContainingModule; public INamedTypeSymbol ContainingType => WrappedSymbol.ContainingType; public INamespaceSymbol ContainingNamespace => WrappedSymbol.ContainingNamespace; public bool IsDefinition => WrappedSymbol.IsDefinition; public bool IsStatic => WrappedSymbol.IsStatic; public bool IsVirtual => WrappedSymbol.IsVirtual; public bool IsOverride => WrappedSymbol.IsOverride; public bool IsAbstract => WrappedSymbol.IsAbstract; public bool IsSealed => WrappedSymbol.IsSealed; public bool IsExtern => WrappedSymbol.IsExtern; public bool IsImplicitlyDeclared => WrappedSymbol.IsImplicitlyDeclared; public bool CanBeReferencedByName => WrappedSymbol.CanBeReferencedByName; public ImmutableArray<Location> Locations => WrappedSymbol.Locations; public ImmutableArray<SyntaxReference> DeclaringSyntaxReferences => WrappedSymbol.DeclaringSyntaxReferences; public Accessibility DeclaredAccessibility => WrappedSymbol.DeclaredAccessibility; public bool HasUnsupportedMetadata => WrappedSymbol.HasUnsupportedMetadata; ISymbol ISymbol.OriginalDefinition => WrappedSymbol.OriginalDefinition; public abstract void Accept(SymbolVisitor visitor); public abstract TResult Accept<TResult>(SymbolVisitor<TResult> visitor); public ISymbol FindImplementationForInterfaceMember(ISymbol interfaceMember) { return WrappedSymbol.FindImplementationForInterfaceMember(interfaceMember); } public ImmutableArray<AttributeData> GetAttributes() { return WrappedSymbol.GetAttributes(); } public string GetDocumentationCommentId() { return WrappedSymbol.GetDocumentationCommentId(); } public string GetDocumentationCommentXml(CultureInfo preferredCulture = null, bool expandIncludes = false, CancellationToken cancellationToken = default) { return WrappedSymbol.GetDocumentationCommentXml(preferredCulture, expandIncludes, cancellationToken); } public ImmutableArray<ISymbol> GetMembers() { return WrappedSymbol.GetMembers(); } public ImmutableArray<ISymbol> GetMembers(string name) { return WrappedSymbol.GetMembers(name); } public ImmutableArray<INamedTypeSymbol> GetTypeMembers() { return WrappedSymbol.GetTypeMembers(); } public ImmutableArray<INamedTypeSymbol> GetTypeMembers(string name) { return WrappedSymbol.GetTypeMembers(name); } public ImmutableArray<INamedTypeSymbol> GetTypeMembers(string name, int arity) { return WrappedSymbol.GetTypeMembers(name, arity); } public ImmutableArray<SymbolDisplayPart> ToDisplayParts(NullableFlowState topLevelNullability, SymbolDisplayFormat format = null) { return WrappedSymbol.ToDisplayParts(topLevelNullability, format); } public ImmutableArray<SymbolDisplayPart> ToDisplayParts(SymbolDisplayFormat format = null) { return WrappedSymbol.ToDisplayParts(format); } public string ToDisplayString(NullableFlowState topLevelNullability, SymbolDisplayFormat format = null) { return WrappedSymbol.ToDisplayString(topLevelNullability, format); } public string ToDisplayString(SymbolDisplayFormat format = null) { return WrappedSymbol.ToDisplayString(format); } public ImmutableArray<SymbolDisplayPart> ToMinimalDisplayParts(SemanticModel semanticModel, NullableFlowState topLevelNullability, int position, SymbolDisplayFormat format = null) { return WrappedSymbol.ToMinimalDisplayParts(semanticModel, topLevelNullability, position, format); } public ImmutableArray<SymbolDisplayPart> ToMinimalDisplayParts(SemanticModel semanticModel, int position, SymbolDisplayFormat format = null) { // Call the right API once https://github.com/dotnet/roslyn/pull/35698 is merged var convertedFlowState = Nullability == NullableAnnotation.Annotated ? NullableFlowState.MaybeNull : NullableFlowState.None; return WrappedSymbol.ToMinimalDisplayParts(semanticModel, convertedFlowState, position, format); } public string ToMinimalDisplayString(SemanticModel semanticModel, NullableFlowState topLevelNullability, int position, SymbolDisplayFormat format = null) { return WrappedSymbol.ToMinimalDisplayString(semanticModel, topLevelNullability, position, format); } public string ToMinimalDisplayString(SemanticModel semanticModel, int position, SymbolDisplayFormat format = null) { return WrappedSymbol.ToMinimalDisplayString(semanticModel, position, format); } #endregion } } }
50.37799
191
0.658087
[ "Apache-2.0" ]
GKotfis/roslyn
src/Workspaces/Core/Portable/Utilities/NullableHelpers/TypeSymbolWithNullableAnnotation.cs
10,531
C#
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ using DslModeling = global::Microsoft.VisualStudio.Modeling; using DslDesign = global::Microsoft.VisualStudio.Modeling.Design; namespace Sawczyn.EFDesigner.EFModel { /// <summary> /// DomainRelationship Association /// Associations between Classes. /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.Association.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [global::System.ComponentModel.TypeDescriptionProvider(typeof(AssociationTypeDescriptionProvider))] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.Association.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslModeling::DomainModelOwner(typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel))] [global::System.CLSCompliant(true)] [global::System.Diagnostics.DebuggerDisplay("{GetType().Name,nq} (Name = {Name})")] [DslModeling::DomainRelationship(AllowsDuplicates = true)] [DslModeling::DomainObjectId("ce77f831-a92d-4274-823a-3a8441a65f3a")] public abstract partial class Association : DslModeling::ElementLink { #region Constructors, domain class Id /// <summary> /// Association domain class Id. /// </summary> public static readonly new global::System.Guid DomainClassId = new global::System.Guid(0xce77f831, 0xa92d, 0x4274, 0x82, 0x3a, 0x3a, 0x84, 0x41, 0xa6, 0x5f, 0x3a); /// <summary> /// Constructor. /// </summary> /// <param name="partition">The Partition instance containing this ElementLink</param> /// <param name="roleAssignments">A set of role assignments for roleplayer initialization</param> /// <param name="propertyAssignments">A set of attribute assignments for attribute initialization</param> protected Association(DslModeling::Partition partition, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments) : base(partition, roleAssignments, propertyAssignments) { } #endregion #region Source domain role code /// <summary> /// Source domain role Id. /// </summary> public static readonly global::System.Guid SourceDomainRoleId = new global::System.Guid(0xd2edf927, 0x64c2, 0x4fe3, 0x8d, 0x4e, 0xc4, 0x4e, 0x87, 0x14, 0x2c, 0x4c); /// <summary> /// DomainRole Source /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.Association/Source.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.Association/Source.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslModeling::DomainRole(DslModeling::DomainRoleOrder.Source, PropertyName = "Targets", PropertyDisplayNameKey="Sawczyn.EFDesigner.EFModel.Association/Source.PropertyDisplayName", PropagatesCopy = DslModeling::PropagatesCopyOption.DoNotPropagateCopy, Multiplicity = DslModeling::Multiplicity.ZeroMany)] [DslModeling::DomainObjectId("d2edf927-64c2-4fe3-8d4e-c44e87142c4c")] public abstract ModelClass Source { get; set; } #endregion #region Static methods to access Sources of a ModelClass /// <summary> /// Gets a list of Sources. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static DslModeling::ReadOnlyLinkedElementCollection<ModelClass> GetSources(ModelClass element) { return GetRoleCollection<DslModeling::ReadOnlyLinkedElementCollection<ModelClass>, ModelClass>(element, TargetDomainRoleId); } #endregion #region Target domain role code /// <summary> /// Target domain role Id. /// </summary> public static readonly global::System.Guid TargetDomainRoleId = new global::System.Guid(0x1a39c29f, 0x8df6, 0x4063, 0xbf, 0x60, 0xcf, 0xe2, 0xc0, 0xc6, 0x19, 0xfa); /// <summary> /// DomainRole Target /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.Association/Target.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.Association/Target.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslModeling::DomainRole(DslModeling::DomainRoleOrder.Target, PropertyName = "Sources", PropertyDisplayNameKey="Sawczyn.EFDesigner.EFModel.Association/Target.PropertyDisplayName", PropagatesCopy = DslModeling::PropagatesCopyOption.DoNotPropagateCopy, Multiplicity = DslModeling::Multiplicity.ZeroMany)] [DslModeling::DomainObjectId("1a39c29f-8df6-4063-bf60-cfe2c0c619fa")] public abstract ModelClass Target { get; set; } #endregion #region Static methods to access Targets of a ModelClass /// <summary> /// Gets a list of Targets. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static DslModeling::ReadOnlyLinkedElementCollection<ModelClass> GetTargets(ModelClass element) { return GetRoleCollection<DslModeling::ReadOnlyLinkedElementCollection<ModelClass>, ModelClass>(element, SourceDomainRoleId); } #endregion #region SourceMultiplicity domain property code /// <summary> /// SourceMultiplicity domain property Id. /// </summary> public static readonly global::System.Guid SourceMultiplicityDomainPropertyId = new global::System.Guid(0x50d076b7, 0x4a3e, 0x4b87, 0xb5, 0xbb, 0x85, 0x37, 0x52, 0x0a, 0xdc, 0x72); /// <summary> /// Storage for SourceMultiplicity /// </summary> private Multiplicity sourceMultiplicityPropertyStorage = Multiplicity.One; /// <summary> /// Gets or sets the value of SourceMultiplicity domain property. /// The allowed number of entities at this end of the association /// </summary> [System.ComponentModel.TypeConverter(typeof(SourceMultiplicityTypeConverter))] [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.Association/SourceMultiplicity.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::CategoryResource("Sawczyn.EFDesigner.EFModel.Association/SourceMultiplicity.Category", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.Association/SourceMultiplicity.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [global::System.ComponentModel.DefaultValue(Multiplicity.One)] [DslModeling::DomainObjectId("50d076b7-4a3e-4b87-b5bb-8537520adc72")] public Multiplicity SourceMultiplicity { [global::System.Diagnostics.DebuggerStepThrough] get { return sourceMultiplicityPropertyStorage; } [global::System.Diagnostics.DebuggerStepThrough] set { SourceMultiplicityPropertyHandler.Instance.SetValue(this, value); } } /// <summary> /// Value handler for the Association.SourceMultiplicity domain property. /// </summary> internal sealed partial class SourceMultiplicityPropertyHandler : DslModeling::DomainPropertyValueHandler<Association, Multiplicity> { private SourceMultiplicityPropertyHandler() { } /// <summary> /// Gets the singleton instance of the Association.SourceMultiplicity domain property value handler. /// </summary> public static readonly SourceMultiplicityPropertyHandler Instance = new SourceMultiplicityPropertyHandler(); /// <summary> /// Gets the Id of the Association.SourceMultiplicity domain property. /// </summary> public sealed override global::System.Guid DomainPropertyId { [global::System.Diagnostics.DebuggerStepThrough] get { return SourceMultiplicityDomainPropertyId; } } /// <summary> /// Gets a strongly-typed value of the property on specified element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <returns>Property value.</returns> public override sealed Multiplicity GetValue(Association element) { if (element == null) throw new global::System.ArgumentNullException("element"); return element.sourceMultiplicityPropertyStorage; } /// <summary> /// Sets property value on an element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <param name="newValue">New property value.</param> public override sealed void SetValue(Association element, Multiplicity newValue) { if (element == null) throw new global::System.ArgumentNullException("element"); Multiplicity oldValue = GetValue(element); if (newValue != oldValue) { ValueChanging(element, oldValue, newValue); element.sourceMultiplicityPropertyStorage = newValue; ValueChanged(element, oldValue, newValue); } } } #endregion #region TargetMultiplicity domain property code /// <summary> /// TargetMultiplicity domain property Id. /// </summary> public static readonly global::System.Guid TargetMultiplicityDomainPropertyId = new global::System.Guid(0xb84f185b, 0x4eea, 0x4454, 0xa4, 0x7d, 0x26, 0xb1, 0xa4, 0xb0, 0x95, 0x23); /// <summary> /// Storage for TargetMultiplicity /// </summary> private Multiplicity targetMultiplicityPropertyStorage = Multiplicity.ZeroMany; /// <summary> /// Gets or sets the value of TargetMultiplicity domain property. /// The allowed number of entities at this end of the association /// </summary> [System.ComponentModel.TypeConverter(typeof(TargetMultiplicityTypeConverter))] [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.Association/TargetMultiplicity.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::CategoryResource("Sawczyn.EFDesigner.EFModel.Association/TargetMultiplicity.Category", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.Association/TargetMultiplicity.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [global::System.ComponentModel.DefaultValue(Multiplicity.ZeroMany)] [DslModeling::DomainObjectId("b84f185b-4eea-4454-a47d-26b1a4b09523")] public Multiplicity TargetMultiplicity { [global::System.Diagnostics.DebuggerStepThrough] get { return targetMultiplicityPropertyStorage; } [global::System.Diagnostics.DebuggerStepThrough] set { TargetMultiplicityPropertyHandler.Instance.SetValue(this, value); } } /// <summary> /// Value handler for the Association.TargetMultiplicity domain property. /// </summary> internal sealed partial class TargetMultiplicityPropertyHandler : DslModeling::DomainPropertyValueHandler<Association, Multiplicity> { private TargetMultiplicityPropertyHandler() { } /// <summary> /// Gets the singleton instance of the Association.TargetMultiplicity domain property value handler. /// </summary> public static readonly TargetMultiplicityPropertyHandler Instance = new TargetMultiplicityPropertyHandler(); /// <summary> /// Gets the Id of the Association.TargetMultiplicity domain property. /// </summary> public sealed override global::System.Guid DomainPropertyId { [global::System.Diagnostics.DebuggerStepThrough] get { return TargetMultiplicityDomainPropertyId; } } /// <summary> /// Gets a strongly-typed value of the property on specified element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <returns>Property value.</returns> public override sealed Multiplicity GetValue(Association element) { if (element == null) throw new global::System.ArgumentNullException("element"); return element.targetMultiplicityPropertyStorage; } /// <summary> /// Sets property value on an element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <param name="newValue">New property value.</param> public override sealed void SetValue(Association element, Multiplicity newValue) { if (element == null) throw new global::System.ArgumentNullException("element"); Multiplicity oldValue = GetValue(element); if (newValue != oldValue) { ValueChanging(element, oldValue, newValue); element.targetMultiplicityPropertyStorage = newValue; ValueChanged(element, oldValue, newValue); } } } #endregion #region TargetPropertyName domain property code /// <summary> /// TargetPropertyName domain property Id. /// </summary> public static readonly global::System.Guid TargetPropertyNameDomainPropertyId = new global::System.Guid(0x81625766, 0x4885, 0x46ba, 0xa5, 0x35, 0xc3, 0xe2, 0x3a, 0x7c, 0x5f, 0x88); /// <summary> /// Storage for TargetPropertyName /// </summary> private global::System.String targetPropertyNamePropertyStorage = string.Empty; /// <summary> /// Gets or sets the value of TargetPropertyName domain property. /// Name of the entity property that returns the value at this end /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.Association/TargetPropertyName.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::CategoryResource("Sawczyn.EFDesigner.EFModel.Association/TargetPropertyName.Category", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.Association/TargetPropertyName.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [global::System.ComponentModel.DefaultValue("")] [DslModeling::DomainObjectId("81625766-4885-46ba-a535-c3e23a7c5f88")] public global::System.String TargetPropertyName { [global::System.Diagnostics.DebuggerStepThrough] get { return targetPropertyNamePropertyStorage; } [global::System.Diagnostics.DebuggerStepThrough] set { TargetPropertyNamePropertyHandler.Instance.SetValue(this, value); } } /// <summary> /// Value handler for the Association.TargetPropertyName domain property. /// </summary> internal sealed partial class TargetPropertyNamePropertyHandler : DslModeling::DomainPropertyValueHandler<Association, global::System.String> { private TargetPropertyNamePropertyHandler() { } /// <summary> /// Gets the singleton instance of the Association.TargetPropertyName domain property value handler. /// </summary> public static readonly TargetPropertyNamePropertyHandler Instance = new TargetPropertyNamePropertyHandler(); /// <summary> /// Gets the Id of the Association.TargetPropertyName domain property. /// </summary> public sealed override global::System.Guid DomainPropertyId { [global::System.Diagnostics.DebuggerStepThrough] get { return TargetPropertyNameDomainPropertyId; } } /// <summary> /// Gets a strongly-typed value of the property on specified element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <returns>Property value.</returns> public override sealed global::System.String GetValue(Association element) { if (element == null) throw new global::System.ArgumentNullException("element"); return element.targetPropertyNamePropertyStorage; } /// <summary> /// Sets property value on an element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <param name="newValue">New property value.</param> public override sealed void SetValue(Association element, global::System.String newValue) { if (element == null) throw new global::System.ArgumentNullException("element"); global::System.String oldValue = GetValue(element); if (newValue != oldValue) { ValueChanging(element, oldValue, newValue); element.targetPropertyNamePropertyStorage = newValue; ValueChanged(element, oldValue, newValue); } } } #endregion #region Persistent domain property code /// <summary> /// Persistent domain property Id. /// </summary> public static readonly global::System.Guid PersistentDomainPropertyId = new global::System.Guid(0x8c8b1118, 0xd3f2, 0x494a, 0xb1, 0x8e, 0x8d, 0xbe, 0x26, 0x21, 0x29, 0x10); /// <summary> /// Storage for Persistent /// </summary> private global::System.Boolean persistentPropertyStorage = true; /// <summary> /// Gets or sets the value of Persistent domain property. /// If false, this is a transient association not stored in the database but instead /// created in code /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.Association/Persistent.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::CategoryResource("Sawczyn.EFDesigner.EFModel.Association/Persistent.Category", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.Association/Persistent.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [global::System.ComponentModel.DefaultValue(true)] [DslModeling::DomainObjectId("8c8b1118-d3f2-494a-b18e-8dbe26212910")] public global::System.Boolean Persistent { [global::System.Diagnostics.DebuggerStepThrough] get { return persistentPropertyStorage; } [global::System.Diagnostics.DebuggerStepThrough] set { PersistentPropertyHandler.Instance.SetValue(this, value); } } /// <summary> /// Value handler for the Association.Persistent domain property. /// </summary> internal sealed partial class PersistentPropertyHandler : DslModeling::DomainPropertyValueHandler<Association, global::System.Boolean> { private PersistentPropertyHandler() { } /// <summary> /// Gets the singleton instance of the Association.Persistent domain property value handler. /// </summary> public static readonly PersistentPropertyHandler Instance = new PersistentPropertyHandler(); /// <summary> /// Gets the Id of the Association.Persistent domain property. /// </summary> public sealed override global::System.Guid DomainPropertyId { [global::System.Diagnostics.DebuggerStepThrough] get { return PersistentDomainPropertyId; } } /// <summary> /// Gets a strongly-typed value of the property on specified element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <returns>Property value.</returns> public override sealed global::System.Boolean GetValue(Association element) { if (element == null) throw new global::System.ArgumentNullException("element"); return element.persistentPropertyStorage; } /// <summary> /// Sets property value on an element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <param name="newValue">New property value.</param> public override sealed void SetValue(Association element, global::System.Boolean newValue) { if (element == null) throw new global::System.ArgumentNullException("element"); global::System.Boolean oldValue = GetValue(element); if (newValue != oldValue) { ValueChanging(element, oldValue, newValue); element.persistentPropertyStorage = newValue; ValueChanged(element, oldValue, newValue); } } } #endregion #region SourceMultiplicityDisplay domain property code /// <summary> /// SourceMultiplicityDisplay domain property Id. /// </summary> public static readonly global::System.Guid SourceMultiplicityDisplayDomainPropertyId = new global::System.Guid(0x0346043b, 0x1ed8, 0x4299, 0xb8, 0x4a, 0x57, 0x16, 0x7b, 0x4c, 0x00, 0xdb); /// <summary> /// Gets or sets the value of SourceMultiplicityDisplay domain property. /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.Association/SourceMultiplicityDisplay.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::CategoryResource("Sawczyn.EFDesigner.EFModel.Association/SourceMultiplicityDisplay.Category", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.Association/SourceMultiplicityDisplay.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [global::System.ComponentModel.Browsable(false)] [global::System.ComponentModel.ReadOnly(true)] [DslModeling::DomainProperty(Kind = DslModeling::DomainPropertyKind.Calculated)] [DslModeling::DomainObjectId("0346043b-1ed8-4299-b84a-57167b4c00db")] public global::System.String SourceMultiplicityDisplay { [global::System.Diagnostics.DebuggerStepThrough] get { return SourceMultiplicityDisplayPropertyHandler.Instance.GetValue(this); } } /// <summary> /// Value handler for the Association.SourceMultiplicityDisplay domain property. /// </summary> internal sealed partial class SourceMultiplicityDisplayPropertyHandler : DslModeling::CalculatedPropertyValueHandler<Association, global::System.String> { private SourceMultiplicityDisplayPropertyHandler() { } /// <summary> /// Gets the singleton instance of the Association.SourceMultiplicityDisplay domain property value handler. /// </summary> public static readonly SourceMultiplicityDisplayPropertyHandler Instance = new SourceMultiplicityDisplayPropertyHandler(); /// <summary> /// Gets the Id of the Association.SourceMultiplicityDisplay domain property. /// </summary> public sealed override global::System.Guid DomainPropertyId { [global::System.Diagnostics.DebuggerStepThrough] get { return SourceMultiplicityDisplayDomainPropertyId; } } /// <summary> /// Gets a strongly-typed value of the property on specified element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <returns>Property value.</returns> public override sealed global::System.String GetValue(Association element) { if (element == null) throw new global::System.ArgumentNullException("element"); // There is no storage for SourceMultiplicityDisplay because its Kind is // set to Calculated. Please provide the GetSourceMultiplicityDisplayValue() // method on the domain class. return element.GetSourceMultiplicityDisplayValue(); } } #endregion #region TargetMultiplicityDisplay domain property code /// <summary> /// TargetMultiplicityDisplay domain property Id. /// </summary> public static readonly global::System.Guid TargetMultiplicityDisplayDomainPropertyId = new global::System.Guid(0x450de663, 0xcfb6, 0x48e3, 0x88, 0x8a, 0x4f, 0xbc, 0xee, 0x3a, 0xc7, 0x78); /// <summary> /// Gets or sets the value of TargetMultiplicityDisplay domain property. /// Decorator text /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.Association/TargetMultiplicityDisplay.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::CategoryResource("Sawczyn.EFDesigner.EFModel.Association/TargetMultiplicityDisplay.Category", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.Association/TargetMultiplicityDisplay.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [global::System.ComponentModel.Browsable(false)] [global::System.ComponentModel.ReadOnly(true)] [DslModeling::DomainProperty(Kind = DslModeling::DomainPropertyKind.Calculated)] [DslModeling::DomainObjectId("450de663-cfb6-48e3-888a-4fbcee3ac778")] public global::System.String TargetMultiplicityDisplay { [global::System.Diagnostics.DebuggerStepThrough] get { return TargetMultiplicityDisplayPropertyHandler.Instance.GetValue(this); } } /// <summary> /// Value handler for the Association.TargetMultiplicityDisplay domain property. /// </summary> internal sealed partial class TargetMultiplicityDisplayPropertyHandler : DslModeling::CalculatedPropertyValueHandler<Association, global::System.String> { private TargetMultiplicityDisplayPropertyHandler() { } /// <summary> /// Gets the singleton instance of the Association.TargetMultiplicityDisplay domain property value handler. /// </summary> public static readonly TargetMultiplicityDisplayPropertyHandler Instance = new TargetMultiplicityDisplayPropertyHandler(); /// <summary> /// Gets the Id of the Association.TargetMultiplicityDisplay domain property. /// </summary> public sealed override global::System.Guid DomainPropertyId { [global::System.Diagnostics.DebuggerStepThrough] get { return TargetMultiplicityDisplayDomainPropertyId; } } /// <summary> /// Gets a strongly-typed value of the property on specified element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <returns>Property value.</returns> public override sealed global::System.String GetValue(Association element) { if (element == null) throw new global::System.ArgumentNullException("element"); // There is no storage for TargetMultiplicityDisplay because its Kind is // set to Calculated. Please provide the GetTargetMultiplicityDisplayValue() // method on the domain class. return element.GetTargetMultiplicityDisplayValue(); } } #endregion #region SourceDeleteAction domain property code /// <summary> /// SourceDeleteAction domain property Id. /// </summary> public static readonly global::System.Guid SourceDeleteActionDomainPropertyId = new global::System.Guid(0xf40a8fc6, 0x0b1b, 0x4c1b, 0xa4, 0x6c, 0x75, 0xd3, 0x45, 0x0c, 0xd6, 0xc8); /// <summary> /// Storage for SourceDeleteAction /// </summary> private DeleteAction sourceDeleteActionPropertyStorage = DeleteAction.Default; /// <summary> /// Gets or sets the value of SourceDeleteAction domain property. /// The action to take when an entity on this end is deleted. /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.Association/SourceDeleteAction.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::CategoryResource("Sawczyn.EFDesigner.EFModel.Association/SourceDeleteAction.Category", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.Association/SourceDeleteAction.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [global::System.ComponentModel.DefaultValue(DeleteAction.Default)] [DslModeling::DomainObjectId("f40a8fc6-0b1b-4c1b-a46c-75d3450cd6c8")] public DeleteAction SourceDeleteAction { [global::System.Diagnostics.DebuggerStepThrough] get { return sourceDeleteActionPropertyStorage; } [global::System.Diagnostics.DebuggerStepThrough] set { SourceDeleteActionPropertyHandler.Instance.SetValue(this, value); } } /// <summary> /// Value handler for the Association.SourceDeleteAction domain property. /// </summary> internal sealed partial class SourceDeleteActionPropertyHandler : DslModeling::DomainPropertyValueHandler<Association, DeleteAction> { private SourceDeleteActionPropertyHandler() { } /// <summary> /// Gets the singleton instance of the Association.SourceDeleteAction domain property value handler. /// </summary> public static readonly SourceDeleteActionPropertyHandler Instance = new SourceDeleteActionPropertyHandler(); /// <summary> /// Gets the Id of the Association.SourceDeleteAction domain property. /// </summary> public sealed override global::System.Guid DomainPropertyId { [global::System.Diagnostics.DebuggerStepThrough] get { return SourceDeleteActionDomainPropertyId; } } /// <summary> /// Gets a strongly-typed value of the property on specified element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <returns>Property value.</returns> public override sealed DeleteAction GetValue(Association element) { if (element == null) throw new global::System.ArgumentNullException("element"); return element.sourceDeleteActionPropertyStorage; } /// <summary> /// Sets property value on an element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <param name="newValue">New property value.</param> public override sealed void SetValue(Association element, DeleteAction newValue) { if (element == null) throw new global::System.ArgumentNullException("element"); DeleteAction oldValue = GetValue(element); if (newValue != oldValue) { ValueChanging(element, oldValue, newValue); element.sourceDeleteActionPropertyStorage = newValue; ValueChanged(element, oldValue, newValue); } } } #endregion #region TargetDeleteAction domain property code /// <summary> /// TargetDeleteAction domain property Id. /// </summary> public static readonly global::System.Guid TargetDeleteActionDomainPropertyId = new global::System.Guid(0x6e502a47, 0x428b, 0x455f, 0xb1, 0x55, 0xed, 0xf3, 0x10, 0xce, 0x6c, 0x73); /// <summary> /// Storage for TargetDeleteAction /// </summary> private DeleteAction targetDeleteActionPropertyStorage = DeleteAction.Default; /// <summary> /// Gets or sets the value of TargetDeleteAction domain property. /// The action to take when an entity on this end is deleted. /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.Association/TargetDeleteAction.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::CategoryResource("Sawczyn.EFDesigner.EFModel.Association/TargetDeleteAction.Category", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.Association/TargetDeleteAction.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [global::System.ComponentModel.DefaultValue(DeleteAction.Default)] [DslModeling::DomainObjectId("6e502a47-428b-455f-b155-edf310ce6c73")] public DeleteAction TargetDeleteAction { [global::System.Diagnostics.DebuggerStepThrough] get { return targetDeleteActionPropertyStorage; } [global::System.Diagnostics.DebuggerStepThrough] set { TargetDeleteActionPropertyHandler.Instance.SetValue(this, value); } } /// <summary> /// Value handler for the Association.TargetDeleteAction domain property. /// </summary> internal sealed partial class TargetDeleteActionPropertyHandler : DslModeling::DomainPropertyValueHandler<Association, DeleteAction> { private TargetDeleteActionPropertyHandler() { } /// <summary> /// Gets the singleton instance of the Association.TargetDeleteAction domain property value handler. /// </summary> public static readonly TargetDeleteActionPropertyHandler Instance = new TargetDeleteActionPropertyHandler(); /// <summary> /// Gets the Id of the Association.TargetDeleteAction domain property. /// </summary> public sealed override global::System.Guid DomainPropertyId { [global::System.Diagnostics.DebuggerStepThrough] get { return TargetDeleteActionDomainPropertyId; } } /// <summary> /// Gets a strongly-typed value of the property on specified element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <returns>Property value.</returns> public override sealed DeleteAction GetValue(Association element) { if (element == null) throw new global::System.ArgumentNullException("element"); return element.targetDeleteActionPropertyStorage; } /// <summary> /// Sets property value on an element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <param name="newValue">New property value.</param> public override sealed void SetValue(Association element, DeleteAction newValue) { if (element == null) throw new global::System.ArgumentNullException("element"); DeleteAction oldValue = GetValue(element); if (newValue != oldValue) { ValueChanging(element, oldValue, newValue); element.targetDeleteActionPropertyStorage = newValue; ValueChanged(element, oldValue, newValue); } } } #endregion #region CollectionClass domain property code /// <summary> /// CollectionClass domain property Id. /// </summary> public static readonly global::System.Guid CollectionClassDomainPropertyId = new global::System.Guid(0x59735c14, 0x84b9, 0x4b9c, 0xb4, 0x49, 0x22, 0x48, 0xcb, 0x67, 0xd6, 0x5a); /// <summary> /// Gets or sets the value of CollectionClass domain property. /// Class used to instanciate association properties. Implements ICollection<> /// </summary> [System.ComponentModel.TypeConverter(typeof(CollectionTypeTypeConverter))] [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.Association/CollectionClass.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::CategoryResource("Sawczyn.EFDesigner.EFModel.Association/CollectionClass.Category", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.Association/CollectionClass.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [global::System.ComponentModel.DefaultValue("")] [global::System.ComponentModel.Browsable(false)] [DslModeling::DomainProperty(Kind = DslModeling::DomainPropertyKind.CustomStorage)] [DslModeling::DomainObjectId("59735c14-84b9-4b9c-b449-2248cb67d65a")] public global::System.String CollectionClass { [global::System.Diagnostics.DebuggerStepThrough] get { return CollectionClassPropertyHandler.Instance.GetValue(this); } [global::System.Diagnostics.DebuggerStepThrough] set { CollectionClassPropertyHandler.Instance.SetValue(this, value); } } /// <summary> /// Value handler for the Association.CollectionClass domain property. /// </summary> internal sealed partial class CollectionClassPropertyHandler : DslModeling::DomainPropertyValueHandler<Association, global::System.String> { private CollectionClassPropertyHandler() { } /// <summary> /// Gets the singleton instance of the Association.CollectionClass domain property value handler. /// </summary> public static readonly CollectionClassPropertyHandler Instance = new CollectionClassPropertyHandler(); /// <summary> /// Gets the Id of the Association.CollectionClass domain property. /// </summary> public sealed override global::System.Guid DomainPropertyId { [global::System.Diagnostics.DebuggerStepThrough] get { return CollectionClassDomainPropertyId; } } /// <summary> /// Gets a strongly-typed value of the property on specified element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <returns>Property value.</returns> public override sealed global::System.String GetValue(Association element) { if (element == null) throw new global::System.ArgumentNullException("element"); // There is no storage for CollectionClass because its Kind is // set to CustomStorage. Please provide the GetCollectionClassValue() // method on the domain class. return element.GetCollectionClassValue(); } /// <summary> /// Sets property value on an element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <param name="newValue">New property value.</param> public override sealed void SetValue(Association element, global::System.String newValue) { if (element == null) throw new global::System.ArgumentNullException("element"); global::System.String oldValue = GetValue(element); if (newValue != oldValue) { ValueChanging(element, oldValue, newValue); // There is no storage for CollectionClass because its Kind is // set to CustomStorage. Please provide the SetCollectionClassValue() // method on the domain class. element.SetCollectionClassValue(newValue); ValueChanged(element, oldValue, GetValue(element)); } } } #endregion #region TargetDescription domain property code /// <summary> /// TargetDescription domain property Id. /// </summary> public static readonly global::System.Guid TargetDescriptionDomainPropertyId = new global::System.Guid(0x8983d9c4, 0xc5f3, 0x4eaa, 0xb8, 0xb2, 0x14, 0xd1, 0x8a, 0x85, 0x8f, 0x21); /// <summary> /// Storage for TargetDescription /// </summary> private global::System.String targetDescriptionPropertyStorage = string.Empty; /// <summary> /// Gets or sets the value of TargetDescription domain property. /// Detailed code documentation for this end of the association /// </summary> [System.ComponentModel.Editor(typeof(System.ComponentModel.Design.MultilineStringEditor), typeof(System.Drawing.Design.UITypeEditor))] [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.Association/TargetDescription.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::CategoryResource("Sawczyn.EFDesigner.EFModel.Association/TargetDescription.Category", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.Association/TargetDescription.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [global::System.ComponentModel.DefaultValue("")] [DslModeling::DomainObjectId("8983d9c4-c5f3-4eaa-b8b2-14d18a858f21")] public global::System.String TargetDescription { [global::System.Diagnostics.DebuggerStepThrough] get { return targetDescriptionPropertyStorage; } [global::System.Diagnostics.DebuggerStepThrough] set { TargetDescriptionPropertyHandler.Instance.SetValue(this, value); } } /// <summary> /// Value handler for the Association.TargetDescription domain property. /// </summary> internal sealed partial class TargetDescriptionPropertyHandler : DslModeling::DomainPropertyValueHandler<Association, global::System.String> { private TargetDescriptionPropertyHandler() { } /// <summary> /// Gets the singleton instance of the Association.TargetDescription domain property value handler. /// </summary> public static readonly TargetDescriptionPropertyHandler Instance = new TargetDescriptionPropertyHandler(); /// <summary> /// Gets the Id of the Association.TargetDescription domain property. /// </summary> public sealed override global::System.Guid DomainPropertyId { [global::System.Diagnostics.DebuggerStepThrough] get { return TargetDescriptionDomainPropertyId; } } /// <summary> /// Gets a strongly-typed value of the property on specified element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <returns>Property value.</returns> public override sealed global::System.String GetValue(Association element) { if (element == null) throw new global::System.ArgumentNullException("element"); return element.targetDescriptionPropertyStorage; } /// <summary> /// Sets property value on an element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <param name="newValue">New property value.</param> public override sealed void SetValue(Association element, global::System.String newValue) { if (element == null) throw new global::System.ArgumentNullException("element"); global::System.String oldValue = GetValue(element); if (newValue != oldValue) { ValueChanging(element, oldValue, newValue); element.targetDescriptionPropertyStorage = newValue; ValueChanged(element, oldValue, newValue); } } } #endregion #region TargetSummary domain property code /// <summary> /// TargetSummary domain property Id. /// </summary> public static readonly global::System.Guid TargetSummaryDomainPropertyId = new global::System.Guid(0xedec72cc, 0xc40b, 0x4c64, 0xb2, 0xd4, 0xe7, 0x13, 0xf6, 0x91, 0xec, 0xd0); /// <summary> /// Storage for TargetSummary /// </summary> private global::System.String targetSummaryPropertyStorage = string.Empty; /// <summary> /// Gets or sets the value of TargetSummary domain property. /// Short code documentation for this end of the association /// </summary> [System.ComponentModel.Editor(typeof(System.ComponentModel.Design.MultilineStringEditor), typeof(System.Drawing.Design.UITypeEditor))] [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.Association/TargetSummary.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::CategoryResource("Sawczyn.EFDesigner.EFModel.Association/TargetSummary.Category", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.Association/TargetSummary.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslModeling::DomainObjectId("edec72cc-c40b-4c64-b2d4-e713f691ecd0")] public global::System.String TargetSummary { [global::System.Diagnostics.DebuggerStepThrough] get { return targetSummaryPropertyStorage; } [global::System.Diagnostics.DebuggerStepThrough] set { TargetSummaryPropertyHandler.Instance.SetValue(this, value); } } /// <summary> /// Value handler for the Association.TargetSummary domain property. /// </summary> internal sealed partial class TargetSummaryPropertyHandler : DslModeling::DomainPropertyValueHandler<Association, global::System.String> { private TargetSummaryPropertyHandler() { } /// <summary> /// Gets the singleton instance of the Association.TargetSummary domain property value handler. /// </summary> public static readonly TargetSummaryPropertyHandler Instance = new TargetSummaryPropertyHandler(); /// <summary> /// Gets the Id of the Association.TargetSummary domain property. /// </summary> public sealed override global::System.Guid DomainPropertyId { [global::System.Diagnostics.DebuggerStepThrough] get { return TargetSummaryDomainPropertyId; } } /// <summary> /// Gets a strongly-typed value of the property on specified element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <returns>Property value.</returns> public override sealed global::System.String GetValue(Association element) { if (element == null) throw new global::System.ArgumentNullException("element"); return element.targetSummaryPropertyStorage; } /// <summary> /// Sets property value on an element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <param name="newValue">New property value.</param> public override sealed void SetValue(Association element, global::System.String newValue) { if (element == null) throw new global::System.ArgumentNullException("element"); global::System.String oldValue = GetValue(element); if (newValue != oldValue) { ValueChanging(element, oldValue, newValue); element.targetSummaryPropertyStorage = newValue; ValueChanged(element, oldValue, newValue); } } } #endregion #region Summary domain property code /// <summary> /// Summary domain property Id. /// </summary> public static readonly global::System.Guid SummaryDomainPropertyId = new global::System.Guid(0x53747127, 0xcd19, 0x43e0, 0xb3, 0x7b, 0x1b, 0x66, 0x9d, 0x50, 0x6e, 0xd2); /// <summary> /// Storage for Summary /// </summary> private global::System.String summaryPropertyStorage = string.Empty; /// <summary> /// Gets or sets the value of Summary domain property. /// Brief code documentation /// </summary> [System.ComponentModel.Editor(typeof(System.ComponentModel.Design.MultilineStringEditor), typeof(System.Drawing.Design.UITypeEditor))] [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.Association/Summary.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::CategoryResource("Sawczyn.EFDesigner.EFModel.Association/Summary.Category", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.Association/Summary.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [global::System.ComponentModel.Browsable(false)] [DslModeling::DomainObjectId("53747127-cd19-43e0-b37b-1b669d506ed2")] public global::System.String Summary { [global::System.Diagnostics.DebuggerStepThrough] get { return summaryPropertyStorage; } [global::System.Diagnostics.DebuggerStepThrough] set { SummaryPropertyHandler.Instance.SetValue(this, value); } } /// <summary> /// Value handler for the Association.Summary domain property. /// </summary> internal sealed partial class SummaryPropertyHandler : DslModeling::DomainPropertyValueHandler<Association, global::System.String> { private SummaryPropertyHandler() { } /// <summary> /// Gets the singleton instance of the Association.Summary domain property value handler. /// </summary> public static readonly SummaryPropertyHandler Instance = new SummaryPropertyHandler(); /// <summary> /// Gets the Id of the Association.Summary domain property. /// </summary> public sealed override global::System.Guid DomainPropertyId { [global::System.Diagnostics.DebuggerStepThrough] get { return SummaryDomainPropertyId; } } /// <summary> /// Gets a strongly-typed value of the property on specified element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <returns>Property value.</returns> public override sealed global::System.String GetValue(Association element) { if (element == null) throw new global::System.ArgumentNullException("element"); return element.summaryPropertyStorage; } /// <summary> /// Sets property value on an element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <param name="newValue">New property value.</param> public override sealed void SetValue(Association element, global::System.String newValue) { if (element == null) throw new global::System.ArgumentNullException("element"); global::System.String oldValue = GetValue(element); if (newValue != oldValue) { ValueChanging(element, oldValue, newValue); element.summaryPropertyStorage = newValue; ValueChanged(element, oldValue, newValue); } } } #endregion #region IsCollectionClassTracking domain property code /// <summary> /// IsCollectionClassTracking domain property Id. /// </summary> public static readonly global::System.Guid IsCollectionClassTrackingDomainPropertyId = new global::System.Guid(0xe73f6b6d, 0x22b1, 0x4dd7, 0x8d, 0x8d, 0x37, 0xb7, 0xf1, 0xca, 0xc4, 0xa0); /// <summary> /// Storage for IsCollectionClassTracking /// </summary> private global::System.Boolean isCollectionClassTrackingPropertyStorage = true; /// <summary> /// Gets or sets the value of IsCollectionClassTracking domain property. /// If true, Association.CollectionClass tracks ModelRoot.DefaultCollectionClass /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.Association/IsCollectionClassTracking.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.Association/IsCollectionClassTracking.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [global::System.ComponentModel.DefaultValue(true)] [global::System.ComponentModel.Browsable(false)] [DslModeling::DomainObjectId("e73f6b6d-22b1-4dd7-8d8d-37b7f1cac4a0")] public global::System.Boolean IsCollectionClassTracking { [global::System.Diagnostics.DebuggerStepThrough] get { return isCollectionClassTrackingPropertyStorage; } [global::System.Diagnostics.DebuggerStepThrough] set { IsCollectionClassTrackingPropertyHandler.Instance.SetValue(this, value); } } /// <summary> /// Value handler for the Association.IsCollectionClassTracking domain property. /// </summary> internal sealed partial class IsCollectionClassTrackingPropertyHandler : DslModeling::DomainPropertyValueHandler<Association, global::System.Boolean> { private IsCollectionClassTrackingPropertyHandler() { } /// <summary> /// Gets the singleton instance of the Association.IsCollectionClassTracking domain property value handler. /// </summary> public static readonly IsCollectionClassTrackingPropertyHandler Instance = new IsCollectionClassTrackingPropertyHandler(); /// <summary> /// Gets the Id of the Association.IsCollectionClassTracking domain property. /// </summary> public sealed override global::System.Guid DomainPropertyId { [global::System.Diagnostics.DebuggerStepThrough] get { return IsCollectionClassTrackingDomainPropertyId; } } /// <summary> /// Gets a strongly-typed value of the property on specified element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <returns>Property value.</returns> public override sealed global::System.Boolean GetValue(Association element) { if (element == null) throw new global::System.ArgumentNullException("element"); return element.isCollectionClassTrackingPropertyStorage; } /// <summary> /// Sets property value on an element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <param name="newValue">New property value.</param> public override sealed void SetValue(Association element, global::System.Boolean newValue) { if (element == null) throw new global::System.ArgumentNullException("element"); global::System.Boolean oldValue = GetValue(element); if (newValue != oldValue) { ValueChanging(element, oldValue, newValue); element.isCollectionClassTrackingPropertyStorage = newValue; ValueChanged(element, oldValue, newValue); } } } #endregion #region SourceRole domain property code /// <summary> /// SourceRole domain property Id. /// </summary> public static readonly global::System.Guid SourceRoleDomainPropertyId = new global::System.Guid(0x8f74b05b, 0x3bb2, 0x480b, 0x95, 0x13, 0x50, 0xef, 0xd9, 0x15, 0x88, 0xec); /// <summary> /// Storage for SourceRole /// </summary> private EndpointRole sourceRolePropertyStorage = EndpointRole.NotSet; /// <summary> /// Gets or sets the value of SourceRole domain property. /// Which object(s) in this association is/are the principal object(s)? /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.Association/SourceRole.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::CategoryResource("Sawczyn.EFDesigner.EFModel.Association/SourceRole.Category", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.Association/SourceRole.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [global::System.ComponentModel.DefaultValue(EndpointRole.NotSet)] [DslModeling::DomainObjectId("8f74b05b-3bb2-480b-9513-50efd91588ec")] public EndpointRole SourceRole { [global::System.Diagnostics.DebuggerStepThrough] get { return sourceRolePropertyStorage; } [global::System.Diagnostics.DebuggerStepThrough] set { SourceRolePropertyHandler.Instance.SetValue(this, value); } } /// <summary> /// Value handler for the Association.SourceRole domain property. /// </summary> internal sealed partial class SourceRolePropertyHandler : DslModeling::DomainPropertyValueHandler<Association, EndpointRole> { private SourceRolePropertyHandler() { } /// <summary> /// Gets the singleton instance of the Association.SourceRole domain property value handler. /// </summary> public static readonly SourceRolePropertyHandler Instance = new SourceRolePropertyHandler(); /// <summary> /// Gets the Id of the Association.SourceRole domain property. /// </summary> public sealed override global::System.Guid DomainPropertyId { [global::System.Diagnostics.DebuggerStepThrough] get { return SourceRoleDomainPropertyId; } } /// <summary> /// Gets a strongly-typed value of the property on specified element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <returns>Property value.</returns> public override sealed EndpointRole GetValue(Association element) { if (element == null) throw new global::System.ArgumentNullException("element"); return element.sourceRolePropertyStorage; } /// <summary> /// Sets property value on an element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <param name="newValue">New property value.</param> public override sealed void SetValue(Association element, EndpointRole newValue) { if (element == null) throw new global::System.ArgumentNullException("element"); EndpointRole oldValue = GetValue(element); if (newValue != oldValue) { ValueChanging(element, oldValue, newValue); element.sourceRolePropertyStorage = newValue; ValueChanged(element, oldValue, newValue); } } } #endregion #region TargetRole domain property code /// <summary> /// TargetRole domain property Id. /// </summary> public static readonly global::System.Guid TargetRoleDomainPropertyId = new global::System.Guid(0x2eb18350, 0x1736, 0x4c15, 0x84, 0xc4, 0x21, 0x91, 0x19, 0xa5, 0x6a, 0x2a); /// <summary> /// Storage for TargetRole /// </summary> private EndpointRole targetRolePropertyStorage = EndpointRole.NotSet; /// <summary> /// Gets or sets the value of TargetRole domain property. /// Which object(s) in this association is/are the dependent object(s)? /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.Association/TargetRole.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::CategoryResource("Sawczyn.EFDesigner.EFModel.Association/TargetRole.Category", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.Association/TargetRole.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [global::System.ComponentModel.DefaultValue(EndpointRole.NotSet)] [DslModeling::DomainObjectId("2eb18350-1736-4c15-84c4-219119a56a2a")] public EndpointRole TargetRole { [global::System.Diagnostics.DebuggerStepThrough] get { return targetRolePropertyStorage; } [global::System.Diagnostics.DebuggerStepThrough] set { TargetRolePropertyHandler.Instance.SetValue(this, value); } } /// <summary> /// Value handler for the Association.TargetRole domain property. /// </summary> internal sealed partial class TargetRolePropertyHandler : DslModeling::DomainPropertyValueHandler<Association, EndpointRole> { private TargetRolePropertyHandler() { } /// <summary> /// Gets the singleton instance of the Association.TargetRole domain property value handler. /// </summary> public static readonly TargetRolePropertyHandler Instance = new TargetRolePropertyHandler(); /// <summary> /// Gets the Id of the Association.TargetRole domain property. /// </summary> public sealed override global::System.Guid DomainPropertyId { [global::System.Diagnostics.DebuggerStepThrough] get { return TargetRoleDomainPropertyId; } } /// <summary> /// Gets a strongly-typed value of the property on specified element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <returns>Property value.</returns> public override sealed EndpointRole GetValue(Association element) { if (element == null) throw new global::System.ArgumentNullException("element"); return element.targetRolePropertyStorage; } /// <summary> /// Sets property value on an element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <param name="newValue">New property value.</param> public override sealed void SetValue(Association element, EndpointRole newValue) { if (element == null) throw new global::System.ArgumentNullException("element"); EndpointRole oldValue = GetValue(element); if (newValue != oldValue) { ValueChanging(element, oldValue, newValue); element.targetRolePropertyStorage = newValue; ValueChanged(element, oldValue, newValue); } } } #endregion #region ForeignKeyLocation domain property code /// <summary> /// ForeignKeyLocation domain property Id. /// </summary> public static readonly global::System.Guid ForeignKeyLocationDomainPropertyId = new global::System.Guid(0xc0b9ec69, 0x21ba, 0x432e, 0xa8, 0xe9, 0x3a, 0xfa, 0x83, 0xf8, 0xb2, 0xb7); /// <summary> /// Storage for ForeignKeyLocation /// </summary> private ForeignKeyOwner foreignKeyLocationPropertyStorage; /// <summary> /// Gets or sets the value of ForeignKeyLocation domain property. /// Which class should hold the foreign key for this relationship /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.Association/ForeignKeyLocation.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.Association/ForeignKeyLocation.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [global::System.ComponentModel.Browsable(false)] [global::System.ComponentModel.ReadOnly(true)] [DslModeling::DomainObjectId("c0b9ec69-21ba-432e-a8e9-3afa83f8b2b7")] public ForeignKeyOwner ForeignKeyLocation { [global::System.Diagnostics.DebuggerStepThrough] get { return foreignKeyLocationPropertyStorage; } [global::System.Diagnostics.DebuggerStepThrough] internal set { ForeignKeyLocationPropertyHandler.Instance.SetValue(this, value); } } /// <summary> /// Value handler for the Association.ForeignKeyLocation domain property. /// </summary> internal sealed partial class ForeignKeyLocationPropertyHandler : DslModeling::DomainPropertyValueHandler<Association, ForeignKeyOwner> { private ForeignKeyLocationPropertyHandler() { } /// <summary> /// Gets the singleton instance of the Association.ForeignKeyLocation domain property value handler. /// </summary> public static readonly ForeignKeyLocationPropertyHandler Instance = new ForeignKeyLocationPropertyHandler(); /// <summary> /// Gets the Id of the Association.ForeignKeyLocation domain property. /// </summary> public sealed override global::System.Guid DomainPropertyId { [global::System.Diagnostics.DebuggerStepThrough] get { return ForeignKeyLocationDomainPropertyId; } } /// <summary> /// Gets a strongly-typed value of the property on specified element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <returns>Property value.</returns> public override sealed ForeignKeyOwner GetValue(Association element) { if (element == null) throw new global::System.ArgumentNullException("element"); return element.foreignKeyLocationPropertyStorage; } /// <summary> /// Sets property value on an element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <param name="newValue">New property value.</param> public override sealed void SetValue(Association element, ForeignKeyOwner newValue) { if (element == null) throw new global::System.ArgumentNullException("element"); ForeignKeyOwner oldValue = GetValue(element); if (newValue != oldValue) { ValueChanging(element, oldValue, newValue); element.foreignKeyLocationPropertyStorage = newValue; ValueChanged(element, oldValue, newValue); } } } #endregion #region TargetCustomAttributes domain property code /// <summary> /// TargetCustomAttributes domain property Id. /// </summary> public static readonly global::System.Guid TargetCustomAttributesDomainPropertyId = new global::System.Guid(0xa667dd36, 0xac5c, 0x4c98, 0xb3, 0x68, 0xb8, 0x47, 0x78, 0xbd, 0xcd, 0x56); /// <summary> /// Storage for TargetCustomAttributes /// </summary> private global::System.String targetCustomAttributesPropertyStorage = string.Empty; /// <summary> /// Gets or sets the value of TargetCustomAttributes domain property. /// Any custom attributes to be generated for the target property. Will be passed /// through as entered. /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.Association/TargetCustomAttributes.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::CategoryResource("Sawczyn.EFDesigner.EFModel.Association/TargetCustomAttributes.Category", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.Association/TargetCustomAttributes.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslModeling::DomainObjectId("a667dd36-ac5c-4c98-b368-b84778bdcd56")] public global::System.String TargetCustomAttributes { [global::System.Diagnostics.DebuggerStepThrough] get { return targetCustomAttributesPropertyStorage; } [global::System.Diagnostics.DebuggerStepThrough] set { TargetCustomAttributesPropertyHandler.Instance.SetValue(this, value); } } /// <summary> /// Value handler for the Association.TargetCustomAttributes domain property. /// </summary> internal sealed partial class TargetCustomAttributesPropertyHandler : DslModeling::DomainPropertyValueHandler<Association, global::System.String> { private TargetCustomAttributesPropertyHandler() { } /// <summary> /// Gets the singleton instance of the Association.TargetCustomAttributes domain property value handler. /// </summary> public static readonly TargetCustomAttributesPropertyHandler Instance = new TargetCustomAttributesPropertyHandler(); /// <summary> /// Gets the Id of the Association.TargetCustomAttributes domain property. /// </summary> public sealed override global::System.Guid DomainPropertyId { [global::System.Diagnostics.DebuggerStepThrough] get { return TargetCustomAttributesDomainPropertyId; } } /// <summary> /// Gets a strongly-typed value of the property on specified element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <returns>Property value.</returns> public override sealed global::System.String GetValue(Association element) { if (element == null) throw new global::System.ArgumentNullException("element"); return element.targetCustomAttributesPropertyStorage; } /// <summary> /// Sets property value on an element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <param name="newValue">New property value.</param> public override sealed void SetValue(Association element, global::System.String newValue) { if (element == null) throw new global::System.ArgumentNullException("element"); global::System.String oldValue = GetValue(element); if (newValue != oldValue) { ValueChanging(element, oldValue, newValue); element.targetCustomAttributesPropertyStorage = newValue; ValueChanged(element, oldValue, newValue); } } } #endregion #region TargetDisplayText domain property code /// <summary> /// TargetDisplayText domain property Id. /// </summary> public static readonly global::System.Guid TargetDisplayTextDomainPropertyId = new global::System.Guid(0x4f71c60f, 0xe2d6, 0x475c, 0xb5, 0x45, 0x1a, 0xa1, 0x8d, 0x85, 0xd5, 0xab); /// <summary> /// Storage for TargetDisplayText /// </summary> private global::System.String targetDisplayTextPropertyStorage = string.Empty; /// <summary> /// Gets or sets the value of TargetDisplayText domain property. /// Text for [Display(Name="<text>")] attribute on this end's property /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.Association/TargetDisplayText.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::CategoryResource("Sawczyn.EFDesigner.EFModel.Association/TargetDisplayText.Category", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.Association/TargetDisplayText.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslModeling::DomainObjectId("4f71c60f-e2d6-475c-b545-1aa18d85d5ab")] public global::System.String TargetDisplayText { [global::System.Diagnostics.DebuggerStepThrough] get { return targetDisplayTextPropertyStorage; } [global::System.Diagnostics.DebuggerStepThrough] set { TargetDisplayTextPropertyHandler.Instance.SetValue(this, value); } } /// <summary> /// Value handler for the Association.TargetDisplayText domain property. /// </summary> internal sealed partial class TargetDisplayTextPropertyHandler : DslModeling::DomainPropertyValueHandler<Association, global::System.String> { private TargetDisplayTextPropertyHandler() { } /// <summary> /// Gets the singleton instance of the Association.TargetDisplayText domain property value handler. /// </summary> public static readonly TargetDisplayTextPropertyHandler Instance = new TargetDisplayTextPropertyHandler(); /// <summary> /// Gets the Id of the Association.TargetDisplayText domain property. /// </summary> public sealed override global::System.Guid DomainPropertyId { [global::System.Diagnostics.DebuggerStepThrough] get { return TargetDisplayTextDomainPropertyId; } } /// <summary> /// Gets a strongly-typed value of the property on specified element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <returns>Property value.</returns> public override sealed global::System.String GetValue(Association element) { if (element == null) throw new global::System.ArgumentNullException("element"); return element.targetDisplayTextPropertyStorage; } /// <summary> /// Sets property value on an element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <param name="newValue">New property value.</param> public override sealed void SetValue(Association element, global::System.String newValue) { if (element == null) throw new global::System.ArgumentNullException("element"); global::System.String oldValue = GetValue(element); if (newValue != oldValue) { ValueChanging(element, oldValue, newValue); element.targetDisplayTextPropertyStorage = newValue; ValueChanged(element, oldValue, newValue); } } } #endregion #region TargetImplementNotify domain property code /// <summary> /// TargetImplementNotify domain property Id. /// </summary> public static readonly global::System.Guid TargetImplementNotifyDomainPropertyId = new global::System.Guid(0x637b64d2, 0x193d, 0x47f9, 0xb6, 0x3f, 0xdf, 0x8c, 0xcc, 0x23, 0xf9, 0x00); /// <summary> /// Gets or sets the value of TargetImplementNotify domain property. /// Should this end participate in INotifyPropertyChanged activities? Only valid for /// non-collection targets. /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.Association/TargetImplementNotify.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::CategoryResource("Sawczyn.EFDesigner.EFModel.Association/TargetImplementNotify.Category", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.Association/TargetImplementNotify.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [global::System.ComponentModel.Browsable(false)] [DslModeling::DomainProperty(Kind = DslModeling::DomainPropertyKind.CustomStorage)] [DslModeling::DomainObjectId("637b64d2-193d-47f9-b63f-df8ccc23f900")] public global::System.Boolean TargetImplementNotify { [global::System.Diagnostics.DebuggerStepThrough] get { return TargetImplementNotifyPropertyHandler.Instance.GetValue(this); } [global::System.Diagnostics.DebuggerStepThrough] set { TargetImplementNotifyPropertyHandler.Instance.SetValue(this, value); } } /// <summary> /// Value handler for the Association.TargetImplementNotify domain property. /// </summary> internal sealed partial class TargetImplementNotifyPropertyHandler : DslModeling::DomainPropertyValueHandler<Association, global::System.Boolean> { private TargetImplementNotifyPropertyHandler() { } /// <summary> /// Gets the singleton instance of the Association.TargetImplementNotify domain property value handler. /// </summary> public static readonly TargetImplementNotifyPropertyHandler Instance = new TargetImplementNotifyPropertyHandler(); /// <summary> /// Gets the Id of the Association.TargetImplementNotify domain property. /// </summary> public sealed override global::System.Guid DomainPropertyId { [global::System.Diagnostics.DebuggerStepThrough] get { return TargetImplementNotifyDomainPropertyId; } } /// <summary> /// Gets a strongly-typed value of the property on specified element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <returns>Property value.</returns> public override sealed global::System.Boolean GetValue(Association element) { if (element == null) throw new global::System.ArgumentNullException("element"); // There is no storage for TargetImplementNotify because its Kind is // set to CustomStorage. Please provide the GetTargetImplementNotifyValue() // method on the domain class. return element.GetTargetImplementNotifyValue(); } /// <summary> /// Sets property value on an element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <param name="newValue">New property value.</param> public override sealed void SetValue(Association element, global::System.Boolean newValue) { if (element == null) throw new global::System.ArgumentNullException("element"); global::System.Boolean oldValue = GetValue(element); if (newValue != oldValue) { ValueChanging(element, oldValue, newValue); // There is no storage for TargetImplementNotify because its Kind is // set to CustomStorage. Please provide the SetTargetImplementNotifyValue() // method on the domain class. element.SetTargetImplementNotifyValue(newValue); ValueChanged(element, oldValue, GetValue(element)); } } } #endregion #region IsTargetImplementNotifyTracking domain property code /// <summary> /// IsTargetImplementNotifyTracking domain property Id. /// </summary> public static readonly global::System.Guid IsTargetImplementNotifyTrackingDomainPropertyId = new global::System.Guid(0x30a6413f, 0xab71, 0x4297, 0x9d, 0x37, 0xe5, 0x3f, 0x0e, 0xda, 0x88, 0x7f); /// <summary> /// Storage for IsTargetImplementNotifyTracking /// </summary> private global::System.Boolean isTargetImplementNotifyTrackingPropertyStorage = true; /// <summary> /// Gets or sets the value of IsTargetImplementNotifyTracking domain property. /// Description for Sawczyn.EFDesigner.EFModel.Association.Is Target Implement /// Notify Tracking /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.Association/IsTargetImplementNotifyTracking.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.Association/IsTargetImplementNotifyTracking.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [global::System.ComponentModel.DefaultValue(true)] [global::System.ComponentModel.Browsable(false)] [DslModeling::DomainObjectId("30a6413f-ab71-4297-9d37-e53f0eda887f")] public global::System.Boolean IsTargetImplementNotifyTracking { [global::System.Diagnostics.DebuggerStepThrough] get { return isTargetImplementNotifyTrackingPropertyStorage; } [global::System.Diagnostics.DebuggerStepThrough] set { IsTargetImplementNotifyTrackingPropertyHandler.Instance.SetValue(this, value); } } /// <summary> /// Value handler for the Association.IsTargetImplementNotifyTracking domain property. /// </summary> internal sealed partial class IsTargetImplementNotifyTrackingPropertyHandler : DslModeling::DomainPropertyValueHandler<Association, global::System.Boolean> { private IsTargetImplementNotifyTrackingPropertyHandler() { } /// <summary> /// Gets the singleton instance of the Association.IsTargetImplementNotifyTracking domain property value handler. /// </summary> public static readonly IsTargetImplementNotifyTrackingPropertyHandler Instance = new IsTargetImplementNotifyTrackingPropertyHandler(); /// <summary> /// Gets the Id of the Association.IsTargetImplementNotifyTracking domain property. /// </summary> public sealed override global::System.Guid DomainPropertyId { [global::System.Diagnostics.DebuggerStepThrough] get { return IsTargetImplementNotifyTrackingDomainPropertyId; } } /// <summary> /// Gets a strongly-typed value of the property on specified element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <returns>Property value.</returns> public override sealed global::System.Boolean GetValue(Association element) { if (element == null) throw new global::System.ArgumentNullException("element"); return element.isTargetImplementNotifyTrackingPropertyStorage; } /// <summary> /// Sets property value on an element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <param name="newValue">New property value.</param> public override sealed void SetValue(Association element, global::System.Boolean newValue) { if (element == null) throw new global::System.ArgumentNullException("element"); global::System.Boolean oldValue = GetValue(element); if (newValue != oldValue) { ValueChanging(element, oldValue, newValue); element.isTargetImplementNotifyTrackingPropertyStorage = newValue; ValueChanged(element, oldValue, newValue); } } } #endregion #region FKPropertyName domain property code /// <summary> /// FKPropertyName domain property Id. /// </summary> public static readonly global::System.Guid FKPropertyNameDomainPropertyId = new global::System.Guid(0x1d5c6e0b, 0x4942, 0x4504, 0x97, 0x1d, 0x93, 0x01, 0xbe, 0x5e, 0x07, 0xf1); /// <summary> /// Storage for FKPropertyName /// </summary> private global::System.String fKPropertyNamePropertyStorage = string.Empty; /// <summary> /// Gets or sets the value of FKPropertyName domain property. /// Name of property holding foreign key value for this association /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.Association/FKPropertyName.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::CategoryResource("Sawczyn.EFDesigner.EFModel.Association/FKPropertyName.Category", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.Association/FKPropertyName.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslModeling::DomainObjectId("1d5c6e0b-4942-4504-971d-9301be5e07f1")] public global::System.String FKPropertyName { [global::System.Diagnostics.DebuggerStepThrough] get { return fKPropertyNamePropertyStorage; } [global::System.Diagnostics.DebuggerStepThrough] set { FKPropertyNamePropertyHandler.Instance.SetValue(this, value); } } /// <summary> /// Value handler for the Association.FKPropertyName domain property. /// </summary> internal sealed partial class FKPropertyNamePropertyHandler : DslModeling::DomainPropertyValueHandler<Association, global::System.String> { private FKPropertyNamePropertyHandler() { } /// <summary> /// Gets the singleton instance of the Association.FKPropertyName domain property value handler. /// </summary> public static readonly FKPropertyNamePropertyHandler Instance = new FKPropertyNamePropertyHandler(); /// <summary> /// Gets the Id of the Association.FKPropertyName domain property. /// </summary> public sealed override global::System.Guid DomainPropertyId { [global::System.Diagnostics.DebuggerStepThrough] get { return FKPropertyNameDomainPropertyId; } } /// <summary> /// Gets a strongly-typed value of the property on specified element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <returns>Property value.</returns> public override sealed global::System.String GetValue(Association element) { if (element == null) throw new global::System.ArgumentNullException("element"); return element.fKPropertyNamePropertyStorage; } /// <summary> /// Sets property value on an element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <param name="newValue">New property value.</param> public override sealed void SetValue(Association element, global::System.String newValue) { if (element == null) throw new global::System.ArgumentNullException("element"); global::System.String oldValue = GetValue(element); if (newValue != oldValue) { ValueChanging(element, oldValue, newValue); element.fKPropertyNamePropertyStorage = newValue; ValueChanged(element, oldValue, newValue); } } } #endregion #region TargetPropertyNameDisplay domain property code /// <summary> /// TargetPropertyNameDisplay domain property Id. /// </summary> public static readonly global::System.Guid TargetPropertyNameDisplayDomainPropertyId = new global::System.Guid(0x0b56420b, 0x5f48, 0x4e04, 0x92, 0x88, 0x6d, 0x6a, 0x6f, 0x12, 0xce, 0x9f); /// <summary> /// Gets or sets the value of TargetPropertyNameDisplay domain property. /// Decorator text /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.Association/TargetPropertyNameDisplay.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::CategoryResource("Sawczyn.EFDesigner.EFModel.Association/TargetPropertyNameDisplay.Category", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.Association/TargetPropertyNameDisplay.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [global::System.ComponentModel.Browsable(false)] [global::System.ComponentModel.ReadOnly(true)] [DslModeling::DomainProperty(Kind = DslModeling::DomainPropertyKind.Calculated)] [DslModeling::DomainObjectId("0b56420b-5f48-4e04-9288-6d6a6f12ce9f")] public global::System.String TargetPropertyNameDisplay { [global::System.Diagnostics.DebuggerStepThrough] get { return TargetPropertyNameDisplayPropertyHandler.Instance.GetValue(this); } } /// <summary> /// Value handler for the Association.TargetPropertyNameDisplay domain property. /// </summary> internal sealed partial class TargetPropertyNameDisplayPropertyHandler : DslModeling::CalculatedPropertyValueHandler<Association, global::System.String> { private TargetPropertyNameDisplayPropertyHandler() { } /// <summary> /// Gets the singleton instance of the Association.TargetPropertyNameDisplay domain property value handler. /// </summary> public static readonly TargetPropertyNameDisplayPropertyHandler Instance = new TargetPropertyNameDisplayPropertyHandler(); /// <summary> /// Gets the Id of the Association.TargetPropertyNameDisplay domain property. /// </summary> public sealed override global::System.Guid DomainPropertyId { [global::System.Diagnostics.DebuggerStepThrough] get { return TargetPropertyNameDisplayDomainPropertyId; } } /// <summary> /// Gets a strongly-typed value of the property on specified element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <returns>Property value.</returns> public override sealed global::System.String GetValue(Association element) { if (element == null) throw new global::System.ArgumentNullException("element"); // There is no storage for TargetPropertyNameDisplay because its Kind is // set to Calculated. Please provide the GetTargetPropertyNameDisplayValue() // method on the domain class. return element.GetTargetPropertyNameDisplayValue(); } } #endregion #region Name domain property code /// <summary> /// Name domain property Id. /// </summary> public static readonly global::System.Guid NameDomainPropertyId = new global::System.Guid(0x21f7d7e2, 0xe0bc, 0x4d59, 0xb7, 0x76, 0x55, 0xa5, 0x67, 0xc1, 0x6c, 0xb0); /// <summary> /// Gets or sets the value of Name domain property. /// Solely for display in the object list of the VStudio property window /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.Association/Name.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.Association/Name.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [global::System.ComponentModel.Browsable(false)] [global::System.ComponentModel.ReadOnly(true)] [DslModeling::ElementName] [DslModeling::DomainProperty(Kind = DslModeling::DomainPropertyKind.Calculated)] [DslModeling::DomainObjectId("21f7d7e2-e0bc-4d59-b776-55a567c16cb0")] public global::System.String Name { [global::System.Diagnostics.DebuggerStepThrough] get { return NamePropertyHandler.Instance.GetValue(this); } } /// <summary> /// Value handler for the Association.Name domain property. /// </summary> internal sealed partial class NamePropertyHandler : DslModeling::CalculatedPropertyValueHandler<Association, global::System.String> { private NamePropertyHandler() { } /// <summary> /// Gets the singleton instance of the Association.Name domain property value handler. /// </summary> public static readonly NamePropertyHandler Instance = new NamePropertyHandler(); /// <summary> /// Gets the Id of the Association.Name domain property. /// </summary> public sealed override global::System.Guid DomainPropertyId { [global::System.Diagnostics.DebuggerStepThrough] get { return NameDomainPropertyId; } } /// <summary> /// Gets a strongly-typed value of the property on specified element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <returns>Property value.</returns> public override sealed global::System.String GetValue(Association element) { if (element == null) throw new global::System.ArgumentNullException("element"); // There is no storage for Name because its Kind is // set to Calculated. Please provide the GetNameValue() // method on the domain class. return element.GetNameValue(); } } #endregion #region JoinTableName domain property code /// <summary> /// JoinTableName domain property Id. /// </summary> public static readonly global::System.Guid JoinTableNameDomainPropertyId = new global::System.Guid(0x37a67510, 0x4e09, 0x4d8b, 0xa0, 0xb1, 0xa3, 0x40, 0x1b, 0x2a, 0x5f, 0x15); /// <summary> /// Storage for JoinTableName /// </summary> private global::System.String joinTableNamePropertyStorage = string.Empty; /// <summary> /// Gets or sets the value of JoinTableName domain property. /// Optional name of the database table used to join the two end classes for /// many-to-many associations. If empty, a reasonable default name will be used. /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.Association/JoinTableName.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::CategoryResource("Sawczyn.EFDesigner.EFModel.Association/JoinTableName.Category", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.Association/JoinTableName.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [global::System.ComponentModel.DefaultValue("")] [DslModeling::DomainObjectId("37a67510-4e09-4d8b-a0b1-a3401b2a5f15")] public global::System.String JoinTableName { [global::System.Diagnostics.DebuggerStepThrough] get { return joinTableNamePropertyStorage; } [global::System.Diagnostics.DebuggerStepThrough] set { JoinTableNamePropertyHandler.Instance.SetValue(this, value); } } /// <summary> /// Value handler for the Association.JoinTableName domain property. /// </summary> internal sealed partial class JoinTableNamePropertyHandler : DslModeling::DomainPropertyValueHandler<Association, global::System.String> { private JoinTableNamePropertyHandler() { } /// <summary> /// Gets the singleton instance of the Association.JoinTableName domain property value handler. /// </summary> public static readonly JoinTableNamePropertyHandler Instance = new JoinTableNamePropertyHandler(); /// <summary> /// Gets the Id of the Association.JoinTableName domain property. /// </summary> public sealed override global::System.Guid DomainPropertyId { [global::System.Diagnostics.DebuggerStepThrough] get { return JoinTableNameDomainPropertyId; } } /// <summary> /// Gets a strongly-typed value of the property on specified element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <returns>Property value.</returns> public override sealed global::System.String GetValue(Association element) { if (element == null) throw new global::System.ArgumentNullException("element"); return element.joinTableNamePropertyStorage; } /// <summary> /// Sets property value on an element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <param name="newValue">New property value.</param> public override sealed void SetValue(Association element, global::System.String newValue) { if (element == null) throw new global::System.ArgumentNullException("element"); global::System.String oldValue = GetValue(element); if (newValue != oldValue) { ValueChanging(element, oldValue, newValue); element.joinTableNamePropertyStorage = newValue; ValueChanged(element, oldValue, newValue); } } } #endregion #region Source link accessor /// <summary> /// Get the list of Association links to a ModelClass. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::System.Collections.ObjectModel.ReadOnlyCollection<global::Sawczyn.EFDesigner.EFModel.Association> GetLinksToTargets ( global::Sawczyn.EFDesigner.EFModel.ModelClass sourceInstance ) { return DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.Association>(sourceInstance, global::Sawczyn.EFDesigner.EFModel.Association.SourceDomainRoleId); } #endregion #region Target link accessor /// <summary> /// Get the list of Association links to a ModelClass. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::System.Collections.ObjectModel.ReadOnlyCollection<global::Sawczyn.EFDesigner.EFModel.Association> GetLinksToSources ( global::Sawczyn.EFDesigner.EFModel.ModelClass targetInstance ) { return DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.Association>(targetInstance, global::Sawczyn.EFDesigner.EFModel.Association.TargetDomainRoleId); } #endregion #region Association instance accessors /// <summary> /// Get any Association links between a given ModelClass and a ModelClass. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::System.Collections.ObjectModel.ReadOnlyCollection<global::Sawczyn.EFDesigner.EFModel.Association> GetLinks( global::Sawczyn.EFDesigner.EFModel.ModelClass source, global::Sawczyn.EFDesigner.EFModel.ModelClass target ) { global::System.Collections.Generic.List<global::Sawczyn.EFDesigner.EFModel.Association> outLinks = new global::System.Collections.Generic.List<global::Sawczyn.EFDesigner.EFModel.Association>(); global::System.Collections.Generic.IList<global::Sawczyn.EFDesigner.EFModel.Association> links = DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.Association>(source, global::Sawczyn.EFDesigner.EFModel.Association.SourceDomainRoleId); foreach ( global::Sawczyn.EFDesigner.EFModel.Association link in links ) { if ( target.Equals(link.Target) ) { outLinks.Add(link); } } return outLinks.AsReadOnly(); } #endregion } } namespace Sawczyn.EFDesigner.EFModel { /// <summary> /// DomainRelationship UnidirectionalAssociation /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.UnidirectionalAssociation.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.UnidirectionalAssociation.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslModeling::DomainModelOwner(typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel))] [global::System.CLSCompliant(true)] [DslModeling::DomainRelationship(AllowsDuplicates = true)] [DslModeling::DomainObjectId("71aa98ea-ecd0-4096-b185-5c63efa364eb")] public partial class UnidirectionalAssociation : Association { #region Constructors, domain class Id /// <summary> /// UnidirectionalAssociation domain class Id. /// </summary> public static readonly new global::System.Guid DomainClassId = new global::System.Guid(0x71aa98ea, 0xecd0, 0x4096, 0xb1, 0x85, 0x5c, 0x63, 0xef, 0xa3, 0x64, 0xeb); /// <summary> /// Constructor /// Creates a UnidirectionalAssociation link in the same Partition as the given ModelClass /// </summary> /// <param name="source">ModelClass to use as the source of the relationship.</param> /// <param name="target">ModelClass to use as the target of the relationship.</param> public UnidirectionalAssociation(ModelClass source, ModelClass target) : base((source != null ? source.Partition : null), new DslModeling::RoleAssignment[]{new DslModeling::RoleAssignment(UnidirectionalAssociation.UnidirectionalSourceDomainRoleId, source), new DslModeling::RoleAssignment(UnidirectionalAssociation.UnidirectionalTargetDomainRoleId, target)}, null) { } /// <summary> /// Constructor /// </summary> /// <param name="store">Store where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> public UnidirectionalAssociation(DslModeling::Store store, params DslModeling::RoleAssignment[] roleAssignments) : base(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, roleAssignments, null) { } /// <summary> /// Constructor /// </summary> /// <param name="store">Store where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> /// <param name="propertyAssignments">List of properties assignments to set on the new link.</param> public UnidirectionalAssociation(DslModeling::Store store, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments) : base(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, roleAssignments, propertyAssignments) { } /// <summary> /// Constructor /// </summary> /// <param name="partition">Partition where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> public UnidirectionalAssociation(DslModeling::Partition partition, params DslModeling::RoleAssignment[] roleAssignments) : base(partition, roleAssignments, null) { } /// <summary> /// Constructor /// </summary> /// <param name="partition">Partition where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> /// <param name="propertyAssignments">List of properties assignments to set on the new link.</param> public UnidirectionalAssociation(DslModeling::Partition partition, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments) : base(partition, roleAssignments, propertyAssignments) { } #endregion #region UnidirectionalSource domain role code /// <summary> /// UnidirectionalSource domain role Id. /// </summary> public static readonly global::System.Guid UnidirectionalSourceDomainRoleId = new global::System.Guid(0x2ece6e4a, 0x4505, 0x4e70, 0x8f, 0x12, 0x59, 0x52, 0x5a, 0xca, 0xe9, 0x45); /// <summary> /// DomainRole UnidirectionalSource /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.UnidirectionalAssociation/UnidirectionalSource.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.UnidirectionalAssociation/UnidirectionalSource.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslModeling::DomainRole(DslModeling::DomainRoleOrder.Source, PropertyName = "UnidirectionalTargets", PropertyDisplayNameKey="Sawczyn.EFDesigner.EFModel.UnidirectionalAssociation/UnidirectionalSource.PropertyDisplayName", PropagatesCopy = DslModeling::PropagatesCopyOption.DoNotPropagateCopy, Multiplicity = DslModeling::Multiplicity.ZeroMany)] [DslModeling::DomainObjectId("2ece6e4a-4505-4e70-8f12-59525acae945")] public virtual ModelClass UnidirectionalSource { [global::System.Diagnostics.DebuggerStepThrough] get { return (ModelClass)DslModeling::DomainRoleInfo.GetRolePlayer(this, UnidirectionalSourceDomainRoleId); } [global::System.Diagnostics.DebuggerStepThrough] set { DslModeling::DomainRoleInfo.SetRolePlayer(this, UnidirectionalSourceDomainRoleId, value); } } #endregion #region Static methods to access UnidirectionalSources of a ModelClass /// <summary> /// Gets a list of UnidirectionalSources. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static DslModeling::LinkedElementCollection<ModelClass> GetUnidirectionalSources(ModelClass element) { return GetRoleCollection<DslModeling::LinkedElementCollection<ModelClass>, ModelClass>(element, UnidirectionalTargetDomainRoleId); } #endregion #region Source domain role override /// <summary> /// Gets the element playing UnidirectionalSource domain role. /// </summary> public override ModelClass Source { [global::System.Diagnostics.DebuggerStepThrough] get { return this.UnidirectionalSource; } [global::System.Diagnostics.DebuggerStepThrough] set { this.UnidirectionalSource = value; } } #endregion #region UnidirectionalTarget domain role code /// <summary> /// UnidirectionalTarget domain role Id. /// </summary> public static readonly global::System.Guid UnidirectionalTargetDomainRoleId = new global::System.Guid(0x0cd8b649, 0x09aa, 0x4c6b, 0x9e, 0x7a, 0x95, 0x08, 0x8c, 0x24, 0x6e, 0x5f); /// <summary> /// DomainRole UnidirectionalTarget /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.UnidirectionalAssociation/UnidirectionalTarget.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.UnidirectionalAssociation/UnidirectionalTarget.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslModeling::DomainRole(DslModeling::DomainRoleOrder.Target, PropertyName = "UnidirectionalSources", PropertyDisplayNameKey="Sawczyn.EFDesigner.EFModel.UnidirectionalAssociation/UnidirectionalTarget.PropertyDisplayName", PropagatesCopy = DslModeling::PropagatesCopyOption.DoNotPropagateCopy, Multiplicity = DslModeling::Multiplicity.ZeroMany)] [DslModeling::DomainObjectId("0cd8b649-09aa-4c6b-9e7a-95088c246e5f")] public virtual ModelClass UnidirectionalTarget { [global::System.Diagnostics.DebuggerStepThrough] get { return (ModelClass)DslModeling::DomainRoleInfo.GetRolePlayer(this, UnidirectionalTargetDomainRoleId); } [global::System.Diagnostics.DebuggerStepThrough] set { DslModeling::DomainRoleInfo.SetRolePlayer(this, UnidirectionalTargetDomainRoleId, value); } } #endregion #region Static methods to access UnidirectionalTargets of a ModelClass /// <summary> /// Gets a list of UnidirectionalTargets. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static DslModeling::LinkedElementCollection<ModelClass> GetUnidirectionalTargets(ModelClass element) { return GetRoleCollection<DslModeling::LinkedElementCollection<ModelClass>, ModelClass>(element, UnidirectionalSourceDomainRoleId); } #endregion #region Target domain role override /// <summary> /// Gets the element playing UnidirectionalTarget domain role. /// </summary> public override ModelClass Target { [global::System.Diagnostics.DebuggerStepThrough] get { return this.UnidirectionalTarget; } [global::System.Diagnostics.DebuggerStepThrough] set { this.UnidirectionalTarget = value; } } #endregion #region UnidirectionalSource link accessor /// <summary> /// Get the list of UnidirectionalAssociation links to a ModelClass. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::System.Collections.ObjectModel.ReadOnlyCollection<global::Sawczyn.EFDesigner.EFModel.UnidirectionalAssociation> GetLinksToUnidirectionalTargets ( global::Sawczyn.EFDesigner.EFModel.ModelClass unidirectionalSourceInstance ) { return DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.UnidirectionalAssociation>(unidirectionalSourceInstance, global::Sawczyn.EFDesigner.EFModel.UnidirectionalAssociation.UnidirectionalSourceDomainRoleId); } #endregion #region UnidirectionalTarget link accessor /// <summary> /// Get the list of UnidirectionalAssociation links to a ModelClass. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::System.Collections.ObjectModel.ReadOnlyCollection<global::Sawczyn.EFDesigner.EFModel.UnidirectionalAssociation> GetLinksToUnidirectionalSources ( global::Sawczyn.EFDesigner.EFModel.ModelClass unidirectionalTargetInstance ) { return DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.UnidirectionalAssociation>(unidirectionalTargetInstance, global::Sawczyn.EFDesigner.EFModel.UnidirectionalAssociation.UnidirectionalTargetDomainRoleId); } #endregion #region UnidirectionalAssociation instance accessors /// <summary> /// Get any UnidirectionalAssociation links between a given ModelClass and a ModelClass. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static new global::System.Collections.ObjectModel.ReadOnlyCollection<global::Sawczyn.EFDesigner.EFModel.UnidirectionalAssociation> GetLinks( global::Sawczyn.EFDesigner.EFModel.ModelClass source, global::Sawczyn.EFDesigner.EFModel.ModelClass target ) { global::System.Collections.Generic.List<global::Sawczyn.EFDesigner.EFModel.UnidirectionalAssociation> outLinks = new global::System.Collections.Generic.List<global::Sawczyn.EFDesigner.EFModel.UnidirectionalAssociation>(); global::System.Collections.Generic.IList<global::Sawczyn.EFDesigner.EFModel.UnidirectionalAssociation> links = DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.UnidirectionalAssociation>(source, global::Sawczyn.EFDesigner.EFModel.UnidirectionalAssociation.UnidirectionalSourceDomainRoleId); foreach ( global::Sawczyn.EFDesigner.EFModel.UnidirectionalAssociation link in links ) { if ( target.Equals(link.UnidirectionalTarget) ) { outLinks.Add(link); } } return outLinks.AsReadOnly(); } #endregion } } namespace Sawczyn.EFDesigner.EFModel { /// <summary> /// DomainRelationship ClassHasAttributes /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.ClassHasAttributes.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.ClassHasAttributes.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslModeling::DomainModelOwner(typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel))] [global::System.CLSCompliant(true)] [DslModeling::DomainRelationship(IsEmbedding=true)] [DslModeling::DomainObjectId("75261e55-91dc-47d5-aa17-0eceb29660b5")] public partial class ClassHasAttributes : DslModeling::ElementLink { #region Constructors, domain class Id /// <summary> /// ClassHasAttributes domain class Id. /// </summary> public static readonly new global::System.Guid DomainClassId = new global::System.Guid(0x75261e55, 0x91dc, 0x47d5, 0xaa, 0x17, 0x0e, 0xce, 0xb2, 0x96, 0x60, 0xb5); /// <summary> /// Constructor /// Creates a ClassHasAttributes link in the same Partition as the given ModelClass /// </summary> /// <param name="source">ModelClass to use as the source of the relationship.</param> /// <param name="target">ModelAttribute to use as the target of the relationship.</param> public ClassHasAttributes(ModelClass source, ModelAttribute target) : base((source != null ? source.Partition : null), new DslModeling::RoleAssignment[]{new DslModeling::RoleAssignment(ClassHasAttributes.ModelClassDomainRoleId, source), new DslModeling::RoleAssignment(ClassHasAttributes.AttributeDomainRoleId, target)}, null) { } /// <summary> /// Constructor /// </summary> /// <param name="store">Store where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> public ClassHasAttributes(DslModeling::Store store, params DslModeling::RoleAssignment[] roleAssignments) : base(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, roleAssignments, null) { } /// <summary> /// Constructor /// </summary> /// <param name="store">Store where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> /// <param name="propertyAssignments">List of properties assignments to set on the new link.</param> public ClassHasAttributes(DslModeling::Store store, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments) : base(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, roleAssignments, propertyAssignments) { } /// <summary> /// Constructor /// </summary> /// <param name="partition">Partition where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> public ClassHasAttributes(DslModeling::Partition partition, params DslModeling::RoleAssignment[] roleAssignments) : base(partition, roleAssignments, null) { } /// <summary> /// Constructor /// </summary> /// <param name="partition">Partition where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> /// <param name="propertyAssignments">List of properties assignments to set on the new link.</param> public ClassHasAttributes(DslModeling::Partition partition, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments) : base(partition, roleAssignments, propertyAssignments) { } #endregion #region ModelClass domain role code /// <summary> /// ModelClass domain role Id. /// </summary> public static readonly global::System.Guid ModelClassDomainRoleId = new global::System.Guid(0x97fe55a1, 0x616b, 0x4c9e, 0x89, 0xbe, 0x2a, 0x8e, 0x41, 0xe8, 0xeb, 0xaa); /// <summary> /// DomainRole ModelClass /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.ClassHasAttributes/ModelClass.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.ClassHasAttributes/ModelClass.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslModeling::DomainRole(DslModeling::DomainRoleOrder.Source, PropertyName = "Attributes", PropertyDisplayNameKey="Sawczyn.EFDesigner.EFModel.ClassHasAttributes/ModelClass.PropertyDisplayName", PropagatesCopy = DslModeling::PropagatesCopyOption.PropagatesCopyToLinkAndOppositeRolePlayer, Multiplicity = DslModeling::Multiplicity.ZeroMany)] [DslModeling::DomainObjectId("97fe55a1-616b-4c9e-89be-2a8e41e8ebaa")] public virtual ModelClass ModelClass { [global::System.Diagnostics.DebuggerStepThrough] get { return (ModelClass)DslModeling::DomainRoleInfo.GetRolePlayer(this, ModelClassDomainRoleId); } [global::System.Diagnostics.DebuggerStepThrough] set { DslModeling::DomainRoleInfo.SetRolePlayer(this, ModelClassDomainRoleId, value); } } #endregion #region Static methods to access ModelClass of a ModelAttribute /// <summary> /// Gets ModelClass. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static ModelClass GetModelClass(ModelAttribute element) { return DslModeling::DomainRoleInfo.GetLinkedElement(element, AttributeDomainRoleId) as ModelClass; } /// <summary> /// Sets ModelClass. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static void SetModelClass(ModelAttribute element, ModelClass newModelClass) { DslModeling::DomainRoleInfo.SetLinkedElement(element, AttributeDomainRoleId, newModelClass); } #endregion #region Attribute domain role code /// <summary> /// Attribute domain role Id. /// </summary> public static readonly global::System.Guid AttributeDomainRoleId = new global::System.Guid(0x970ec7f5, 0xc880, 0x454c, 0xab, 0x1d, 0xd5, 0x70, 0x63, 0x15, 0xc5, 0x30); /// <summary> /// DomainRole Attribute /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.ClassHasAttributes/Attribute.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.ClassHasAttributes/Attribute.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslModeling::DomainRole(DslModeling::DomainRoleOrder.Target, PropertyName = "ModelClass", PropertyDisplayNameKey="Sawczyn.EFDesigner.EFModel.ClassHasAttributes/Attribute.PropertyDisplayName", PropagatesDelete = true, PropagatesCopy = DslModeling::PropagatesCopyOption.DoNotPropagateCopy, Multiplicity = DslModeling::Multiplicity.ZeroOne)] [DslModeling::DomainObjectId("970ec7f5-c880-454c-ab1d-d5706315c530")] public virtual ModelAttribute Attribute { [global::System.Diagnostics.DebuggerStepThrough] get { return (ModelAttribute)DslModeling::DomainRoleInfo.GetRolePlayer(this, AttributeDomainRoleId); } [global::System.Diagnostics.DebuggerStepThrough] set { DslModeling::DomainRoleInfo.SetRolePlayer(this, AttributeDomainRoleId, value); } } #endregion #region Static methods to access Attributes of a ModelClass /// <summary> /// Gets a list of Attributes. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static DslModeling::LinkedElementCollection<ModelAttribute> GetAttributes(ModelClass element) { return GetRoleCollection<DslModeling::LinkedElementCollection<ModelAttribute>, ModelAttribute>(element, ModelClassDomainRoleId); } #endregion #region ModelClass link accessor /// <summary> /// Get the list of ClassHasAttributes links to a ModelClass. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::System.Collections.ObjectModel.ReadOnlyCollection<global::Sawczyn.EFDesigner.EFModel.ClassHasAttributes> GetLinksToAttributes ( global::Sawczyn.EFDesigner.EFModel.ModelClass modelClassInstance ) { return DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.ClassHasAttributes>(modelClassInstance, global::Sawczyn.EFDesigner.EFModel.ClassHasAttributes.ModelClassDomainRoleId); } #endregion #region Attribute link accessor /// <summary> /// Get the ClassHasAttributes link to a ModelAttribute. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::Sawczyn.EFDesigner.EFModel.ClassHasAttributes GetLinkToModelClass (global::Sawczyn.EFDesigner.EFModel.ModelAttribute attributeInstance) { global::System.Collections.Generic.IList<global::Sawczyn.EFDesigner.EFModel.ClassHasAttributes> links = DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.ClassHasAttributes>(attributeInstance, global::Sawczyn.EFDesigner.EFModel.ClassHasAttributes.AttributeDomainRoleId); global::System.Diagnostics.Debug.Assert(links.Count <= 1, "Multiplicity of Attribute not obeyed."); if ( links.Count == 0 ) { return null; } else { return links[0]; } } #endregion #region ClassHasAttributes instance accessors /// <summary> /// Get any ClassHasAttributes links between a given ModelClass and a ModelAttribute. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::System.Collections.ObjectModel.ReadOnlyCollection<global::Sawczyn.EFDesigner.EFModel.ClassHasAttributes> GetLinks( global::Sawczyn.EFDesigner.EFModel.ModelClass source, global::Sawczyn.EFDesigner.EFModel.ModelAttribute target ) { global::System.Collections.Generic.List<global::Sawczyn.EFDesigner.EFModel.ClassHasAttributes> outLinks = new global::System.Collections.Generic.List<global::Sawczyn.EFDesigner.EFModel.ClassHasAttributes>(); global::System.Collections.Generic.IList<global::Sawczyn.EFDesigner.EFModel.ClassHasAttributes> links = DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.ClassHasAttributes>(source, global::Sawczyn.EFDesigner.EFModel.ClassHasAttributes.ModelClassDomainRoleId); foreach ( global::Sawczyn.EFDesigner.EFModel.ClassHasAttributes link in links ) { if ( target.Equals(link.Attribute) ) { outLinks.Add(link); } } return outLinks.AsReadOnly(); } /// <summary> /// Get the one ClassHasAttributes link between a given ModelClassand a ModelAttribute. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::Sawczyn.EFDesigner.EFModel.ClassHasAttributes GetLink( global::Sawczyn.EFDesigner.EFModel.ModelClass source, global::Sawczyn.EFDesigner.EFModel.ModelAttribute target ) { global::System.Collections.Generic.IList<global::Sawczyn.EFDesigner.EFModel.ClassHasAttributes> links = DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.ClassHasAttributes>(source, global::Sawczyn.EFDesigner.EFModel.ClassHasAttributes.ModelClassDomainRoleId); foreach ( global::Sawczyn.EFDesigner.EFModel.ClassHasAttributes link in links ) { if ( target.Equals(link.Attribute) ) { return link; } } return null; } #endregion } } namespace Sawczyn.EFDesigner.EFModel { /// <summary> /// DomainRelationship ModelRootHasComments /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.ModelRootHasComments.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.ModelRootHasComments.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslModeling::DomainModelOwner(typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel))] [global::System.CLSCompliant(true)] [DslModeling::DomainRelationship(IsEmbedding=true)] [DslModeling::DomainObjectId("f531650c-f0d4-47a2-be7c-c3a564194629")] public partial class ModelRootHasComments : DslModeling::ElementLink { #region Constructors, domain class Id /// <summary> /// ModelRootHasComments domain class Id. /// </summary> public static readonly new global::System.Guid DomainClassId = new global::System.Guid(0xf531650c, 0xf0d4, 0x47a2, 0xbe, 0x7c, 0xc3, 0xa5, 0x64, 0x19, 0x46, 0x29); /// <summary> /// Constructor /// Creates a ModelRootHasComments link in the same Partition as the given ModelRoot /// </summary> /// <param name="source">ModelRoot to use as the source of the relationship.</param> /// <param name="target">Comment to use as the target of the relationship.</param> public ModelRootHasComments(ModelRoot source, Comment target) : base((source != null ? source.Partition : null), new DslModeling::RoleAssignment[]{new DslModeling::RoleAssignment(ModelRootHasComments.ModelRootDomainRoleId, source), new DslModeling::RoleAssignment(ModelRootHasComments.CommentDomainRoleId, target)}, null) { } /// <summary> /// Constructor /// </summary> /// <param name="store">Store where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> public ModelRootHasComments(DslModeling::Store store, params DslModeling::RoleAssignment[] roleAssignments) : base(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, roleAssignments, null) { } /// <summary> /// Constructor /// </summary> /// <param name="store">Store where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> /// <param name="propertyAssignments">List of properties assignments to set on the new link.</param> public ModelRootHasComments(DslModeling::Store store, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments) : base(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, roleAssignments, propertyAssignments) { } /// <summary> /// Constructor /// </summary> /// <param name="partition">Partition where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> public ModelRootHasComments(DslModeling::Partition partition, params DslModeling::RoleAssignment[] roleAssignments) : base(partition, roleAssignments, null) { } /// <summary> /// Constructor /// </summary> /// <param name="partition">Partition where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> /// <param name="propertyAssignments">List of properties assignments to set on the new link.</param> public ModelRootHasComments(DslModeling::Partition partition, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments) : base(partition, roleAssignments, propertyAssignments) { } #endregion #region ModelRoot domain role code /// <summary> /// ModelRoot domain role Id. /// </summary> public static readonly global::System.Guid ModelRootDomainRoleId = new global::System.Guid(0xab8f00b5, 0xd976, 0x4ffa, 0xb9, 0xda, 0xbe, 0x28, 0x5a, 0xcb, 0xbe, 0x91); /// <summary> /// DomainRole ModelRoot /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.ModelRootHasComments/ModelRoot.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.ModelRootHasComments/ModelRoot.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslModeling::DomainRole(DslModeling::DomainRoleOrder.Source, PropertyName = "Comments", PropertyDisplayNameKey="Sawczyn.EFDesigner.EFModel.ModelRootHasComments/ModelRoot.PropertyDisplayName", PropagatesCopy = DslModeling::PropagatesCopyOption.PropagatesCopyToLinkAndOppositeRolePlayer, Multiplicity = DslModeling::Multiplicity.ZeroMany)] [DslModeling::DomainObjectId("ab8f00b5-d976-4ffa-b9da-be285acbbe91")] public virtual ModelRoot ModelRoot { [global::System.Diagnostics.DebuggerStepThrough] get { return (ModelRoot)DslModeling::DomainRoleInfo.GetRolePlayer(this, ModelRootDomainRoleId); } [global::System.Diagnostics.DebuggerStepThrough] set { DslModeling::DomainRoleInfo.SetRolePlayer(this, ModelRootDomainRoleId, value); } } #endregion #region Static methods to access ModelRoot of a Comment /// <summary> /// Gets ModelRoot. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static ModelRoot GetModelRoot(Comment element) { return DslModeling::DomainRoleInfo.GetLinkedElement(element, CommentDomainRoleId) as ModelRoot; } /// <summary> /// Sets ModelRoot. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static void SetModelRoot(Comment element, ModelRoot newModelRoot) { DslModeling::DomainRoleInfo.SetLinkedElement(element, CommentDomainRoleId, newModelRoot); } #endregion #region Comment domain role code /// <summary> /// Comment domain role Id. /// </summary> public static readonly global::System.Guid CommentDomainRoleId = new global::System.Guid(0xe13a639c, 0xa993, 0x4cf5, 0x9c, 0x8d, 0xac, 0xa5, 0x2b, 0x7a, 0xea, 0xb6); /// <summary> /// DomainRole Comment /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.ModelRootHasComments/Comment.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.ModelRootHasComments/Comment.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslModeling::DomainRole(DslModeling::DomainRoleOrder.Target, PropertyName = "ModelRoot", PropertyDisplayNameKey="Sawczyn.EFDesigner.EFModel.ModelRootHasComments/Comment.PropertyDisplayName", PropagatesDelete = true, PropagatesCopy = DslModeling::PropagatesCopyOption.DoNotPropagateCopy, Multiplicity = DslModeling::Multiplicity.One)] [DslModeling::DomainObjectId("e13a639c-a993-4cf5-9c8d-aca52b7aeab6")] public virtual Comment Comment { [global::System.Diagnostics.DebuggerStepThrough] get { return (Comment)DslModeling::DomainRoleInfo.GetRolePlayer(this, CommentDomainRoleId); } [global::System.Diagnostics.DebuggerStepThrough] set { DslModeling::DomainRoleInfo.SetRolePlayer(this, CommentDomainRoleId, value); } } #endregion #region Static methods to access Comments of a ModelRoot /// <summary> /// Gets a list of Comments. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static DslModeling::LinkedElementCollection<Comment> GetComments(ModelRoot element) { return GetRoleCollection<DslModeling::LinkedElementCollection<Comment>, Comment>(element, ModelRootDomainRoleId); } #endregion #region ModelRoot link accessor /// <summary> /// Get the list of ModelRootHasComments links to a ModelRoot. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::System.Collections.ObjectModel.ReadOnlyCollection<global::Sawczyn.EFDesigner.EFModel.ModelRootHasComments> GetLinksToComments ( global::Sawczyn.EFDesigner.EFModel.ModelRoot modelRootInstance ) { return DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.ModelRootHasComments>(modelRootInstance, global::Sawczyn.EFDesigner.EFModel.ModelRootHasComments.ModelRootDomainRoleId); } #endregion #region Comment link accessor /// <summary> /// Get the ModelRootHasComments link to a Comment. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::Sawczyn.EFDesigner.EFModel.ModelRootHasComments GetLinkToModelRoot (global::Sawczyn.EFDesigner.EFModel.Comment commentInstance) { global::System.Collections.Generic.IList<global::Sawczyn.EFDesigner.EFModel.ModelRootHasComments> links = DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.ModelRootHasComments>(commentInstance, global::Sawczyn.EFDesigner.EFModel.ModelRootHasComments.CommentDomainRoleId); global::System.Diagnostics.Debug.Assert(links.Count <= 1, "Multiplicity of Comment not obeyed."); if ( links.Count == 0 ) { return null; } else { return links[0]; } } #endregion #region ModelRootHasComments instance accessors /// <summary> /// Get any ModelRootHasComments links between a given ModelRoot and a Comment. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::System.Collections.ObjectModel.ReadOnlyCollection<global::Sawczyn.EFDesigner.EFModel.ModelRootHasComments> GetLinks( global::Sawczyn.EFDesigner.EFModel.ModelRoot source, global::Sawczyn.EFDesigner.EFModel.Comment target ) { global::System.Collections.Generic.List<global::Sawczyn.EFDesigner.EFModel.ModelRootHasComments> outLinks = new global::System.Collections.Generic.List<global::Sawczyn.EFDesigner.EFModel.ModelRootHasComments>(); global::System.Collections.Generic.IList<global::Sawczyn.EFDesigner.EFModel.ModelRootHasComments> links = DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.ModelRootHasComments>(source, global::Sawczyn.EFDesigner.EFModel.ModelRootHasComments.ModelRootDomainRoleId); foreach ( global::Sawczyn.EFDesigner.EFModel.ModelRootHasComments link in links ) { if ( target.Equals(link.Comment) ) { outLinks.Add(link); } } return outLinks.AsReadOnly(); } /// <summary> /// Get the one ModelRootHasComments link between a given ModelRootand a Comment. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::Sawczyn.EFDesigner.EFModel.ModelRootHasComments GetLink( global::Sawczyn.EFDesigner.EFModel.ModelRoot source, global::Sawczyn.EFDesigner.EFModel.Comment target ) { global::System.Collections.Generic.IList<global::Sawczyn.EFDesigner.EFModel.ModelRootHasComments> links = DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.ModelRootHasComments>(source, global::Sawczyn.EFDesigner.EFModel.ModelRootHasComments.ModelRootDomainRoleId); foreach ( global::Sawczyn.EFDesigner.EFModel.ModelRootHasComments link in links ) { if ( target.Equals(link.Comment) ) { return link; } } return null; } #endregion } } namespace Sawczyn.EFDesigner.EFModel { /// <summary> /// DomainRelationship Generalization /// Inheritance between Classes. /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.Generalization.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.Generalization.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslModeling::DomainModelOwner(typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel))] [global::System.CLSCompliant(true)] [global::System.Diagnostics.DebuggerDisplay("{GetType().Name,nq} (Name = {Name})")] [DslModeling::DomainRelationship()] [DslModeling::DomainObjectId("c6eff342-0a73-4d2f-aa0e-b2811663fb60")] public partial class Generalization : DslModeling::ElementLink { #region Constructors, domain class Id /// <summary> /// Generalization domain class Id. /// </summary> public static readonly new global::System.Guid DomainClassId = new global::System.Guid(0xc6eff342, 0x0a73, 0x4d2f, 0xaa, 0x0e, 0xb2, 0x81, 0x16, 0x63, 0xfb, 0x60); /// <summary> /// Constructor /// Creates a Generalization link in the same Partition as the given ModelClass /// </summary> /// <param name="source">ModelClass to use as the source of the relationship.</param> /// <param name="target">ModelClass to use as the target of the relationship.</param> public Generalization(ModelClass source, ModelClass target) : base((source != null ? source.Partition : null), new DslModeling::RoleAssignment[]{new DslModeling::RoleAssignment(Generalization.SuperclassDomainRoleId, source), new DslModeling::RoleAssignment(Generalization.SubclassDomainRoleId, target)}, null) { } /// <summary> /// Constructor /// </summary> /// <param name="store">Store where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> public Generalization(DslModeling::Store store, params DslModeling::RoleAssignment[] roleAssignments) : base(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, roleAssignments, null) { } /// <summary> /// Constructor /// </summary> /// <param name="store">Store where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> /// <param name="propertyAssignments">List of properties assignments to set on the new link.</param> public Generalization(DslModeling::Store store, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments) : base(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, roleAssignments, propertyAssignments) { } /// <summary> /// Constructor /// </summary> /// <param name="partition">Partition where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> public Generalization(DslModeling::Partition partition, params DslModeling::RoleAssignment[] roleAssignments) : base(partition, roleAssignments, null) { } /// <summary> /// Constructor /// </summary> /// <param name="partition">Partition where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> /// <param name="propertyAssignments">List of properties assignments to set on the new link.</param> public Generalization(DslModeling::Partition partition, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments) : base(partition, roleAssignments, propertyAssignments) { } #endregion #region Superclass domain role code /// <summary> /// Superclass domain role Id. /// </summary> public static readonly global::System.Guid SuperclassDomainRoleId = new global::System.Guid(0x6df2e060, 0xabe4, 0x4aae, 0xa9, 0xe7, 0xae, 0x6f, 0xb3, 0x8c, 0xa1, 0xc3); /// <summary> /// DomainRole Superclass /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.Generalization/Superclass.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.Generalization/Superclass.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslModeling::DomainRole(DslModeling::DomainRoleOrder.Source, PropertyName = "Subclasses", PropertyDisplayNameKey="Sawczyn.EFDesigner.EFModel.Generalization/Superclass.PropertyDisplayName", PropagatesCopy = DslModeling::PropagatesCopyOption.DoNotPropagateCopy, Multiplicity = DslModeling::Multiplicity.ZeroMany)] [DslModeling::DomainObjectId("6df2e060-abe4-4aae-a9e7-ae6fb38ca1c3")] public virtual ModelClass Superclass { [global::System.Diagnostics.DebuggerStepThrough] get { return (ModelClass)DslModeling::DomainRoleInfo.GetRolePlayer(this, SuperclassDomainRoleId); } [global::System.Diagnostics.DebuggerStepThrough] set { DslModeling::DomainRoleInfo.SetRolePlayer(this, SuperclassDomainRoleId, value); } } #endregion #region Static methods to access Superclass of a ModelClass /// <summary> /// Gets Superclass. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static ModelClass GetSuperclass(ModelClass element) { return DslModeling::DomainRoleInfo.GetLinkedElement(element, SubclassDomainRoleId) as ModelClass; } /// <summary> /// Sets Superclass. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static void SetSuperclass(ModelClass element, ModelClass newSuperclass) { DslModeling::DomainRoleInfo.SetLinkedElement(element, SubclassDomainRoleId, newSuperclass); } #endregion #region Subclass domain role code /// <summary> /// Subclass domain role Id. /// </summary> public static readonly global::System.Guid SubclassDomainRoleId = new global::System.Guid(0xd805f6db, 0xaa0c, 0x42e0, 0xb4, 0x1d, 0xa4, 0xff, 0x89, 0x8c, 0x64, 0x04); /// <summary> /// DomainRole Subclass /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.Generalization/Subclass.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.Generalization/Subclass.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [global::System.ComponentModel.Browsable(false)] [DslModeling::DomainRole(DslModeling::DomainRoleOrder.Target, PropertyName = "Superclass", PropertyDisplayNameKey="Sawczyn.EFDesigner.EFModel.Generalization/Subclass.PropertyDisplayName", PropagatesCopy = DslModeling::PropagatesCopyOption.DoNotPropagateCopy, Multiplicity = DslModeling::Multiplicity.ZeroOne)] [DslModeling::DomainObjectId("d805f6db-aa0c-42e0-b41d-a4ff898c6404")] public virtual ModelClass Subclass { [global::System.Diagnostics.DebuggerStepThrough] get { return (ModelClass)DslModeling::DomainRoleInfo.GetRolePlayer(this, SubclassDomainRoleId); } [global::System.Diagnostics.DebuggerStepThrough] set { DslModeling::DomainRoleInfo.SetRolePlayer(this, SubclassDomainRoleId, value); } } #endregion #region Static methods to access Subclasses of a ModelClass /// <summary> /// Gets a list of Subclasses. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static DslModeling::LinkedElementCollection<ModelClass> GetSubclasses(ModelClass element) { return GetRoleCollection<DslModeling::LinkedElementCollection<ModelClass>, ModelClass>(element, SuperclassDomainRoleId); } #endregion #region Name domain property code /// <summary> /// Name domain property Id. /// </summary> public static readonly global::System.Guid NameDomainPropertyId = new global::System.Guid(0x76e2afe8, 0x4124, 0x448f, 0x83, 0xe1, 0xb6, 0xbe, 0xf1, 0xd1, 0xe9, 0xd7); /// <summary> /// Gets or sets the value of Name domain property. /// Solely for display in the object list of the VStudio property window /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.Generalization/Name.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.Generalization/Name.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [global::System.ComponentModel.Browsable(false)] [global::System.ComponentModel.ReadOnly(true)] [DslModeling::ElementName] [DslModeling::DomainProperty(Kind = DslModeling::DomainPropertyKind.Calculated)] [DslModeling::DomainObjectId("76e2afe8-4124-448f-83e1-b6bef1d1e9d7")] public global::System.String Name { [global::System.Diagnostics.DebuggerStepThrough] get { return NamePropertyHandler.Instance.GetValue(this); } } /// <summary> /// Value handler for the Generalization.Name domain property. /// </summary> internal sealed partial class NamePropertyHandler : DslModeling::CalculatedPropertyValueHandler<Generalization, global::System.String> { private NamePropertyHandler() { } /// <summary> /// Gets the singleton instance of the Generalization.Name domain property value handler. /// </summary> public static readonly NamePropertyHandler Instance = new NamePropertyHandler(); /// <summary> /// Gets the Id of the Generalization.Name domain property. /// </summary> public sealed override global::System.Guid DomainPropertyId { [global::System.Diagnostics.DebuggerStepThrough] get { return NameDomainPropertyId; } } /// <summary> /// Gets a strongly-typed value of the property on specified element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <returns>Property value.</returns> public override sealed global::System.String GetValue(Generalization element) { if (element == null) throw new global::System.ArgumentNullException("element"); // There is no storage for Name because its Kind is // set to Calculated. Please provide the GetNameValue() // method on the domain class. return element.GetNameValue(); } } #endregion #region Superclass link accessor /// <summary> /// Get the list of Generalization links to a ModelClass. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::System.Collections.ObjectModel.ReadOnlyCollection<global::Sawczyn.EFDesigner.EFModel.Generalization> GetLinksToSubclasses ( global::Sawczyn.EFDesigner.EFModel.ModelClass superclassInstance ) { return DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.Generalization>(superclassInstance, global::Sawczyn.EFDesigner.EFModel.Generalization.SuperclassDomainRoleId); } #endregion #region Subclass link accessor /// <summary> /// Get the Generalization link to a ModelClass. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::Sawczyn.EFDesigner.EFModel.Generalization GetLinkToSuperclass (global::Sawczyn.EFDesigner.EFModel.ModelClass subclassInstance) { global::System.Collections.Generic.IList<global::Sawczyn.EFDesigner.EFModel.Generalization> links = DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.Generalization>(subclassInstance, global::Sawczyn.EFDesigner.EFModel.Generalization.SubclassDomainRoleId); global::System.Diagnostics.Debug.Assert(links.Count <= 1, "Multiplicity of Subclass not obeyed."); if ( links.Count == 0 ) { return null; } else { return links[0]; } } #endregion #region Generalization instance accessors /// <summary> /// Get any Generalization links between a given ModelClass and a ModelClass. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::System.Collections.ObjectModel.ReadOnlyCollection<global::Sawczyn.EFDesigner.EFModel.Generalization> GetLinks( global::Sawczyn.EFDesigner.EFModel.ModelClass source, global::Sawczyn.EFDesigner.EFModel.ModelClass target ) { global::System.Collections.Generic.List<global::Sawczyn.EFDesigner.EFModel.Generalization> outLinks = new global::System.Collections.Generic.List<global::Sawczyn.EFDesigner.EFModel.Generalization>(); global::System.Collections.Generic.IList<global::Sawczyn.EFDesigner.EFModel.Generalization> links = DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.Generalization>(source, global::Sawczyn.EFDesigner.EFModel.Generalization.SuperclassDomainRoleId); foreach ( global::Sawczyn.EFDesigner.EFModel.Generalization link in links ) { if ( target.Equals(link.Subclass) ) { outLinks.Add(link); } } return outLinks.AsReadOnly(); } /// <summary> /// Get the one Generalization link between a given ModelClassand a ModelClass. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::Sawczyn.EFDesigner.EFModel.Generalization GetLink( global::Sawczyn.EFDesigner.EFModel.ModelClass source, global::Sawczyn.EFDesigner.EFModel.ModelClass target ) { global::System.Collections.Generic.IList<global::Sawczyn.EFDesigner.EFModel.Generalization> links = DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.Generalization>(source, global::Sawczyn.EFDesigner.EFModel.Generalization.SuperclassDomainRoleId); foreach ( global::Sawczyn.EFDesigner.EFModel.Generalization link in links ) { if ( target.Equals(link.Subclass) ) { return link; } } return null; } #endregion } } namespace Sawczyn.EFDesigner.EFModel { /// <summary> /// DomainRelationship BidirectionalAssociation /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.BidirectionalAssociation.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.BidirectionalAssociation.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslModeling::DomainModelOwner(typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel))] [global::System.CLSCompliant(true)] [DslModeling::DomainRelationship(AllowsDuplicates = true)] [DslModeling::DomainObjectId("73a40ac4-1b7a-4b4a-8099-3783fabcca5b")] public partial class BidirectionalAssociation : Association { #region Constructors, domain class Id /// <summary> /// BidirectionalAssociation domain class Id. /// </summary> public static readonly new global::System.Guid DomainClassId = new global::System.Guid(0x73a40ac4, 0x1b7a, 0x4b4a, 0x80, 0x99, 0x37, 0x83, 0xfa, 0xbc, 0xca, 0x5b); /// <summary> /// Constructor /// Creates a BidirectionalAssociation link in the same Partition as the given ModelClass /// </summary> /// <param name="source">ModelClass to use as the source of the relationship.</param> /// <param name="target">ModelClass to use as the target of the relationship.</param> public BidirectionalAssociation(ModelClass source, ModelClass target) : base((source != null ? source.Partition : null), new DslModeling::RoleAssignment[]{new DslModeling::RoleAssignment(BidirectionalAssociation.BidirectionalSourceDomainRoleId, source), new DslModeling::RoleAssignment(BidirectionalAssociation.BidirectionalTargetDomainRoleId, target)}, null) { } /// <summary> /// Constructor /// </summary> /// <param name="store">Store where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> public BidirectionalAssociation(DslModeling::Store store, params DslModeling::RoleAssignment[] roleAssignments) : base(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, roleAssignments, null) { } /// <summary> /// Constructor /// </summary> /// <param name="store">Store where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> /// <param name="propertyAssignments">List of properties assignments to set on the new link.</param> public BidirectionalAssociation(DslModeling::Store store, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments) : base(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, roleAssignments, propertyAssignments) { } /// <summary> /// Constructor /// </summary> /// <param name="partition">Partition where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> public BidirectionalAssociation(DslModeling::Partition partition, params DslModeling::RoleAssignment[] roleAssignments) : base(partition, roleAssignments, null) { } /// <summary> /// Constructor /// </summary> /// <param name="partition">Partition where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> /// <param name="propertyAssignments">List of properties assignments to set on the new link.</param> public BidirectionalAssociation(DslModeling::Partition partition, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments) : base(partition, roleAssignments, propertyAssignments) { } #endregion #region BidirectionalSource domain role code /// <summary> /// BidirectionalSource domain role Id. /// </summary> public static readonly global::System.Guid BidirectionalSourceDomainRoleId = new global::System.Guid(0xa775052d, 0xa6a9, 0x4916, 0x8c, 0x4a, 0x1b, 0xd7, 0x72, 0x4b, 0x6e, 0x8b); /// <summary> /// DomainRole BidirectionalSource /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.BidirectionalAssociation/BidirectionalSource.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.BidirectionalAssociation/BidirectionalSource.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslModeling::DomainRole(DslModeling::DomainRoleOrder.Source, PropertyName = "BidirectionalTargets", PropertyDisplayNameKey="Sawczyn.EFDesigner.EFModel.BidirectionalAssociation/BidirectionalSource.PropertyDisplayName", PropagatesCopy = DslModeling::PropagatesCopyOption.DoNotPropagateCopy, Multiplicity = DslModeling::Multiplicity.ZeroMany)] [DslModeling::DomainObjectId("a775052d-a6a9-4916-8c4a-1bd7724b6e8b")] public virtual ModelClass BidirectionalSource { [global::System.Diagnostics.DebuggerStepThrough] get { return (ModelClass)DslModeling::DomainRoleInfo.GetRolePlayer(this, BidirectionalSourceDomainRoleId); } [global::System.Diagnostics.DebuggerStepThrough] set { DslModeling::DomainRoleInfo.SetRolePlayer(this, BidirectionalSourceDomainRoleId, value); } } #endregion #region Static methods to access BidirectionalSources of a ModelClass /// <summary> /// Gets a list of BidirectionalSources. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static DslModeling::LinkedElementCollection<ModelClass> GetBidirectionalSources(ModelClass element) { return GetRoleCollection<DslModeling::LinkedElementCollection<ModelClass>, ModelClass>(element, BidirectionalTargetDomainRoleId); } #endregion #region Source domain role override /// <summary> /// Gets the element playing BidirectionalSource domain role. /// </summary> public override ModelClass Source { [global::System.Diagnostics.DebuggerStepThrough] get { return this.BidirectionalSource; } [global::System.Diagnostics.DebuggerStepThrough] set { this.BidirectionalSource = value; } } #endregion #region BidirectionalTarget domain role code /// <summary> /// BidirectionalTarget domain role Id. /// </summary> public static readonly global::System.Guid BidirectionalTargetDomainRoleId = new global::System.Guid(0x59ead621, 0xa9cd, 0x4372, 0xb4, 0x8f, 0x27, 0x72, 0x53, 0x0d, 0x09, 0xe4); /// <summary> /// DomainRole BidirectionalTarget /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.BidirectionalAssociation/BidirectionalTarget.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.BidirectionalAssociation/BidirectionalTarget.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslModeling::DomainRole(DslModeling::DomainRoleOrder.Target, PropertyName = "BidirectionalSources", PropertyDisplayNameKey="Sawczyn.EFDesigner.EFModel.BidirectionalAssociation/BidirectionalTarget.PropertyDisplayName", PropagatesCopy = DslModeling::PropagatesCopyOption.DoNotPropagateCopy, Multiplicity = DslModeling::Multiplicity.ZeroMany)] [DslModeling::DomainObjectId("59ead621-a9cd-4372-b48f-2772530d09e4")] public virtual ModelClass BidirectionalTarget { [global::System.Diagnostics.DebuggerStepThrough] get { return (ModelClass)DslModeling::DomainRoleInfo.GetRolePlayer(this, BidirectionalTargetDomainRoleId); } [global::System.Diagnostics.DebuggerStepThrough] set { DslModeling::DomainRoleInfo.SetRolePlayer(this, BidirectionalTargetDomainRoleId, value); } } #endregion #region Static methods to access BidirectionalTargets of a ModelClass /// <summary> /// Gets a list of BidirectionalTargets. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static DslModeling::LinkedElementCollection<ModelClass> GetBidirectionalTargets(ModelClass element) { return GetRoleCollection<DslModeling::LinkedElementCollection<ModelClass>, ModelClass>(element, BidirectionalSourceDomainRoleId); } #endregion #region Target domain role override /// <summary> /// Gets the element playing BidirectionalTarget domain role. /// </summary> public override ModelClass Target { [global::System.Diagnostics.DebuggerStepThrough] get { return this.BidirectionalTarget; } [global::System.Diagnostics.DebuggerStepThrough] set { this.BidirectionalTarget = value; } } #endregion #region SourcePropertyName domain property code /// <summary> /// SourcePropertyName domain property Id. /// </summary> public static readonly global::System.Guid SourcePropertyNameDomainPropertyId = new global::System.Guid(0x1e0e43de, 0x1ed5, 0x42e9, 0x9c, 0x81, 0x8f, 0xee, 0x8d, 0x85, 0xb4, 0xcf); /// <summary> /// Storage for SourcePropertyName /// </summary> private global::System.String sourcePropertyNamePropertyStorage = string.Empty; /// <summary> /// Gets or sets the value of SourcePropertyName domain property. /// Name of the entity property that returns the value at this end /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.BidirectionalAssociation/SourcePropertyName.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::CategoryResource("Sawczyn.EFDesigner.EFModel.BidirectionalAssociation/SourcePropertyName.Category", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.BidirectionalAssociation/SourcePropertyName.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [global::System.ComponentModel.DefaultValue("")] [DslModeling::DomainObjectId("1e0e43de-1ed5-42e9-9c81-8fee8d85b4cf")] public global::System.String SourcePropertyName { [global::System.Diagnostics.DebuggerStepThrough] get { return sourcePropertyNamePropertyStorage; } [global::System.Diagnostics.DebuggerStepThrough] set { SourcePropertyNamePropertyHandler.Instance.SetValue(this, value); } } /// <summary> /// Value handler for the BidirectionalAssociation.SourcePropertyName domain property. /// </summary> internal sealed partial class SourcePropertyNamePropertyHandler : DslModeling::DomainPropertyValueHandler<BidirectionalAssociation, global::System.String> { private SourcePropertyNamePropertyHandler() { } /// <summary> /// Gets the singleton instance of the BidirectionalAssociation.SourcePropertyName domain property value handler. /// </summary> public static readonly SourcePropertyNamePropertyHandler Instance = new SourcePropertyNamePropertyHandler(); /// <summary> /// Gets the Id of the BidirectionalAssociation.SourcePropertyName domain property. /// </summary> public sealed override global::System.Guid DomainPropertyId { [global::System.Diagnostics.DebuggerStepThrough] get { return SourcePropertyNameDomainPropertyId; } } /// <summary> /// Gets a strongly-typed value of the property on specified element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <returns>Property value.</returns> public override sealed global::System.String GetValue(BidirectionalAssociation element) { if (element == null) throw new global::System.ArgumentNullException("element"); return element.sourcePropertyNamePropertyStorage; } /// <summary> /// Sets property value on an element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <param name="newValue">New property value.</param> public override sealed void SetValue(BidirectionalAssociation element, global::System.String newValue) { if (element == null) throw new global::System.ArgumentNullException("element"); global::System.String oldValue = GetValue(element); if (newValue != oldValue) { ValueChanging(element, oldValue, newValue); element.sourcePropertyNamePropertyStorage = newValue; ValueChanged(element, oldValue, newValue); } } } #endregion #region SourceDescription domain property code /// <summary> /// SourceDescription domain property Id. /// </summary> public static readonly global::System.Guid SourceDescriptionDomainPropertyId = new global::System.Guid(0x378e5c5a, 0x9eb0, 0x4d42, 0xad, 0x4c, 0x7f, 0xec, 0xa0, 0x17, 0x69, 0x95); /// <summary> /// Storage for SourceDescription /// </summary> private global::System.String sourceDescriptionPropertyStorage = string.Empty; /// <summary> /// Gets or sets the value of SourceDescription domain property. /// Detailed code documentation for this end of the association /// </summary> [System.ComponentModel.Editor(typeof(System.ComponentModel.Design.MultilineStringEditor), typeof(System.Drawing.Design.UITypeEditor))] [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.BidirectionalAssociation/SourceDescription.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::CategoryResource("Sawczyn.EFDesigner.EFModel.BidirectionalAssociation/SourceDescription.Category", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.BidirectionalAssociation/SourceDescription.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [global::System.ComponentModel.DefaultValue("")] [DslModeling::DomainObjectId("378e5c5a-9eb0-4d42-ad4c-7feca0176995")] public global::System.String SourceDescription { [global::System.Diagnostics.DebuggerStepThrough] get { return sourceDescriptionPropertyStorage; } [global::System.Diagnostics.DebuggerStepThrough] set { SourceDescriptionPropertyHandler.Instance.SetValue(this, value); } } /// <summary> /// Value handler for the BidirectionalAssociation.SourceDescription domain property. /// </summary> internal sealed partial class SourceDescriptionPropertyHandler : DslModeling::DomainPropertyValueHandler<BidirectionalAssociation, global::System.String> { private SourceDescriptionPropertyHandler() { } /// <summary> /// Gets the singleton instance of the BidirectionalAssociation.SourceDescription domain property value handler. /// </summary> public static readonly SourceDescriptionPropertyHandler Instance = new SourceDescriptionPropertyHandler(); /// <summary> /// Gets the Id of the BidirectionalAssociation.SourceDescription domain property. /// </summary> public sealed override global::System.Guid DomainPropertyId { [global::System.Diagnostics.DebuggerStepThrough] get { return SourceDescriptionDomainPropertyId; } } /// <summary> /// Gets a strongly-typed value of the property on specified element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <returns>Property value.</returns> public override sealed global::System.String GetValue(BidirectionalAssociation element) { if (element == null) throw new global::System.ArgumentNullException("element"); return element.sourceDescriptionPropertyStorage; } /// <summary> /// Sets property value on an element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <param name="newValue">New property value.</param> public override sealed void SetValue(BidirectionalAssociation element, global::System.String newValue) { if (element == null) throw new global::System.ArgumentNullException("element"); global::System.String oldValue = GetValue(element); if (newValue != oldValue) { ValueChanging(element, oldValue, newValue); element.sourceDescriptionPropertyStorage = newValue; ValueChanged(element, oldValue, newValue); } } } #endregion #region SourceSummary domain property code /// <summary> /// SourceSummary domain property Id. /// </summary> public static readonly global::System.Guid SourceSummaryDomainPropertyId = new global::System.Guid(0x73bbc365, 0x57ca, 0x4f07, 0xa8, 0x34, 0x9f, 0xe6, 0x60, 0x5b, 0x76, 0xd0); /// <summary> /// Storage for SourceSummary /// </summary> private global::System.String sourceSummaryPropertyStorage = string.Empty; /// <summary> /// Gets or sets the value of SourceSummary domain property. /// Short code documentation for this end of the association /// </summary> [System.ComponentModel.Editor(typeof(System.ComponentModel.Design.MultilineStringEditor), typeof(System.Drawing.Design.UITypeEditor))] [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.BidirectionalAssociation/SourceSummary.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::CategoryResource("Sawczyn.EFDesigner.EFModel.BidirectionalAssociation/SourceSummary.Category", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.BidirectionalAssociation/SourceSummary.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslModeling::DomainObjectId("73bbc365-57ca-4f07-a834-9fe6605b76d0")] public global::System.String SourceSummary { [global::System.Diagnostics.DebuggerStepThrough] get { return sourceSummaryPropertyStorage; } [global::System.Diagnostics.DebuggerStepThrough] set { SourceSummaryPropertyHandler.Instance.SetValue(this, value); } } /// <summary> /// Value handler for the BidirectionalAssociation.SourceSummary domain property. /// </summary> internal sealed partial class SourceSummaryPropertyHandler : DslModeling::DomainPropertyValueHandler<BidirectionalAssociation, global::System.String> { private SourceSummaryPropertyHandler() { } /// <summary> /// Gets the singleton instance of the BidirectionalAssociation.SourceSummary domain property value handler. /// </summary> public static readonly SourceSummaryPropertyHandler Instance = new SourceSummaryPropertyHandler(); /// <summary> /// Gets the Id of the BidirectionalAssociation.SourceSummary domain property. /// </summary> public sealed override global::System.Guid DomainPropertyId { [global::System.Diagnostics.DebuggerStepThrough] get { return SourceSummaryDomainPropertyId; } } /// <summary> /// Gets a strongly-typed value of the property on specified element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <returns>Property value.</returns> public override sealed global::System.String GetValue(BidirectionalAssociation element) { if (element == null) throw new global::System.ArgumentNullException("element"); return element.sourceSummaryPropertyStorage; } /// <summary> /// Sets property value on an element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <param name="newValue">New property value.</param> public override sealed void SetValue(BidirectionalAssociation element, global::System.String newValue) { if (element == null) throw new global::System.ArgumentNullException("element"); global::System.String oldValue = GetValue(element); if (newValue != oldValue) { ValueChanging(element, oldValue, newValue); element.sourceSummaryPropertyStorage = newValue; ValueChanged(element, oldValue, newValue); } } } #endregion #region SourceCustomAttributes domain property code /// <summary> /// SourceCustomAttributes domain property Id. /// </summary> public static readonly global::System.Guid SourceCustomAttributesDomainPropertyId = new global::System.Guid(0x124bb49e, 0xc952, 0x4a7f, 0x80, 0x1a, 0xa7, 0xaf, 0x0a, 0x98, 0x5f, 0xc4); /// <summary> /// Storage for SourceCustomAttributes /// </summary> private global::System.String sourceCustomAttributesPropertyStorage = string.Empty; /// <summary> /// Gets or sets the value of SourceCustomAttributes domain property. /// Any custom attributes to be generated for the source property. Will be passed /// through as entered. /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.BidirectionalAssociation/SourceCustomAttributes.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::CategoryResource("Sawczyn.EFDesigner.EFModel.BidirectionalAssociation/SourceCustomAttributes.Category", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.BidirectionalAssociation/SourceCustomAttributes.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslModeling::DomainObjectId("124bb49e-c952-4a7f-801a-a7af0a985fc4")] public global::System.String SourceCustomAttributes { [global::System.Diagnostics.DebuggerStepThrough] get { return sourceCustomAttributesPropertyStorage; } [global::System.Diagnostics.DebuggerStepThrough] set { SourceCustomAttributesPropertyHandler.Instance.SetValue(this, value); } } /// <summary> /// Value handler for the BidirectionalAssociation.SourceCustomAttributes domain property. /// </summary> internal sealed partial class SourceCustomAttributesPropertyHandler : DslModeling::DomainPropertyValueHandler<BidirectionalAssociation, global::System.String> { private SourceCustomAttributesPropertyHandler() { } /// <summary> /// Gets the singleton instance of the BidirectionalAssociation.SourceCustomAttributes domain property value handler. /// </summary> public static readonly SourceCustomAttributesPropertyHandler Instance = new SourceCustomAttributesPropertyHandler(); /// <summary> /// Gets the Id of the BidirectionalAssociation.SourceCustomAttributes domain property. /// </summary> public sealed override global::System.Guid DomainPropertyId { [global::System.Diagnostics.DebuggerStepThrough] get { return SourceCustomAttributesDomainPropertyId; } } /// <summary> /// Gets a strongly-typed value of the property on specified element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <returns>Property value.</returns> public override sealed global::System.String GetValue(BidirectionalAssociation element) { if (element == null) throw new global::System.ArgumentNullException("element"); return element.sourceCustomAttributesPropertyStorage; } /// <summary> /// Sets property value on an element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <param name="newValue">New property value.</param> public override sealed void SetValue(BidirectionalAssociation element, global::System.String newValue) { if (element == null) throw new global::System.ArgumentNullException("element"); global::System.String oldValue = GetValue(element); if (newValue != oldValue) { ValueChanging(element, oldValue, newValue); element.sourceCustomAttributesPropertyStorage = newValue; ValueChanged(element, oldValue, newValue); } } } #endregion #region SourceDisplayText domain property code /// <summary> /// SourceDisplayText domain property Id. /// </summary> public static readonly global::System.Guid SourceDisplayTextDomainPropertyId = new global::System.Guid(0x5069324e, 0x4190, 0x403e, 0x87, 0x91, 0x41, 0x6c, 0x69, 0x2c, 0x87, 0x2a); /// <summary> /// Storage for SourceDisplayText /// </summary> private global::System.String sourceDisplayTextPropertyStorage = string.Empty; /// <summary> /// Gets or sets the value of SourceDisplayText domain property. /// Text for [Display(Name="<text>")] attribute on this end's property /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.BidirectionalAssociation/SourceDisplayText.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::CategoryResource("Sawczyn.EFDesigner.EFModel.BidirectionalAssociation/SourceDisplayText.Category", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.BidirectionalAssociation/SourceDisplayText.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslModeling::DomainObjectId("5069324e-4190-403e-8791-416c692c872a")] public global::System.String SourceDisplayText { [global::System.Diagnostics.DebuggerStepThrough] get { return sourceDisplayTextPropertyStorage; } [global::System.Diagnostics.DebuggerStepThrough] set { SourceDisplayTextPropertyHandler.Instance.SetValue(this, value); } } /// <summary> /// Value handler for the BidirectionalAssociation.SourceDisplayText domain property. /// </summary> internal sealed partial class SourceDisplayTextPropertyHandler : DslModeling::DomainPropertyValueHandler<BidirectionalAssociation, global::System.String> { private SourceDisplayTextPropertyHandler() { } /// <summary> /// Gets the singleton instance of the BidirectionalAssociation.SourceDisplayText domain property value handler. /// </summary> public static readonly SourceDisplayTextPropertyHandler Instance = new SourceDisplayTextPropertyHandler(); /// <summary> /// Gets the Id of the BidirectionalAssociation.SourceDisplayText domain property. /// </summary> public sealed override global::System.Guid DomainPropertyId { [global::System.Diagnostics.DebuggerStepThrough] get { return SourceDisplayTextDomainPropertyId; } } /// <summary> /// Gets a strongly-typed value of the property on specified element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <returns>Property value.</returns> public override sealed global::System.String GetValue(BidirectionalAssociation element) { if (element == null) throw new global::System.ArgumentNullException("element"); return element.sourceDisplayTextPropertyStorage; } /// <summary> /// Sets property value on an element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <param name="newValue">New property value.</param> public override sealed void SetValue(BidirectionalAssociation element, global::System.String newValue) { if (element == null) throw new global::System.ArgumentNullException("element"); global::System.String oldValue = GetValue(element); if (newValue != oldValue) { ValueChanging(element, oldValue, newValue); element.sourceDisplayTextPropertyStorage = newValue; ValueChanged(element, oldValue, newValue); } } } #endregion #region SourceImplementNotify domain property code /// <summary> /// SourceImplementNotify domain property Id. /// </summary> public static readonly global::System.Guid SourceImplementNotifyDomainPropertyId = new global::System.Guid(0x44fda399, 0xd8f1, 0x4d63, 0x80, 0xf1, 0x88, 0x12, 0x77, 0xcb, 0x81, 0x15); /// <summary> /// Gets or sets the value of SourceImplementNotify domain property. /// Should this end participate in INotifyPropertyChanged activities? Only valid for /// non-collection targets. /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.BidirectionalAssociation/SourceImplementNotify.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::CategoryResource("Sawczyn.EFDesigner.EFModel.BidirectionalAssociation/SourceImplementNotify.Category", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.BidirectionalAssociation/SourceImplementNotify.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [global::System.ComponentModel.Browsable(false)] [DslModeling::DomainProperty(Kind = DslModeling::DomainPropertyKind.CustomStorage)] [DslModeling::DomainObjectId("44fda399-d8f1-4d63-80f1-881277cb8115")] public global::System.Boolean SourceImplementNotify { [global::System.Diagnostics.DebuggerStepThrough] get { return SourceImplementNotifyPropertyHandler.Instance.GetValue(this); } [global::System.Diagnostics.DebuggerStepThrough] set { SourceImplementNotifyPropertyHandler.Instance.SetValue(this, value); } } /// <summary> /// Value handler for the BidirectionalAssociation.SourceImplementNotify domain property. /// </summary> internal sealed partial class SourceImplementNotifyPropertyHandler : DslModeling::DomainPropertyValueHandler<BidirectionalAssociation, global::System.Boolean> { private SourceImplementNotifyPropertyHandler() { } /// <summary> /// Gets the singleton instance of the BidirectionalAssociation.SourceImplementNotify domain property value handler. /// </summary> public static readonly SourceImplementNotifyPropertyHandler Instance = new SourceImplementNotifyPropertyHandler(); /// <summary> /// Gets the Id of the BidirectionalAssociation.SourceImplementNotify domain property. /// </summary> public sealed override global::System.Guid DomainPropertyId { [global::System.Diagnostics.DebuggerStepThrough] get { return SourceImplementNotifyDomainPropertyId; } } /// <summary> /// Gets a strongly-typed value of the property on specified element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <returns>Property value.</returns> public override sealed global::System.Boolean GetValue(BidirectionalAssociation element) { if (element == null) throw new global::System.ArgumentNullException("element"); // There is no storage for SourceImplementNotify because its Kind is // set to CustomStorage. Please provide the GetSourceImplementNotifyValue() // method on the domain class. return element.GetSourceImplementNotifyValue(); } /// <summary> /// Sets property value on an element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <param name="newValue">New property value.</param> public override sealed void SetValue(BidirectionalAssociation element, global::System.Boolean newValue) { if (element == null) throw new global::System.ArgumentNullException("element"); global::System.Boolean oldValue = GetValue(element); if (newValue != oldValue) { ValueChanging(element, oldValue, newValue); // There is no storage for SourceImplementNotify because its Kind is // set to CustomStorage. Please provide the SetSourceImplementNotifyValue() // method on the domain class. element.SetSourceImplementNotifyValue(newValue); ValueChanged(element, oldValue, GetValue(element)); } } } #endregion #region IsSourceImplementNotifyTracking domain property code /// <summary> /// IsSourceImplementNotifyTracking domain property Id. /// </summary> public static readonly global::System.Guid IsSourceImplementNotifyTrackingDomainPropertyId = new global::System.Guid(0x4b2acec5, 0x2746, 0x43a0, 0xb4, 0xbe, 0x17, 0x6e, 0x3c, 0xfa, 0x53, 0x3f); /// <summary> /// Storage for IsSourceImplementNotifyTracking /// </summary> private global::System.Boolean isSourceImplementNotifyTrackingPropertyStorage = true; /// <summary> /// Gets or sets the value of IsSourceImplementNotifyTracking domain property. /// Description for Sawczyn.EFDesigner.EFModel.BidirectionalAssociation.Is Source /// Implement Notify Tracking /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.BidirectionalAssociation/IsSourceImplementNotifyTracking.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.BidirectionalAssociation/IsSourceImplementNotifyTracking.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [global::System.ComponentModel.DefaultValue(true)] [global::System.ComponentModel.Browsable(false)] [DslModeling::DomainObjectId("4b2acec5-2746-43a0-b4be-176e3cfa533f")] public global::System.Boolean IsSourceImplementNotifyTracking { [global::System.Diagnostics.DebuggerStepThrough] get { return isSourceImplementNotifyTrackingPropertyStorage; } [global::System.Diagnostics.DebuggerStepThrough] set { IsSourceImplementNotifyTrackingPropertyHandler.Instance.SetValue(this, value); } } /// <summary> /// Value handler for the BidirectionalAssociation.IsSourceImplementNotifyTracking domain property. /// </summary> internal sealed partial class IsSourceImplementNotifyTrackingPropertyHandler : DslModeling::DomainPropertyValueHandler<BidirectionalAssociation, global::System.Boolean> { private IsSourceImplementNotifyTrackingPropertyHandler() { } /// <summary> /// Gets the singleton instance of the BidirectionalAssociation.IsSourceImplementNotifyTracking domain property value handler. /// </summary> public static readonly IsSourceImplementNotifyTrackingPropertyHandler Instance = new IsSourceImplementNotifyTrackingPropertyHandler(); /// <summary> /// Gets the Id of the BidirectionalAssociation.IsSourceImplementNotifyTracking domain property. /// </summary> public sealed override global::System.Guid DomainPropertyId { [global::System.Diagnostics.DebuggerStepThrough] get { return IsSourceImplementNotifyTrackingDomainPropertyId; } } /// <summary> /// Gets a strongly-typed value of the property on specified element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <returns>Property value.</returns> public override sealed global::System.Boolean GetValue(BidirectionalAssociation element) { if (element == null) throw new global::System.ArgumentNullException("element"); return element.isSourceImplementNotifyTrackingPropertyStorage; } /// <summary> /// Sets property value on an element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <param name="newValue">New property value.</param> public override sealed void SetValue(BidirectionalAssociation element, global::System.Boolean newValue) { if (element == null) throw new global::System.ArgumentNullException("element"); global::System.Boolean oldValue = GetValue(element); if (newValue != oldValue) { ValueChanging(element, oldValue, newValue); element.isSourceImplementNotifyTrackingPropertyStorage = newValue; ValueChanged(element, oldValue, newValue); } } } #endregion #region SourcePropertyNameDisplay domain property code /// <summary> /// SourcePropertyNameDisplay domain property Id. /// </summary> public static readonly global::System.Guid SourcePropertyNameDisplayDomainPropertyId = new global::System.Guid(0x0f8bd2a8, 0x4b1c, 0x429d, 0x96, 0xdb, 0xaf, 0xbe, 0x59, 0x25, 0x3d, 0xc6); /// <summary> /// Gets or sets the value of SourcePropertyNameDisplay domain property. /// Decorator text /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.BidirectionalAssociation/SourcePropertyNameDisplay.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::CategoryResource("Sawczyn.EFDesigner.EFModel.BidirectionalAssociation/SourcePropertyNameDisplay.Category", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.BidirectionalAssociation/SourcePropertyNameDisplay.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [global::System.ComponentModel.Browsable(false)] [global::System.ComponentModel.ReadOnly(true)] [DslModeling::DomainProperty(Kind = DslModeling::DomainPropertyKind.Calculated)] [DslModeling::DomainObjectId("0f8bd2a8-4b1c-429d-96db-afbe59253dc6")] public global::System.String SourcePropertyNameDisplay { [global::System.Diagnostics.DebuggerStepThrough] get { return SourcePropertyNameDisplayPropertyHandler.Instance.GetValue(this); } } /// <summary> /// Value handler for the BidirectionalAssociation.SourcePropertyNameDisplay domain property. /// </summary> internal sealed partial class SourcePropertyNameDisplayPropertyHandler : DslModeling::CalculatedPropertyValueHandler<BidirectionalAssociation, global::System.String> { private SourcePropertyNameDisplayPropertyHandler() { } /// <summary> /// Gets the singleton instance of the BidirectionalAssociation.SourcePropertyNameDisplay domain property value handler. /// </summary> public static readonly SourcePropertyNameDisplayPropertyHandler Instance = new SourcePropertyNameDisplayPropertyHandler(); /// <summary> /// Gets the Id of the BidirectionalAssociation.SourcePropertyNameDisplay domain property. /// </summary> public sealed override global::System.Guid DomainPropertyId { [global::System.Diagnostics.DebuggerStepThrough] get { return SourcePropertyNameDisplayDomainPropertyId; } } /// <summary> /// Gets a strongly-typed value of the property on specified element. /// </summary> /// <param name="element">Element which owns the property.</param> /// <returns>Property value.</returns> public override sealed global::System.String GetValue(BidirectionalAssociation element) { if (element == null) throw new global::System.ArgumentNullException("element"); // There is no storage for SourcePropertyNameDisplay because its Kind is // set to Calculated. Please provide the GetSourcePropertyNameDisplayValue() // method on the domain class. return element.GetSourcePropertyNameDisplayValue(); } } #endregion #region BidirectionalSource link accessor /// <summary> /// Get the list of BidirectionalAssociation links to a ModelClass. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::System.Collections.ObjectModel.ReadOnlyCollection<global::Sawczyn.EFDesigner.EFModel.BidirectionalAssociation> GetLinksToBidirectionalTargets ( global::Sawczyn.EFDesigner.EFModel.ModelClass bidirectionalSourceInstance ) { return DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.BidirectionalAssociation>(bidirectionalSourceInstance, global::Sawczyn.EFDesigner.EFModel.BidirectionalAssociation.BidirectionalSourceDomainRoleId); } #endregion #region BidirectionalTarget link accessor /// <summary> /// Get the list of BidirectionalAssociation links to a ModelClass. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::System.Collections.ObjectModel.ReadOnlyCollection<global::Sawczyn.EFDesigner.EFModel.BidirectionalAssociation> GetLinksToBidirectionalSources ( global::Sawczyn.EFDesigner.EFModel.ModelClass bidirectionalTargetInstance ) { return DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.BidirectionalAssociation>(bidirectionalTargetInstance, global::Sawczyn.EFDesigner.EFModel.BidirectionalAssociation.BidirectionalTargetDomainRoleId); } #endregion #region BidirectionalAssociation instance accessors /// <summary> /// Get any BidirectionalAssociation links between a given ModelClass and a ModelClass. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static new global::System.Collections.ObjectModel.ReadOnlyCollection<global::Sawczyn.EFDesigner.EFModel.BidirectionalAssociation> GetLinks( global::Sawczyn.EFDesigner.EFModel.ModelClass source, global::Sawczyn.EFDesigner.EFModel.ModelClass target ) { global::System.Collections.Generic.List<global::Sawczyn.EFDesigner.EFModel.BidirectionalAssociation> outLinks = new global::System.Collections.Generic.List<global::Sawczyn.EFDesigner.EFModel.BidirectionalAssociation>(); global::System.Collections.Generic.IList<global::Sawczyn.EFDesigner.EFModel.BidirectionalAssociation> links = DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.BidirectionalAssociation>(source, global::Sawczyn.EFDesigner.EFModel.BidirectionalAssociation.BidirectionalSourceDomainRoleId); foreach ( global::Sawczyn.EFDesigner.EFModel.BidirectionalAssociation link in links ) { if ( target.Equals(link.BidirectionalTarget) ) { outLinks.Add(link); } } return outLinks.AsReadOnly(); } #endregion } } namespace Sawczyn.EFDesigner.EFModel { /// <summary> /// DomainRelationship ModelRootHasEnums /// Relationship rooting ModelEnum domain entities to the tree /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.ModelRootHasEnums.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.ModelRootHasEnums.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslModeling::DomainModelOwner(typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel))] [global::System.CLSCompliant(true)] [DslModeling::DomainRelationship(IsEmbedding=true)] [DslModeling::DomainObjectId("7937b5d4-2003-470b-9140-051f2dcd8dd0")] public partial class ModelRootHasEnums : DslModeling::ElementLink { #region Constructors, domain class Id /// <summary> /// ModelRootHasEnums domain class Id. /// </summary> public static readonly new global::System.Guid DomainClassId = new global::System.Guid(0x7937b5d4, 0x2003, 0x470b, 0x91, 0x40, 0x05, 0x1f, 0x2d, 0xcd, 0x8d, 0xd0); /// <summary> /// Constructor /// Creates a ModelRootHasEnums link in the same Partition as the given ModelRoot /// </summary> /// <param name="source">ModelRoot to use as the source of the relationship.</param> /// <param name="target">ModelEnum to use as the target of the relationship.</param> public ModelRootHasEnums(ModelRoot source, ModelEnum target) : base((source != null ? source.Partition : null), new DslModeling::RoleAssignment[]{new DslModeling::RoleAssignment(ModelRootHasEnums.ModelRootDomainRoleId, source), new DslModeling::RoleAssignment(ModelRootHasEnums.ModelEnumDomainRoleId, target)}, null) { } /// <summary> /// Constructor /// </summary> /// <param name="store">Store where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> public ModelRootHasEnums(DslModeling::Store store, params DslModeling::RoleAssignment[] roleAssignments) : base(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, roleAssignments, null) { } /// <summary> /// Constructor /// </summary> /// <param name="store">Store where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> /// <param name="propertyAssignments">List of properties assignments to set on the new link.</param> public ModelRootHasEnums(DslModeling::Store store, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments) : base(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, roleAssignments, propertyAssignments) { } /// <summary> /// Constructor /// </summary> /// <param name="partition">Partition where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> public ModelRootHasEnums(DslModeling::Partition partition, params DslModeling::RoleAssignment[] roleAssignments) : base(partition, roleAssignments, null) { } /// <summary> /// Constructor /// </summary> /// <param name="partition">Partition where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> /// <param name="propertyAssignments">List of properties assignments to set on the new link.</param> public ModelRootHasEnums(DslModeling::Partition partition, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments) : base(partition, roleAssignments, propertyAssignments) { } #endregion #region ModelRoot domain role code /// <summary> /// ModelRoot domain role Id. /// </summary> public static readonly global::System.Guid ModelRootDomainRoleId = new global::System.Guid(0xa613cf7f, 0x477b, 0x4842, 0xb1, 0xc2, 0x95, 0x86, 0x97, 0x74, 0x63, 0xf8); /// <summary> /// DomainRole ModelRoot /// No description available /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.ModelRootHasEnums/ModelRoot.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.ModelRootHasEnums/ModelRoot.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslModeling::DomainRole(DslModeling::DomainRoleOrder.Source, PropertyName = "Enums", PropertyDisplayNameKey="Sawczyn.EFDesigner.EFModel.ModelRootHasEnums/ModelRoot.PropertyDisplayName", PropagatesCopy = DslModeling::PropagatesCopyOption.PropagatesCopyToLinkAndOppositeRolePlayer, Multiplicity = DslModeling::Multiplicity.ZeroMany)] [DslModeling::DomainObjectId("a613cf7f-477b-4842-b1c2-9586977463f8")] public virtual ModelRoot ModelRoot { [global::System.Diagnostics.DebuggerStepThrough] get { return (ModelRoot)DslModeling::DomainRoleInfo.GetRolePlayer(this, ModelRootDomainRoleId); } [global::System.Diagnostics.DebuggerStepThrough] set { DslModeling::DomainRoleInfo.SetRolePlayer(this, ModelRootDomainRoleId, value); } } #endregion #region Static methods to access ModelRoot of a ModelEnum /// <summary> /// Gets ModelRoot. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static ModelRoot GetModelRoot(ModelEnum element) { return DslModeling::DomainRoleInfo.GetLinkedElement(element, ModelEnumDomainRoleId) as ModelRoot; } /// <summary> /// Sets ModelRoot. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static void SetModelRoot(ModelEnum element, ModelRoot newModelRoot) { DslModeling::DomainRoleInfo.SetLinkedElement(element, ModelEnumDomainRoleId, newModelRoot); } #endregion #region ModelEnum domain role code /// <summary> /// ModelEnum domain role Id. /// </summary> public static readonly global::System.Guid ModelEnumDomainRoleId = new global::System.Guid(0x3e74772a, 0x5e00, 0x4977, 0x81, 0xe5, 0xbc, 0xfc, 0x90, 0xa8, 0xb8, 0xd9); /// <summary> /// DomainRole ModelEnum /// No description available /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.ModelRootHasEnums/ModelEnum.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.ModelRootHasEnums/ModelEnum.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslModeling::DomainRole(DslModeling::DomainRoleOrder.Target, PropertyName = "ModelRoot", PropertyDisplayNameKey="Sawczyn.EFDesigner.EFModel.ModelRootHasEnums/ModelEnum.PropertyDisplayName", PropagatesDelete = true, PropagatesCopy = DslModeling::PropagatesCopyOption.DoNotPropagateCopy, Multiplicity = DslModeling::Multiplicity.One)] [DslModeling::DomainObjectId("3e74772a-5e00-4977-81e5-bcfc90a8b8d9")] public virtual ModelEnum ModelEnum { [global::System.Diagnostics.DebuggerStepThrough] get { return (ModelEnum)DslModeling::DomainRoleInfo.GetRolePlayer(this, ModelEnumDomainRoleId); } [global::System.Diagnostics.DebuggerStepThrough] set { DslModeling::DomainRoleInfo.SetRolePlayer(this, ModelEnumDomainRoleId, value); } } #endregion #region Static methods to access Enums of a ModelRoot /// <summary> /// Gets a list of Enums. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static DslModeling::LinkedElementCollection<ModelEnum> GetEnums(ModelRoot element) { return GetRoleCollection<DslModeling::LinkedElementCollection<ModelEnum>, ModelEnum>(element, ModelRootDomainRoleId); } #endregion #region ModelRoot link accessor /// <summary> /// Get the list of ModelRootHasEnums links to a ModelRoot. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::System.Collections.ObjectModel.ReadOnlyCollection<global::Sawczyn.EFDesigner.EFModel.ModelRootHasEnums> GetLinksToEnums ( global::Sawczyn.EFDesigner.EFModel.ModelRoot modelRootInstance ) { return DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.ModelRootHasEnums>(modelRootInstance, global::Sawczyn.EFDesigner.EFModel.ModelRootHasEnums.ModelRootDomainRoleId); } #endregion #region ModelEnum link accessor /// <summary> /// Get the ModelRootHasEnums link to a ModelEnum. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::Sawczyn.EFDesigner.EFModel.ModelRootHasEnums GetLinkToModelRoot (global::Sawczyn.EFDesigner.EFModel.ModelEnum modelEnumInstance) { global::System.Collections.Generic.IList<global::Sawczyn.EFDesigner.EFModel.ModelRootHasEnums> links = DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.ModelRootHasEnums>(modelEnumInstance, global::Sawczyn.EFDesigner.EFModel.ModelRootHasEnums.ModelEnumDomainRoleId); global::System.Diagnostics.Debug.Assert(links.Count <= 1, "Multiplicity of ModelEnum not obeyed."); if ( links.Count == 0 ) { return null; } else { return links[0]; } } #endregion #region ModelRootHasEnums instance accessors /// <summary> /// Get any ModelRootHasEnums links between a given ModelRoot and a ModelEnum. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::System.Collections.ObjectModel.ReadOnlyCollection<global::Sawczyn.EFDesigner.EFModel.ModelRootHasEnums> GetLinks( global::Sawczyn.EFDesigner.EFModel.ModelRoot source, global::Sawczyn.EFDesigner.EFModel.ModelEnum target ) { global::System.Collections.Generic.List<global::Sawczyn.EFDesigner.EFModel.ModelRootHasEnums> outLinks = new global::System.Collections.Generic.List<global::Sawczyn.EFDesigner.EFModel.ModelRootHasEnums>(); global::System.Collections.Generic.IList<global::Sawczyn.EFDesigner.EFModel.ModelRootHasEnums> links = DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.ModelRootHasEnums>(source, global::Sawczyn.EFDesigner.EFModel.ModelRootHasEnums.ModelRootDomainRoleId); foreach ( global::Sawczyn.EFDesigner.EFModel.ModelRootHasEnums link in links ) { if ( target.Equals(link.ModelEnum) ) { outLinks.Add(link); } } return outLinks.AsReadOnly(); } /// <summary> /// Get the one ModelRootHasEnums link between a given ModelRootand a ModelEnum. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::Sawczyn.EFDesigner.EFModel.ModelRootHasEnums GetLink( global::Sawczyn.EFDesigner.EFModel.ModelRoot source, global::Sawczyn.EFDesigner.EFModel.ModelEnum target ) { global::System.Collections.Generic.IList<global::Sawczyn.EFDesigner.EFModel.ModelRootHasEnums> links = DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.ModelRootHasEnums>(source, global::Sawczyn.EFDesigner.EFModel.ModelRootHasEnums.ModelRootDomainRoleId); foreach ( global::Sawczyn.EFDesigner.EFModel.ModelRootHasEnums link in links ) { if ( target.Equals(link.ModelEnum) ) { return link; } } return null; } #endregion } } namespace Sawczyn.EFDesigner.EFModel { /// <summary> /// DomainRelationship ModelEnumHasValues /// Relationship linking enumeration values to an enumeration /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.ModelEnumHasValues.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.ModelEnumHasValues.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslModeling::DomainModelOwner(typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel))] [global::System.CLSCompliant(true)] [DslModeling::DomainRelationship(IsEmbedding=true)] [DslModeling::DomainObjectId("168660d9-3989-40a9-b6ef-25d54c6e6d34")] public partial class ModelEnumHasValues : DslModeling::ElementLink { #region Constructors, domain class Id /// <summary> /// ModelEnumHasValues domain class Id. /// </summary> public static readonly new global::System.Guid DomainClassId = new global::System.Guid(0x168660d9, 0x3989, 0x40a9, 0xb6, 0xef, 0x25, 0xd5, 0x4c, 0x6e, 0x6d, 0x34); /// <summary> /// Constructor /// Creates a ModelEnumHasValues link in the same Partition as the given ModelEnum /// </summary> /// <param name="source">ModelEnum to use as the source of the relationship.</param> /// <param name="target">ModelEnumValue to use as the target of the relationship.</param> public ModelEnumHasValues(ModelEnum source, ModelEnumValue target) : base((source != null ? source.Partition : null), new DslModeling::RoleAssignment[]{new DslModeling::RoleAssignment(ModelEnumHasValues.EnumDomainRoleId, source), new DslModeling::RoleAssignment(ModelEnumHasValues.ValueDomainRoleId, target)}, null) { } /// <summary> /// Constructor /// </summary> /// <param name="store">Store where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> public ModelEnumHasValues(DslModeling::Store store, params DslModeling::RoleAssignment[] roleAssignments) : base(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, roleAssignments, null) { } /// <summary> /// Constructor /// </summary> /// <param name="store">Store where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> /// <param name="propertyAssignments">List of properties assignments to set on the new link.</param> public ModelEnumHasValues(DslModeling::Store store, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments) : base(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, roleAssignments, propertyAssignments) { } /// <summary> /// Constructor /// </summary> /// <param name="partition">Partition where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> public ModelEnumHasValues(DslModeling::Partition partition, params DslModeling::RoleAssignment[] roleAssignments) : base(partition, roleAssignments, null) { } /// <summary> /// Constructor /// </summary> /// <param name="partition">Partition where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> /// <param name="propertyAssignments">List of properties assignments to set on the new link.</param> public ModelEnumHasValues(DslModeling::Partition partition, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments) : base(partition, roleAssignments, propertyAssignments) { } #endregion #region Enum domain role code /// <summary> /// Enum domain role Id. /// </summary> public static readonly global::System.Guid EnumDomainRoleId = new global::System.Guid(0x0e073c3b, 0xea79, 0x41d0, 0xb8, 0x20, 0xb9, 0x72, 0x05, 0x2c, 0xfb, 0x86); /// <summary> /// DomainRole Enum /// No description available /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.ModelEnumHasValues/Enum.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.ModelEnumHasValues/Enum.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslModeling::DomainRole(DslModeling::DomainRoleOrder.Source, PropertyName = "Values", PropertyDisplayNameKey="Sawczyn.EFDesigner.EFModel.ModelEnumHasValues/Enum.PropertyDisplayName", PropagatesCopy = DslModeling::PropagatesCopyOption.PropagatesCopyToLinkAndOppositeRolePlayer, Multiplicity = DslModeling::Multiplicity.ZeroMany)] [DslModeling::DomainObjectId("0e073c3b-ea79-41d0-b820-b972052cfb86")] public virtual ModelEnum Enum { [global::System.Diagnostics.DebuggerStepThrough] get { return (ModelEnum)DslModeling::DomainRoleInfo.GetRolePlayer(this, EnumDomainRoleId); } [global::System.Diagnostics.DebuggerStepThrough] set { DslModeling::DomainRoleInfo.SetRolePlayer(this, EnumDomainRoleId, value); } } #endregion #region Static methods to access Enum of a ModelEnumValue /// <summary> /// Gets Enum. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static ModelEnum GetEnum(ModelEnumValue element) { return DslModeling::DomainRoleInfo.GetLinkedElement(element, ValueDomainRoleId) as ModelEnum; } /// <summary> /// Sets Enum. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static void SetEnum(ModelEnumValue element, ModelEnum newEnum) { DslModeling::DomainRoleInfo.SetLinkedElement(element, ValueDomainRoleId, newEnum); } #endregion #region Value domain role code /// <summary> /// Value domain role Id. /// </summary> public static readonly global::System.Guid ValueDomainRoleId = new global::System.Guid(0xa9be9f1b, 0x6dc5, 0x4dae, 0xb3, 0x45, 0xa4, 0x7b, 0x3d, 0xb1, 0x9d, 0x2b); /// <summary> /// DomainRole Value /// No description available /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.ModelEnumHasValues/Value.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.ModelEnumHasValues/Value.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslModeling::DomainRole(DslModeling::DomainRoleOrder.Target, PropertyName = "Enum", PropertyDisplayNameKey="Sawczyn.EFDesigner.EFModel.ModelEnumHasValues/Value.PropertyDisplayName", PropagatesDelete = true, PropagatesCopy = DslModeling::PropagatesCopyOption.DoNotPropagateCopy, Multiplicity = DslModeling::Multiplicity.ZeroOne)] [DslModeling::DomainObjectId("a9be9f1b-6dc5-4dae-b345-a47b3db19d2b")] public virtual ModelEnumValue Value { [global::System.Diagnostics.DebuggerStepThrough] get { return (ModelEnumValue)DslModeling::DomainRoleInfo.GetRolePlayer(this, ValueDomainRoleId); } [global::System.Diagnostics.DebuggerStepThrough] set { DslModeling::DomainRoleInfo.SetRolePlayer(this, ValueDomainRoleId, value); } } #endregion #region Static methods to access Values of a ModelEnum /// <summary> /// Gets a list of Values. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static DslModeling::LinkedElementCollection<ModelEnumValue> GetValues(ModelEnum element) { return GetRoleCollection<DslModeling::LinkedElementCollection<ModelEnumValue>, ModelEnumValue>(element, EnumDomainRoleId); } #endregion #region Enum link accessor /// <summary> /// Get the list of ModelEnumHasValues links to a ModelEnum. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::System.Collections.ObjectModel.ReadOnlyCollection<global::Sawczyn.EFDesigner.EFModel.ModelEnumHasValues> GetLinksToValues ( global::Sawczyn.EFDesigner.EFModel.ModelEnum enumInstance ) { return DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.ModelEnumHasValues>(enumInstance, global::Sawczyn.EFDesigner.EFModel.ModelEnumHasValues.EnumDomainRoleId); } #endregion #region Value link accessor /// <summary> /// Get the ModelEnumHasValues link to a ModelEnumValue. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::Sawczyn.EFDesigner.EFModel.ModelEnumHasValues GetLinkToEnum (global::Sawczyn.EFDesigner.EFModel.ModelEnumValue valueInstance) { global::System.Collections.Generic.IList<global::Sawczyn.EFDesigner.EFModel.ModelEnumHasValues> links = DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.ModelEnumHasValues>(valueInstance, global::Sawczyn.EFDesigner.EFModel.ModelEnumHasValues.ValueDomainRoleId); global::System.Diagnostics.Debug.Assert(links.Count <= 1, "Multiplicity of Value not obeyed."); if ( links.Count == 0 ) { return null; } else { return links[0]; } } #endregion #region ModelEnumHasValues instance accessors /// <summary> /// Get any ModelEnumHasValues links between a given ModelEnum and a ModelEnumValue. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::System.Collections.ObjectModel.ReadOnlyCollection<global::Sawczyn.EFDesigner.EFModel.ModelEnumHasValues> GetLinks( global::Sawczyn.EFDesigner.EFModel.ModelEnum source, global::Sawczyn.EFDesigner.EFModel.ModelEnumValue target ) { global::System.Collections.Generic.List<global::Sawczyn.EFDesigner.EFModel.ModelEnumHasValues> outLinks = new global::System.Collections.Generic.List<global::Sawczyn.EFDesigner.EFModel.ModelEnumHasValues>(); global::System.Collections.Generic.IList<global::Sawczyn.EFDesigner.EFModel.ModelEnumHasValues> links = DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.ModelEnumHasValues>(source, global::Sawczyn.EFDesigner.EFModel.ModelEnumHasValues.EnumDomainRoleId); foreach ( global::Sawczyn.EFDesigner.EFModel.ModelEnumHasValues link in links ) { if ( target.Equals(link.Value) ) { outLinks.Add(link); } } return outLinks.AsReadOnly(); } /// <summary> /// Get the one ModelEnumHasValues link between a given ModelEnumand a ModelEnumValue. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::Sawczyn.EFDesigner.EFModel.ModelEnumHasValues GetLink( global::Sawczyn.EFDesigner.EFModel.ModelEnum source, global::Sawczyn.EFDesigner.EFModel.ModelEnumValue target ) { global::System.Collections.Generic.IList<global::Sawczyn.EFDesigner.EFModel.ModelEnumHasValues> links = DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.ModelEnumHasValues>(source, global::Sawczyn.EFDesigner.EFModel.ModelEnumHasValues.EnumDomainRoleId); foreach ( global::Sawczyn.EFDesigner.EFModel.ModelEnumHasValues link in links ) { if ( target.Equals(link.Value) ) { return link; } } return null; } #endregion } } namespace Sawczyn.EFDesigner.EFModel { /// <summary> /// DomainRelationship ModelRootHasClasses /// Description for Sawczyn.EFDesigner.EFModel.ModelRootHasClasses /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.ModelRootHasClasses.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.ModelRootHasClasses.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslModeling::DomainModelOwner(typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel))] [global::System.CLSCompliant(true)] [DslModeling::DomainRelationship(IsEmbedding=true)] [DslModeling::DomainObjectId("08ff1339-a992-4ffe-b350-6ba2eab5d7a4")] public partial class ModelRootHasClasses : DslModeling::ElementLink { #region Constructors, domain class Id /// <summary> /// ModelRootHasClasses domain class Id. /// </summary> public static readonly new global::System.Guid DomainClassId = new global::System.Guid(0x08ff1339, 0xa992, 0x4ffe, 0xb3, 0x50, 0x6b, 0xa2, 0xea, 0xb5, 0xd7, 0xa4); /// <summary> /// Constructor /// Creates a ModelRootHasClasses link in the same Partition as the given ModelRoot /// </summary> /// <param name="source">ModelRoot to use as the source of the relationship.</param> /// <param name="target">ModelClass to use as the target of the relationship.</param> public ModelRootHasClasses(ModelRoot source, ModelClass target) : base((source != null ? source.Partition : null), new DslModeling::RoleAssignment[]{new DslModeling::RoleAssignment(ModelRootHasClasses.ModelRootDomainRoleId, source), new DslModeling::RoleAssignment(ModelRootHasClasses.ModelClassDomainRoleId, target)}, null) { } /// <summary> /// Constructor /// </summary> /// <param name="store">Store where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> public ModelRootHasClasses(DslModeling::Store store, params DslModeling::RoleAssignment[] roleAssignments) : base(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, roleAssignments, null) { } /// <summary> /// Constructor /// </summary> /// <param name="store">Store where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> /// <param name="propertyAssignments">List of properties assignments to set on the new link.</param> public ModelRootHasClasses(DslModeling::Store store, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments) : base(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, roleAssignments, propertyAssignments) { } /// <summary> /// Constructor /// </summary> /// <param name="partition">Partition where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> public ModelRootHasClasses(DslModeling::Partition partition, params DslModeling::RoleAssignment[] roleAssignments) : base(partition, roleAssignments, null) { } /// <summary> /// Constructor /// </summary> /// <param name="partition">Partition where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> /// <param name="propertyAssignments">List of properties assignments to set on the new link.</param> public ModelRootHasClasses(DslModeling::Partition partition, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments) : base(partition, roleAssignments, propertyAssignments) { } #endregion #region ModelRoot domain role code /// <summary> /// ModelRoot domain role Id. /// </summary> public static readonly global::System.Guid ModelRootDomainRoleId = new global::System.Guid(0x435f6b0f, 0xd7e3, 0x43c3, 0x8b, 0x08, 0x0f, 0x2a, 0x95, 0xdd, 0xd7, 0x55); /// <summary> /// DomainRole ModelRoot /// Description for Sawczyn.EFDesigner.EFModel.ModelRootHasClasses.ModelRoot /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.ModelRootHasClasses/ModelRoot.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.ModelRootHasClasses/ModelRoot.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslModeling::DomainRole(DslModeling::DomainRoleOrder.Source, PropertyName = "Classes", PropertyDisplayNameKey="Sawczyn.EFDesigner.EFModel.ModelRootHasClasses/ModelRoot.PropertyDisplayName", PropagatesCopy = DslModeling::PropagatesCopyOption.PropagatesCopyToLinkAndOppositeRolePlayer, Multiplicity = DslModeling::Multiplicity.ZeroMany)] [DslModeling::DomainObjectId("435f6b0f-d7e3-43c3-8b08-0f2a95ddd755")] public virtual ModelRoot ModelRoot { [global::System.Diagnostics.DebuggerStepThrough] get { return (ModelRoot)DslModeling::DomainRoleInfo.GetRolePlayer(this, ModelRootDomainRoleId); } [global::System.Diagnostics.DebuggerStepThrough] set { DslModeling::DomainRoleInfo.SetRolePlayer(this, ModelRootDomainRoleId, value); } } #endregion #region Static methods to access ModelRoot of a ModelClass /// <summary> /// Gets ModelRoot. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static ModelRoot GetModelRoot(ModelClass element) { return DslModeling::DomainRoleInfo.GetLinkedElement(element, ModelClassDomainRoleId) as ModelRoot; } /// <summary> /// Sets ModelRoot. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static void SetModelRoot(ModelClass element, ModelRoot newModelRoot) { DslModeling::DomainRoleInfo.SetLinkedElement(element, ModelClassDomainRoleId, newModelRoot); } #endregion #region ModelClass domain role code /// <summary> /// ModelClass domain role Id. /// </summary> public static readonly global::System.Guid ModelClassDomainRoleId = new global::System.Guid(0x82403bdb, 0x397b, 0x48d8, 0x98, 0x9d, 0xa7, 0x48, 0x27, 0xdc, 0xb2, 0x72); /// <summary> /// DomainRole ModelClass /// Description for Sawczyn.EFDesigner.EFModel.ModelRootHasClasses.ModelClass /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.ModelRootHasClasses/ModelClass.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.ModelRootHasClasses/ModelClass.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslModeling::DomainRole(DslModeling::DomainRoleOrder.Target, PropertyName = "ModelRoot", PropertyDisplayNameKey="Sawczyn.EFDesigner.EFModel.ModelRootHasClasses/ModelClass.PropertyDisplayName", PropagatesDelete = true, PropagatesCopy = DslModeling::PropagatesCopyOption.DoNotPropagateCopy, Multiplicity = DslModeling::Multiplicity.One)] [DslModeling::DomainObjectId("82403bdb-397b-48d8-989d-a74827dcb272")] public virtual ModelClass ModelClass { [global::System.Diagnostics.DebuggerStepThrough] get { return (ModelClass)DslModeling::DomainRoleInfo.GetRolePlayer(this, ModelClassDomainRoleId); } [global::System.Diagnostics.DebuggerStepThrough] set { DslModeling::DomainRoleInfo.SetRolePlayer(this, ModelClassDomainRoleId, value); } } #endregion #region Static methods to access Classes of a ModelRoot /// <summary> /// Gets a list of Classes. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static DslModeling::LinkedElementCollection<ModelClass> GetClasses(ModelRoot element) { return GetRoleCollection<DslModeling::LinkedElementCollection<ModelClass>, ModelClass>(element, ModelRootDomainRoleId); } #endregion #region ModelRoot link accessor /// <summary> /// Get the list of ModelRootHasClasses links to a ModelRoot. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::System.Collections.ObjectModel.ReadOnlyCollection<global::Sawczyn.EFDesigner.EFModel.ModelRootHasClasses> GetLinksToClasses ( global::Sawczyn.EFDesigner.EFModel.ModelRoot modelRootInstance ) { return DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.ModelRootHasClasses>(modelRootInstance, global::Sawczyn.EFDesigner.EFModel.ModelRootHasClasses.ModelRootDomainRoleId); } #endregion #region ModelClass link accessor /// <summary> /// Get the ModelRootHasClasses link to a ModelClass. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::Sawczyn.EFDesigner.EFModel.ModelRootHasClasses GetLinkToModelRoot (global::Sawczyn.EFDesigner.EFModel.ModelClass modelClassInstance) { global::System.Collections.Generic.IList<global::Sawczyn.EFDesigner.EFModel.ModelRootHasClasses> links = DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.ModelRootHasClasses>(modelClassInstance, global::Sawczyn.EFDesigner.EFModel.ModelRootHasClasses.ModelClassDomainRoleId); global::System.Diagnostics.Debug.Assert(links.Count <= 1, "Multiplicity of ModelClass not obeyed."); if ( links.Count == 0 ) { return null; } else { return links[0]; } } #endregion #region ModelRootHasClasses instance accessors /// <summary> /// Get any ModelRootHasClasses links between a given ModelRoot and a ModelClass. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::System.Collections.ObjectModel.ReadOnlyCollection<global::Sawczyn.EFDesigner.EFModel.ModelRootHasClasses> GetLinks( global::Sawczyn.EFDesigner.EFModel.ModelRoot source, global::Sawczyn.EFDesigner.EFModel.ModelClass target ) { global::System.Collections.Generic.List<global::Sawczyn.EFDesigner.EFModel.ModelRootHasClasses> outLinks = new global::System.Collections.Generic.List<global::Sawczyn.EFDesigner.EFModel.ModelRootHasClasses>(); global::System.Collections.Generic.IList<global::Sawczyn.EFDesigner.EFModel.ModelRootHasClasses> links = DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.ModelRootHasClasses>(source, global::Sawczyn.EFDesigner.EFModel.ModelRootHasClasses.ModelRootDomainRoleId); foreach ( global::Sawczyn.EFDesigner.EFModel.ModelRootHasClasses link in links ) { if ( target.Equals(link.ModelClass) ) { outLinks.Add(link); } } return outLinks.AsReadOnly(); } /// <summary> /// Get the one ModelRootHasClasses link between a given ModelRootand a ModelClass. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::Sawczyn.EFDesigner.EFModel.ModelRootHasClasses GetLink( global::Sawczyn.EFDesigner.EFModel.ModelRoot source, global::Sawczyn.EFDesigner.EFModel.ModelClass target ) { global::System.Collections.Generic.IList<global::Sawczyn.EFDesigner.EFModel.ModelRootHasClasses> links = DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.ModelRootHasClasses>(source, global::Sawczyn.EFDesigner.EFModel.ModelRootHasClasses.ModelRootDomainRoleId); foreach ( global::Sawczyn.EFDesigner.EFModel.ModelRootHasClasses link in links ) { if ( target.Equals(link.ModelClass) ) { return link; } } return null; } #endregion } } namespace Sawczyn.EFDesigner.EFModel { /// <summary> /// DomainRelationship CommentReferencesSubjects /// Description for Sawczyn.EFDesigner.EFModel.CommentReferencesSubjects /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.CommentReferencesSubjects.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.CommentReferencesSubjects.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslModeling::DomainModelOwner(typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel))] [global::System.CLSCompliant(true)] [DslModeling::DomainRelationship()] [DslModeling::DomainObjectId("c1a798b4-85dc-4479-9c35-30f5b15d8aa1")] public abstract partial class CommentReferencesSubjects : DslModeling::ElementLink { #region Constructors, domain class Id /// <summary> /// CommentReferencesSubjects domain class Id. /// </summary> public static readonly new global::System.Guid DomainClassId = new global::System.Guid(0xc1a798b4, 0x85dc, 0x4479, 0x9c, 0x35, 0x30, 0xf5, 0xb1, 0x5d, 0x8a, 0xa1); /// <summary> /// Constructor. /// </summary> /// <param name="partition">The Partition instance containing this ElementLink</param> /// <param name="roleAssignments">A set of role assignments for roleplayer initialization</param> /// <param name="propertyAssignments">A set of attribute assignments for attribute initialization</param> protected CommentReferencesSubjects(DslModeling::Partition partition, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments) : base(partition, roleAssignments, propertyAssignments) { } #endregion #region Comment domain role code /// <summary> /// Comment domain role Id. /// </summary> public static readonly global::System.Guid CommentDomainRoleId = new global::System.Guid(0x8624f267, 0x1304, 0x43ef, 0xac, 0xc4, 0xf0, 0xb7, 0xd6, 0x7b, 0x28, 0x56); /// <summary> /// DomainRole Comment /// Description for Sawczyn.EFDesigner.EFModel.CommentReferencesSubjects.Comment /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.CommentReferencesSubjects/Comment.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.CommentReferencesSubjects/Comment.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [global::System.ComponentModel.Browsable(false)] [DslModeling::DomainRole(DslModeling::DomainRoleOrder.Source, PropertyName = "Subjects", PropertyDisplayNameKey="Sawczyn.EFDesigner.EFModel.CommentReferencesSubjects/Comment.PropertyDisplayName", PropagatesCopy = DslModeling::PropagatesCopyOption.DoNotPropagateCopy, Multiplicity = DslModeling::Multiplicity.ZeroMany)] [DslModeling::DomainObjectId("8624f267-1304-43ef-acc4-f0b7d67b2856")] public abstract Comment Comment { get; set; } #endregion #region Static methods to access Comments of a DesignElement /// <summary> /// Gets a list of Comments. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static DslModeling::ReadOnlyLinkedElementCollection<Comment> GetComments(DesignElement element) { return GetRoleCollection<DslModeling::ReadOnlyLinkedElementCollection<Comment>, Comment>(element, DesignElementDomainRoleId); } #endregion #region DesignElement domain role code /// <summary> /// DesignElement domain role Id. /// </summary> public static readonly global::System.Guid DesignElementDomainRoleId = new global::System.Guid(0xf2d70cc8, 0x21b0, 0x455b, 0x98, 0x41, 0xbe, 0xe1, 0x7b, 0x5a, 0xd5, 0xd9); /// <summary> /// DomainRole DesignElement /// Description for /// Sawczyn.EFDesigner.EFModel.CommentReferencesSubjects.DesignElement /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.CommentReferencesSubjects/DesignElement.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.CommentReferencesSubjects/DesignElement.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslModeling::DomainRole(DslModeling::DomainRoleOrder.Target, PropertyName = "Comments", PropertyDisplayNameKey="Sawczyn.EFDesigner.EFModel.CommentReferencesSubjects/DesignElement.PropertyDisplayName", PropagatesCopy = DslModeling::PropagatesCopyOption.DoNotPropagateCopy, Multiplicity = DslModeling::Multiplicity.ZeroMany)] [DslModeling::DomainObjectId("f2d70cc8-21b0-455b-9841-bee17b5ad5d9")] public abstract DesignElement DesignElement { get; set; } #endregion #region Static methods to access Subjects of a Comment /// <summary> /// Gets a list of Subjects. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static DslModeling::ReadOnlyLinkedElementCollection<DesignElement> GetSubjects(Comment element) { return GetRoleCollection<DslModeling::ReadOnlyLinkedElementCollection<DesignElement>, DesignElement>(element, CommentDomainRoleId); } #endregion #region Comment link accessor /// <summary> /// Get the list of CommentReferencesSubjects links to a Comment. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::System.Collections.ObjectModel.ReadOnlyCollection<global::Sawczyn.EFDesigner.EFModel.CommentReferencesSubjects> GetLinksToSubjects ( global::Sawczyn.EFDesigner.EFModel.Comment commentInstance ) { return DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.CommentReferencesSubjects>(commentInstance, global::Sawczyn.EFDesigner.EFModel.CommentReferencesSubjects.CommentDomainRoleId); } #endregion #region DesignElement link accessor /// <summary> /// Get the list of CommentReferencesSubjects links to a DesignElement. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::System.Collections.ObjectModel.ReadOnlyCollection<global::Sawczyn.EFDesigner.EFModel.CommentReferencesSubjects> GetLinksToComments ( global::Sawczyn.EFDesigner.EFModel.DesignElement designElementInstance ) { return DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.CommentReferencesSubjects>(designElementInstance, global::Sawczyn.EFDesigner.EFModel.CommentReferencesSubjects.DesignElementDomainRoleId); } #endregion #region CommentReferencesSubjects instance accessors /// <summary> /// Get any CommentReferencesSubjects links between a given Comment and a DesignElement. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::System.Collections.ObjectModel.ReadOnlyCollection<global::Sawczyn.EFDesigner.EFModel.CommentReferencesSubjects> GetLinks( global::Sawczyn.EFDesigner.EFModel.Comment source, global::Sawczyn.EFDesigner.EFModel.DesignElement target ) { global::System.Collections.Generic.List<global::Sawczyn.EFDesigner.EFModel.CommentReferencesSubjects> outLinks = new global::System.Collections.Generic.List<global::Sawczyn.EFDesigner.EFModel.CommentReferencesSubjects>(); global::System.Collections.Generic.IList<global::Sawczyn.EFDesigner.EFModel.CommentReferencesSubjects> links = DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.CommentReferencesSubjects>(source, global::Sawczyn.EFDesigner.EFModel.CommentReferencesSubjects.CommentDomainRoleId); foreach ( global::Sawczyn.EFDesigner.EFModel.CommentReferencesSubjects link in links ) { if ( target.Equals(link.DesignElement) ) { outLinks.Add(link); } } return outLinks.AsReadOnly(); } /// <summary> /// Get the one CommentReferencesSubjects link between a given Commentand a DesignElement. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::Sawczyn.EFDesigner.EFModel.CommentReferencesSubjects GetLink( global::Sawczyn.EFDesigner.EFModel.Comment source, global::Sawczyn.EFDesigner.EFModel.DesignElement target ) { global::System.Collections.Generic.IList<global::Sawczyn.EFDesigner.EFModel.CommentReferencesSubjects> links = DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.CommentReferencesSubjects>(source, global::Sawczyn.EFDesigner.EFModel.CommentReferencesSubjects.CommentDomainRoleId); foreach ( global::Sawczyn.EFDesigner.EFModel.CommentReferencesSubjects link in links ) { if ( target.Equals(link.DesignElement) ) { return link; } } return null; } #endregion } } namespace Sawczyn.EFDesigner.EFModel { /// <summary> /// DomainRelationship CommentReferencesClasses /// Description for Sawczyn.EFDesigner.EFModel.CommentReferencesClasses /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.CommentReferencesClasses.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.CommentReferencesClasses.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslModeling::DomainModelOwner(typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel))] [global::System.CLSCompliant(true)] [DslModeling::DomainRelationship()] [DslModeling::DomainObjectId("cedffe97-5a26-4774-89bf-ea0bda108db2")] public partial class CommentReferencesClasses : CommentReferencesSubjects { #region Constructors, domain class Id /// <summary> /// CommentReferencesClasses domain class Id. /// </summary> public static readonly new global::System.Guid DomainClassId = new global::System.Guid(0xcedffe97, 0x5a26, 0x4774, 0x89, 0xbf, 0xea, 0x0b, 0xda, 0x10, 0x8d, 0xb2); /// <summary> /// Constructor /// Creates a CommentReferencesClasses link in the same Partition as the given Comment /// </summary> /// <param name="source">Comment to use as the source of the relationship.</param> /// <param name="target">ModelClass to use as the target of the relationship.</param> public CommentReferencesClasses(Comment source, ModelClass target) : base((source != null ? source.Partition : null), new DslModeling::RoleAssignment[]{new DslModeling::RoleAssignment(CommentReferencesClasses.CommentDomainRoleId, source), new DslModeling::RoleAssignment(CommentReferencesClasses.ModelClassDomainRoleId, target)}, null) { } /// <summary> /// Constructor /// </summary> /// <param name="store">Store where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> public CommentReferencesClasses(DslModeling::Store store, params DslModeling::RoleAssignment[] roleAssignments) : base(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, roleAssignments, null) { } /// <summary> /// Constructor /// </summary> /// <param name="store">Store where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> /// <param name="propertyAssignments">List of properties assignments to set on the new link.</param> public CommentReferencesClasses(DslModeling::Store store, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments) : base(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, roleAssignments, propertyAssignments) { } /// <summary> /// Constructor /// </summary> /// <param name="partition">Partition where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> public CommentReferencesClasses(DslModeling::Partition partition, params DslModeling::RoleAssignment[] roleAssignments) : base(partition, roleAssignments, null) { } /// <summary> /// Constructor /// </summary> /// <param name="partition">Partition where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> /// <param name="propertyAssignments">List of properties assignments to set on the new link.</param> public CommentReferencesClasses(DslModeling::Partition partition, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments) : base(partition, roleAssignments, propertyAssignments) { } #endregion #region Comment domain role code /// <summary> /// Comment domain role Id. /// </summary> public static readonly new global::System.Guid CommentDomainRoleId = new global::System.Guid(0xebcf4701, 0xc44e, 0x4ec9, 0x8a, 0x34, 0x0f, 0x84, 0x28, 0xca, 0xc3, 0x52); /// <summary> /// DomainRole Comment /// Description for Sawczyn.EFDesigner.EFModel.CommentReferencesClasses.Comment /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.CommentReferencesClasses/Comment.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.CommentReferencesClasses/Comment.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [global::System.ComponentModel.Browsable(false)] [DslModeling::DomainRole(DslModeling::DomainRoleOrder.Source, PropertyName = "Classes", PropertyDisplayNameKey="Sawczyn.EFDesigner.EFModel.CommentReferencesClasses/Comment.PropertyDisplayName", PropagatesCopy = DslModeling::PropagatesCopyOption.DoNotPropagateCopy, Multiplicity = DslModeling::Multiplicity.ZeroMany)] [DslModeling::DomainObjectId("ebcf4701-c44e-4ec9-8a34-0f8428cac352")] public override Comment Comment { [global::System.Diagnostics.DebuggerStepThrough] get { return (Comment)DslModeling::DomainRoleInfo.GetRolePlayer(this, CommentDomainRoleId); } [global::System.Diagnostics.DebuggerStepThrough] set { DslModeling::DomainRoleInfo.SetRolePlayer(this, CommentDomainRoleId, value); } } #endregion #region Static methods to access Comments of a ModelClass /// <summary> /// Gets a list of Comments. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static DslModeling::LinkedElementCollection<Comment> GetComments(ModelClass element) { return GetRoleCollection<DslModeling::LinkedElementCollection<Comment>, Comment>(element, ModelClassDomainRoleId); } #endregion #region ModelClass domain role code /// <summary> /// ModelClass domain role Id. /// </summary> public static readonly global::System.Guid ModelClassDomainRoleId = new global::System.Guid(0x2495fc6d, 0x7420, 0x46b0, 0x85, 0x65, 0x21, 0xe3, 0x81, 0x82, 0x8d, 0x40); /// <summary> /// DomainRole ModelClass /// Description for Sawczyn.EFDesigner.EFModel.CommentReferencesClasses.ModelClass /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.CommentReferencesClasses/ModelClass.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.CommentReferencesClasses/ModelClass.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslModeling::DomainRole(DslModeling::DomainRoleOrder.Target, PropertyName = "Comments", PropertyDisplayNameKey="Sawczyn.EFDesigner.EFModel.CommentReferencesClasses/ModelClass.PropertyDisplayName", PropagatesCopy = DslModeling::PropagatesCopyOption.DoNotPropagateCopy, Multiplicity = DslModeling::Multiplicity.ZeroMany)] [DslModeling::DomainObjectId("2495fc6d-7420-46b0-8565-21e381828d40")] public virtual ModelClass ModelClass { [global::System.Diagnostics.DebuggerStepThrough] get { return (ModelClass)DslModeling::DomainRoleInfo.GetRolePlayer(this, ModelClassDomainRoleId); } [global::System.Diagnostics.DebuggerStepThrough] set { DslModeling::DomainRoleInfo.SetRolePlayer(this, ModelClassDomainRoleId, value); } } #endregion #region Static methods to access Classes of a Comment /// <summary> /// Gets a list of Classes. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static DslModeling::LinkedElementCollection<ModelClass> GetClasses(Comment element) { return GetRoleCollection<DslModeling::LinkedElementCollection<ModelClass>, ModelClass>(element, CommentDomainRoleId); } #endregion #region DesignElement domain role override /// <summary> /// Gets the element playing ModelClass domain role. /// Description for /// Sawczyn.EFDesigner.EFModel.CommentReferencesSubjects.DesignElement /// </summary> public override DesignElement DesignElement { [global::System.Diagnostics.DebuggerStepThrough] get { return this.ModelClass; } [global::System.Diagnostics.DebuggerStepThrough] set { this.ModelClass = (ModelClass)value; } } #endregion #region Comment link accessor /// <summary> /// Get the list of CommentReferencesClasses links to a Comment. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::System.Collections.ObjectModel.ReadOnlyCollection<global::Sawczyn.EFDesigner.EFModel.CommentReferencesClasses> GetLinksToClasses ( global::Sawczyn.EFDesigner.EFModel.Comment commentInstance ) { return DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.CommentReferencesClasses>(commentInstance, global::Sawczyn.EFDesigner.EFModel.CommentReferencesClasses.CommentDomainRoleId); } #endregion #region ModelClass link accessor /// <summary> /// Get the list of CommentReferencesClasses links to a ModelClass. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::System.Collections.ObjectModel.ReadOnlyCollection<global::Sawczyn.EFDesigner.EFModel.CommentReferencesClasses> GetLinksToComments ( global::Sawczyn.EFDesigner.EFModel.ModelClass modelClassInstance ) { return DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.CommentReferencesClasses>(modelClassInstance, global::Sawczyn.EFDesigner.EFModel.CommentReferencesClasses.ModelClassDomainRoleId); } #endregion #region CommentReferencesClasses instance accessors /// <summary> /// Get any CommentReferencesClasses links between a given Comment and a ModelClass. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::System.Collections.ObjectModel.ReadOnlyCollection<global::Sawczyn.EFDesigner.EFModel.CommentReferencesClasses> GetLinks( global::Sawczyn.EFDesigner.EFModel.Comment source, global::Sawczyn.EFDesigner.EFModel.ModelClass target ) { global::System.Collections.Generic.List<global::Sawczyn.EFDesigner.EFModel.CommentReferencesClasses> outLinks = new global::System.Collections.Generic.List<global::Sawczyn.EFDesigner.EFModel.CommentReferencesClasses>(); global::System.Collections.Generic.IList<global::Sawczyn.EFDesigner.EFModel.CommentReferencesClasses> links = DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.CommentReferencesClasses>(source, global::Sawczyn.EFDesigner.EFModel.CommentReferencesClasses.CommentDomainRoleId); foreach ( global::Sawczyn.EFDesigner.EFModel.CommentReferencesClasses link in links ) { if ( target.Equals(link.ModelClass) ) { outLinks.Add(link); } } return outLinks.AsReadOnly(); } /// <summary> /// Get the one CommentReferencesClasses link between a given Commentand a ModelClass. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::Sawczyn.EFDesigner.EFModel.CommentReferencesClasses GetLink( global::Sawczyn.EFDesigner.EFModel.Comment source, global::Sawczyn.EFDesigner.EFModel.ModelClass target ) { global::System.Collections.Generic.IList<global::Sawczyn.EFDesigner.EFModel.CommentReferencesClasses> links = DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.CommentReferencesClasses>(source, global::Sawczyn.EFDesigner.EFModel.CommentReferencesClasses.CommentDomainRoleId); foreach ( global::Sawczyn.EFDesigner.EFModel.CommentReferencesClasses link in links ) { if ( target.Equals(link.ModelClass) ) { return link; } } return null; } #endregion } } namespace Sawczyn.EFDesigner.EFModel { /// <summary> /// DomainRelationship CommentReferencesEnums /// Description for Sawczyn.EFDesigner.EFModel.CommentReferencesEnums /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.CommentReferencesEnums.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.CommentReferencesEnums.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslModeling::DomainModelOwner(typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel))] [global::System.CLSCompliant(true)] [DslModeling::DomainRelationship()] [DslModeling::DomainObjectId("c2ca35b4-7dc5-4a7d-9a6f-cfd1cc9aedac")] public partial class CommentReferencesEnums : CommentReferencesSubjects { #region Constructors, domain class Id /// <summary> /// CommentReferencesEnums domain class Id. /// </summary> public static readonly new global::System.Guid DomainClassId = new global::System.Guid(0xc2ca35b4, 0x7dc5, 0x4a7d, 0x9a, 0x6f, 0xcf, 0xd1, 0xcc, 0x9a, 0xed, 0xac); /// <summary> /// Constructor /// Creates a CommentReferencesEnums link in the same Partition as the given Comment /// </summary> /// <param name="source">Comment to use as the source of the relationship.</param> /// <param name="target">ModelEnum to use as the target of the relationship.</param> public CommentReferencesEnums(Comment source, ModelEnum target) : base((source != null ? source.Partition : null), new DslModeling::RoleAssignment[]{new DslModeling::RoleAssignment(CommentReferencesEnums.CommentDomainRoleId, source), new DslModeling::RoleAssignment(CommentReferencesEnums.ModelEnumDomainRoleId, target)}, null) { } /// <summary> /// Constructor /// </summary> /// <param name="store">Store where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> public CommentReferencesEnums(DslModeling::Store store, params DslModeling::RoleAssignment[] roleAssignments) : base(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, roleAssignments, null) { } /// <summary> /// Constructor /// </summary> /// <param name="store">Store where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> /// <param name="propertyAssignments">List of properties assignments to set on the new link.</param> public CommentReferencesEnums(DslModeling::Store store, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments) : base(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, roleAssignments, propertyAssignments) { } /// <summary> /// Constructor /// </summary> /// <param name="partition">Partition where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> public CommentReferencesEnums(DslModeling::Partition partition, params DslModeling::RoleAssignment[] roleAssignments) : base(partition, roleAssignments, null) { } /// <summary> /// Constructor /// </summary> /// <param name="partition">Partition where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> /// <param name="propertyAssignments">List of properties assignments to set on the new link.</param> public CommentReferencesEnums(DslModeling::Partition partition, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments) : base(partition, roleAssignments, propertyAssignments) { } #endregion #region Comment domain role code /// <summary> /// Comment domain role Id. /// </summary> public static readonly new global::System.Guid CommentDomainRoleId = new global::System.Guid(0xed267b9d, 0xcbe7, 0x4888, 0x9a, 0x95, 0xe7, 0x51, 0x91, 0x35, 0xc7, 0x6b); /// <summary> /// DomainRole Comment /// Description for Sawczyn.EFDesigner.EFModel.CommentReferencesEnums.Comment /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.CommentReferencesEnums/Comment.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.CommentReferencesEnums/Comment.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [global::System.ComponentModel.Browsable(false)] [DslModeling::DomainRole(DslModeling::DomainRoleOrder.Source, PropertyName = "Enums", PropertyDisplayNameKey="Sawczyn.EFDesigner.EFModel.CommentReferencesEnums/Comment.PropertyDisplayName", PropagatesCopy = DslModeling::PropagatesCopyOption.DoNotPropagateCopy, Multiplicity = DslModeling::Multiplicity.ZeroMany)] [DslModeling::DomainObjectId("ed267b9d-cbe7-4888-9a95-e7519135c76b")] public override Comment Comment { [global::System.Diagnostics.DebuggerStepThrough] get { return (Comment)DslModeling::DomainRoleInfo.GetRolePlayer(this, CommentDomainRoleId); } [global::System.Diagnostics.DebuggerStepThrough] set { DslModeling::DomainRoleInfo.SetRolePlayer(this, CommentDomainRoleId, value); } } #endregion #region Static methods to access Comments of a ModelEnum /// <summary> /// Gets a list of Comments. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static DslModeling::LinkedElementCollection<Comment> GetComments(ModelEnum element) { return GetRoleCollection<DslModeling::LinkedElementCollection<Comment>, Comment>(element, ModelEnumDomainRoleId); } #endregion #region ModelEnum domain role code /// <summary> /// ModelEnum domain role Id. /// </summary> public static readonly global::System.Guid ModelEnumDomainRoleId = new global::System.Guid(0xd5ba04cb, 0xa560, 0x4293, 0xbd, 0xee, 0xb4, 0x5b, 0x62, 0x74, 0x28, 0x64); /// <summary> /// DomainRole ModelEnum /// Description for Sawczyn.EFDesigner.EFModel.CommentReferencesEnums.ModelEnum /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.CommentReferencesEnums/ModelEnum.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.CommentReferencesEnums/ModelEnum.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslModeling::DomainRole(DslModeling::DomainRoleOrder.Target, PropertyName = "Comments", PropertyDisplayNameKey="Sawczyn.EFDesigner.EFModel.CommentReferencesEnums/ModelEnum.PropertyDisplayName", PropagatesCopy = DslModeling::PropagatesCopyOption.DoNotPropagateCopy, Multiplicity = DslModeling::Multiplicity.ZeroMany)] [DslModeling::DomainObjectId("d5ba04cb-a560-4293-bdee-b45b62742864")] public virtual ModelEnum ModelEnum { [global::System.Diagnostics.DebuggerStepThrough] get { return (ModelEnum)DslModeling::DomainRoleInfo.GetRolePlayer(this, ModelEnumDomainRoleId); } [global::System.Diagnostics.DebuggerStepThrough] set { DslModeling::DomainRoleInfo.SetRolePlayer(this, ModelEnumDomainRoleId, value); } } #endregion #region Static methods to access Enums of a Comment /// <summary> /// Gets a list of Enums. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static DslModeling::LinkedElementCollection<ModelEnum> GetEnums(Comment element) { return GetRoleCollection<DslModeling::LinkedElementCollection<ModelEnum>, ModelEnum>(element, CommentDomainRoleId); } #endregion #region DesignElement domain role override /// <summary> /// Gets the element playing ModelEnum domain role. /// Description for /// Sawczyn.EFDesigner.EFModel.CommentReferencesSubjects.DesignElement /// </summary> public override DesignElement DesignElement { [global::System.Diagnostics.DebuggerStepThrough] get { return this.ModelEnum; } [global::System.Diagnostics.DebuggerStepThrough] set { this.ModelEnum = (ModelEnum)value; } } #endregion #region Comment link accessor /// <summary> /// Get the list of CommentReferencesEnums links to a Comment. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::System.Collections.ObjectModel.ReadOnlyCollection<global::Sawczyn.EFDesigner.EFModel.CommentReferencesEnums> GetLinksToEnums ( global::Sawczyn.EFDesigner.EFModel.Comment commentInstance ) { return DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.CommentReferencesEnums>(commentInstance, global::Sawczyn.EFDesigner.EFModel.CommentReferencesEnums.CommentDomainRoleId); } #endregion #region ModelEnum link accessor /// <summary> /// Get the list of CommentReferencesEnums links to a ModelEnum. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::System.Collections.ObjectModel.ReadOnlyCollection<global::Sawczyn.EFDesigner.EFModel.CommentReferencesEnums> GetLinksToComments ( global::Sawczyn.EFDesigner.EFModel.ModelEnum modelEnumInstance ) { return DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.CommentReferencesEnums>(modelEnumInstance, global::Sawczyn.EFDesigner.EFModel.CommentReferencesEnums.ModelEnumDomainRoleId); } #endregion #region CommentReferencesEnums instance accessors /// <summary> /// Get any CommentReferencesEnums links between a given Comment and a ModelEnum. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::System.Collections.ObjectModel.ReadOnlyCollection<global::Sawczyn.EFDesigner.EFModel.CommentReferencesEnums> GetLinks( global::Sawczyn.EFDesigner.EFModel.Comment source, global::Sawczyn.EFDesigner.EFModel.ModelEnum target ) { global::System.Collections.Generic.List<global::Sawczyn.EFDesigner.EFModel.CommentReferencesEnums> outLinks = new global::System.Collections.Generic.List<global::Sawczyn.EFDesigner.EFModel.CommentReferencesEnums>(); global::System.Collections.Generic.IList<global::Sawczyn.EFDesigner.EFModel.CommentReferencesEnums> links = DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.CommentReferencesEnums>(source, global::Sawczyn.EFDesigner.EFModel.CommentReferencesEnums.CommentDomainRoleId); foreach ( global::Sawczyn.EFDesigner.EFModel.CommentReferencesEnums link in links ) { if ( target.Equals(link.ModelEnum) ) { outLinks.Add(link); } } return outLinks.AsReadOnly(); } /// <summary> /// Get the one CommentReferencesEnums link between a given Commentand a ModelEnum. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::Sawczyn.EFDesigner.EFModel.CommentReferencesEnums GetLink( global::Sawczyn.EFDesigner.EFModel.Comment source, global::Sawczyn.EFDesigner.EFModel.ModelEnum target ) { global::System.Collections.Generic.IList<global::Sawczyn.EFDesigner.EFModel.CommentReferencesEnums> links = DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.CommentReferencesEnums>(source, global::Sawczyn.EFDesigner.EFModel.CommentReferencesEnums.CommentDomainRoleId); foreach ( global::Sawczyn.EFDesigner.EFModel.CommentReferencesEnums link in links ) { if ( target.Equals(link.ModelEnum) ) { return link; } } return null; } #endregion } } namespace Sawczyn.EFDesigner.EFModel { /// <summary> /// DomainRelationship ModelRootHasModelDiagrams /// Description for Sawczyn.EFDesigner.EFModel.ModelRootHasModelDiagrams /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.ModelRootHasModelDiagrams.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.ModelRootHasModelDiagrams.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslModeling::DomainModelOwner(typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel))] [global::System.CLSCompliant(true)] [DslModeling::DomainRelationship(IsEmbedding=true)] [DslModeling::DomainObjectId("bbdf2307-a6c2-4cf5-b2d9-290b94558d42")] public partial class ModelRootHasModelDiagrams : DslModeling::ElementLink { #region Constructors, domain class Id /// <summary> /// ModelRootHasModelDiagrams domain class Id. /// </summary> public static readonly new global::System.Guid DomainClassId = new global::System.Guid(0xbbdf2307, 0xa6c2, 0x4cf5, 0xb2, 0xd9, 0x29, 0x0b, 0x94, 0x55, 0x8d, 0x42); /// <summary> /// Constructor /// Creates a ModelRootHasModelDiagrams link in the same Partition as the given ModelRoot /// </summary> /// <param name="source">ModelRoot to use as the source of the relationship.</param> /// <param name="target">ModelDiagramData to use as the target of the relationship.</param> public ModelRootHasModelDiagrams(ModelRoot source, ModelDiagramData target) : base((source != null ? source.Partition : null), new DslModeling::RoleAssignment[]{new DslModeling::RoleAssignment(ModelRootHasModelDiagrams.ModelRootDomainRoleId, source), new DslModeling::RoleAssignment(ModelRootHasModelDiagrams.ModelDiagramDataDomainRoleId, target)}, null) { } /// <summary> /// Constructor /// </summary> /// <param name="store">Store where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> public ModelRootHasModelDiagrams(DslModeling::Store store, params DslModeling::RoleAssignment[] roleAssignments) : base(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, roleAssignments, null) { } /// <summary> /// Constructor /// </summary> /// <param name="store">Store where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> /// <param name="propertyAssignments">List of properties assignments to set on the new link.</param> public ModelRootHasModelDiagrams(DslModeling::Store store, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments) : base(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, roleAssignments, propertyAssignments) { } /// <summary> /// Constructor /// </summary> /// <param name="partition">Partition where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> public ModelRootHasModelDiagrams(DslModeling::Partition partition, params DslModeling::RoleAssignment[] roleAssignments) : base(partition, roleAssignments, null) { } /// <summary> /// Constructor /// </summary> /// <param name="partition">Partition where new link is to be created.</param> /// <param name="roleAssignments">List of relationship role assignments.</param> /// <param name="propertyAssignments">List of properties assignments to set on the new link.</param> public ModelRootHasModelDiagrams(DslModeling::Partition partition, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments) : base(partition, roleAssignments, propertyAssignments) { } #endregion #region ModelRoot domain role code /// <summary> /// ModelRoot domain role Id. /// </summary> public static readonly global::System.Guid ModelRootDomainRoleId = new global::System.Guid(0x76e3ca2c, 0x137a, 0x4b7f, 0xa6, 0x1b, 0xcf, 0xb0, 0xe4, 0xfe, 0x55, 0x90); /// <summary> /// DomainRole ModelRoot /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.ModelRootHasModelDiagrams/ModelRoot.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.ModelRootHasModelDiagrams/ModelRoot.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslModeling::DomainRole(DslModeling::DomainRoleOrder.Source, PropertyName = "Diagrams", PropertyDisplayNameKey="Sawczyn.EFDesigner.EFModel.ModelRootHasModelDiagrams/ModelRoot.PropertyDisplayName", PropagatesCopy = DslModeling::PropagatesCopyOption.PropagatesCopyToLinkAndOppositeRolePlayer, Multiplicity = DslModeling::Multiplicity.ZeroMany)] [DslModeling::DomainObjectId("76e3ca2c-137a-4b7f-a61b-cfb0e4fe5590")] public virtual ModelRoot ModelRoot { [global::System.Diagnostics.DebuggerStepThrough] get { return (ModelRoot)DslModeling::DomainRoleInfo.GetRolePlayer(this, ModelRootDomainRoleId); } [global::System.Diagnostics.DebuggerStepThrough] set { DslModeling::DomainRoleInfo.SetRolePlayer(this, ModelRootDomainRoleId, value); } } #endregion #region Static methods to access ModelRoot of a ModelDiagramData /// <summary> /// Gets ModelRoot. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static ModelRoot GetModelRoot(ModelDiagramData element) { return DslModeling::DomainRoleInfo.GetLinkedElement(element, ModelDiagramDataDomainRoleId) as ModelRoot; } /// <summary> /// Sets ModelRoot. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static void SetModelRoot(ModelDiagramData element, ModelRoot newModelRoot) { DslModeling::DomainRoleInfo.SetLinkedElement(element, ModelDiagramDataDomainRoleId, newModelRoot); } #endregion #region ModelDiagramData domain role code /// <summary> /// ModelDiagramData domain role Id. /// </summary> public static readonly global::System.Guid ModelDiagramDataDomainRoleId = new global::System.Guid(0x669f90c2, 0x5bc9, 0x475d, 0xb0, 0x7b, 0x1a, 0xe3, 0x58, 0xcb, 0xb6, 0x71); /// <summary> /// DomainRole ModelDiagramData /// Description for /// Sawczyn.EFDesigner.EFModel.ModelRootHasModelDiagrams.ModelDiagramData /// </summary> [DslDesign::DisplayNameResource("Sawczyn.EFDesigner.EFModel.ModelRootHasModelDiagrams/ModelDiagramData.DisplayName", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslDesign::DescriptionResource("Sawczyn.EFDesigner.EFModel.ModelRootHasModelDiagrams/ModelDiagramData.Description", typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDomainModel), "Sawczyn.EFDesigner.EFModel.GeneratedCode.DomainModelResx")] [DslModeling::DomainRole(DslModeling::DomainRoleOrder.Target, PropertyName = "ModelRoot", PropertyDisplayNameKey="Sawczyn.EFDesigner.EFModel.ModelRootHasModelDiagrams/ModelDiagramData.PropertyDisplayName", PropagatesDelete = true, PropagatesCopy = DslModeling::PropagatesCopyOption.DoNotPropagateCopy, Multiplicity = DslModeling::Multiplicity.One)] [DslModeling::DomainObjectId("669f90c2-5bc9-475d-b07b-1ae358cbb671")] public virtual ModelDiagramData ModelDiagramData { [global::System.Diagnostics.DebuggerStepThrough] get { return (ModelDiagramData)DslModeling::DomainRoleInfo.GetRolePlayer(this, ModelDiagramDataDomainRoleId); } [global::System.Diagnostics.DebuggerStepThrough] set { DslModeling::DomainRoleInfo.SetRolePlayer(this, ModelDiagramDataDomainRoleId, value); } } #endregion #region Static methods to access Diagrams of a ModelRoot /// <summary> /// Gets a list of Diagrams. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static DslModeling::LinkedElementCollection<ModelDiagramData> GetDiagrams(ModelRoot element) { return GetRoleCollection<DslModeling::LinkedElementCollection<ModelDiagramData>, ModelDiagramData>(element, ModelRootDomainRoleId); } #endregion #region ModelRoot link accessor /// <summary> /// Get the list of ModelRootHasModelDiagrams links to a ModelRoot. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::System.Collections.ObjectModel.ReadOnlyCollection<global::Sawczyn.EFDesigner.EFModel.ModelRootHasModelDiagrams> GetLinksToDiagrams ( global::Sawczyn.EFDesigner.EFModel.ModelRoot modelRootInstance ) { return DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.ModelRootHasModelDiagrams>(modelRootInstance, global::Sawczyn.EFDesigner.EFModel.ModelRootHasModelDiagrams.ModelRootDomainRoleId); } #endregion #region ModelDiagramData link accessor /// <summary> /// Get the ModelRootHasModelDiagrams link to a ModelDiagramData. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::Sawczyn.EFDesigner.EFModel.ModelRootHasModelDiagrams GetLinkToModelRoot (global::Sawczyn.EFDesigner.EFModel.ModelDiagramData modelDiagramDataInstance) { global::System.Collections.Generic.IList<global::Sawczyn.EFDesigner.EFModel.ModelRootHasModelDiagrams> links = DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.ModelRootHasModelDiagrams>(modelDiagramDataInstance, global::Sawczyn.EFDesigner.EFModel.ModelRootHasModelDiagrams.ModelDiagramDataDomainRoleId); global::System.Diagnostics.Debug.Assert(links.Count <= 1, "Multiplicity of ModelDiagramData not obeyed."); if ( links.Count == 0 ) { return null; } else { return links[0]; } } #endregion #region ModelRootHasModelDiagrams instance accessors /// <summary> /// Get any ModelRootHasModelDiagrams links between a given ModelRoot and a ModelDiagramData. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::System.Collections.ObjectModel.ReadOnlyCollection<global::Sawczyn.EFDesigner.EFModel.ModelRootHasModelDiagrams> GetLinks( global::Sawczyn.EFDesigner.EFModel.ModelRoot source, global::Sawczyn.EFDesigner.EFModel.ModelDiagramData target ) { global::System.Collections.Generic.List<global::Sawczyn.EFDesigner.EFModel.ModelRootHasModelDiagrams> outLinks = new global::System.Collections.Generic.List<global::Sawczyn.EFDesigner.EFModel.ModelRootHasModelDiagrams>(); global::System.Collections.Generic.IList<global::Sawczyn.EFDesigner.EFModel.ModelRootHasModelDiagrams> links = DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.ModelRootHasModelDiagrams>(source, global::Sawczyn.EFDesigner.EFModel.ModelRootHasModelDiagrams.ModelRootDomainRoleId); foreach ( global::Sawczyn.EFDesigner.EFModel.ModelRootHasModelDiagrams link in links ) { if ( target.Equals(link.ModelDiagramData) ) { outLinks.Add(link); } } return outLinks.AsReadOnly(); } /// <summary> /// Get the one ModelRootHasModelDiagrams link between a given ModelRootand a ModelDiagramData. /// </summary> [global::System.Diagnostics.DebuggerStepThrough] [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")] public static global::Sawczyn.EFDesigner.EFModel.ModelRootHasModelDiagrams GetLink( global::Sawczyn.EFDesigner.EFModel.ModelRoot source, global::Sawczyn.EFDesigner.EFModel.ModelDiagramData target ) { global::System.Collections.Generic.IList<global::Sawczyn.EFDesigner.EFModel.ModelRootHasModelDiagrams> links = DslModeling::DomainRoleInfo.GetElementLinks<global::Sawczyn.EFDesigner.EFModel.ModelRootHasModelDiagrams>(source, global::Sawczyn.EFDesigner.EFModel.ModelRootHasModelDiagrams.ModelRootDomainRoleId); foreach ( global::Sawczyn.EFDesigner.EFModel.ModelRootHasModelDiagrams link in links ) { if ( target.Equals(link.ModelDiagramData) ) { return link; } } return null; } #endregion } }
48.631889
352
0.746285
[ "MIT" ]
cnayan/EFDesigner
src/Dsl/GeneratedCode/DomainRelationships.cs
280,608
C#
// Copyright 2019 Google LLC // // 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 Google.Api.Ads.AdManager.Lib; using Google.Api.Ads.AdManager.v202105; using System; namespace Google.Api.Ads.AdManager.Examples.CSharp.v202105 { /// <summary> /// This code example gets current user. To create users, run CreateUsers.cs. /// </summary> public class GetCurrentUser : SampleBase { /// <summary> /// Returns a description about the code example. /// </summary> public override string Description { get { return "This example gets current user. To create users, run CreateUsers.cs."; } } /// <summary> /// Main method, to run this code example as a standalone application. /// </summary> public static void Main() { GetCurrentUser codeExample = new GetCurrentUser(); Console.WriteLine(codeExample.Description); codeExample.Run(new AdManagerUser()); } /// <summary> /// Run the code example. /// </summary> public void Run(AdManagerUser user) { using (UserService userService = user.GetService<UserService>()) { try { // Get the current user. User usr = userService.getCurrentUser(); if (usr != null) { Console.WriteLine( "User with ID = '{0}', email = '{1}', and role = '{2}' is the " + "current user.", usr.id, usr.email, usr.roleName); } else { Console.WriteLine("The current user could not be retrieved."); } } catch (Exception e) { Console.WriteLine("Failed to get current user. Exception says \"{0}\"", e.Message); } } } } }
33.727273
98
0.538313
[ "Apache-2.0" ]
googleads/googleads-dotnet-lib
examples/AdManager/CSharp/v202105/UserService/GetCurrentUser.cs
2,597
C#
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace CefSharp.Example.Properties { using System; /// <summary> /// A strongly-typed resource class, for looking up localized strings, etc. /// </summary> // This class was auto-generated by the StronglyTypedResourceBuilder // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] public class Resources { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Resources() { } /// <summary> /// Returns the cached ResourceManager instance used by this class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] public static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CefSharp.Example.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } /// <summary> /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] public static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } /// <summary> /// Looks up a localized string similar to /* /// * Bootstrap Documentation /// * Special styles for presenting Bootstrap&apos;s documentation and code examples. /// * /// * Table of contents: /// * /// * Scaffolding /// * Main navigation /// * Footer /// * Social buttons /// * Homepage /// * Page headers /// * Old docs callout /// * Ads /// * Side navigation /// * Docs sections /// * Callouts /// * Grid styles /// * Examples /// * Code snippets (highlight) /// * Responsive tests /// * Glyphicons /// * Customizer /// * Miscellaneous /// */ /// /// ////* /// * Scaffolding /// * /// * Update the basics of our docum [rest of string was truncated]&quot;;. /// </summary> public static string assets_css_docs_css { get { return ResourceManager.GetString("assets_css_docs_css", resourceCulture); } } /// <summary> /// Looks up a localized string similar to /** /// * SyntaxHighlighter /// * http://alexgorbatchev.com/SyntaxHighlighter /// * /// * SyntaxHighlighter is donationware. If you are using it, please donate. /// * http://alexgorbatchev.com/SyntaxHighlighter/donate.html /// * /// * @version /// * 3.0.83 (July 02 2010) /// * /// * @copyright /// * Copyright (C) 2004-2010 Alex Gorbatchev. /// * /// * @license /// * Dual licensed under the MIT and GPL licenses. /// */ ///.syntaxhighlighter a, ///.syntaxhighlighter div, ///.syntaxhighlighter code, ///.syntaxhighlighter table, ///.syntaxhighlighte [rest of string was truncated]&quot;;. /// </summary> public static string assets_css_shCore_css { get { return ResourceManager.GetString("assets_css_shCore_css", resourceCulture); } } /// <summary> /// Looks up a localized string similar to /** /// * SyntaxHighlighter /// * http://alexgorbatchev.com/SyntaxHighlighter /// * /// * SyntaxHighlighter is donationware. If you are using it, please donate. /// * http://alexgorbatchev.com/SyntaxHighlighter/donate.html /// * /// * @version /// * 3.0.83 (July 02 2010) /// * /// * @copyright /// * Copyright (C) 2004-2010 Alex Gorbatchev. /// * /// * @license /// * Dual licensed under the MIT and GPL licenses. /// */ ///.syntaxhighlighter a, ///.syntaxhighlighter div, ///.syntaxhighlighter code, ///.syntaxhighlighter table, ///.syntaxhighlighte [rest of string was truncated]&quot;;. /// </summary> public static string assets_css_shCoreDefault_css { get { return ResourceManager.GetString("assets_css_shCoreDefault_css", resourceCulture); } } /// <summary> /// Looks up a localized string similar to // NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT ///// IT&apos;S ALL JUST JUNK FOR OUR DOCS! ///// ++++++++++++++++++++++++++++++++++++++++++ /// ///!function ($) { /// $(function () { /// var $window = $(window); /// var $body = $(document.body); /// var navHeight = $(&apos;.navbar&apos;).outerHeight(true) + 10; /// $body.scrollspy({ /// target: &apos;.bs-sidebar&apos;, /// offset: navHeight /// }); /// $window.on(&apos;load&apos;, function () { /// $body.scrollspy(&apos;refresh&apos;); /// }); /// [rest of string was truncated]&quot;;. /// </summary> public static string assets_js_application_js { get { return ResourceManager.GetString("assets_js_application_js", resourceCulture); } } /// <summary> /// Looks up a localized string similar to /*! jQuery v1.11.3 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */ ///!function(a,b){&quot;object&quot;==typeof module&amp;&amp;&quot;object&quot;==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error(&quot;jQuery requires a window with a document&quot;);return b(a)}:b(a)}(&quot;undefined&quot;!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=&quot;1.11.3&quot;,m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\x [rest of string was truncated]&quot;;. /// </summary> public static string assets_js_jquery_js { get { return ResourceManager.GetString("assets_js_jquery_js", resourceCulture); } } /// <summary> /// Looks up a localized string similar to /** /// * SyntaxHighlighter /// * http://alexgorbatchev.com/SyntaxHighlighter /// * /// * SyntaxHighlighter is donationware. If you are using it, please donate. /// * http://alexgorbatchev.com/SyntaxHighlighter/donate.html /// * /// * @version /// * 3.0.83 (July 02 2010) /// * /// * @copyright /// * Copyright (C) 2004-2010 Alex Gorbatchev. /// * /// * @license /// * Dual licensed under the MIT and GPL licenses. /// */ ///;(function() ///{ /// // CommonJS /// typeof(require) != &apos;undefined&apos; ? SyntaxHighlighter = require(&apos;shCore&apos;).SyntaxHighlight [rest of string was truncated]&quot;;. /// </summary> public static string assets_js_shBrushCSharp_js { get { return ResourceManager.GetString("assets_js_shBrushCSharp_js", resourceCulture); } } /// <summary> /// Looks up a localized string similar to /** /// * SyntaxHighlighter /// * http://alexgorbatchev.com/SyntaxHighlighter /// * /// * SyntaxHighlighter is donationware. If you are using it, please donate. /// * http://alexgorbatchev.com/SyntaxHighlighter/donate.html /// * /// * @version /// * 3.0.83 (July 02 2010) /// * /// * @copyright /// * Copyright (C) 2004-2010 Alex Gorbatchev. /// * /// * @license /// * Dual licensed under the MIT and GPL licenses. /// */ ///; (function () { /// // CommonJS /// typeof (require) != &apos;undefined&apos; ? SyntaxHighlighter = require(&apos;shCore&apos;).SyntaxH [rest of string was truncated]&quot;;. /// </summary> public static string assets_js_shBrushJScript_js { get { return ResourceManager.GetString("assets_js_shBrushJScript_js", resourceCulture); } } /// <summary> /// Looks up a localized string similar to /** /// * SyntaxHighlighter /// * http://alexgorbatchev.com/SyntaxHighlighter /// * /// * SyntaxHighlighter is donationware. If you are using it, please donate. /// * http://alexgorbatchev.com/SyntaxHighlighter/donate.html /// * /// * @version /// * 3.0.83 (July 02 2010) /// * /// * @copyright /// * Copyright (C) 2004-2010 Alex Gorbatchev. /// * /// * @license /// * Dual licensed under the MIT and GPL licenses. /// */ ///eval(function (p, a, c, k, e, d) { e = function (c) { return (c &lt; a ? &apos;&apos; : e(parseInt(c / a))) + ((c = c % a) &gt; 35 ? S [rest of string was truncated]&quot;;. /// </summary> public static string assets_js_shCore_js { get { return ResourceManager.GetString("assets_js_shCore_js", resourceCulture); } } /// <summary> /// Looks up a localized resource of type System.Drawing.Bitmap. /// </summary> public static System.Drawing.Bitmap beach { get { object obj = ResourceManager.GetObject("beach", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } /// <summary> /// Looks up a localized string similar to &lt;!DOCTYPE html&gt; ///&lt;html&gt; ///&lt;head&gt; /// &lt;meta charset=&quot;utf-8&quot;&gt; /// &lt;title&gt;QUnit Javascript Binding API Object Name&lt;/title&gt; /// &lt;link rel=&quot;stylesheet&quot; href=&quot;https://code.jquery.com/qunit/qunit-2.10.0.css&quot;&gt; /// &lt;script&gt; /// if (!window.bindingApiObject) /// { /// window.bindingApiObject = window.cefSharp; /// } /// &lt;/script&gt; ///&lt;/head&gt; ///&lt;body&gt; /// &lt;div id=&quot;qunit&quot;&gt;&lt;/div&gt; /// &lt;div id=&quot;qunit-fixture&quot;&gt;&lt;/div&gt; /// &lt;script src=&quot;https://code.jquery.com/qunit/qunit-2.10.0.js&quot;&gt;&lt;/script&gt; /// &lt; [rest of string was truncated]&quot;;. /// </summary> public static string BindingApiCustomObjectNameTest { get { return ResourceManager.GetString("BindingApiCustomObjectNameTest", resourceCulture); } } /// <summary> /// Looks up a localized string similar to &lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;&gt; ///&lt;html&gt; ///&lt;head&gt; /// &lt;title&gt;Binding Test&lt;/title&gt; /// &lt;link rel=&quot;stylesheet&quot; href=&quot;https://code.jquery.com/qunit/qunit-2.10.0.css&quot;&gt; ///&lt;/head&gt; ///&lt;body&gt; /// &lt;div id=&quot;qunit&quot;&gt;&lt;/div&gt; /// &lt;div id=&quot;qunit-fixture&quot;&gt;&lt;/div&gt; /// &lt;script src=&quot;https://code.jquery.com/qunit/qunit-2.10.0.js&quot;&gt;&lt;/script&gt; /// /// &lt;!--&lt;script type=&quot;text/javascript&quot;&gt; /// (async function() { /// // &lt;embed user provided code here&gt; /// /// await CefSharp.BindObjectAsync(&quot;boundA [rest of string was truncated]&quot;;. /// </summary> public static string BindingTest { get { return ResourceManager.GetString("BindingTest", resourceCulture); } } /// <summary> /// Looks up a localized string similar to QUnit.module(&apos;BindingTestAsync&apos;, (hooks) =&gt; ///{ /// hooks.before(async () =&gt; /// { /// await CefSharp.BindObjectAsync(&quot;boundAsync&quot;); /// }); /// /// QUnit.test(&quot;BindObjectAsync Second call with boundAsync param&quot;, async (assert) =&gt; /// { /// const res = await CefSharp.BindObjectAsync(&quot;boundAsync&quot;); /// assert.equal(res.Success, false, &quot;Second call to BindObjectAsync with already bound objects as params returned false.&quot;); /// }); /// /// QUnit.test(&quot;Async call (Throw .Net Exception)&quot;, async ( [rest of string was truncated]&quot;;. /// </summary> public static string BindingTestAsync { get { return ResourceManager.GetString("BindingTestAsync", resourceCulture); } } /// <summary> /// Looks up a localized string similar to &lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;&gt; ///&lt;html&gt; ///&lt;head&gt; /// &lt;title&gt;Binding Test (Net Core)&lt;/title&gt; /// &lt;link rel=&quot;stylesheet&quot; href=&quot;https://code.jquery.com/qunit/qunit-2.10.0.css&quot;&gt; ///&lt;/head&gt; ///&lt;body&gt; /// &lt;div id=&quot;qunit&quot;&gt;&lt;/div&gt; /// &lt;div id=&quot;qunit-fixture&quot;&gt;&lt;/div&gt; /// &lt;script src=&quot;https://code.jquery.com/qunit/qunit-2.10.0.js&quot;&gt;&lt;/script&gt; /// /// &lt;!--&lt;script type=&quot;text/javascript&quot;&gt; /// (async function() { /// // &lt;embed user provided code here&gt; /// /// await CefSharp.BindObjectAs [rest of string was truncated]&quot;;. /// </summary> public static string BindingTestNetCore { get { return ResourceManager.GetString("BindingTestNetCore", resourceCulture); } } /// <summary> /// Looks up a localized string similar to &lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;&gt; ///&lt;html&gt; ///&lt;head&gt; /// &lt;title&gt;Binding Test Async Task&lt;/title&gt; /// &lt;link rel=&quot;stylesheet&quot; href=&quot;https://code.jquery.com/qunit/qunit-2.10.0.css&quot;&gt; ///&lt;/head&gt; ///&lt;body&gt; /// &lt;div&gt; /// These tests require CefSharpSettings.ConcurrentTaskExecution = true; /// Which by default is set to false /// &lt;/div&gt; /// /// &lt;div id=&quot;qunit&quot;&gt;&lt;/div&gt; /// &lt;div id=&quot;qunit-fixture&quot;&gt;&lt;/div&gt; /// &lt;script src=&quot;https://code.jquery.com/qunit/qunit-2.10.0.js&quot;&gt;&lt;/script&gt; /// /// [rest of string was truncated]&quot;;. /// </summary> public static string BindingTestsAsyncTask { get { return ResourceManager.GetString("BindingTestsAsyncTask", resourceCulture); } } /// <summary> /// Looks up a localized string similar to &lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;&gt; ///&lt;html&gt; ///&lt;head&gt; /// &lt;title&gt;Binding Test Single&lt;/title&gt; /// &lt;link rel=&quot;stylesheet&quot; href=&quot;https://code.jquery.com/qunit/qunit-2.10.0.css&quot;&gt; ///&lt;/head&gt; ///&lt;body&gt; /// &lt;div id=&quot;qunit&quot;&gt;&lt;/div&gt; /// &lt;div id=&quot;qunit-fixture&quot;&gt;&lt;/div&gt; /// &lt;script src=&quot;https://code.jquery.com/qunit/qunit-2.10.0.js&quot;&gt;&lt;/script&gt; /// /// &lt;script type=&quot;text/javascript&quot;&gt; /// QUnit.module(&apos;BindingTestSingle&apos;, (hooks) =&gt; /// { /// hooks.before(async () =&gt; /// { /// [rest of string was truncated]&quot;;. /// </summary> public static string BindingTestSingle { get { return ResourceManager.GetString("BindingTestSingle", resourceCulture); } } /// <summary> /// Looks up a localized string similar to QUnit.module(&apos;BindingTestSync&apos;, (hooks) =&gt; ///{ /// hooks.before(async () =&gt; /// { /// await CefSharp.BindObjectAsync(&quot;bound&quot;); /// }); /// /// QUnit.test(&quot;BindObjectAsync Second call with Bound param&quot;, async (assert) =&gt; /// { /// const res = await CefSharp.BindObjectAsync(&quot;bound&quot;); /// /// assert.equal(res.Success, false, &quot;Second call to BindObjectAsync with already bound objects as params returned false.&quot;); /// }); /// /// QUnit.test(&quot;bound.repeat(&apos;hi &apos;, 5)&quot;, function (assert) /// { /// [rest of string was truncated]&quot;;. /// </summary> public static string BindingTestSync { get { return ResourceManager.GetString("BindingTestSync", resourceCulture); } } /// <summary> /// Looks up a localized string similar to /*! /// * Bootstrap v3.0.0 /// * /// * Copyright 2013 Twitter, Inc /// * Licensed under the Apache License v2.0 /// * http://www.apache.org/licenses/LICENSE-2.0 /// * /// * Designed and built with all the love in the world by @mdo and @fat. /// *//*! normalize.css v2.1.0 | MIT License | git.io/normalize */article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,video{display:inline-block}audio:not([controls]){display:none;height:0}[hidden]{display:none}html{font-famil [rest of string was truncated]&quot;;. /// </summary> public static string bootstrap_min_css { get { return ResourceManager.GetString("bootstrap_min_css", resourceCulture); } } /// <summary> /// Looks up a localized string similar to /** ///* bootstrap.js v3.0.0 by @fat and @mdo ///* Copyright 2013 Twitter Inc. ///* http://www.apache.org/licenses/LICENSE-2.0 ///*/ ///if (!jQuery) throw new Error(&quot;Bootstrap requires jQuery&quot;); +function (a) { &quot;use strict&quot;; function b() { var a = document.createElement(&quot;bootstrap&quot;), b = { WebkitTransition: &quot;webkitTransitionEnd&quot;, MozTransition: &quot;transitionend&quot;, OTransition: &quot;oTransitionEnd otransitionend&quot;, transition: &quot;transitionend&quot; }; for (var c in b) if (void 0 !== a.style[c]) return { end: b[c] } } a.fn.emulateTr [rest of string was truncated]&quot;;. /// </summary> public static string bootstrap_min_js { get { return ResourceManager.GetString("bootstrap_min_js", resourceCulture); } } /// <summary> /// Looks up a localized string similar to .btn-default,.btn-primary,.btn-success,.btn-info,.btn-warning,.btn-danger{text-shadow:0 -1px 0 rgba(0,0,0,0.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.15),0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 0 rgba(255,255,255,0.15),0 1px 1px rgba(0,0,0,0.075)}.btn-default:active,.btn-primary:active,.btn-success:active,.btn-info:active,.btn-warning:active,.btn-danger:active,.btn-default.active,.btn-primary.active,.btn-success.active,.btn-info.active,.btn-warning.active,.btn-danger.active{-webkit-b [rest of string was truncated]&quot;;. /// </summary> public static string bootstrap_theme_min_css { get { return ResourceManager.GetString("bootstrap_theme_min_css", resourceCulture); } } /// <summary> /// Looks up a localized string similar to ///&lt;html&gt; ///&lt;head&gt; /// &lt;script language=&quot;JavaScript&quot;&gt; /// function probeSupport() { /// var tests = []; /// var testKeySystems = [ /// &apos;com.widevine.alpha&apos;, /// &apos;org.w3.clearkey&apos; /// ]; /// /// var testCodecs = [ /// { type: &apos;H.264&apos;, contentType: &apos;video/mp4; codecs=&quot;avc1.42E01E&quot;&apos; }, /// { type: &apos;H.264/MPEG-4 AVC&apos;, contentType: &apos;video/mp4; codecs=&quot;avc1.42E01E, mp4a.40.2&quot;&apos; }, /// { type: &apos;ogg&apos;, contentType: &apos;vid [rest of string was truncated]&quot;;. /// </summary> public static string CdmSupportTest { get { return ResourceManager.GetString("CdmSupportTest", resourceCulture); } } /// <summary> /// Looks up a localized string similar to &lt;!DOCTYPE html&gt; ///&lt;html&gt; ///&lt;head&gt; /// &lt;style&gt; /// div { /// width: 100px; /// height: 100px; /// background-color: red; /// position: relative; /// animation: myfirst 5s linear infinite alternate; /// } /// /// @keyframes myfirst { /// 0% { /// background-color: red; /// left: 0px; /// top: 0px; /// } /// /// 25% { /// background-color: yellow; /// left: 200px; /// [rest of string was truncated]&quot;;. /// </summary> public static string CssAnimation { get { return ResourceManager.GetString("CssAnimation", resourceCulture); } } /// <summary> /// Looks up a localized string similar to &lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;&gt; ///&lt;html&gt; ///&lt;head&gt; /// &lt;title&gt;Drag&amp;Drop Cursors Test&lt;/title&gt; /// &lt;style&gt; /// .dropzone { width: 80px; height: 70px; padding: 10px; display: inline-block; border: 1px solid #aaaaaa; background: white; } /// /// #drag { width: 200px; height: 50px; padding: 10px; border: 1px solid #aaaaaa; background: wheat; } /// &lt;/style&gt; /// &lt;script&gt; /// function allowDrop(ev, effect) /// { /// ev.dataTransfer.dropEffect = effect; /// [rest of string was truncated]&quot;;. /// </summary> public static string DragDropCursorsTest { get { return ResourceManager.GetString("DragDropCursorsTest", resourceCulture); } } /// <summary> /// Looks up a localized string similar to &lt;!DOCTYPE html&gt; /// ///&lt;html lang=&quot;en&quot; xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt; ///&lt;head&gt; /// &lt;meta charset=&quot;utf-8&quot; /&gt; /// &lt;title&gt;Draggable Region Test&lt;/title&gt; ///&lt;/head&gt; ///&lt;body&gt; /// /// &lt;h1&gt;Draggable Region Test&lt;/h1&gt; /// &lt;div style=&quot;-webkit-app-region: drag;width:200px;height:200px;border:1px solid black;&quot;&gt; /// A draggable area /// &lt;/div&gt; /// &lt;br/&gt; /// /// &lt;div style=&quot;-webkit-app-region: drag;width:400px;height:400px;border:1px solid black;&quot;&gt; /// A draggable area /// &lt;div style=&quot;-webkit-app-region: [rest of string was truncated]&quot;;. /// </summary> public static string DraggableRegionTest { get { return ResourceManager.GetString("DraggableRegionTest", resourceCulture); } } /// <summary> /// Looks up a localized string similar to &lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;&gt; ///&lt;html&gt; /// &lt;head&gt; /// &lt;title&gt;Exception Test&lt;/title&gt; /// &lt;script type=&quot;text/javascript&quot;&gt; /// function logException(e) /// { /// document.write(e.message.replace(/\n/g, &apos;&lt;br /&gt;&apos;) + &quot;&lt;br /&gt;Stack:&lt;br /&gt;&quot; + e.stack.replace(/\n/g, &apos;&lt;br /&gt;&apos;)); /// } /// &lt;/script&gt; /// &lt;/head&gt; /// &lt;body&gt; /// &lt;p&gt; /// Exception string for nested exceptions:&lt;br /&gt; /// &lt;script type=&quot;text/javasc [rest of string was truncated]&quot;;. /// </summary> public static string ExceptionTest { get { return ResourceManager.GetString("ExceptionTest", resourceCulture); } } /// <summary> /// Looks up a localized string similar to &lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;&gt; ///&lt;html&gt; /// &lt;head&gt; /// &lt;title&gt;Framed WebGL Test&lt;/title&gt; /// &lt;/head&gt; /// &lt;body&gt; /// &lt;iframe width=&quot;600&quot; height=&quot;400&quot; src=&quot;http://webglsamples.org/aquarium/aquarium.html&quot;&gt;&lt;/iframe&gt; /// &lt;/body&gt; ///&lt;/html&gt; ///. /// </summary> public static string FramedWebGLTest { get { return ResourceManager.GetString("FramedWebGLTest", resourceCulture); } } /// <summary> /// Looks up a localized string similar to &lt;!DOCTYPE html&gt; /// ///&lt;html lang=&quot;en&quot; xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt; ///&lt;head&gt; /// &lt;meta charset=&quot;utf-8&quot; /&gt; /// &lt;title&gt;Hello World&lt;/title&gt; ///&lt;/head&gt; ///&lt;body&gt; /// &lt;p&gt;Hello World&lt;/p&gt; /// &lt;script&gt; /// document.write(&quot;Testing&quot;); /// &lt;/script&gt; ///&lt;/body&gt; ///&lt;/html&gt; ///. /// </summary> public static string HelloWorld { get { return ResourceManager.GetString("HelloWorld", resourceCulture); } } /// <summary> /// Looks up a localized string similar to &lt;!DOCTYPE html&gt; ///&lt;html lang=&quot;en&quot;&gt; ///&lt;head&gt; /// &lt;!-- Meta, title, CSS, favicons, etc. --&gt; /// &lt;meta charset=&quot;utf-8&quot;&gt; /// &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt; /// &lt;meta name=&quot;description&quot; content=&quot;&quot;&gt; /// &lt;meta name=&quot;author&quot; content=&quot;&quot;&gt; /// &lt;title&gt;Getting started &amp;middot; CefSharp &lt;/title&gt; /// &lt;!-- Bootstrap core CSS --&gt; /// &lt;link href=&quot;bootstrap/bootstrap.min.css&quot; rel=&quot;stylesheet&quot;&gt; /// &lt;!-- Page-specific extras --&gt; /// &lt;link href=&quot;assets/css/docs.css&quot; rel=&quot;stylesheet [rest of string was truncated]&quot;;. /// </summary> public static string home_html { get { return ResourceManager.GetString("home_html", resourceCulture); } } /// <summary> /// Looks up a localized string similar to &lt;!DOCTYPE html&gt; /// ///&lt;html lang=&quot;en&quot; xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt; ///&lt;head&gt; /// &lt;meta charset=&quot;utf-8&quot; /&gt; /// &lt;title&gt;Javascript Callback Test&lt;/title&gt; /// /// &lt;script type=&quot;text/javascript&quot;&gt; /// (async function () /// { /// await CefSharp.BindObjectAsync(&apos;boundObject&apos;); /// boundObject.setCallBack(myFunction); /// /// function myFunction(param) /// { /// return &quot;Test &quot; + param; /// } /// })(); /// /// &lt;/script&gt; ///&lt;/head&gt; ///&lt;body&gt; /// &lt; [rest of string was truncated]&quot;;. /// </summary> public static string JavascriptCallbackTest { get { return ResourceManager.GetString("JavascriptCallbackTest", resourceCulture); } } /// <summary> /// Looks up a localized string similar to &lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;&gt; ///&lt;html&gt; /// &lt;head&gt; /// &lt;title&gt;Legacy Binding Test&lt;/title&gt; /// &lt;link rel=&quot;stylesheet&quot; href=&quot;https://code.jquery.com/qunit/qunit-2.10.0.css&quot;&gt; /// &lt;/head&gt; /// &lt;body&gt; /// &lt;div id=&quot;qunit&quot;&gt;&lt;/div&gt; /// &lt;div id=&quot;qunit-fixture&quot;&gt;&lt;/div&gt; /// &lt;script src=&quot;https://code.jquery.com/qunit/qunit-2.10.0.js&quot;&gt;&lt;/script&gt; /// /// &lt;script type=&quot;text/javascript&quot;&gt; /// (function() /// { /// QUnit.test( &quot;bound.rep [rest of string was truncated]&quot;;. /// </summary> public static string LegacyBindingTest { get { return ResourceManager.GetString("LegacyBindingTest", resourceCulture); } } /// <summary> /// Looks up a localized string similar to &lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;&gt; ///&lt;html&gt; /// &lt;head&gt; /// &lt;title&gt;Multi Binding Test&lt;/title&gt; /// &lt;script type=&quot;text/javascript&quot;&gt; /// var DYNAMIC_CONTAINER_COUNT = 6; /// var PRIMES = [1453, 4273, 6277, 9923, 26099, 41231]; /// function replaceContainer(id, src) /// { /// console.log(&quot;Replacing Container &quot; + id); /// var container = document.getElementById(&quot;dynamicContainer&quot; + id); /// var newFram [rest of string was truncated]&quot;;. /// </summary> public static string MultiBindingTest { get { return ResourceManager.GetString("MultiBindingTest", resourceCulture); } } /// <summary> /// Looks up a localized string similar to &lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;&gt; ///&lt;html&gt; ///&lt;head&gt; /// &lt;title&gt;Popup Test&lt;/title&gt; ///&lt;/head&gt; ///&lt;body&gt; /// &lt;a href=&quot;https://github.com/CefSharp/CefSharp&quot; target=&quot;_blank&quot;&gt;target=_blank&lt;/a&gt; /// &lt;br /&gt; /// &lt;a href=&quot;#&quot; onclick=&quot;window.open(&apos;https://github.com/CefSharp/CefSharp&apos;)&quot;&gt;window.open()&lt;/a&gt; /// &lt;br /&gt; /// &lt;a href=&quot;#&quot; onclick=&quot;window.open(&apos;custom://cefsharp/BindingTest.html&apos;)&quot;&gt;BindingTest.html&lt;/a&gt; /// &lt;br /&gt; /// &lt;a href=&quot;#&quot; onclick=&quot;window.open(&apos;custom://cefsharp/MultiBindin [rest of string was truncated]&quot;;. /// </summary> public static string PopupTest { get { return ResourceManager.GetString("PopupTest", resourceCulture); } } /// <summary> /// Looks up a localized string similar to &lt;!DOCTYPE html&gt; /// ///&lt;html lang=&quot;en&quot; xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt; ///&lt;head&gt; /// &lt;meta charset=&quot;utf-8&quot; /&gt; /// &lt;title&gt;Post Message Test&lt;/title&gt; /// &lt;link rel=&quot;stylesheet&quot; href=&quot;https://code.jquery.com/qunit/qunit-2.10.0.css&quot;&gt; ///&lt;/head&gt; ///&lt;body&gt; /// &lt;div id=&quot;qunit&quot;&gt;&lt;/div&gt; /// &lt;div id=&quot;qunit-fixture&quot;&gt;&lt;/div&gt; /// &lt;script src=&quot;https://code.jquery.com/qunit/qunit-2.10.0.js&quot;&gt;&lt;/script&gt; /// /// &lt;script type=&quot;text/javascript&quot;&gt; /// let PostMessageIntTestCallback; /// /// (async () =&gt; /// { /// [rest of string was truncated]&quot;;. /// </summary> public static string PostMessageTest { get { return ResourceManager.GetString("PostMessageTest", resourceCulture); } } /// <summary> /// Looks up a localized string similar to &lt;!DOCTYPE html&gt; /// ///&lt;html lang=&quot;en&quot; xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt; ///&lt;head&gt; /// &lt;meta charset=&quot;utf-8&quot; /&gt; /// &lt;title&gt;CefSharp Recaptcha Test&lt;/title&gt; /// &lt;script src=&apos;https://www.google.com/recaptcha/api.js&apos;&gt;&lt;/script&gt; ///&lt;/head&gt; ///&lt;body&gt; /// &lt;h1&gt;Recaptcha Test&lt;/h1&gt; /// &lt;form&gt; /// &lt;div class=&quot;g-recaptcha&quot; data-sitekey=&quot;6Lce2hoUAAAAALGrg1Z7075o6a3TqHE1N5KX2og0&quot;&gt;&lt;/div&gt; /// /// &lt;/form&gt; ///&lt;/body&gt; ///&lt;/html&gt;. /// </summary> public static string Recaptcha { get { return ResourceManager.GetString("Recaptcha", resourceCulture); } } /// <summary> /// Looks up a localized string similar to &lt;html&gt; ///&lt;head&gt; /// &lt;title&gt;Response Filter Test&lt;/title&gt; ///&lt;/head&gt; ///&lt;body bgcolor=&quot;white&quot;&gt; /// &lt;p&gt;The text shown below in &lt;font color=&quot;red&quot;&gt;red&lt;/font&gt; has been replaced by the filter. This document is &gt; 32kb in order to exceed the standard output buffer size.&lt;/p&gt; /// &lt;p&gt;&lt;font color=&quot;red&quot;&gt;REPLACE_THIS_STRING&lt;/font&gt;&lt;/p&gt; /// &lt;p&gt;0. It was the best of times, it was the worst of times, it was the age of wisdom, it was the age of foolishness, it was the epoch of belief, it was the epoch of incredulity, it was the [rest of string was truncated]&quot;;. /// </summary> public static string ResponseFilterTest { get { return ResourceManager.GetString("ResponseFilterTest", resourceCulture); } } /// <summary> /// Looks up a localized string similar to &lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;&gt; ///&lt;html&gt; ///&lt;head&gt; /// &lt;title&gt;Scheme Handler Test&lt;/title&gt; /// /// &lt;script type=&quot;text/javascript&quot;&gt; /// var htmlNode; /// var newLine = &quot;\n&quot;; /// var showError = function (text) /// { /// if (!htmlNode) /// { /// htmlNode = document.createElement(&quot;div&quot;); /// htmlNode.id = &quot;debugWindow&quot;; /// document.body.appendChild(htmlNode); /// } /// /// htmlNode.innerHTML [rest of string was truncated]&quot;;. /// </summary> public static string SchemeTest { get { return ResourceManager.GetString("SchemeTest", resourceCulture); } } /// <summary> /// Looks up a localized string similar to &lt;!DOCTYPE html&gt; ///&lt;html lang=&quot;en&quot;&gt; ///&lt;head&gt; /// &lt;meta charset=&quot;utf-8&quot;&gt; /// &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt; /// &lt;meta name=&quot;description&quot; content=&quot;&quot;&gt; /// &lt;meta name=&quot;author&quot; content=&quot;&quot;&gt; /// &lt;title&gt;ScriptedMethodsTest&lt;/title&gt; /// &lt;link href=&quot;bootstrap/bootstrap.min.css&quot; rel=&quot;stylesheet&quot;&gt; /// &lt;link href=&quot;assets/css/shCore.css&quot; rel=&quot;stylesheet&quot;&gt; /// &lt;link href=&quot;assets/css/shCoreDefault.css&quot; rel=&quot;stylesheet&quot;&gt; ///&lt;/head&gt; ///&lt;body&gt; /// &lt;div class=&quot;container&quot;&gt; /// &lt;div [rest of string was truncated]&quot;;. /// </summary> public static string ScriptedMethodsTest { get { return ResourceManager.GetString("ScriptedMethodsTest", resourceCulture); } } /// <summary> /// Looks up a localized string similar to &lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;&gt; ///&lt;html&gt; /// &lt;head&gt; /// &lt;title&gt;Tooltip Test&lt;/title&gt; /// &lt;/head&gt; /// &lt;body&gt; /// &lt;div style=&quot;width:500px;&quot;&gt; /// &lt;input type=&quot;text&quot; size=25 title=&quot;This is the first tooltip&quot;&gt; /// &lt;br /&gt; /// &lt;input type=&quot;text&quot; size=25 title=&quot;This is the second tooltip&quot;&gt; /// &lt;br /&gt; /// &lt;div&gt; /// &lt;select style=&quot;float: left;&quot;&gt; /// &lt;option selected&gt;test&lt;/option&gt; /// &lt; [rest of string was truncated]&quot;;. /// </summary> public static string TooltipTest { get { return ResourceManager.GetString("TooltipTest", resourceCulture); } } /// <summary> /// Looks up a localized string similar to &lt;!DOCTYPE html&gt; ///&lt;html lang=&quot;ja&quot;&gt; ///&lt;head&gt; /// &lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot; /&gt; /// &lt;style&gt; /// Body { /// font-family: Meiryo, leiryoUI; /// } /// .ITSMultipleChoice { /// font-family: Meiryo, leiryoUI; /// } /// #popUpDiv { /// background-color: transparent; /// color: black; /// } /// #pwDiv { /// border: 2p [rest of string was truncated]&quot;;. /// </summary> public static string UnicodeExampleGreaterThan32kb { get { return ResourceManager.GetString("UnicodeExampleGreaterThan32kb", resourceCulture); } } /// <summary> /// Looks up a localized string similar to &lt;!DOCTYPE html&gt; ///&lt;html lang=&quot;ja&quot;&gt; ///&lt;head&gt; /// &lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot; /&gt; /// &lt;style&gt; /// Body { /// font-family: Meiryo, leiryoUI; /// } /// .ITSMultipleChoice { /// font-family: Meiryo, leiryoUI; /// } /// #popUpDiv { /// background-color: transparent; /// color: black; /// } /// #pwDiv { /// border: 2p [rest of string was truncated]&quot;;. /// </summary> public static string UnocodeExampleEqualTo32kb { get { return ResourceManager.GetString("UnocodeExampleEqualTo32kb", resourceCulture); } } } }
45.15186
604
0.513854
[ "BSD-3-Clause" ]
Bodekaer/CefSharp
CefSharp.Example/Properties/Resources.Designer.cs
43,709
C#
using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; namespace BDSA2018.Lecture06.Entities { public class Episode { public int Id { get; set; } [Required] [StringLength(100)] public string Title { get; set; } public DateTime? FirstAired { get; set; } public ICollection<EpisodeCharacter> EpisodeCharacters { get; set; } } }
21.45
76
0.655012
[ "MIT" ]
ondfisk/BDSA2018
BDSA2018.Lecture06.Entities/Episode.cs
431
C#
using System; using NHapi.Base.Model; using NHapi.Base.Log; using NHapi.Base; using NHapi.Base.Model.Primitive; namespace NHapi.Model.V23.Datatype { ///<summary> /// <p>The HL7 CP (Composite Price) data type. Consists of the following components: </p><ol> /// <li>price (MO)</li> /// <li>price type (ID)</li> /// <li>from value (NM)</li> /// <li>to value (NM)</li> /// <li>range units (CE)</li> /// <li>range type (ID)</li> /// </ol> ///</summary> [Serializable] public class CP : AbstractType, IComposite{ private IType[] data; ///<summary> /// Creates a CP. /// <param name="message">The Message to which this Type belongs</param> ///</summary> public CP(IMessage message) : this(message, null){} ///<summary> /// Creates a CP. /// <param name="message">The Message to which this Type belongs</param> /// <param name="description">The description of this type</param> ///</summary> public CP(IMessage message, string description) : base(message, description){ data = new IType[6]; data[0] = new MO(message,"Price"); data[1] = new ID(message, 0,"Price type"); data[2] = new NM(message,"From value"); data[3] = new NM(message,"To value"); data[4] = new CE(message,"Range units"); data[5] = new ID(message, 0,"Range type"); } ///<summary> /// Returns an array containing the data elements. ///</summary> public IType[] Components { get{ return this.data; } } ///<summary> /// Returns an individual data component. /// @throws DataTypeException if the given element number is out of range. ///<param name="index">The index item to get (zero based)</param> ///<returns>The data component (as a type) at the requested number (ordinal)</returns> ///</summary> public IType this[int index] { get{ try { return this.data[index]; } catch (System.ArgumentOutOfRangeException) { throw new DataTypeException("Element " + index + " doesn't exist in 6 element CP composite"); } } } ///<summary> /// Returns price (component #0). This is a convenience method that saves you from /// casting and handling an exception. ///</summary> public MO Price { get{ MO ret = null; try { ret = (MO)this[0]; } catch (DataTypeException e) { HapiLogFactory.GetHapiLog(this.GetType()).Error("Unexpected problem accessing known data type component - this is a bug.", e); throw new System.Exception("An unexpected error ocurred",e); } return ret; } } ///<summary> /// Returns price type (component #1). This is a convenience method that saves you from /// casting and handling an exception. ///</summary> public ID PriceType { get{ ID ret = null; try { ret = (ID)this[1]; } catch (DataTypeException e) { HapiLogFactory.GetHapiLog(this.GetType()).Error("Unexpected problem accessing known data type component - this is a bug.", e); throw new System.Exception("An unexpected error ocurred",e); } return ret; } } ///<summary> /// Returns from value (component #2). This is a convenience method that saves you from /// casting and handling an exception. ///</summary> public NM FromValue { get{ NM ret = null; try { ret = (NM)this[2]; } catch (DataTypeException e) { HapiLogFactory.GetHapiLog(this.GetType()).Error("Unexpected problem accessing known data type component - this is a bug.", e); throw new System.Exception("An unexpected error ocurred",e); } return ret; } } ///<summary> /// Returns to value (component #3). This is a convenience method that saves you from /// casting and handling an exception. ///</summary> public NM ToValue { get{ NM ret = null; try { ret = (NM)this[3]; } catch (DataTypeException e) { HapiLogFactory.GetHapiLog(this.GetType()).Error("Unexpected problem accessing known data type component - this is a bug.", e); throw new System.Exception("An unexpected error ocurred",e); } return ret; } } ///<summary> /// Returns range units (component #4). This is a convenience method that saves you from /// casting and handling an exception. ///</summary> public CE RangeUnits { get{ CE ret = null; try { ret = (CE)this[4]; } catch (DataTypeException e) { HapiLogFactory.GetHapiLog(this.GetType()).Error("Unexpected problem accessing known data type component - this is a bug.", e); throw new System.Exception("An unexpected error ocurred",e); } return ret; } } ///<summary> /// Returns range type (component #5). This is a convenience method that saves you from /// casting and handling an exception. ///</summary> public ID RangeType { get{ ID ret = null; try { ret = (ID)this[5]; } catch (DataTypeException e) { HapiLogFactory.GetHapiLog(this.GetType()).Error("Unexpected problem accessing known data type component - this is a bug.", e); throw new System.Exception("An unexpected error ocurred",e); } return ret; } } }}
28.82659
133
0.651093
[ "MPL-2.0", "MPL-2.0-no-copyleft-exception" ]
AMCN41R/nHapi
src/NHapi.Model.V23/Datatype/CP.cs
4,987
C#
using System; using System.Linq; namespace NumberArray { class Program { static void Main(string[] args) { string input = Console.ReadLine(); int[] inputNumberArray = input.Split().Select(int.Parse).ToArray(); string[] currentLine = new string[input.Length]; while (currentLine[0] != "End") { string command = currentLine[0]; int indexNumber = 0; bool numberExist = false; switch (command) { case "Switch": indexNumber = int.Parse(currentLine[1]); numberExist = inputNumberArray.Length - 1 >= indexNumber; if (indexNumber < 0) break; else if (numberExist) { int num = inputNumberArray[indexNumber] * 2; inputNumberArray[indexNumber] -= num; } break; case "Change": indexNumber = int.Parse(currentLine[1]); numberExist = inputNumberArray.Length - 1 >= indexNumber; if (indexNumber < 0) break; else if (numberExist) { inputNumberArray[indexNumber] = int.Parse(currentLine[2]); } break; case "Sum": string subCommand = currentLine[1]; Console.WriteLine(GetSum(subCommand, inputNumberArray)); break; } currentLine = Console.ReadLine().Split(' ', StringSplitOptions.RemoveEmptyEntries); } Console.WriteLine(string.Join(" ", inputNumberArray.Where(i => i >= 0))); } static int GetSum(string command, int[] arr) { int result = 0; foreach (var num in arr) { if (command == "Negative") { if (num < 0) result += num; } else if (command == "Positive") { if (num >= 0) result += num; } else if (command == "All") { result += num; } } return result; } } }
35.418919
99
0.391072
[ "MIT" ]
kkaraivanov/CSharpFundamentalsExams
MidleExam/TasksTwo/NumberArray/Program.cs
2,623
C#
// Copyright (c) XRTK. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using System.Reflection; [assembly: AssemblyVersion("1.0.0")] [assembly: AssemblyTitle("com.realitytoolkit.tests")] [assembly: AssemblyCompany("Reality Collective")] [assembly: AssemblyCopyright("Copyright (c) Reality Collective. All rights reserved.")]
39.2
91
0.772959
[ "MIT" ]
realitycollective/com.realitytoolkit.core
Tests/AssemblyInfo.cs
392
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.Collections.Generic; namespace Microsoft.Cci.Comparers { public interface ICciComparers { IEqualityComparer<T> GetEqualityComparer<T>(); IComparer<T> GetComparer<T>(); } }
27.866667
71
0.72488
[ "MIT" ]
0xced/arcade
src/Microsoft.Cci.Extensions/Comparers/ICciComparers.cs
418
C#
using System; using System.Collections; using System.Collections.Generic; using UnityEngine; public class LampsClick : MonoBehaviour { public GameObject lamp; private Game _game; private bool _isGameNotNull; private bool didImplement = false; // Start is called before the first frame update void Start() { _game = GameObject.FindGameObjectWithTag("UiCanvas").GetComponent<Game>(); _isGameNotNull = _game != null; } // Update is called once per frame void Update() { RaycastHit hit; Vector3 fwd = transform.TransformDirection(Vector3.forward); if (Physics.Raycast(transform.position, fwd, out hit, 6)) { if (Input.GetKeyDown(KeyCode.E) && hit.collider.tag.Equals(lamp.tag)) { if (_isGameNotNull && !didImplement && _game.ConfirmedLamps) { _game.ImplementLamps(); didImplement = true; } } } } }
26.1
82
0.582375
[ "Apache-2.0" ]
alexDevp/estig_escola_sustentavel
13_ESTIG_EscolaSustentavel/Assets/Scripts/Enviroment/LampsClick.cs
1,046
C#
// Portions Copyright (C) 2017 MarketFactory, Inc // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. using System; namespace Baseline { class Program { public static void Main() { Example.Main(); Console.WriteLine("Press a key to continue..."); Console.ReadKey(); } } }
28.3
75
0.67609
[ "Apache-2.0" ]
JerryShea/simple-binary-encoding
csharp/.nuget/examples/Program.cs
851
C#
using System.Collections.Generic; using System.Runtime.Serialization; using Service.Bitgo.WithdrawalProcessor.Domain.Models; namespace Service.Bitgo.WithdrawalProcessor.Grpc.Models { [DataContract] public class GetWithdrawalsResponse { [DataMember(Order = 1)] public bool Success { get; set; } [DataMember(Order = 2)] public string ErrorMessage { get; set; } [DataMember(Order = 3)] public long IdForNextQuery { get; set; } [DataMember(Order = 4)] public List<Withdrawal> WithdrawalCollection { get; set; } } }
37.333333
90
0.707143
[ "MIT" ]
MyJetWallet/Service.Bitgo.WithdrawalProcessor
src/Service.Bitgo.WithdrawalProcessor.Grpc/Models/GetWithdrawalsResponse.cs
562
C#
using Futura.Engine.Resources; using System; using Newtonsoft.Json; using System.Diagnostics.CodeAnalysis; namespace Futura.Engine.Utility.CustomSerializer { class AssetSerializer<T> : JsonConverter<T> where T : Asset { public override T ReadJson(JsonReader reader, Type objectType, [AllowNull] T existingValue, bool hasExistingValue, Newtonsoft.Json.JsonSerializer serializer) { if (reader.Value == null) return null; Guid identifier = new Guid((string)reader.Value); return ResourceManager.Instance.GetAsset<T>(identifier); } public override void WriteJson(JsonWriter writer, [AllowNull] T value, Newtonsoft.Json.JsonSerializer serializer) { if (value == null) writer.WriteValue(Guid.Empty); else writer.WriteValue(value.Identifier.ToString()); } } }
35.72
165
0.674132
[ "MIT" ]
Lama96103/Futura
Source/Futura.Engine/Utility/CustomSerializer/AssetSerializer.cs
895
C#
using SamOatesGames.Systems; public class ResourcePickupEvent : IEventAggregatorEvent { public ResourceType ResourceType { get; } public int PickupAmount { get; } public int TotalAmount { get; } public ResourcePickupEvent(ResourceType resourceType, int pickupAmount, int totalAmount) { ResourceType = resourceType; PickupAmount = pickupAmount; TotalAmount = totalAmount; } }
26.625
92
0.713615
[ "MIT" ]
SamOatesJams/Ludum-Dare-46
Assets/Game/Scripts/Events/ResourcePickupEvent.cs
428
C#
using RazorEngine.Configuration; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Runtime.CompilerServices; using System.Text; using System.Threading.Tasks; namespace RazorEngine.Templating { /// <summary> /// Extensions for the <see cref="IRazorEngineService"/>. /// </summary> public static class RazorEngineServiceExtensions { /// <summary> /// Checks if a given template is already cached. /// </summary> /// <param name="service"></param> /// <param name="name"></param> /// <param name="modelType"></param> /// <returns></returns> public static bool IsTemplateCached(this IRazorEngineService service, string name, Type modelType) { var key = service.GetKey(name); return service.IsTemplateCached(key, modelType); } /// <summary> /// Adds a given template to the template manager as dynamic template. /// </summary> /// <param name="service"></param> /// <param name="name"></param> /// <param name="templateSource"></param> public static void AddTemplate(this IRazorEngineService service, string name, ITemplateSource templateSource) { var key = service.GetKey(name); service.AddTemplate(key, templateSource); } /// <summary> /// Adds a given template to the template manager as dynamic template. /// </summary> /// <param name="service"></param> /// <param name="key"></param> /// <param name="templateSource"></param> public static void AddTemplate(this IRazorEngineService service, ITemplateKey key, string templateSource) { service.AddTemplate(key, new LoadedTemplateSource(templateSource)); } /// <summary> /// Adds a given template to the template manager as dynamic template. /// </summary> /// <param name="service"></param> /// <param name="name"></param> /// <param name="templateSource"></param> public static void AddTemplate(this IRazorEngineService service, string name, string templateSource) { service.AddTemplate(name, new LoadedTemplateSource(templateSource)); } /// <summary> /// See <see cref="RazorEngineService.Compile"/>. /// </summary> /// <param name="service"></param> /// <param name="name"></param> /// <param name="modelType"></param> public static void Compile(this IRazorEngineService service, string name, Type modelType = null) { service.Compile(service.GetKey(name), modelType); } /// <summary> /// See <see cref="RazorEngineService.Compile"/>. /// Convenience method which calls <see cref="RazorEngineService.AddTemplate"/> before calling <see cref="RazorEngineService.Compile"/>. /// </summary> /// <param name="service"></param> /// <param name="templateSource"></param> /// <param name="key"></param> /// <param name="modelType"></param> public static void Compile(this IRazorEngineService service, ITemplateSource templateSource, ITemplateKey key, Type modelType = null) { service.AddTemplate(key, templateSource); service.Compile(key, modelType); } /// <summary> /// See <see cref="RazorEngineService.Compile"/>. /// Convenience method which calls <see cref="RazorEngineService.AddTemplate"/> before calling <see cref="RazorEngineService.Compile"/>. /// </summary> /// <param name="service"></param> /// <param name="templateSource"></param> /// <param name="key"></param> /// <param name="modelType"></param> public static void Compile(this IRazorEngineService service, string templateSource, ITemplateKey key, Type modelType = null) { service.AddTemplate(key, templateSource); service.Compile(key, modelType); } /// <summary> /// See <see cref="RazorEngineService.Compile"/>. /// Convenience method which calls <see cref="RazorEngineService.AddTemplate"/> before calling <see cref="RazorEngineService.Compile"/>. /// </summary> /// <param name="service"></param> /// <param name="templateSource"></param> /// <param name="name"></param> /// <param name="modelType"></param> public static void Compile(this IRazorEngineService service, ITemplateSource templateSource, string name, Type modelType = null) { service.AddTemplate(name, templateSource); service.Compile(name, modelType); } /// <summary> /// See <see cref="RazorEngineService.Compile"/>. /// Convenience method which calls <see cref="RazorEngineService.AddTemplate"/> before calling <see cref="RazorEngineService.Compile"/>. /// </summary> /// <param name="service"></param> /// <param name="templateSource"></param> /// <param name="name"></param> /// <param name="modelType"></param> public static void Compile(this IRazorEngineService service, string templateSource, string name, Type modelType = null) { service.AddTemplate(name, templateSource); service.Compile(name, modelType); } /// <summary> /// See <see cref="RazorEngineService.RunCompile"/>. /// </summary> /// <param name="service"></param> /// <param name="name"></param> /// <param name="writer"></param> /// <param name="modelType"></param> /// <param name="model"></param> /// <param name="viewBag"></param> public static void RunCompile(this IRazorEngineService service, string name, TextWriter writer, Type modelType = null, object model = null, DynamicViewBag viewBag = null) { service.RunCompile(service.GetKey(name), writer, modelType, model, viewBag); } /// <summary> /// See <see cref="RazorEngineService.RunCompile"/>. /// Convenience method which calls <see cref="RazorEngineService.AddTemplate"/> before calling <see cref="RazorEngineService.RunCompile"/>. /// </summary> /// <param name="service"></param> /// <param name="templateSource"></param> /// <param name="key"></param> /// <param name="writer"></param> /// <param name="modelType"></param> /// <param name="model"></param> /// <param name="viewBag"></param> public static void RunCompile(this IRazorEngineService service, ITemplateSource templateSource, ITemplateKey key, TextWriter writer, Type modelType = null, object model = null, DynamicViewBag viewBag = null) { service.AddTemplate(key, templateSource); service.RunCompile(key, writer, modelType, model, viewBag); } /// <summary> /// See <see cref="RazorEngineService.RunCompile"/>. /// Convenience method which calls <see cref="RazorEngineService.AddTemplate"/> before calling <see cref="RazorEngineService.RunCompile"/>. /// </summary> /// <param name="service"></param> /// <param name="templateSource"></param> /// <param name="key"></param> /// <param name="writer"></param> /// <param name="modelType"></param> /// <param name="model"></param> /// <param name="viewBag"></param> public static void RunCompile(this IRazorEngineService service, string templateSource, ITemplateKey key, TextWriter writer, Type modelType = null, object model = null, DynamicViewBag viewBag = null) { service.AddTemplate(key, templateSource); service.RunCompile(key, writer, modelType, model, viewBag); } /// <summary> /// See <see cref="RazorEngineService.RunCompile"/>. /// Convenience method which calls <see cref="RazorEngineService.AddTemplate"/> before calling <see cref="RazorEngineService.RunCompile"/>. /// </summary> /// <param name="service"></param> /// <param name="templateSource"></param> /// <param name="name"></param> /// <param name="writer"></param> /// <param name="modelType"></param> /// <param name="model"></param> /// <param name="viewBag"></param> public static void RunCompile(this IRazorEngineService service, ITemplateSource templateSource, string name, TextWriter writer, Type modelType = null, object model = null, DynamicViewBag viewBag = null) { service.AddTemplate(name, templateSource); service.RunCompile(name, writer, modelType, model, viewBag); } /// <summary> /// See <see cref="RazorEngineService.RunCompile"/>. /// Convenience method which calls <see cref="RazorEngineService.AddTemplate"/> before calling <see cref="RazorEngineService.RunCompile"/>. /// </summary> /// <param name="service"></param> /// <param name="templateSource"></param> /// <param name="name"></param> /// <param name="writer"></param> /// <param name="modelType"></param> /// <param name="model"></param> /// <param name="viewBag"></param> public static void RunCompile(this IRazorEngineService service, string templateSource, string name, TextWriter writer, Type modelType = null, object model = null, DynamicViewBag viewBag = null) { service.AddTemplate(name, templateSource); service.RunCompile(name, writer, modelType, model, viewBag); } /// <summary> /// Helper method to provide a TextWriter and return the written data. /// </summary> /// <param name="withWriter"></param> /// <returns></returns> private static string WithWriter(Action<TextWriter> withWriter) { using (var writer = new System.IO.StringWriter()) { withWriter(writer); return writer.ToString(); } } /// <summary> /// See <see cref="RazorEngineService.RunCompile"/>. /// Convenience method which creates a <see cref="TextWriter"/> and returns the result as string. /// </summary> /// <param name="service"></param> /// <param name="key"></param> /// <param name="modelType"></param> /// <param name="model"></param> /// <param name="viewBag"></param> /// <returns></returns> public static string RunCompile(this IRazorEngineService service, ITemplateKey key, Type modelType = null, object model = null, DynamicViewBag viewBag = null) { return WithWriter(writer => service.RunCompile(key, writer, modelType, model, viewBag)); } /// <summary> /// See <see cref="RazorEngineService.RunCompile"/>. /// Convenience method which creates a <see cref="TextWriter"/> and returns the result as string. /// </summary> /// <param name="service"></param> /// <param name="name"></param> /// <param name="modelType"></param> /// <param name="model"></param> /// <param name="viewBag"></param> /// <returns></returns> public static string RunCompile(this IRazorEngineService service, string name, Type modelType = null, object model = null, DynamicViewBag viewBag = null) { return WithWriter(writer => service.RunCompile(name, writer, modelType, model, viewBag)); } /// <summary> /// See <see cref="RazorEngineService.RunCompile"/>. /// Convenience method which calls <see cref="RazorEngineService.AddTemplate"/> before calling <see cref="RazorEngineService.RunCompile"/>. /// Convenience method which creates a <see cref="TextWriter"/> and returns the result as string. /// </summary> /// <param name="service"></param> /// <param name="templateSource"></param> /// <param name="key"></param> /// <param name="modelType"></param> /// <param name="model"></param> /// <param name="viewBag"></param> /// <returns></returns> public static string RunCompile(this IRazorEngineService service, ITemplateSource templateSource, ITemplateKey key, Type modelType = null, object model = null, DynamicViewBag viewBag = null) { service.AddTemplate(key, templateSource); return service.RunCompile(key, modelType, model, viewBag); } /// <summary> /// See <see cref="RazorEngineService.RunCompile"/>. /// Convenience method which calls <see cref="RazorEngineService.AddTemplate"/> before calling <see cref="RazorEngineService.RunCompile"/>. /// Convenience method which creates a <see cref="TextWriter"/> and returns the result as string. /// </summary> /// <param name="service"></param> /// <param name="templateSource"></param> /// <param name="key"></param> /// <param name="modelType"></param> /// <param name="model"></param> /// <param name="viewBag"></param> /// <returns></returns> public static string RunCompile(this IRazorEngineService service, string templateSource, ITemplateKey key, Type modelType = null, object model = null, DynamicViewBag viewBag = null) { service.AddTemplate(key, templateSource); return service.RunCompile(key, modelType, model, viewBag); } /// <summary> /// See <see cref="RazorEngineService.RunCompile"/>. /// Convenience method which calls <see cref="RazorEngineService.AddTemplate"/> before calling <see cref="RazorEngineService.RunCompile"/>. /// Convenience method which creates a <see cref="TextWriter"/> and returns the result as string. /// </summary> /// <param name="service"></param> /// <param name="templateSource"></param> /// <param name="name"></param> /// <param name="modelType"></param> /// <param name="model"></param> /// <param name="viewBag"></param> /// <returns></returns> public static string RunCompile(this IRazorEngineService service, ITemplateSource templateSource, string name, Type modelType = null, object model = null, DynamicViewBag viewBag = null) { service.AddTemplate(name, templateSource); return service.RunCompile(name, modelType, model, viewBag); } /// <summary> /// See <see cref="RazorEngineService.RunCompile"/>. /// Convenience method which calls <see cref="RazorEngineService.AddTemplate"/> before calling <see cref="RazorEngineService.RunCompile"/>. /// Convenience method which creates a <see cref="TextWriter"/> and returns the result as string. /// </summary> /// <param name="service"></param> /// <param name="templateSource"></param> /// <param name="name"></param> /// <param name="modelType"></param> /// <param name="model"></param> /// <param name="viewBag"></param> /// <returns></returns> public static string RunCompile(this IRazorEngineService service, string templateSource, string name, Type modelType = null, object model = null, DynamicViewBag viewBag = null) { service.AddTemplate(name, templateSource); return service.RunCompile(name, modelType, model, viewBag); } /// <summary> /// See <see cref="RazorEngineService.Run"/>. /// </summary> /// <param name="service"></param> /// <param name="name"></param> /// <param name="writer"></param> /// <param name="modelType"></param> /// <param name="model"></param> /// <param name="viewBag"></param> public static void Run(this IRazorEngineService service, string name, TextWriter writer, Type modelType = null, object model = null, DynamicViewBag viewBag = null) { service.Run(service.GetKey(name), writer, modelType, model, viewBag); } /// <summary> /// See <see cref="RazorEngineService.Run"/>. /// Convenience method which creates a <see cref="TextWriter"/> and returns the result as string. /// </summary> /// <param name="service"></param> /// <param name="key"></param> /// <param name="modelType"></param> /// <param name="model"></param> /// <param name="viewBag"></param> /// <returns></returns> public static string Run(this IRazorEngineService service, ITemplateKey key, Type modelType = null, object model = null, DynamicViewBag viewBag = null) { return WithWriter(writer => service.Run(key, writer, modelType, model, viewBag)); } /// <summary> /// See <see cref="RazorEngineService.Run"/>. /// Convenience method which creates a <see cref="TextWriter"/> and returns the result as string. /// </summary> /// <param name="service"></param> /// <param name="name"></param> /// <param name="modelType"></param> /// <param name="model"></param> /// <param name="viewBag"></param> /// <returns></returns> public static string Run(this IRazorEngineService service, string name, Type modelType = null, object model = null, DynamicViewBag viewBag = null) { return WithWriter(writer => service.Run(name, writer, modelType, model, viewBag)); } } }
47.532086
215
0.602464
[ "Apache-2.0" ]
HongJunRen/RazorEngine
src/source/RazorEngine.Core/Templating/RazorEngineServiceExtensions.cs
17,779
C#
using Neo.IO; using System; namespace Neo.Cryptography.MPT { partial class MPTTrie<TKey, TValue> { private static ReadOnlySpan<byte> CommonPrefix(ReadOnlySpan<byte> a, ReadOnlySpan<byte> b) { var minLen = a.Length <= b.Length ? a.Length : b.Length; int i = 0; if (a.Length != 0 && b.Length != 0) { for (i = 0; i < minLen; i++) { if (a[i] != b[i]) break; } } return a[..i]; } public bool Put(TKey key, TValue value) { var path = ToNibbles(key.ToArray()); var val = value.ToArray(); if (path.Length == 0 || path.Length > ExtensionNode.MaxKeyLength) return false; if (val.Length > LeafNode.MaxValueLength) return false; if (val.Length == 0) return TryDelete(ref root, path); var n = new LeafNode(val); return Put(ref root, path, n); } private bool Put(ref MPTNode node, ReadOnlySpan<byte> path, MPTNode val) { switch (node) { case LeafNode leafNode: { if (val is LeafNode v) { if (path.IsEmpty) { node = v; PutToStore(node); return true; } var branch = new BranchNode(); branch.Children[BranchNode.ChildCount - 1] = leafNode; Put(ref branch.Children[path[0]], path[1..], v); PutToStore(branch); node = branch; return true; } return false; } case ExtensionNode extensionNode: { if (path.StartsWith(extensionNode.Key)) { var result = Put(ref extensionNode.Next, path[extensionNode.Key.Length..], val); if (result) { extensionNode.SetDirty(); PutToStore(extensionNode); } return result; } var prefix = CommonPrefix(extensionNode.Key, path); var pathRemain = path[prefix.Length..]; var keyRemain = extensionNode.Key.AsSpan(prefix.Length); var son = new BranchNode(); MPTNode grandSon1 = HashNode.EmptyNode; MPTNode grandSon2 = HashNode.EmptyNode; Put(ref grandSon1, keyRemain[1..], extensionNode.Next); son.Children[keyRemain[0]] = grandSon1; if (pathRemain.IsEmpty) { Put(ref grandSon2, pathRemain, val); son.Children[BranchNode.ChildCount - 1] = grandSon2; } else { Put(ref grandSon2, pathRemain[1..], val); son.Children[pathRemain[0]] = grandSon2; } PutToStore(son); if (prefix.Length > 0) { var exNode = new ExtensionNode() { Key = prefix.ToArray(), Next = son, }; PutToStore(exNode); node = exNode; } else { node = son; } return true; } case BranchNode branchNode: { bool result; if (path.IsEmpty) { result = Put(ref branchNode.Children[BranchNode.ChildCount - 1], path, val); } else { result = Put(ref branchNode.Children[path[0]], path[1..], val); } if (result) { branchNode.SetDirty(); PutToStore(branchNode); } return result; } case HashNode hashNode: { MPTNode newNode; if (hashNode.IsEmpty) { if (path.IsEmpty) { newNode = val; } else { newNode = new ExtensionNode() { Key = path.ToArray(), Next = val, }; PutToStore(newNode); } node = newNode; if (val is LeafNode) PutToStore(val); return true; } newNode = Resolve(hashNode); if (newNode is null) return false; node = newNode; return Put(ref node, path, val); } default: return false; } } } }
38.672956
108
0.328671
[ "MIT" ]
Lichen9618/neo
src/neo/Cryptography/MPT/MPTTrie.Put.cs
6,149
C#
// Recompile at 2021/5/15 16:32:04 #if USE_TIMELINE #if UNITY_2017_1_OR_NEWER // Copyright (c) Pixel Crushers. All rights reserved. using UnityEngine; using UnityEngine.Playables; using System.Collections.Generic; namespace PixelCrushers.DialogueSystem { public class AlertMixerBehaviour : PlayableBehaviour { private HashSet<int> played = new HashSet<int>(); // NOTE: This function is called at runtime and edit time. Keep that in mind when setting the values of properties. public override void ProcessFrame(Playable playable, FrameData info, object playerData) { int inputCount = playable.GetInputCount(); for (int i = 0; i < inputCount; i++) { float inputWeight = playable.GetInputWeight(i); if (inputWeight > 0.001f && !played.Contains(i)) { played.Add(i); ScriptPlayable<ShowAlertBehaviour> inputPlayable = (ScriptPlayable<ShowAlertBehaviour>)playable.GetInput(i); ShowAlertBehaviour input = inputPlayable.GetBehaviour(); var message = input.message; var duration = input.useTextLengthForDuration ? 0 : (float) inputPlayable.GetDuration(); if (Application.isPlaying) { DialogueManager.ShowAlert(message, duration); } else { PreviewUI.ShowMessage(message, duration, -1); } } else if (inputWeight <= 0.001f && played.Contains(i)) { played.Remove(i); } } } public override void OnGraphStart(Playable playable) { base.OnGraphStart(playable); played.Clear(); } public override void OnGraphStop(Playable playable) { base.OnGraphStop(playable); played.Clear(); } } } #endif #endif
33.076923
129
0.533023
[ "Apache-2.0" ]
NGTO-WONG/KishiStory
Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Options/Timeline/Playables/ShowAlert/AlertMixerBehaviour.cs
2,150
C#
// <copyright file="IOutputPort.cs" company="Ivan Paulovich"> // Copyright © Ivan Paulovich. All rights reserved. // </copyright> namespace Application.UseCases.Withdraw { using Domain; using Domain.Debits; using Services; /// <summary> /// Output Port. /// </summary> public interface IOutputPort { /// <summary> /// Informs it is out of balance. /// </summary> void OutOfFunds(); /// <summary> /// Invalid input. /// </summary> void Invalid(Notification notification); /// <summary> /// Resource not closed. /// </summary> void NotFound(); /// <summary> /// </summary> /// <param name="debit"></param> /// <param name="account"></param> void Ok(Debit debit, Account account); } }
24
62
0.504386
[ "Apache-2.0" ]
devdotcore/clean-architecture-manga
accounts-api/src/Application/UseCases/Withdraw/IOutputPort.cs
913
C#
using UnityEngine; using System; using System.Collections; using System.Collections.Generic; /// /// !!! Machine generated code !!! /// /// A class which deriveds ScritableObject class so all its data /// can be serialized onto an asset data file. /// [System.Serializable] public class Item : ScriptableObject { [HideInInspector] [SerializeField] public string SheetName = ""; [HideInInspector] [SerializeField] public string WorksheetName = ""; // Note: initialize in OnEnable() not here. public ItemData[] dataArray; void OnEnable() { //#if UNITY_EDITOR //hideFlags = HideFlags.DontSave; //#endif // Important: // It should be checked an initialization of any collection data before it is initialized. // Without this check, the array collection which already has its data get to be null // because OnEnable is called whenever Unity builds. // if (dataArray == null) dataArray = new ItemData[0]; } // // Write a proper query methods for retrieving data. // //public ItemData FindByKey(string key) //{ // return Array.Find(dataArray, d => d.Key == key); //} }
26.826087
101
0.63128
[ "MIT" ]
dochi486/Unity-QuickSheet
Assets/QuickSheet/Runtime/Item.cs
1,234
C#
namespace Custom.InputAccel.UimScript { using Emc.InputAccel.UimScript; using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; class ScriptSuitabilityIL : UimScriptDocument { public static ArrayList prelist; public void DocumentLoad(IUimDataContext dataContext) { dataContext.TaskFinishOnErrorNotAllowed = true; } /// <summary> /// Executes when the Document is first loaded for the task by the Extraction /// module, after all of the runtime setup is complete. ///</summary> /// <param name="dataContext">The context object for the document.</param> public void FormLoad(IUimDataEntryFormContext form) { try { IUimDataContext dataContext = form.UimDataContext; IUimFieldDataContext hidden = dataContext.FindFieldDataContext("hiddenCOMMONS"); ScriptMain m = new ScriptMain(); m.hiddenSection(form, hidden.ValueAsString); prelist = m.getLabelField(form); } catch (Exception e) { string error = e.StackTrace; } } public void ExitControl(IUimFormControlContext controlContext) { try { //Lookup ScriptMain m = new ScriptMain(); m.LookupRestPolicy(controlContext, controlContext.ParentForm, "policyNo"); } catch (Exception e) { string error = e.StackTrace; } } public void DocumentClosing(IUimDataContext dataContext, CloseReasonCode reason) { try { ScriptMain m = new ScriptMain(); m.jsonFormat(dataContext, prelist); } catch (Exception e) { string error = e.StackTrace; } } } }
31.313433
96
0.547664
[ "Apache-2.0" ]
R0NETDeveloper/FWD
ProfileScriptFWD/ProfileScriptFWD/FWDDocumentType/ScriptSuitabilityIL.cs
2,100
C#
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; using System.Collections.Generic; using System.Linq; using System.Reflection; namespace FlUnit.Adapters.VSTest { using Microsoft.VisualStudio.TestPlatform.ObjectModel; using System.IO; /// <summary> /// FlUnit's implementation of <see cref="ITestDiscoverer"/> - takes responsibility for discovering tests in a given assembly or assemblies. /// </summary> [FileExtension(".exe")] [FileExtension(".dll")] [DefaultExecutorUri(Constants.ExecutorUriString)] public class TestDiscoverer : ITestDiscoverer { /// <inheritdoc /> public void DiscoverTests( IEnumerable<string> sources, IDiscoveryContext discoveryContext, IMessageLogger logger, ITestCaseDiscoverySink discoverySink) { var testRunConfiguration = TestRunConfiguration.ReadFromXml(discoveryContext.RunSettings?.SettingsXml, Constants.FlUnitConfigurationXmlElement); MakeTestCases(sources, logger, testRunConfiguration).ForEach(tc => discoverySink.SendTestCase(tc)); } internal static List<TestCase> MakeTestCases( IEnumerable<string> sources, IMessageLogger logger, TestRunConfiguration testRunConfiguration) { return sources.SelectMany(s => MakeTestCases(s, logger, testRunConfiguration)).ToList(); } private static List<TestCase> MakeTestCases( string source, IMessageLogger logger, TestRunConfiguration testRunConfiguration) { var assembly = Assembly.LoadFile(source); // TODO: check exactly how other adapters go about this logger.SendMessage(TestMessageLevel.Informational, $"Test discovery started for {assembly.FullName}"); var testMetadata = TestDiscovery.FindTests(assembly, testRunConfiguration); var testCases = new List<TestCase>(); DiaSession diaSession = null; try { try { diaSession = new DiaSession(source); } catch (FileNotFoundException) { } foreach (var testMetadatum in testMetadata) { var navigationData = diaSession?.GetNavigationData(testMetadatum.TestProperty.DeclaringType.FullName, testMetadatum.TestProperty.GetGetMethod().Name); var testCase = new TestCase($"{testMetadatum.TestProperty.DeclaringType.FullName}.{testMetadatum.TestProperty.Name}", Constants.ExecutorUri, source) { CodeFilePath = navigationData?.FileName, LineNumber = navigationData?.MinLineNumber ?? 0, }; testCase.Traits.AddRange(testMetadatum.Traits.Select(t => new Trait(t.Name, t.Value))); // Probably better to use JSON or similar.. // ..and in general need to pay more attention to how the serialization between discovery and execution works.. // ..e.g. does the serialised version stick around? Do I need to worry about versioning test cases and executor version? testCase.SetPropertyValue( TestProperties.FlUnitTestProp, $"{testMetadatum.TestProperty.DeclaringType.Assembly.GetName().Name}:{testMetadatum.TestProperty.DeclaringType.FullName}:{testMetadatum.TestProperty.Name}"); testCases.Add(testCase); // TODO: Neater message when there are no traits (or simply don't include them - was only a quick and dirty test) logger.SendMessage( TestMessageLevel.Informational, $"Found test case [{assembly.GetName().Name}]{testCase.FullyQualifiedName}. Traits: {string.Join(", ", testCase.Traits.Select(t => $"{t.Name}={t.Value}"))}"); } } finally { diaSession?.Dispose(); } return testCases; } } }
43.653061
182
0.614773
[ "MIT" ]
sdcondon/FlUnit.Adapters.VSTest
src/FlUnit.Adapters.VSTest/VSTest/TestDiscoverer.cs
4,280
C#
using System.Diagnostics; using Xamarin.Forms; using ModernXamarinCalendar.Models; using System; namespace TwoWeekControl { public partial class MainPage : ContentPage { public MainPage() { InitializeComponent(); // Subscribe to the event - This sets up the DateSelectedMethod to // run when a new date is clicked in the TwoWeekControl. CalendarWeekControl.SelectedDateChanged += DateSelectedChanged; } /// <summary> /// Event Handler that responds to the DateSelectedChanged event being /// fired /// </summary> /// <param name="sender"> /// The WeekControl instance that fired the event. /// </param> /// <param name="e"> /// Any additional EventArgs passed with the firing of the event, none /// added on by the WeekControl instance. /// </param> public void DateSelectedChanged(object sender, SelectedDateChangedEventArgs args) { // Insert code here that you want to use the date selected for ... Debug.WriteLine(args.SelectedDate.ToString()); } public void ChangeSelectedDate_Clicked(object sender, EventArgs args) { CalendarWeekControl.OverrideSelectedDate(new DateTime(2020, 3, 22)); } } }
31.534884
89
0.620206
[ "MIT" ]
mattmorgan6/TwoWeekControl
TwoWeekControl/TwoWeekControl/MainPage.xaml.cs
1,358
C#
using Cosmos.Business.Extensions.Holiday.Core; using Cosmos.I18N.Countries; namespace Cosmos.Business.Extensions.Holiday.Definitions.Europe.Italy.Religion { /// <summary> /// Easter Sunday /// </summary> public class EasterSunday : CatholicVariableHolidayFunc { /// <inheritdoc /> public override Country Country { get; } = Country.Italy; /// <inheritdoc /> public override Country BelongsToCountry { get; } = Country.Italy; /// <inheritdoc /> public override string Name { get; } = "Pasqua"; /// <inheritdoc /> public override HolidayType HolidayType { get; set; } = HolidayType.Religion; /// <inheritdoc /> public override string I18NIdentityCode { get; } = "i18n_holiday_it_easter_sunday"; } }
30.961538
91
0.642236
[ "Apache-2.0" ]
cosmos-open/Holiday
src/Cosmos.Business.Extensions.Holiday/Cosmos/Business/Extensions/Holiday/Definitions/Europe/Italy/Religion/EasterSunday.cs
805
C#
using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Windows; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle( "Mojo.Wpf" )] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Mojo")] [assembly: AssemblyCopyright("Copyright © 2010")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] //In order to begin building localizable applications, set //<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file //inside a <PropertyGroup>. For example, if you are using US english //in your source files, set the <UICulture> to en-US. Then uncomment //the NeutralResourceLanguage attribute below. Update the "en-US" in //the line below to match the UICulture setting in the project file. //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] [assembly: ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located //(used if a resource is not found in the page, // or application resource dictionaries) ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located //(used if a resource is not found in the page, // app, or any theme specific resource dictionaries) )] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("2.0.0.0")] [assembly: AssemblyFileVersion("2.0.0.0")]
39.642857
96
0.752252
[ "MIT" ]
Rhoana/Mojo
Mojo.2.0/Mojo/Mojo.Wpf/Properties/AssemblyInfo.cs
2,223
C#
using Plastic.Definitions.Services; namespace Plastic.Infos.Services { public class ServiceInfoCollection : InfoCollection<ServiceInfo, ServiceDefinition, ApplicationInfo> { public ServiceInfoCollection(ApplicationInfo parent) : base(parent) { } public void SetRef(ApplicationInfo applicationInfo) { foreach (ServiceInfo database in this) { database.SetRef(applicationInfo); } } public void SetAdd(ApplicationInfo applicationInfo) { foreach (ServiceInfo database in this) { database.SetAdd(applicationInfo); } } } }
26.185185
104
0.595474
[ "Unlicense" ]
jonkeda/Plastic
Plastic/Infos/Services/ServiceInfoCollection.cs
709
C#
// Console Viewer Canvas|Prefabs|0060 namespace VRTK { using UnityEngine; using UnityEngine.UI; using System.Collections.Generic; using System.Text.RegularExpressions; using System.Linq; /// <summary> /// This canvas adds the unity console log to a world game object. To use the prefab, it simply needs to be placed into the scene and it will be visible in world space. It's also possible to child it to other objects such as the controller so it can track where the user is. /// </summary> /// <remarks> /// It's also recommended to use the Simple Pointer and UI Pointer on a controller to interact with the Console Viewer Canvas as it has a scrollable text area, a button to clear the log and a checkbox to toggle whether the log messages are collapsed. /// </remarks> public class VRTK_ConsoleViewer : MonoBehaviour { [Tooltip("The size of the font the log text is displayed in.")] public int fontSize = 14; [Tooltip("The colour of the text for an info log message.")] public Color infoMessage = Color.black; [Tooltip("The colour of the text for an assertion log message.")] public Color assertMessage = Color.black; [Tooltip("The colour of the text for a warning log message.")] public Color warningMessage = Color.yellow; [Tooltip("The colour of the text for an error log message.")] public Color errorMessage = Color.red; [Tooltip("The colour of the text for an exception log message.")] public Color exceptionMessage = Color.red; private Dictionary<LogType, Color> logTypeColors; private ScrollRect scrollWindow; private RectTransform consoleRect; private Text consoleOutput; private const string NEWLINE = "\n"; private int lineBuffer = 50; private int currentBuffer; private string lastMessage; private bool collapseLog = false; /// <summary> /// The SetCollapse method determines whether the console will collapse same message output into the same line. A state of `true` will collapse messages and `false` will print the same message for each line. /// </summary> /// <param name="state">The state of whether to collapse the output messages, true will collapse and false will not collapse.</param> public void SetCollapse(bool state) { collapseLog = state; } /// <summary> /// The ClearLog method clears the current log view of all messages /// </summary> public void ClearLog() { consoleOutput.text = ""; currentBuffer = 0; lastMessage = ""; } private void Awake() { logTypeColors = new Dictionary<LogType, Color>() { { LogType.Assert, assertMessage }, { LogType.Error, errorMessage }, { LogType.Exception, exceptionMessage }, { LogType.Log, infoMessage }, { LogType.Warning, warningMessage } }; scrollWindow = transform.FindChild("Panel/Scroll View").GetComponent<ScrollRect>(); consoleRect = transform.FindChild("Panel/Scroll View/Viewport/Content").GetComponent<RectTransform>(); consoleOutput = transform.FindChild("Panel/Scroll View/Viewport/Content/ConsoleOutput").GetComponent<Text>(); consoleOutput.fontSize = fontSize; ClearLog(); } private void OnEnable() { Application.logMessageReceived += HandleLog; } private void OnDisable() { Application.logMessageReceived -= HandleLog; consoleRect.sizeDelta = Vector2.zero; } private string GetMessage(string message, LogType type) { var color = ColorUtility.ToHtmlStringRGBA(logTypeColors[type]); return "<color=#" + color + ">" + message + "</color>" + NEWLINE; } private void HandleLog(string message, string stackTrace, LogType type) { var logOutput = GetMessage(message, type); if (!collapseLog || lastMessage != logOutput) { consoleOutput.text += logOutput; lastMessage = logOutput; } consoleRect.sizeDelta = new Vector2(consoleOutput.preferredWidth, consoleOutput.preferredHeight); scrollWindow.verticalNormalizedPosition = 0; currentBuffer++; if (currentBuffer >= lineBuffer) { var lines = Regex.Split(consoleOutput.text, NEWLINE).Skip(lineBuffer / 2); consoleOutput.text = string.Join(NEWLINE, lines.ToArray()); currentBuffer = lineBuffer / 2; } } } }
41.724138
278
0.621488
[ "MIT" ]
3dit/steamvrtoolkit
Assets/VRTK/Prefabs/Resources/Scripts/VRTK_ConsoleViewer.cs
4,842
C#
using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; namespace SneussFactory.Migrations { public partial class AddEngineerMachineTable : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "EngineerMachine", columns: table => new { EngineerMachineId = table.Column<int>(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), EngineerId = table.Column<int>(nullable: false), MachineId = table.Column<int>(nullable: false) }, constraints: table => { table.PrimaryKey("PK_EngineerMachine", x => x.EngineerMachineId); table.ForeignKey( name: "FK_EngineerMachine_Engineers_EngineerId", column: x => x.EngineerId, principalTable: "Engineers", principalColumn: "EngineerId", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_EngineerMachine_Machines_MachineId", column: x => x.MachineId, principalTable: "Machines", principalColumn: "MachineId", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_EngineerMachine_EngineerId", table: "EngineerMachine", column: "EngineerId"); migrationBuilder.CreateIndex( name: "IX_EngineerMachine_MachineId", table: "EngineerMachine", column: "MachineId"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "EngineerMachine"); } } }
39.518519
114
0.536551
[ "MIT" ]
hubba180/SneussFactory.Solution
Factory/Migrations/20200807183945_AddEngineerMachineTable.cs
2,136
C#
using System; using System.IO; using System.Text; using System.Threading.Tasks; namespace Sentry.Testing { public static class StreamExtensions { private static readonly Random _random = new(); public static async Task FillWithRandomBytesAsync(this Stream stream, long length) { var remainingLength = length; var buffer = new byte[81920]; while (remainingLength > 0) { _random.NextBytes(buffer); var bytesToCopy = (int)Math.Min(remainingLength, buffer.Length); await stream.WriteAsync(buffer, 0, bytesToCopy); remainingLength -= bytesToCopy; } } public static MemoryStream ToMemoryStream(this string source, Encoding encoding) => new(encoding.GetBytes(source)); public static MemoryStream ToMemoryStream(this string source) => source.ToMemoryStream(Encoding.UTF8); } }
28.114286
91
0.621951
[ "MIT" ]
kanadaj/sentry-dotnet
test/Sentry.Testing/StreamExtensions.cs
984
C#
namespace DentalStudio.Web.ViewModels.Medicine.Doctors { using System.Globalization; using AutoMapper; using DentalStudio.Services.Mapping; using DentalStudio.Services.Models; using Ganss.XSS; public class DoctorProfileDetailsViewModel : IMapTo<DoctorServiceModel>, IMapFrom<DoctorServiceModel>, IHaveCustomMappings { public string Id { get; set; } public string FullName { get; set; } public string Email { get; set; } public string PhoneNumber { get; set; } public string Gender { get; set; } public string DateOfBirth { get; set; } public string Specialty { get; set; } public string Address { get; set; } public string Photo { get; set; } public string Grade { get; set; } public string SanitizedGrade => new HtmlSanitizer().Sanitize(this.Grade); public void CreateMappings(IProfileExpression configuration) { configuration .CreateMap<DoctorServiceModel, DoctorProfileDetailsViewModel>() .ForMember( destination => destination.DateOfBirth, opts => opts.MapFrom(x => x.DateOfBirth != null ? x.DateOfBirth.Value.ToString("dd.MM.yyyy", CultureInfo.InvariantCulture) : "N/A")); } } }
29.727273
148
0.642966
[ "MIT" ]
GalyaIT/Dental-Studio
Web/DentalStudio.Web.ViewModels/Medicine/Doctors/DoctorProfileDetailsViewModel.cs
1,310
C#
using Nito.AsyncEx.Synchronous; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using TietzeIO.CyAPI; using TietzeIO.CyAPI.Entities; using TietzeIO.CyAPI.Entities.Optics; using TietzeIO.CyAPI.Entities.Policy; using TietzeIO.CyAPI.Session; using TietzeIO.CyShell.Cmdlets.Base; using TietzeIO.CyShell.Util; namespace TietzeIO.CyShell.Session { /// <summary> /// Shared session state. /// /// This does not contain the actual APIv2 object, but only a serialized version describing how to set up an actual API session, /// and some cached artifacts like detections etc. /// /// The session itself is not thread-safe, and must/will be instantiated for each Powershell Cmdlet invocation. /// </summary> public class ApiConnectionHandle { private static ApiConnectionHandle _global; public static ApiConnectionHandle Global { get => _global; } public SessionDescriptor Session { get; private set; } internal ApiV2 API { get; set; } public bool CacheMode { get; internal set; } public bool IncludeOpticsData { get; set; } = true; public bool IncludeProtectData { get; set; } = true; public List<CyDeviceMetaData> Devices { get; private set; } public List<CyThreatMetaData> Threats { get; private set; } public List<CyThreatDeviceEnriched> ThreatDevices { get; private set; } public List<CyDetectionMetaData> Detections { get; private set; } public List<CyDetection> DetectionsDetail { get; private set; } public List<CyDetectionRuleMetaData> DetectionRules { get; private set; } public List<CyDetectionException> DetectionExceptionsDetail { get; private set; } public List<CyPolicyMetaData> Policies { get; private set; } public List<CyUser> Users { get; private set; } public ApiConnectionHandle(SessionDescriptor session) { Session = session; } public void MakeGlobal() { _global = this; } public static void ClearGlobal() { _global = null; } public void RefreshPolicyCache(ApiV2 connection) { Policies = connection. GetPoliciesAsync(). WaitAndUnwrapException(). OrderBy(p => p.name). ToList(); } public void RefreshDetectionCache(ApiV2 connection) { Detections = connection. GetDetectionsAsync(). WaitAndUnwrapException(). OrderBy(d => d.OccurrenceTime). ToList(); } public void RefreshDetectionDetailsCache(ApiV2 connection, CyCmdlet cmdlet) { DetectionsDetail = new List<CyDetection>(); List<Task<CyDetection>> tasks = new List<Task<CyDetection>>(Detections.Count); var newDetections = (from d in Detections where d.Status.Equals("NEW", StringComparison.InvariantCultureIgnoreCase) select d); foreach (var detection in newDetections) { var task = connection.GetDetectionAsync(detection.id); tasks.Add(task); } if (newDetections.Any()) { PowershellConsoleUtil.BlockWithProgress(cmdlet, tasks.ConvertAll<Task>(x => x as Task), PowershellModuleConstants.ACTIVITY_KEY_REFRESH_DETECTIONS, "Downloading detections detail", $"Downloading full record for all {newDetections.Count()} NEW detections"); } foreach (var task in tasks) { if (task.IsCompleted) DetectionsDetail.Add(task.Result); } } public void RefreshDetectionRulesCache(ApiV2 connection) { DetectionRules = new List<CyDetectionRuleMetaData>(connection. GetDetectionRulesAsync(). WaitAndUnwrapException(). OrderBy(d => d.Name)); } public void RefreshDetectionExceptionsCache(ApiV2 connection) { DetectionExceptionsDetail = new List<CyDetectionException>(); var list = new List<CyDetectionExceptionMetaData>(connection. GetDetectionExceptionsAsync(). WaitAndUnwrapException(). OrderBy(d => d.Name)); list.ForEach(d => { DetectionExceptionsDetail.Add(connection. GetDetectionExceptionAsync(d.id.Value). WaitAndUnwrapException()); }); } public void RefreshThreatInstancesCache(ApiV2 connection, CyCmdlet cmdlet) { ThreatDevices = new List<CyThreatDeviceEnriched>(); List<Task<List<CyThreatDeviceEnriched>>> tasks = new List<Task<List<CyThreatDeviceEnriched>>>(ThreatDevices.Count * 3); var unhandledThreats = from t in Threats where (!t.global_quarantined) && (!t.safelisted) select t; foreach (var threat in unhandledThreats) { var task = connection.RequestThreatDevicesAsync(threat); tasks.Add(task); } if (unhandledThreats.Count() > 0) { PowershellConsoleUtil.BlockWithProgress(cmdlet, tasks.ConvertAll<Task>(x => x as Task), PowershellModuleConstants.ACTIVITY_KEY_REFRESH_DETECTIONS, "Downloading threat instances detail", $"Downloading path and device information for all {unhandledThreats.Count()} unhandled threats"); } foreach (var task in tasks) { ThreatDevices.AddRange(task.Result); } } public void RefreshThreatCache(ApiV2 connection) { Threats = connection. RequestThreatListAsync(). WaitAndUnwrapException(). OrderBy(d => d.name). ToList(); } public void RefreshDeviceCache(ApiV2 connection) { Devices = connection. RequestDeviceListAsync(). WaitAndUnwrapException(). OrderBy(d => d.device_name). ToList(); } public void RefreshUserCache(ApiV2 connection) { Users = connection. RequestUserListAsync(). WaitAndUnwrapException(). OrderBy(d => d.email). ToList(); } public void RefreshCache(ApiV2 connection, CyCmdlet cmdlet) { cmdlet.Write("Refreshing device cache... "); RefreshDeviceCache(connection); cmdlet.WriteLineHL($"Done ({Devices.Count})."); ClearProtectCache(); if (IncludeProtectData) { cmdlet.Write("Refreshing threats cache... "); RefreshThreatCache(connection); cmdlet.WriteLineHL($"Done ({Threats.Count})."); cmdlet.Write("Refreshing threat instances cache... "); RefreshThreatInstancesCache(connection, cmdlet); cmdlet.WriteLineHL($"Done ({Threats.Count})."); } ClearOpticsCache(); if (IncludeOpticsData) { cmdlet.Write("Refreshing detection rules..."); RefreshDetectionRulesCache(connection); cmdlet.WriteLineHL($"Done ({DetectionRules.Count})."); cmdlet.Write("Refreshing detection exceptions rules... "); RefreshDetectionExceptionsCache(connection); cmdlet.WriteLineHL($"Done ({DetectionExceptionsDetail.Count})."); cmdlet.Write("Refreshing detections cache... "); RefreshDetectionCache(connection); cmdlet.WriteLineHL($"Done ({Detections.Count})."); cmdlet.Write("Refreshing detections details cache... "); RefreshDetectionDetailsCache(connection, cmdlet); cmdlet.WriteLineHL($"Done ({DetectionsDetail.Count})."); } cmdlet.Write("Refreshing policy cache... "); RefreshPolicyCache(connection); cmdlet.WriteLineHL($"Done ({Policies.Count})."); cmdlet.Write("Refreshing user cache... "); RefreshUserCache(connection); cmdlet.WriteLineHL($"Done ({Users.Count})."); } public CyDetectionRuleMetaData GetDetectionRule(Guid id) { var result = from r in DetectionRules where r.id.Equals(id) select r; if (result.Count() > 0) return result.First(); else return null; } public void ClearCache(CyCmdlet cmdlet) { cmdlet.Write("Clearing cache... "); Devices = new List<CyDeviceMetaData>(); ClearProtectCache(); ClearOpticsCache(); Policies = new List<CyPolicyMetaData>(); Users = new List<CyUser>(); cmdlet.WriteLineHL("Done."); } private void ClearProtectCache() { Threats = new List<CyThreatMetaData>(); ThreatDevices = new List<CyThreatDeviceEnriched>(); } private void ClearOpticsCache() { Detections = new List<CyDetectionMetaData>(); DetectionsDetail = new List<CyDetection>(); DetectionExceptionsDetail = new List<CyDetectionException>(); DetectionRules = new List<CyDetectionRuleMetaData>(); } } }
37.075472
138
0.574249
[ "Apache-2.0" ]
BlackCyBerry/CyShell
src/TietzeIO.CyShell/Session/ApiConnectionHandle.cs
9,827
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Xamarin.Forms; namespace MyWeather.View { public partial class ForecastViewC : ContentPage { public ForecastViewC() { InitializeComponent(); if (Device.OS == TargetPlatform.iOS) Icon = new FileImageSource { File = "tab2.png" }; ListViewWeather.ItemTapped += (sender, args) => ListViewWeather.SelectedItem = null; } } }
24.181818
96
0.639098
[ "MIT" ]
jpblack/MyWeather.Forms-syncfusion
MyWeather/View/ForecastViewC.xaml.cs
534
C#
using SemVer; namespace Bump { public enum VersionComponent { Major, Minor, Patch, Pre } public static class VersionExtensions { public static Version Bump(this Version version, VersionComponent component) { if (component == VersionComponent.Major) return new Version(version.Major + 1, 0, 0, version.PreRelease, version.Build); if (component == VersionComponent.Minor) return new Version(version.Major, version.Minor + 1, 0, version.PreRelease, version.Build); if (component == VersionComponent.Patch) return new Version(version.Major, version.Minor, version.Patch + 1, version.PreRelease, version.Build); if (component == VersionComponent.Pre) { var pre = version.PreRelease; pre = BumpPre(pre); return new Version(version.Major, version.Minor, version.Patch, pre, version.Build); } else return null; } public static string BumpPre(string pre) { int j = pre.Length; while (j > 0 && char.IsNumber(pre[j-1])) j--; var number = pre[j..]; if (int.TryParse(number, out int value)) { value++; pre = pre.Remove(j); pre = pre + value.ToString(); } else { pre = pre + "-1"; } return pre; } public static Version ClearPrerelease(this Version version) { var result = new Version(version.Major, version.Minor, version.Patch, null, version.Build); return result; } public static Version SetPrerelease(this Version version, string pre) { var result = new Version(version.Major, version.Minor, version.Patch, pre, version.Build); return result; } } }
29.617647
119
0.532274
[ "MIT" ]
mharthoorn/csproj-version
CsProj.ConsoleApp/Engine/VersionExtensions.cs
2,016
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. // </auto-generated> namespace Microsoft.Azure.Management.Network.Fluent { using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; using System.Collections; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; /// <summary> /// ApplicationGatewaysOperations operations. /// </summary> public partial interface IApplicationGatewaysOperations { /// <summary> /// Deletes the specified application gateway. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='applicationGatewayName'> /// The name of the application gateway. /// </param> /// <param name='customHeaders'> /// The 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> Task<AzureOperationResponse> DeleteWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// <summary> /// Gets the specified application gateway. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='applicationGatewayName'> /// The name of the application gateway. /// </param> /// <param name='customHeaders'> /// The 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> Task<AzureOperationResponse<ApplicationGatewayInner>> GetWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// <summary> /// Creates or updates the specified application gateway. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='applicationGatewayName'> /// The name of the application gateway. /// </param> /// <param name='parameters'> /// Parameters supplied to the create or update application gateway /// operation. /// </param> /// <param name='customHeaders'> /// The 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> Task<AzureOperationResponse<ApplicationGatewayInner>> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGatewayInner parameters, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// <summary> /// Updates the specified application gateway tags. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='applicationGatewayName'> /// The name of the application gateway. /// </param> /// <param name='tags'> /// Resource tags. /// </param> /// <param name='customHeaders'> /// The 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> Task<AzureOperationResponse<ApplicationGatewayInner>> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, IDictionary<string, string> tags = default(IDictionary<string, string>), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// <summary> /// Lists all application gateways in a resource group. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='customHeaders'> /// The 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> Task<AzureOperationResponse<IPage<ApplicationGatewayInner>>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// <summary> /// Gets all the application gateways in a subscription. /// </summary> /// <param name='customHeaders'> /// The 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> Task<AzureOperationResponse<IPage<ApplicationGatewayInner>>> ListAllWithHttpMessagesAsync(Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// <summary> /// Starts the specified application gateway. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='applicationGatewayName'> /// The name of the application gateway. /// </param> /// <param name='customHeaders'> /// The 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> Task<AzureOperationResponse> StartWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// <summary> /// Stops the specified application gateway in a resource group. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='applicationGatewayName'> /// The name of the application gateway. /// </param> /// <param name='customHeaders'> /// The 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> Task<AzureOperationResponse> StopWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// <summary> /// Gets the backend health of the specified application gateway in a /// resource group. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='applicationGatewayName'> /// The name of the application gateway. /// </param> /// <param name='expand'> /// Expands BackendAddressPool and BackendHttpSettings referenced in /// backend health. /// </param> /// <param name='customHeaders'> /// The 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> Task<AzureOperationResponse<ApplicationGatewayBackendHealthInner>> BackendHealthWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string expand = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// <summary> /// Gets the backend health for given combination of backend pool and /// http setting of the specified application gateway in a resource /// group. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='applicationGatewayName'> /// The name of the application gateway. /// </param> /// <param name='probeRequest'> /// Request body for on-demand test probe operation. /// </param> /// <param name='expand'> /// Expands BackendAddressPool and BackendHttpSettings referenced in /// backend health. /// </param> /// <param name='customHeaders'> /// The 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> Task<AzureOperationResponse<ApplicationGatewayBackendHealthOnDemandInner>> BackendHealthOnDemandWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest, string expand = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// <summary> /// Lists all available server variables. /// </summary> /// <param name='customHeaders'> /// The headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="ErrorException"> /// 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> Task<AzureOperationResponse<IList<string>>> ListAvailableServerVariablesWithHttpMessagesAsync(Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// <summary> /// Lists all available request headers. /// </summary> /// <param name='customHeaders'> /// The headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="ErrorException"> /// 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> Task<AzureOperationResponse<IList<string>>> ListAvailableRequestHeadersWithHttpMessagesAsync(Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// <summary> /// Lists all available response headers. /// </summary> /// <param name='customHeaders'> /// The headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="ErrorException"> /// 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> Task<AzureOperationResponse<IList<string>>> ListAvailableResponseHeadersWithHttpMessagesAsync(Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// <summary> /// Lists all available web application firewall rule sets. /// </summary> /// <param name='customHeaders'> /// The 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> Task<AzureOperationResponse<ApplicationGatewayAvailableWafRuleSetsResultInner>> ListAvailableWafRuleSetsWithHttpMessagesAsync(Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// <summary> /// Lists available Ssl options for configuring Ssl policy. /// </summary> /// <param name='customHeaders'> /// The 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> Task<AzureOperationResponse<ApplicationGatewayAvailableSslOptionsInner>> ListAvailableSslOptionsWithHttpMessagesAsync(Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// <summary> /// Lists all SSL predefined policies for configuring Ssl policy. /// </summary> /// <param name='customHeaders'> /// The 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> Task<AzureOperationResponse<IPage<ApplicationGatewaySslPredefinedPolicyInner>>> ListAvailableSslPredefinedPoliciesWithHttpMessagesAsync(Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// <summary> /// Gets Ssl predefined policy with the specified policy name. /// </summary> /// <param name='predefinedPolicyName'> /// Name of Ssl predefined policy. /// </param> /// <param name='customHeaders'> /// The 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> Task<AzureOperationResponse<ApplicationGatewaySslPredefinedPolicyInner>> GetSslPredefinedPolicyWithHttpMessagesAsync(string predefinedPolicyName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// <summary> /// Deletes the specified application gateway. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='applicationGatewayName'> /// The name of the application gateway. /// </param> /// <param name='customHeaders'> /// The 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> Task<AzureOperationResponse> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// <summary> /// Creates or updates the specified application gateway. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='applicationGatewayName'> /// The name of the application gateway. /// </param> /// <param name='parameters'> /// Parameters supplied to the create or update application gateway /// operation. /// </param> /// <param name='customHeaders'> /// The 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> Task<AzureOperationResponse<ApplicationGatewayInner>> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGatewayInner parameters, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// <summary> /// Updates the specified application gateway tags. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='applicationGatewayName'> /// The name of the application gateway. /// </param> /// <param name='tags'> /// Resource tags. /// </param> /// <param name='customHeaders'> /// The 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> Task<AzureOperationResponse<ApplicationGatewayInner>> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, IDictionary<string, string> tags = default(IDictionary<string, string>), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// <summary> /// Starts the specified application gateway. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='applicationGatewayName'> /// The name of the application gateway. /// </param> /// <param name='customHeaders'> /// The 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> Task<AzureOperationResponse> BeginStartWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// <summary> /// Stops the specified application gateway in a resource group. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='applicationGatewayName'> /// The name of the application gateway. /// </param> /// <param name='customHeaders'> /// The 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> Task<AzureOperationResponse> BeginStopWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// <summary> /// Gets the backend health of the specified application gateway in a /// resource group. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='applicationGatewayName'> /// The name of the application gateway. /// </param> /// <param name='expand'> /// Expands BackendAddressPool and BackendHttpSettings referenced in /// backend health. /// </param> /// <param name='customHeaders'> /// The 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> Task<AzureOperationResponse<ApplicationGatewayBackendHealthInner>> BeginBackendHealthWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string expand = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// <summary> /// Gets the backend health for given combination of backend pool and /// http setting of the specified application gateway in a resource /// group. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='applicationGatewayName'> /// The name of the application gateway. /// </param> /// <param name='probeRequest'> /// Request body for on-demand test probe operation. /// </param> /// <param name='expand'> /// Expands BackendAddressPool and BackendHttpSettings referenced in /// backend health. /// </param> /// <param name='customHeaders'> /// The 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> Task<AzureOperationResponse<ApplicationGatewayBackendHealthOnDemandInner>> BeginBackendHealthOnDemandWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest, string expand = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// <summary> /// Lists all application gateways in a resource group. /// </summary> /// <param name='nextPageLink'> /// The NextLink from the previous successful call to List operation. /// </param> /// <param name='customHeaders'> /// The 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> Task<AzureOperationResponse<IPage<ApplicationGatewayInner>>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// <summary> /// Gets all the application gateways in a subscription. /// </summary> /// <param name='nextPageLink'> /// The NextLink from the previous successful call to List operation. /// </param> /// <param name='customHeaders'> /// The 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> Task<AzureOperationResponse<IPage<ApplicationGatewayInner>>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// <summary> /// Lists all SSL predefined policies for configuring Ssl policy. /// </summary> /// <param name='nextPageLink'> /// The NextLink from the previous successful call to List operation. /// </param> /// <param name='customHeaders'> /// The 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> Task<AzureOperationResponse<IPage<ApplicationGatewaySslPredefinedPolicyInner>>> ListAvailableSslPredefinedPoliciesNextWithHttpMessagesAsync(string nextPageLink, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } }
51.064371
388
0.633549
[ "MIT" ]
SorenMaagaard/azure-libraries-for-net
src/ResourceManagement/Network/Generated/IApplicationGatewaysOperations.cs
34,111
C#
// ------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. // ------------------------------------------------------------------------------ // **NOTE** This file was generated by a tool and any changes will be overwritten. // <auto-generated/> // Template Source: EntityRequestBuilder.cs.tt namespace Microsoft.Graph { using System; using System.Collections.Generic; using System.IO; /// <summary> /// The type PolicyRootRequestBuilder. /// </summary> public partial class PolicyRootRequestBuilder : BaseRequestBuilder, IPolicyRootRequestBuilder { /// <summary> /// Constructs a new PolicyRootRequestBuilder. /// </summary> /// <param name="requestUrl">The URL for the built request.</param> /// <param name="client">The <see cref="IBaseClient"/> for handling requests.</param> public PolicyRootRequestBuilder( string requestUrl, IBaseClient client) : base(requestUrl, client) { } /// <summary> /// Builds the request. /// </summary> /// <returns>The built request.</returns> public IPolicyRootRequest Request() { return this.Request(null); } /// <summary> /// Builds the request. /// </summary> /// <param name="options">The query and header options for the request.</param> /// <returns>The built request.</returns> public IPolicyRootRequest Request(IEnumerable<Option> options) { return new PolicyRootRequest(this.RequestUrl, this.Client, options); } /// <summary> /// Gets the request builder for AuthenticationMethodsPolicy. /// </summary> /// <returns>The <see cref="IAuthenticationMethodsPolicyRequestBuilder"/>.</returns> public IAuthenticationMethodsPolicyRequestBuilder AuthenticationMethodsPolicy { get { return new AuthenticationMethodsPolicyRequestBuilder(this.AppendSegmentToRequestUrl("authenticationMethodsPolicy"), this.Client); } } /// <summary> /// Gets the request builder for AuthenticationFlowsPolicy. /// </summary> /// <returns>The <see cref="IAuthenticationFlowsPolicyRequestBuilder"/>.</returns> public IAuthenticationFlowsPolicyRequestBuilder AuthenticationFlowsPolicy { get { return new AuthenticationFlowsPolicyRequestBuilder(this.AppendSegmentToRequestUrl("authenticationFlowsPolicy"), this.Client); } } /// <summary> /// Gets the request builder for B2cAuthenticationMethodsPolicy. /// </summary> /// <returns>The <see cref="IB2cAuthenticationMethodsPolicyRequestBuilder"/>.</returns> public IB2cAuthenticationMethodsPolicyRequestBuilder B2cAuthenticationMethodsPolicy { get { return new B2cAuthenticationMethodsPolicyRequestBuilder(this.AppendSegmentToRequestUrl("b2cAuthenticationMethodsPolicy"), this.Client); } } /// <summary> /// Gets the request builder for ActivityBasedTimeoutPolicies. /// </summary> /// <returns>The <see cref="IPolicyRootActivityBasedTimeoutPoliciesCollectionRequestBuilder"/>.</returns> public IPolicyRootActivityBasedTimeoutPoliciesCollectionRequestBuilder ActivityBasedTimeoutPolicies { get { return new PolicyRootActivityBasedTimeoutPoliciesCollectionRequestBuilder(this.AppendSegmentToRequestUrl("activityBasedTimeoutPolicies"), this.Client); } } /// <summary> /// Gets the request builder for AppManagementPolicies. /// </summary> /// <returns>The <see cref="IPolicyRootAppManagementPoliciesCollectionRequestBuilder"/>.</returns> public IPolicyRootAppManagementPoliciesCollectionRequestBuilder AppManagementPolicies { get { return new PolicyRootAppManagementPoliciesCollectionRequestBuilder(this.AppendSegmentToRequestUrl("appManagementPolicies"), this.Client); } } /// <summary> /// Gets the request builder for AuthorizationPolicy. /// </summary> /// <returns>The <see cref="IPolicyRootAuthorizationPolicyCollectionRequestBuilder"/>.</returns> public IPolicyRootAuthorizationPolicyCollectionRequestBuilder AuthorizationPolicy { get { return new PolicyRootAuthorizationPolicyCollectionRequestBuilder(this.AppendSegmentToRequestUrl("authorizationPolicy"), this.Client); } } /// <summary> /// Gets the request builder for ClaimsMappingPolicies. /// </summary> /// <returns>The <see cref="IPolicyRootClaimsMappingPoliciesCollectionRequestBuilder"/>.</returns> public IPolicyRootClaimsMappingPoliciesCollectionRequestBuilder ClaimsMappingPolicies { get { return new PolicyRootClaimsMappingPoliciesCollectionRequestBuilder(this.AppendSegmentToRequestUrl("claimsMappingPolicies"), this.Client); } } /// <summary> /// Gets the request builder for DefaultAppManagementPolicy. /// </summary> /// <returns>The <see cref="ITenantAppManagementPolicyRequestBuilder"/>.</returns> public ITenantAppManagementPolicyRequestBuilder DefaultAppManagementPolicy { get { return new TenantAppManagementPolicyRequestBuilder(this.AppendSegmentToRequestUrl("defaultAppManagementPolicy"), this.Client); } } /// <summary> /// Gets the request builder for HomeRealmDiscoveryPolicies. /// </summary> /// <returns>The <see cref="IPolicyRootHomeRealmDiscoveryPoliciesCollectionRequestBuilder"/>.</returns> public IPolicyRootHomeRealmDiscoveryPoliciesCollectionRequestBuilder HomeRealmDiscoveryPolicies { get { return new PolicyRootHomeRealmDiscoveryPoliciesCollectionRequestBuilder(this.AppendSegmentToRequestUrl("homeRealmDiscoveryPolicies"), this.Client); } } /// <summary> /// Gets the request builder for PermissionGrantPolicies. /// </summary> /// <returns>The <see cref="IPolicyRootPermissionGrantPoliciesCollectionRequestBuilder"/>.</returns> public IPolicyRootPermissionGrantPoliciesCollectionRequestBuilder PermissionGrantPolicies { get { return new PolicyRootPermissionGrantPoliciesCollectionRequestBuilder(this.AppendSegmentToRequestUrl("permissionGrantPolicies"), this.Client); } } /// <summary> /// Gets the request builder for ServicePrincipalCreationPolicies. /// </summary> /// <returns>The <see cref="IPolicyRootServicePrincipalCreationPoliciesCollectionRequestBuilder"/>.</returns> public IPolicyRootServicePrincipalCreationPoliciesCollectionRequestBuilder ServicePrincipalCreationPolicies { get { return new PolicyRootServicePrincipalCreationPoliciesCollectionRequestBuilder(this.AppendSegmentToRequestUrl("servicePrincipalCreationPolicies"), this.Client); } } /// <summary> /// Gets the request builder for TokenIssuancePolicies. /// </summary> /// <returns>The <see cref="IPolicyRootTokenIssuancePoliciesCollectionRequestBuilder"/>.</returns> public IPolicyRootTokenIssuancePoliciesCollectionRequestBuilder TokenIssuancePolicies { get { return new PolicyRootTokenIssuancePoliciesCollectionRequestBuilder(this.AppendSegmentToRequestUrl("tokenIssuancePolicies"), this.Client); } } /// <summary> /// Gets the request builder for TokenLifetimePolicies. /// </summary> /// <returns>The <see cref="IPolicyRootTokenLifetimePoliciesCollectionRequestBuilder"/>.</returns> public IPolicyRootTokenLifetimePoliciesCollectionRequestBuilder TokenLifetimePolicies { get { return new PolicyRootTokenLifetimePoliciesCollectionRequestBuilder(this.AppendSegmentToRequestUrl("tokenLifetimePolicies"), this.Client); } } /// <summary> /// Gets the request builder for FeatureRolloutPolicies. /// </summary> /// <returns>The <see cref="IPolicyRootFeatureRolloutPoliciesCollectionRequestBuilder"/>.</returns> public IPolicyRootFeatureRolloutPoliciesCollectionRequestBuilder FeatureRolloutPolicies { get { return new PolicyRootFeatureRolloutPoliciesCollectionRequestBuilder(this.AppendSegmentToRequestUrl("featureRolloutPolicies"), this.Client); } } /// <summary> /// Gets the request builder for AccessReviewPolicy. /// </summary> /// <returns>The <see cref="IAccessReviewPolicyRequestBuilder"/>.</returns> public IAccessReviewPolicyRequestBuilder AccessReviewPolicy { get { return new AccessReviewPolicyRequestBuilder(this.AppendSegmentToRequestUrl("accessReviewPolicy"), this.Client); } } /// <summary> /// Gets the request builder for AdminConsentRequestPolicy. /// </summary> /// <returns>The <see cref="IAdminConsentRequestPolicyRequestBuilder"/>.</returns> public IAdminConsentRequestPolicyRequestBuilder AdminConsentRequestPolicy { get { return new AdminConsentRequestPolicyRequestBuilder(this.AppendSegmentToRequestUrl("adminConsentRequestPolicy"), this.Client); } } /// <summary> /// Gets the request builder for DirectoryRoleAccessReviewPolicy. /// </summary> /// <returns>The <see cref="IDirectoryRoleAccessReviewPolicyRequestBuilder"/>.</returns> public IDirectoryRoleAccessReviewPolicyRequestBuilder DirectoryRoleAccessReviewPolicy { get { return new DirectoryRoleAccessReviewPolicyRequestBuilder(this.AppendSegmentToRequestUrl("directoryRoleAccessReviewPolicy"), this.Client); } } /// <summary> /// Gets the request builder for ConditionalAccessPolicies. /// </summary> /// <returns>The <see cref="IPolicyRootConditionalAccessPoliciesCollectionRequestBuilder"/>.</returns> public IPolicyRootConditionalAccessPoliciesCollectionRequestBuilder ConditionalAccessPolicies { get { return new PolicyRootConditionalAccessPoliciesCollectionRequestBuilder(this.AppendSegmentToRequestUrl("conditionalAccessPolicies"), this.Client); } } /// <summary> /// Gets the request builder for IdentitySecurityDefaultsEnforcementPolicy. /// </summary> /// <returns>The <see cref="IIdentitySecurityDefaultsEnforcementPolicyRequestBuilder"/>.</returns> public IIdentitySecurityDefaultsEnforcementPolicyRequestBuilder IdentitySecurityDefaultsEnforcementPolicy { get { return new IdentitySecurityDefaultsEnforcementPolicyRequestBuilder(this.AppendSegmentToRequestUrl("identitySecurityDefaultsEnforcementPolicy"), this.Client); } } /// <summary> /// Gets the request builder for MobileAppManagementPolicies. /// </summary> /// <returns>The <see cref="IPolicyRootMobileAppManagementPoliciesCollectionRequestBuilder"/>.</returns> public IPolicyRootMobileAppManagementPoliciesCollectionRequestBuilder MobileAppManagementPolicies { get { return new PolicyRootMobileAppManagementPoliciesCollectionRequestBuilder(this.AppendSegmentToRequestUrl("mobileAppManagementPolicies"), this.Client); } } /// <summary> /// Gets the request builder for MobileDeviceManagementPolicies. /// </summary> /// <returns>The <see cref="IPolicyRootMobileDeviceManagementPoliciesCollectionRequestBuilder"/>.</returns> public IPolicyRootMobileDeviceManagementPoliciesCollectionRequestBuilder MobileDeviceManagementPolicies { get { return new PolicyRootMobileDeviceManagementPoliciesCollectionRequestBuilder(this.AppendSegmentToRequestUrl("mobileDeviceManagementPolicies"), this.Client); } } /// <summary> /// Gets the request builder for RoleManagementPolicies. /// </summary> /// <returns>The <see cref="IPolicyRootRoleManagementPoliciesCollectionRequestBuilder"/>.</returns> public IPolicyRootRoleManagementPoliciesCollectionRequestBuilder RoleManagementPolicies { get { return new PolicyRootRoleManagementPoliciesCollectionRequestBuilder(this.AppendSegmentToRequestUrl("roleManagementPolicies"), this.Client); } } /// <summary> /// Gets the request builder for RoleManagementPolicyAssignments. /// </summary> /// <returns>The <see cref="IPolicyRootRoleManagementPolicyAssignmentsCollectionRequestBuilder"/>.</returns> public IPolicyRootRoleManagementPolicyAssignmentsCollectionRequestBuilder RoleManagementPolicyAssignments { get { return new PolicyRootRoleManagementPolicyAssignmentsCollectionRequestBuilder(this.AppendSegmentToRequestUrl("roleManagementPolicyAssignments"), this.Client); } } } }
42.809668
175
0.6506
[ "MIT" ]
microsoftgraph/msgraph-beta-sdk-dotnet
src/Microsoft.Graph/Generated/requests/PolicyRootRequestBuilder.cs
14,170
C#
// Copyright 2021 Google LLC // // 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 // // https://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. // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; using gagr = Google.Api.Gax.ResourceNames; using lro = Google.LongRunning; using wkt = Google.Protobuf.WellKnownTypes; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; using stt = System.Threading.Tasks; using xunit = Xunit; namespace Google.Cloud.Dialogflow.Cx.V3.Tests { /// <summary>Generated unit tests.</summary> public sealed class GeneratedAgentsClientTest { [xunit::FactAttribute] public void GetAgentRequestObject() { moq::Mock<Agents.AgentsClient> mockGrpcClient = new moq::Mock<Agents.AgentsClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); GetAgentRequest request = new GetAgentRequest { AgentName = AgentName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), }; Agent expectedResponse = new Agent { AgentName = AgentName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), DisplayName = "display_name137f65c2", DefaultLanguageCode = "default_language_codee612e130", TimeZone = "time_zone73f23b20", Description = "description2cf9da67", AvatarUri = "avatar_urie1767db7", SpeechToTextSettings = new SpeechToTextSettings(), StartFlowAsFlowName = FlowName.FromProjectLocationAgentFlow("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"), SecuritySettingsAsSecuritySettingsName = SecuritySettingsName.FromProjectLocationSecuritySettings("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]"), EnableStackdriverLogging = false, EnableSpellCorrection = true, }; mockGrpcClient.Setup(x => x.GetAgent(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse); AgentsClient client = new AgentsClientImpl(mockGrpcClient.Object, null); Agent response = client.GetAgent(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public async stt::Task GetAgentRequestObjectAsync() { moq::Mock<Agents.AgentsClient> mockGrpcClient = new moq::Mock<Agents.AgentsClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); GetAgentRequest request = new GetAgentRequest { AgentName = AgentName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), }; Agent expectedResponse = new Agent { AgentName = AgentName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), DisplayName = "display_name137f65c2", DefaultLanguageCode = "default_language_codee612e130", TimeZone = "time_zone73f23b20", Description = "description2cf9da67", AvatarUri = "avatar_urie1767db7", SpeechToTextSettings = new SpeechToTextSettings(), StartFlowAsFlowName = FlowName.FromProjectLocationAgentFlow("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"), SecuritySettingsAsSecuritySettingsName = SecuritySettingsName.FromProjectLocationSecuritySettings("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]"), EnableStackdriverLogging = false, EnableSpellCorrection = true, }; mockGrpcClient.Setup(x => x.GetAgentAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<Agent>(stt::Task.FromResult(expectedResponse), null, null, null, null)); AgentsClient client = new AgentsClientImpl(mockGrpcClient.Object, null); Agent responseCallSettings = await client.GetAgentAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); Agent responseCancellationToken = await client.GetAgentAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public void GetAgent() { moq::Mock<Agents.AgentsClient> mockGrpcClient = new moq::Mock<Agents.AgentsClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); GetAgentRequest request = new GetAgentRequest { AgentName = AgentName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), }; Agent expectedResponse = new Agent { AgentName = AgentName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), DisplayName = "display_name137f65c2", DefaultLanguageCode = "default_language_codee612e130", TimeZone = "time_zone73f23b20", Description = "description2cf9da67", AvatarUri = "avatar_urie1767db7", SpeechToTextSettings = new SpeechToTextSettings(), StartFlowAsFlowName = FlowName.FromProjectLocationAgentFlow("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"), SecuritySettingsAsSecuritySettingsName = SecuritySettingsName.FromProjectLocationSecuritySettings("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]"), EnableStackdriverLogging = false, EnableSpellCorrection = true, }; mockGrpcClient.Setup(x => x.GetAgent(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse); AgentsClient client = new AgentsClientImpl(mockGrpcClient.Object, null); Agent response = client.GetAgent(request.Name); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public async stt::Task GetAgentAsync() { moq::Mock<Agents.AgentsClient> mockGrpcClient = new moq::Mock<Agents.AgentsClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); GetAgentRequest request = new GetAgentRequest { AgentName = AgentName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), }; Agent expectedResponse = new Agent { AgentName = AgentName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), DisplayName = "display_name137f65c2", DefaultLanguageCode = "default_language_codee612e130", TimeZone = "time_zone73f23b20", Description = "description2cf9da67", AvatarUri = "avatar_urie1767db7", SpeechToTextSettings = new SpeechToTextSettings(), StartFlowAsFlowName = FlowName.FromProjectLocationAgentFlow("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"), SecuritySettingsAsSecuritySettingsName = SecuritySettingsName.FromProjectLocationSecuritySettings("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]"), EnableStackdriverLogging = false, EnableSpellCorrection = true, }; mockGrpcClient.Setup(x => x.GetAgentAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<Agent>(stt::Task.FromResult(expectedResponse), null, null, null, null)); AgentsClient client = new AgentsClientImpl(mockGrpcClient.Object, null); Agent responseCallSettings = await client.GetAgentAsync(request.Name, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); Agent responseCancellationToken = await client.GetAgentAsync(request.Name, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public void GetAgentResourceNames() { moq::Mock<Agents.AgentsClient> mockGrpcClient = new moq::Mock<Agents.AgentsClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); GetAgentRequest request = new GetAgentRequest { AgentName = AgentName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), }; Agent expectedResponse = new Agent { AgentName = AgentName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), DisplayName = "display_name137f65c2", DefaultLanguageCode = "default_language_codee612e130", TimeZone = "time_zone73f23b20", Description = "description2cf9da67", AvatarUri = "avatar_urie1767db7", SpeechToTextSettings = new SpeechToTextSettings(), StartFlowAsFlowName = FlowName.FromProjectLocationAgentFlow("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"), SecuritySettingsAsSecuritySettingsName = SecuritySettingsName.FromProjectLocationSecuritySettings("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]"), EnableStackdriverLogging = false, EnableSpellCorrection = true, }; mockGrpcClient.Setup(x => x.GetAgent(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse); AgentsClient client = new AgentsClientImpl(mockGrpcClient.Object, null); Agent response = client.GetAgent(request.AgentName); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public async stt::Task GetAgentResourceNamesAsync() { moq::Mock<Agents.AgentsClient> mockGrpcClient = new moq::Mock<Agents.AgentsClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); GetAgentRequest request = new GetAgentRequest { AgentName = AgentName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), }; Agent expectedResponse = new Agent { AgentName = AgentName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), DisplayName = "display_name137f65c2", DefaultLanguageCode = "default_language_codee612e130", TimeZone = "time_zone73f23b20", Description = "description2cf9da67", AvatarUri = "avatar_urie1767db7", SpeechToTextSettings = new SpeechToTextSettings(), StartFlowAsFlowName = FlowName.FromProjectLocationAgentFlow("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"), SecuritySettingsAsSecuritySettingsName = SecuritySettingsName.FromProjectLocationSecuritySettings("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]"), EnableStackdriverLogging = false, EnableSpellCorrection = true, }; mockGrpcClient.Setup(x => x.GetAgentAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<Agent>(stt::Task.FromResult(expectedResponse), null, null, null, null)); AgentsClient client = new AgentsClientImpl(mockGrpcClient.Object, null); Agent responseCallSettings = await client.GetAgentAsync(request.AgentName, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); Agent responseCancellationToken = await client.GetAgentAsync(request.AgentName, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public void CreateAgentRequestObject() { moq::Mock<Agents.AgentsClient> mockGrpcClient = new moq::Mock<Agents.AgentsClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); CreateAgentRequest request = new CreateAgentRequest { ParentAsLocationName = gagr::LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"), Agent = new Agent(), }; Agent expectedResponse = new Agent { AgentName = AgentName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), DisplayName = "display_name137f65c2", DefaultLanguageCode = "default_language_codee612e130", TimeZone = "time_zone73f23b20", Description = "description2cf9da67", AvatarUri = "avatar_urie1767db7", SpeechToTextSettings = new SpeechToTextSettings(), StartFlowAsFlowName = FlowName.FromProjectLocationAgentFlow("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"), SecuritySettingsAsSecuritySettingsName = SecuritySettingsName.FromProjectLocationSecuritySettings("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]"), EnableStackdriverLogging = false, EnableSpellCorrection = true, }; mockGrpcClient.Setup(x => x.CreateAgent(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse); AgentsClient client = new AgentsClientImpl(mockGrpcClient.Object, null); Agent response = client.CreateAgent(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public async stt::Task CreateAgentRequestObjectAsync() { moq::Mock<Agents.AgentsClient> mockGrpcClient = new moq::Mock<Agents.AgentsClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); CreateAgentRequest request = new CreateAgentRequest { ParentAsLocationName = gagr::LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"), Agent = new Agent(), }; Agent expectedResponse = new Agent { AgentName = AgentName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), DisplayName = "display_name137f65c2", DefaultLanguageCode = "default_language_codee612e130", TimeZone = "time_zone73f23b20", Description = "description2cf9da67", AvatarUri = "avatar_urie1767db7", SpeechToTextSettings = new SpeechToTextSettings(), StartFlowAsFlowName = FlowName.FromProjectLocationAgentFlow("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"), SecuritySettingsAsSecuritySettingsName = SecuritySettingsName.FromProjectLocationSecuritySettings("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]"), EnableStackdriverLogging = false, EnableSpellCorrection = true, }; mockGrpcClient.Setup(x => x.CreateAgentAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<Agent>(stt::Task.FromResult(expectedResponse), null, null, null, null)); AgentsClient client = new AgentsClientImpl(mockGrpcClient.Object, null); Agent responseCallSettings = await client.CreateAgentAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); Agent responseCancellationToken = await client.CreateAgentAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public void CreateAgent() { moq::Mock<Agents.AgentsClient> mockGrpcClient = new moq::Mock<Agents.AgentsClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); CreateAgentRequest request = new CreateAgentRequest { ParentAsLocationName = gagr::LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"), Agent = new Agent(), }; Agent expectedResponse = new Agent { AgentName = AgentName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), DisplayName = "display_name137f65c2", DefaultLanguageCode = "default_language_codee612e130", TimeZone = "time_zone73f23b20", Description = "description2cf9da67", AvatarUri = "avatar_urie1767db7", SpeechToTextSettings = new SpeechToTextSettings(), StartFlowAsFlowName = FlowName.FromProjectLocationAgentFlow("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"), SecuritySettingsAsSecuritySettingsName = SecuritySettingsName.FromProjectLocationSecuritySettings("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]"), EnableStackdriverLogging = false, EnableSpellCorrection = true, }; mockGrpcClient.Setup(x => x.CreateAgent(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse); AgentsClient client = new AgentsClientImpl(mockGrpcClient.Object, null); Agent response = client.CreateAgent(request.Parent, request.Agent); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public async stt::Task CreateAgentAsync() { moq::Mock<Agents.AgentsClient> mockGrpcClient = new moq::Mock<Agents.AgentsClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); CreateAgentRequest request = new CreateAgentRequest { ParentAsLocationName = gagr::LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"), Agent = new Agent(), }; Agent expectedResponse = new Agent { AgentName = AgentName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), DisplayName = "display_name137f65c2", DefaultLanguageCode = "default_language_codee612e130", TimeZone = "time_zone73f23b20", Description = "description2cf9da67", AvatarUri = "avatar_urie1767db7", SpeechToTextSettings = new SpeechToTextSettings(), StartFlowAsFlowName = FlowName.FromProjectLocationAgentFlow("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"), SecuritySettingsAsSecuritySettingsName = SecuritySettingsName.FromProjectLocationSecuritySettings("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]"), EnableStackdriverLogging = false, EnableSpellCorrection = true, }; mockGrpcClient.Setup(x => x.CreateAgentAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<Agent>(stt::Task.FromResult(expectedResponse), null, null, null, null)); AgentsClient client = new AgentsClientImpl(mockGrpcClient.Object, null); Agent responseCallSettings = await client.CreateAgentAsync(request.Parent, request.Agent, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); Agent responseCancellationToken = await client.CreateAgentAsync(request.Parent, request.Agent, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public void CreateAgentResourceNames() { moq::Mock<Agents.AgentsClient> mockGrpcClient = new moq::Mock<Agents.AgentsClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); CreateAgentRequest request = new CreateAgentRequest { ParentAsLocationName = gagr::LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"), Agent = new Agent(), }; Agent expectedResponse = new Agent { AgentName = AgentName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), DisplayName = "display_name137f65c2", DefaultLanguageCode = "default_language_codee612e130", TimeZone = "time_zone73f23b20", Description = "description2cf9da67", AvatarUri = "avatar_urie1767db7", SpeechToTextSettings = new SpeechToTextSettings(), StartFlowAsFlowName = FlowName.FromProjectLocationAgentFlow("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"), SecuritySettingsAsSecuritySettingsName = SecuritySettingsName.FromProjectLocationSecuritySettings("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]"), EnableStackdriverLogging = false, EnableSpellCorrection = true, }; mockGrpcClient.Setup(x => x.CreateAgent(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse); AgentsClient client = new AgentsClientImpl(mockGrpcClient.Object, null); Agent response = client.CreateAgent(request.ParentAsLocationName, request.Agent); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public async stt::Task CreateAgentResourceNamesAsync() { moq::Mock<Agents.AgentsClient> mockGrpcClient = new moq::Mock<Agents.AgentsClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); CreateAgentRequest request = new CreateAgentRequest { ParentAsLocationName = gagr::LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"), Agent = new Agent(), }; Agent expectedResponse = new Agent { AgentName = AgentName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), DisplayName = "display_name137f65c2", DefaultLanguageCode = "default_language_codee612e130", TimeZone = "time_zone73f23b20", Description = "description2cf9da67", AvatarUri = "avatar_urie1767db7", SpeechToTextSettings = new SpeechToTextSettings(), StartFlowAsFlowName = FlowName.FromProjectLocationAgentFlow("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"), SecuritySettingsAsSecuritySettingsName = SecuritySettingsName.FromProjectLocationSecuritySettings("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]"), EnableStackdriverLogging = false, EnableSpellCorrection = true, }; mockGrpcClient.Setup(x => x.CreateAgentAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<Agent>(stt::Task.FromResult(expectedResponse), null, null, null, null)); AgentsClient client = new AgentsClientImpl(mockGrpcClient.Object, null); Agent responseCallSettings = await client.CreateAgentAsync(request.ParentAsLocationName, request.Agent, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); Agent responseCancellationToken = await client.CreateAgentAsync(request.ParentAsLocationName, request.Agent, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public void UpdateAgentRequestObject() { moq::Mock<Agents.AgentsClient> mockGrpcClient = new moq::Mock<Agents.AgentsClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); UpdateAgentRequest request = new UpdateAgentRequest { Agent = new Agent(), UpdateMask = new wkt::FieldMask(), }; Agent expectedResponse = new Agent { AgentName = AgentName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), DisplayName = "display_name137f65c2", DefaultLanguageCode = "default_language_codee612e130", TimeZone = "time_zone73f23b20", Description = "description2cf9da67", AvatarUri = "avatar_urie1767db7", SpeechToTextSettings = new SpeechToTextSettings(), StartFlowAsFlowName = FlowName.FromProjectLocationAgentFlow("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"), SecuritySettingsAsSecuritySettingsName = SecuritySettingsName.FromProjectLocationSecuritySettings("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]"), EnableStackdriverLogging = false, EnableSpellCorrection = true, }; mockGrpcClient.Setup(x => x.UpdateAgent(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse); AgentsClient client = new AgentsClientImpl(mockGrpcClient.Object, null); Agent response = client.UpdateAgent(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public async stt::Task UpdateAgentRequestObjectAsync() { moq::Mock<Agents.AgentsClient> mockGrpcClient = new moq::Mock<Agents.AgentsClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); UpdateAgentRequest request = new UpdateAgentRequest { Agent = new Agent(), UpdateMask = new wkt::FieldMask(), }; Agent expectedResponse = new Agent { AgentName = AgentName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), DisplayName = "display_name137f65c2", DefaultLanguageCode = "default_language_codee612e130", TimeZone = "time_zone73f23b20", Description = "description2cf9da67", AvatarUri = "avatar_urie1767db7", SpeechToTextSettings = new SpeechToTextSettings(), StartFlowAsFlowName = FlowName.FromProjectLocationAgentFlow("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"), SecuritySettingsAsSecuritySettingsName = SecuritySettingsName.FromProjectLocationSecuritySettings("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]"), EnableStackdriverLogging = false, EnableSpellCorrection = true, }; mockGrpcClient.Setup(x => x.UpdateAgentAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<Agent>(stt::Task.FromResult(expectedResponse), null, null, null, null)); AgentsClient client = new AgentsClientImpl(mockGrpcClient.Object, null); Agent responseCallSettings = await client.UpdateAgentAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); Agent responseCancellationToken = await client.UpdateAgentAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public void UpdateAgent() { moq::Mock<Agents.AgentsClient> mockGrpcClient = new moq::Mock<Agents.AgentsClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); UpdateAgentRequest request = new UpdateAgentRequest { Agent = new Agent(), UpdateMask = new wkt::FieldMask(), }; Agent expectedResponse = new Agent { AgentName = AgentName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), DisplayName = "display_name137f65c2", DefaultLanguageCode = "default_language_codee612e130", TimeZone = "time_zone73f23b20", Description = "description2cf9da67", AvatarUri = "avatar_urie1767db7", SpeechToTextSettings = new SpeechToTextSettings(), StartFlowAsFlowName = FlowName.FromProjectLocationAgentFlow("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"), SecuritySettingsAsSecuritySettingsName = SecuritySettingsName.FromProjectLocationSecuritySettings("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]"), EnableStackdriverLogging = false, EnableSpellCorrection = true, }; mockGrpcClient.Setup(x => x.UpdateAgent(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse); AgentsClient client = new AgentsClientImpl(mockGrpcClient.Object, null); Agent response = client.UpdateAgent(request.Agent, request.UpdateMask); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public async stt::Task UpdateAgentAsync() { moq::Mock<Agents.AgentsClient> mockGrpcClient = new moq::Mock<Agents.AgentsClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); UpdateAgentRequest request = new UpdateAgentRequest { Agent = new Agent(), UpdateMask = new wkt::FieldMask(), }; Agent expectedResponse = new Agent { AgentName = AgentName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), DisplayName = "display_name137f65c2", DefaultLanguageCode = "default_language_codee612e130", TimeZone = "time_zone73f23b20", Description = "description2cf9da67", AvatarUri = "avatar_urie1767db7", SpeechToTextSettings = new SpeechToTextSettings(), StartFlowAsFlowName = FlowName.FromProjectLocationAgentFlow("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"), SecuritySettingsAsSecuritySettingsName = SecuritySettingsName.FromProjectLocationSecuritySettings("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]"), EnableStackdriverLogging = false, EnableSpellCorrection = true, }; mockGrpcClient.Setup(x => x.UpdateAgentAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<Agent>(stt::Task.FromResult(expectedResponse), null, null, null, null)); AgentsClient client = new AgentsClientImpl(mockGrpcClient.Object, null); Agent responseCallSettings = await client.UpdateAgentAsync(request.Agent, request.UpdateMask, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); Agent responseCancellationToken = await client.UpdateAgentAsync(request.Agent, request.UpdateMask, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public void DeleteAgentRequestObject() { moq::Mock<Agents.AgentsClient> mockGrpcClient = new moq::Mock<Agents.AgentsClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); DeleteAgentRequest request = new DeleteAgentRequest { AgentName = AgentName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), }; wkt::Empty expectedResponse = new wkt::Empty { }; mockGrpcClient.Setup(x => x.DeleteAgent(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse); AgentsClient client = new AgentsClientImpl(mockGrpcClient.Object, null); client.DeleteAgent(request); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public async stt::Task DeleteAgentRequestObjectAsync() { moq::Mock<Agents.AgentsClient> mockGrpcClient = new moq::Mock<Agents.AgentsClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); DeleteAgentRequest request = new DeleteAgentRequest { AgentName = AgentName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), }; wkt::Empty expectedResponse = new wkt::Empty { }; mockGrpcClient.Setup(x => x.DeleteAgentAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<wkt::Empty>(stt::Task.FromResult(expectedResponse), null, null, null, null)); AgentsClient client = new AgentsClientImpl(mockGrpcClient.Object, null); await client.DeleteAgentAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); await client.DeleteAgentAsync(request, st::CancellationToken.None); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public void DeleteAgent() { moq::Mock<Agents.AgentsClient> mockGrpcClient = new moq::Mock<Agents.AgentsClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); DeleteAgentRequest request = new DeleteAgentRequest { AgentName = AgentName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), }; wkt::Empty expectedResponse = new wkt::Empty { }; mockGrpcClient.Setup(x => x.DeleteAgent(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse); AgentsClient client = new AgentsClientImpl(mockGrpcClient.Object, null); client.DeleteAgent(request.Name); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public async stt::Task DeleteAgentAsync() { moq::Mock<Agents.AgentsClient> mockGrpcClient = new moq::Mock<Agents.AgentsClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); DeleteAgentRequest request = new DeleteAgentRequest { AgentName = AgentName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), }; wkt::Empty expectedResponse = new wkt::Empty { }; mockGrpcClient.Setup(x => x.DeleteAgentAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<wkt::Empty>(stt::Task.FromResult(expectedResponse), null, null, null, null)); AgentsClient client = new AgentsClientImpl(mockGrpcClient.Object, null); await client.DeleteAgentAsync(request.Name, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); await client.DeleteAgentAsync(request.Name, st::CancellationToken.None); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public void DeleteAgentResourceNames() { moq::Mock<Agents.AgentsClient> mockGrpcClient = new moq::Mock<Agents.AgentsClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); DeleteAgentRequest request = new DeleteAgentRequest { AgentName = AgentName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), }; wkt::Empty expectedResponse = new wkt::Empty { }; mockGrpcClient.Setup(x => x.DeleteAgent(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse); AgentsClient client = new AgentsClientImpl(mockGrpcClient.Object, null); client.DeleteAgent(request.AgentName); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public async stt::Task DeleteAgentResourceNamesAsync() { moq::Mock<Agents.AgentsClient> mockGrpcClient = new moq::Mock<Agents.AgentsClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); DeleteAgentRequest request = new DeleteAgentRequest { AgentName = AgentName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), }; wkt::Empty expectedResponse = new wkt::Empty { }; mockGrpcClient.Setup(x => x.DeleteAgentAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<wkt::Empty>(stt::Task.FromResult(expectedResponse), null, null, null, null)); AgentsClient client = new AgentsClientImpl(mockGrpcClient.Object, null); await client.DeleteAgentAsync(request.AgentName, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); await client.DeleteAgentAsync(request.AgentName, st::CancellationToken.None); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public void ValidateAgentRequestObject() { moq::Mock<Agents.AgentsClient> mockGrpcClient = new moq::Mock<Agents.AgentsClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); ValidateAgentRequest request = new ValidateAgentRequest { AgentName = AgentName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), LanguageCode = "language_code2f6c7160", }; AgentValidationResult expectedResponse = new AgentValidationResult { AgentValidationResultName = AgentValidationResultName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), FlowValidationResults = { new FlowValidationResult(), }, }; mockGrpcClient.Setup(x => x.ValidateAgent(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse); AgentsClient client = new AgentsClientImpl(mockGrpcClient.Object, null); AgentValidationResult response = client.ValidateAgent(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public async stt::Task ValidateAgentRequestObjectAsync() { moq::Mock<Agents.AgentsClient> mockGrpcClient = new moq::Mock<Agents.AgentsClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); ValidateAgentRequest request = new ValidateAgentRequest { AgentName = AgentName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), LanguageCode = "language_code2f6c7160", }; AgentValidationResult expectedResponse = new AgentValidationResult { AgentValidationResultName = AgentValidationResultName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), FlowValidationResults = { new FlowValidationResult(), }, }; mockGrpcClient.Setup(x => x.ValidateAgentAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<AgentValidationResult>(stt::Task.FromResult(expectedResponse), null, null, null, null)); AgentsClient client = new AgentsClientImpl(mockGrpcClient.Object, null); AgentValidationResult responseCallSettings = await client.ValidateAgentAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); AgentValidationResult responseCancellationToken = await client.ValidateAgentAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public void GetAgentValidationResultRequestObject() { moq::Mock<Agents.AgentsClient> mockGrpcClient = new moq::Mock<Agents.AgentsClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); GetAgentValidationResultRequest request = new GetAgentValidationResultRequest { AgentValidationResultName = AgentValidationResultName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), LanguageCode = "language_code2f6c7160", }; AgentValidationResult expectedResponse = new AgentValidationResult { AgentValidationResultName = AgentValidationResultName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), FlowValidationResults = { new FlowValidationResult(), }, }; mockGrpcClient.Setup(x => x.GetAgentValidationResult(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse); AgentsClient client = new AgentsClientImpl(mockGrpcClient.Object, null); AgentValidationResult response = client.GetAgentValidationResult(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public async stt::Task GetAgentValidationResultRequestObjectAsync() { moq::Mock<Agents.AgentsClient> mockGrpcClient = new moq::Mock<Agents.AgentsClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); GetAgentValidationResultRequest request = new GetAgentValidationResultRequest { AgentValidationResultName = AgentValidationResultName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), LanguageCode = "language_code2f6c7160", }; AgentValidationResult expectedResponse = new AgentValidationResult { AgentValidationResultName = AgentValidationResultName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), FlowValidationResults = { new FlowValidationResult(), }, }; mockGrpcClient.Setup(x => x.GetAgentValidationResultAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<AgentValidationResult>(stt::Task.FromResult(expectedResponse), null, null, null, null)); AgentsClient client = new AgentsClientImpl(mockGrpcClient.Object, null); AgentValidationResult responseCallSettings = await client.GetAgentValidationResultAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); AgentValidationResult responseCancellationToken = await client.GetAgentValidationResultAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public void GetAgentValidationResult() { moq::Mock<Agents.AgentsClient> mockGrpcClient = new moq::Mock<Agents.AgentsClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); GetAgentValidationResultRequest request = new GetAgentValidationResultRequest { AgentValidationResultName = AgentValidationResultName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), }; AgentValidationResult expectedResponse = new AgentValidationResult { AgentValidationResultName = AgentValidationResultName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), FlowValidationResults = { new FlowValidationResult(), }, }; mockGrpcClient.Setup(x => x.GetAgentValidationResult(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse); AgentsClient client = new AgentsClientImpl(mockGrpcClient.Object, null); AgentValidationResult response = client.GetAgentValidationResult(request.Name); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public async stt::Task GetAgentValidationResultAsync() { moq::Mock<Agents.AgentsClient> mockGrpcClient = new moq::Mock<Agents.AgentsClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); GetAgentValidationResultRequest request = new GetAgentValidationResultRequest { AgentValidationResultName = AgentValidationResultName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), }; AgentValidationResult expectedResponse = new AgentValidationResult { AgentValidationResultName = AgentValidationResultName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), FlowValidationResults = { new FlowValidationResult(), }, }; mockGrpcClient.Setup(x => x.GetAgentValidationResultAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<AgentValidationResult>(stt::Task.FromResult(expectedResponse), null, null, null, null)); AgentsClient client = new AgentsClientImpl(mockGrpcClient.Object, null); AgentValidationResult responseCallSettings = await client.GetAgentValidationResultAsync(request.Name, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); AgentValidationResult responseCancellationToken = await client.GetAgentValidationResultAsync(request.Name, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public void GetAgentValidationResultResourceNames() { moq::Mock<Agents.AgentsClient> mockGrpcClient = new moq::Mock<Agents.AgentsClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); GetAgentValidationResultRequest request = new GetAgentValidationResultRequest { AgentValidationResultName = AgentValidationResultName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), }; AgentValidationResult expectedResponse = new AgentValidationResult { AgentValidationResultName = AgentValidationResultName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), FlowValidationResults = { new FlowValidationResult(), }, }; mockGrpcClient.Setup(x => x.GetAgentValidationResult(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse); AgentsClient client = new AgentsClientImpl(mockGrpcClient.Object, null); AgentValidationResult response = client.GetAgentValidationResult(request.AgentValidationResultName); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public async stt::Task GetAgentValidationResultResourceNamesAsync() { moq::Mock<Agents.AgentsClient> mockGrpcClient = new moq::Mock<Agents.AgentsClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); GetAgentValidationResultRequest request = new GetAgentValidationResultRequest { AgentValidationResultName = AgentValidationResultName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), }; AgentValidationResult expectedResponse = new AgentValidationResult { AgentValidationResultName = AgentValidationResultName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), FlowValidationResults = { new FlowValidationResult(), }, }; mockGrpcClient.Setup(x => x.GetAgentValidationResultAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<AgentValidationResult>(stt::Task.FromResult(expectedResponse), null, null, null, null)); AgentsClient client = new AgentsClientImpl(mockGrpcClient.Object, null); AgentValidationResult responseCallSettings = await client.GetAgentValidationResultAsync(request.AgentValidationResultName, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); AgentValidationResult responseCancellationToken = await client.GetAgentValidationResultAsync(request.AgentValidationResultName, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } } }
63.220903
245
0.651093
[ "Apache-2.0" ]
snakefoot/google-cloud-dotnet
apis/Google.Cloud.Dialogflow.Cx.V3/Google.Cloud.Dialogflow.Cx.V3.Tests/AgentsClientTest.g.cs
53,232
C#
/**************************************************************************** Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada Copyright (c) 2011 Zynga Inc. Copyright (c) 2011-2012 openxlive.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. ****************************************************************************/ namespace Cocos2D { public class CCShakyTiles3D : CCTiledGrid3DAction { protected bool m_bShakeZ; protected int m_nRandrange; /// <summary> /// initializes the action with a range, whether or not to shake Z vertices, a grid size, and duration /// </summary> protected virtual bool InitWithDuration(float duration, CCGridSize gridSize, int nRange, bool bShakeZ) { if (base.InitWithDuration(duration, gridSize)) { m_nRandrange = nRange; m_bShakeZ = bShakeZ; return true; } return false; } public override object Copy(ICCCopyable pZone) { CCShakyTiles3D pCopy; if (pZone != null) { //in case of being called at sub class pCopy = (CCShakyTiles3D) (pZone); } else { pCopy = new CCShakyTiles3D(); pZone = (pCopy); } base.Copy(pZone); pCopy.InitWithDuration(m_fDuration, m_sGridSize, m_nRandrange, m_bShakeZ); return pCopy; } public override void Update(float time) { int i, j; for (i = 0; i < m_sGridSize.X; ++i) { for (j = 0; j < m_sGridSize.Y; ++j) { CCQuad3 coords = OriginalTile(new CCGridSize(i, j)); // X coords.BottomLeft.X += (CCRandom.Next() % (m_nRandrange * 2)) - m_nRandrange; coords.BottomRight.X += (CCRandom.Next() % (m_nRandrange * 2)) - m_nRandrange; coords.TopLeft.X += (CCRandom.Next() % (m_nRandrange * 2)) - m_nRandrange; coords.TopRight.X += (CCRandom.Next() % (m_nRandrange * 2)) - m_nRandrange; // Y coords.BottomLeft.Y += (CCRandom.Next() % (m_nRandrange * 2)) - m_nRandrange; coords.BottomRight.Y += (CCRandom.Next() % (m_nRandrange * 2)) - m_nRandrange; coords.TopLeft.Y += (CCRandom.Next() % (m_nRandrange * 2)) - m_nRandrange; coords.TopRight.Y += (CCRandom.Next() % (m_nRandrange * 2)) - m_nRandrange; if (m_bShakeZ) { coords.BottomLeft.Z += (CCRandom.Next() % (m_nRandrange * 2)) - m_nRandrange; coords.BottomRight.Z += (CCRandom.Next() % (m_nRandrange * 2)) - m_nRandrange; coords.TopLeft.Z += (CCRandom.Next() % (m_nRandrange * 2)) - m_nRandrange; coords.TopRight.Z += (CCRandom.Next() % (m_nRandrange * 2)) - m_nRandrange; } SetTile(new CCGridSize(i, j), ref coords); } } } public CCShakyTiles3D() { } /// <summary> /// creates the action with a range, whether or not to shake Z vertices, a grid size, and duration /// </summary> public CCShakyTiles3D(float duration, CCGridSize gridSize, int nRange, bool bShakeZ) : base(duration) { InitWithDuration(duration, gridSize, nRange, bShakeZ); } } }
40.043103
111
0.558881
[ "MIT" ]
Karunp/cocos2d-xna
cocos2d/actions/action_tiled_grid/CCShakyTiles3D.cs
4,645
C#
using UnityEngine; using PurificationPioneer.Scriptable; namespace PurificationPioneer.Script { public interface IPpController:IFrameSyncCharacter { HeroConfigAsset HeroConfig { get; } void InitCharacterController(int seatId, HeroConfigAsset config); Transform transform { get; } } public enum CharacterState { Move = 1, Free = 2, Idle = 3, Attack1 = 4, Attack2 = 5, Attack3 = 6, Skill1 = 7, Skill2 = 8, Die = 9, } }
21.230769
73
0.576087
[ "Unlicense" ]
LaudateCorpus1/distributed-architecture-of-moba-game-server
PurificationPioneer/Assets/PurificationPioneer/Script/Character/IPpController.cs
554
C#
//****************************************************************************************************** // PhasorValue.cs - Gbtc // // Copyright © 2012, Grid Protection Alliance. All Rights Reserved. // // Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See // the NOTICE file distributed with this work for additional information regarding copyright ownership. // The GPA licenses this file to you under the MIT License (MIT), 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.opensource.org/licenses/MIT // // Unless agreed to in writing, the subject software distributed under the License is distributed on an // "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the // License for the specific language governing permissions and limitations. // // Code Modification History: // ---------------------------------------------------------------------------------------------------- // 11/12/2004 - J. Ritchie Carroll // Generated original version of source code. // 09/15/2009 - Stephen C. Wills // Added new header and license agreement. // 12/17/2012 - Starlynn Danyelle Gilliam // Modified Header. // //****************************************************************************************************** using System; using System.Runtime.Serialization; using GSF.Units; namespace GSF.PhasorProtocols.IEEE1344 { /// <summary> /// Represents the IEEE 1344 implementation of a <see cref="IPhasorValue"/>. /// </summary> [Serializable] public class PhasorValue : PhasorValueBase { #region [ Constructors ] /// <summary> /// Creates a new <see cref="PhasorValue"/>. /// </summary> /// <param name="parent">The <see cref="IDataCell"/> parent of this <see cref="PhasorValue"/>.</param> /// <param name="phasorDefinition">The <see cref="IPhasorDefinition"/> associated with this <see cref="PhasorValue"/>.</param> public PhasorValue(IDataCell parent, IPhasorDefinition phasorDefinition) : base(parent, phasorDefinition) { } /// <summary> /// Creates a new <see cref="PhasorValue"/> from specified parameters. /// </summary> /// <param name="parent">The <see cref="DataCell"/> parent of this <see cref="PhasorValue"/>.</param> /// <param name="phasorDefinition">The <see cref="PhasorDefinition"/> associated with this <see cref="PhasorValue"/>.</param> /// <param name="real">The real value of this <see cref="PhasorValue"/>.</param> /// <param name="imaginary">The imaginary value of this <see cref="PhasorValue"/>.</param> public PhasorValue(DataCell parent, PhasorDefinition phasorDefinition, double real, double imaginary) : base(parent, phasorDefinition, real, imaginary) { } /// <summary> /// Creates a new <see cref="PhasorValue"/> from specified parameters. /// </summary> /// <param name="parent">The <see cref="DataCell"/> parent of this <see cref="PhasorValue"/>.</param> /// <param name="phasorDefinition">The <see cref="PhasorDefinition"/> associated with this <see cref="PhasorValue"/>.</param> /// <param name="angle">The <see cref="GSF.Units.Angle"/> value (a.k.a., the argument) of this <see cref="PhasorValue"/>, in radians.</param> /// <param name="magnitude">The magnitude value (a.k.a., the absolute value or modulus) of this <see cref="PhasorValue"/>.</param> public PhasorValue(DataCell parent, PhasorDefinition phasorDefinition, Angle angle, double magnitude) : base(parent, phasorDefinition, angle, magnitude) { } /// <summary> /// Creates a new <see cref="PhasorValue"/> from serialization parameters. /// </summary> /// <param name="info">The <see cref="SerializationInfo"/> with populated with data.</param> /// <param name="context">The source <see cref="StreamingContext"/> for this deserialization.</param> protected PhasorValue(SerializationInfo info, StreamingContext context) : base(info, context) { } #endregion #region [ Properties ] /// <summary> /// Gets or sets the <see cref="DataCell"/> parent of this <see cref="PhasorValue"/>. /// </summary> public new virtual DataCell Parent { get => base.Parent as DataCell; set => base.Parent = value; } /// <summary> /// Gets or sets the <see cref="PhasorDefinition"/> associated with this <see cref="PhasorValue"/>. /// </summary> public new virtual PhasorDefinition Definition { get => base.Definition as PhasorDefinition; set => base.Definition = value; } #endregion #region [ Static ] // Static Methods // Delegate handler to create a new IEEE 1344 phasor value internal static IPhasorValue CreateNewValue(IDataCell parent, IPhasorDefinition definition, byte[] buffer, int startIndex, out int parsedLength) { IPhasorValue phasor = new PhasorValue(parent, definition); parsedLength = phasor.ParseBinaryImage(buffer, startIndex, 0); return phasor; } #endregion } }
43.81746
152
0.601159
[ "MIT" ]
SRM256/gsf
Source/Libraries/GSF.PhasorProtocols/IEEE1344/PhasorValue.cs
5,524
C#
namespace SimpleWorkfloorManagementSuite.Modules { partial class TimeTableManagementModule { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose( bool disposing ) { if( disposing && ( components != null ) ) { components.Dispose(); } base.Dispose( disposing ); } #region Component Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); SwmSuite.Presentation.Common.TimeTable.OccupationRenderer occupationRenderer1 = new SwmSuite.Presentation.Common.TimeTable.OccupationRenderer(); SwmSuite.Presentation.Common.TimeTable.OccupationSettings occupationSettings1 = new SwmSuite.Presentation.Common.TimeTable.OccupationSettings(); SwmSuite.Presentation.Common.TimeTable.TimeTableHitTest timeTableHitTest1 = new SwmSuite.Presentation.Common.TimeTable.TimeTableHitTest(); SwmSuite.Presentation.Common.TimeTable.TimeTableRenderer timeTableRenderer1 = new SwmSuite.Presentation.Common.TimeTable.TimeTableRenderer(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager( typeof( TimeTableManagementModule ) ); this.toolStrip = new System.Windows.Forms.ToolStrip(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.employeeTreeView = new SwmSuite.Presentation.Common.BrowserTreeView.BrowserTreeViewControl(); this.ImageList = new System.Windows.Forms.ImageList( this.components ); this.occupationControl = new SwmSuite.Presentation.Common.TimeTable.OccupationControl(); this.timeTable = new SwmSuite.Presentation.Common.TimeTable.TimeTableControl(); this.templateManagementToolStripButton = new System.Windows.Forms.ToolStripButton(); this.timeTablePurposeToolStripButton = new System.Windows.Forms.ToolStripButton(); this.nextToolStripButton = new System.Windows.Forms.ToolStripButton(); this.selectionToolStripButton = new System.Windows.Forms.ToolStripButton(); this.previousToolStripButton = new System.Windows.Forms.ToolStripButton(); this.occupationToolStripButton = new System.Windows.Forms.ToolStripButton(); this.templateToolStripButton = new System.Windows.Forms.ToolStripButton(); this.mondayToolStripButton = new System.Windows.Forms.ToolStripButton(); this.tuesdayToolStripButton = new System.Windows.Forms.ToolStripButton(); this.wednesdayToolStripButton = new System.Windows.Forms.ToolStripButton(); this.thursdayToolStripButton = new System.Windows.Forms.ToolStripButton(); this.fridayToolStripButton = new System.Windows.Forms.ToolStripButton(); this.saturdayToolStripButton = new System.Windows.Forms.ToolStripButton(); this.sundayToolStripButton = new System.Windows.Forms.ToolStripButton(); this.toolStrip.SuspendLayout(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.SuspendLayout(); this.SuspendLayout(); // // toolStrip // this.toolStrip.AutoSize = false; this.toolStrip.Items.AddRange( new System.Windows.Forms.ToolStripItem[] { this.templateManagementToolStripButton, this.timeTablePurposeToolStripButton, this.nextToolStripButton, this.selectionToolStripButton, this.previousToolStripButton, this.toolStripSeparator1, this.occupationToolStripButton, this.templateToolStripButton, this.toolStripSeparator2, this.mondayToolStripButton, this.tuesdayToolStripButton, this.wednesdayToolStripButton, this.thursdayToolStripButton, this.fridayToolStripButton, this.saturdayToolStripButton, this.sundayToolStripButton} ); this.toolStrip.Location = new System.Drawing.Point( 0 , 0 ); this.toolStrip.Name = "toolStrip"; this.toolStrip.Size = new System.Drawing.Size( 873 , 35 ); this.toolStrip.TabIndex = 34; this.toolStrip.Text = "toolStrip1"; // // toolStripSeparator1 // this.toolStripSeparator1.ForeColor = System.Drawing.Color.White; this.toolStripSeparator1.Name = "toolStripSeparator1"; this.toolStripSeparator1.Size = new System.Drawing.Size( 6 , 35 ); // // toolStripSeparator2 // this.toolStripSeparator2.Name = "toolStripSeparator2"; this.toolStripSeparator2.Size = new System.Drawing.Size( 6 , 35 ); // // splitContainer1 // this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; this.splitContainer1.Location = new System.Drawing.Point( 0 , 35 ); this.splitContainer1.Name = "splitContainer1"; // // splitContainer1.Panel1 // this.splitContainer1.Panel1.Controls.Add( this.employeeTreeView ); this.splitContainer1.Panel1.Padding = new System.Windows.Forms.Padding( 5 , 5 , 0 , 5 ); // // splitContainer1.Panel2 // this.splitContainer1.Panel2.Controls.Add( this.occupationControl ); this.splitContainer1.Panel2.Controls.Add( this.timeTable ); this.splitContainer1.Panel2.Padding = new System.Windows.Forms.Padding( 0 , 5 , 5 , 5 ); this.splitContainer1.Size = new System.Drawing.Size( 873 , 596 ); this.splitContainer1.SplitterDistance = 200; this.splitContainer1.TabIndex = 35; // // employeeTreeView // this.employeeTreeView.AllowDrop = true; this.employeeTreeView.Dock = System.Windows.Forms.DockStyle.Fill; this.employeeTreeView.Font = new System.Drawing.Font( "Verdana" , 10F ); this.employeeTreeView.FullRowSelect = true; this.employeeTreeView.HideSelection = false; this.employeeTreeView.ImageIndex = 2; this.employeeTreeView.ImageList = this.ImageList; this.employeeTreeView.Location = new System.Drawing.Point( 5 , 5 ); this.employeeTreeView.Name = "employeeTreeView"; this.employeeTreeView.SelectedImageIndex = 2; this.employeeTreeView.Size = new System.Drawing.Size( 195 , 586 ); this.employeeTreeView.TabIndex = 39; this.employeeTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler( this.employeeTreeView_AfterSelect ); // // ImageList // this.ImageList.ImageStream = ( (System.Windows.Forms.ImageListStreamer)( resources.GetObject( "ImageList.ImageStream" ) ) ); this.ImageList.TransparentColor = System.Drawing.Color.Transparent; this.ImageList.Images.SetKeyName( 0 , "everyone.png" ); this.ImageList.Images.SetKeyName( 1 , "employeegroup.png" ); this.ImageList.Images.SetKeyName( 2 , "employee.png" ); // // occupationControl // this.occupationControl.Dock = System.Windows.Forms.DockStyle.Fill; this.occupationControl.Location = new System.Drawing.Point( 0 , 5 ); this.occupationControl.Name = "occupationControl"; this.occupationControl.Renderer = occupationRenderer1; this.occupationControl.Scheme.BarGap = 5; this.occupationControl.Scheme.BarHeight = 30; this.occupationControl.Scheme.ColumnHeaderBackgroundColor1 = System.Drawing.Color.FromArgb( ( (int)( ( (byte)( 136 ) ) ) ) , ( (int)( ( (byte)( 180 ) ) ) ) , ( (int)( ( (byte)( 192 ) ) ) ) ); this.occupationControl.Scheme.ColumnHeaderBackgroundColor2 = System.Drawing.Color.FromArgb( ( (int)( ( (byte)( 71 ) ) ) ) , ( (int)( ( (byte)( 139 ) ) ) ) , ( (int)( ( (byte)( 158 ) ) ) ) ); this.occupationControl.Scheme.ColumnHeaderBackgroundColor3 = System.Drawing.Color.FromArgb( ( (int)( ( (byte)( 19 ) ) ) ) , ( (int)( ( (byte)( 97 ) ) ) ) , ( (int)( ( (byte)( 119 ) ) ) ) ); this.occupationControl.Scheme.ColumnHeaderBackgroundColor4 = System.Drawing.Color.FromArgb( ( (int)( ( (byte)( 83 ) ) ) ) , ( (int)( ( (byte)( 159 ) ) ) ) , ( (int)( ( (byte)( 171 ) ) ) ) ); this.occupationControl.Scheme.DescriptionCaptionColor = System.Drawing.Color.FromArgb( ( (int)( ( (byte)( 0 ) ) ) ) , ( (int)( ( (byte)( 0 ) ) ) ) , ( (int)( ( (byte)( 0 ) ) ) ) ); this.occupationControl.Scheme.DescriptionCaptionFont = new System.Drawing.Font( "Verdana" , 9.75F , System.Drawing.FontStyle.Bold , System.Drawing.GraphicsUnit.Point , ( (byte)( 0 ) ) ); this.occupationControl.Scheme.DescriptionColumnWidth = 200; this.occupationControl.Scheme.HeaderHeight = 30; this.occupationControl.Scheme.LargeRulerColor = System.Drawing.Color.Gainsboro; this.occupationControl.Scheme.SeperatorColor = System.Drawing.Color.FromArgb( ( (int)( ( (byte)( 0 ) ) ) ) , ( (int)( ( (byte)( 0 ) ) ) ) , ( (int)( ( (byte)( 0 ) ) ) ) ); this.occupationControl.Scheme.SmallRulerColor = System.Drawing.Color.FromArgb( ( (int)( ( (byte)( 240 ) ) ) ) , ( (int)( ( (byte)( 240 ) ) ) ) , ( (int)( ( (byte)( 240 ) ) ) ) ); this.occupationControl.Scheme.SummaryCaptionColor = System.Drawing.Color.FromArgb( ( (int)( ( (byte)( 0 ) ) ) ) , ( (int)( ( (byte)( 0 ) ) ) ) , ( (int)( ( (byte)( 0 ) ) ) ) ); this.occupationControl.Scheme.SummaryCaptionFont = new System.Drawing.Font( "Verdana" , 8.25F , System.Drawing.FontStyle.Bold , System.Drawing.GraphicsUnit.Point , ( (byte)( 0 ) ) ); this.occupationControl.Scheme.SummaryColumnWidth = 50; this.occupationControl.Scheme.SummaryRowBackgroundColor1 = System.Drawing.Color.FromArgb( ( (int)( ( (byte)( 255 ) ) ) ) , ( (int)( ( (byte)( 255 ) ) ) ) , ( (int)( ( (byte)( 255 ) ) ) ) ); this.occupationControl.Scheme.SummaryRowBackgroundColor2 = System.Drawing.Color.FromArgb( ( (int)( ( (byte)( 215 ) ) ) ) , ( (int)( ( (byte)( 215 ) ) ) ) , ( (int)( ( (byte)( 215 ) ) ) ) ); this.occupationControl.Scheme.SummaryRowBackgroundColor3 = System.Drawing.Color.FromArgb( ( (int)( ( (byte)( 171 ) ) ) ) , ( (int)( ( (byte)( 171 ) ) ) ) , ( (int)( ( (byte)( 171 ) ) ) ) ); this.occupationControl.Scheme.SummaryRowBackgroundColor4 = System.Drawing.Color.FromArgb( ( (int)( ( (byte)( 222 ) ) ) ) , ( (int)( ( (byte)( 222 ) ) ) ) , ( (int)( ( (byte)( 222 ) ) ) ) ); this.occupationControl.Scheme.TimeCaptionColor = System.Drawing.Color.White; this.occupationControl.Scheme.TimeCaptionFont = new System.Drawing.Font( "Verdana" , 8F ); this.occupationControl.Selection = new System.DateTime( 2009 , 3 , 25 , 0 , 0 , 0 , 0 ); occupationSettings1.EndHour = 23; occupationSettings1.StartHour = 7; this.occupationControl.Settings = occupationSettings1; this.occupationControl.Size = new System.Drawing.Size( 664 , 586 ); this.occupationControl.TabIndex = 37; this.occupationControl.Visible = false; this.occupationControl.DataNeeded += new System.EventHandler<System.EventArgs>( this.occupationControl_DataNeeded ); // // timeTable // this.timeTable.Dock = System.Windows.Forms.DockStyle.Fill; timeTableHitTest1.HitTestColumn = null; timeTableHitTest1.HitTestDate = new System.DateTime( ( (long)( 0 ) ) ); timeTableHitTest1.HitTestEntry = null; this.timeTable.HitTester = timeTableHitTest1; this.timeTable.HoveredColumn = null; this.timeTable.InDesign = true; this.timeTable.Location = new System.Drawing.Point( 0 , 5 ); this.timeTable.Name = "timeTable"; timeTableRenderer1.HoveredColumn = null; timeTableRenderer1.HoveredDate = null; this.timeTable.Renderer = timeTableRenderer1; this.timeTable.Scheme.BorderColor = System.Drawing.Color.FromArgb( ( (int)( ( (byte)( 0 ) ) ) ) , ( (int)( ( (byte)( 0 ) ) ) ) , ( (int)( ( (byte)( 0 ) ) ) ) ); this.timeTable.Scheme.CaptionBoldFont = new System.Drawing.Font( "Verdana" , 8F , System.Drawing.FontStyle.Bold ); this.timeTable.Scheme.CaptionColor = System.Drawing.Color.FromArgb( ( (int)( ( (byte)( 0 ) ) ) ) , ( (int)( ( (byte)( 0 ) ) ) ) , ( (int)( ( (byte)( 0 ) ) ) ) ); this.timeTable.Scheme.CaptionFont = new System.Drawing.Font( "Verdana" , 8F ); this.timeTable.Scheme.ColumnHeaderBackgroundColor1 = System.Drawing.Color.FromArgb( ( (int)( ( (byte)( 136 ) ) ) ) , ( (int)( ( (byte)( 180 ) ) ) ) , ( (int)( ( (byte)( 192 ) ) ) ) ); this.timeTable.Scheme.ColumnHeaderBackgroundColor2 = System.Drawing.Color.FromArgb( ( (int)( ( (byte)( 71 ) ) ) ) , ( (int)( ( (byte)( 139 ) ) ) ) , ( (int)( ( (byte)( 158 ) ) ) ) ); this.timeTable.Scheme.ColumnHeaderBackgroundColor3 = System.Drawing.Color.FromArgb( ( (int)( ( (byte)( 19 ) ) ) ) , ( (int)( ( (byte)( 97 ) ) ) ) , ( (int)( ( (byte)( 119 ) ) ) ) ); this.timeTable.Scheme.ColumnHeaderBackgroundColor4 = System.Drawing.Color.FromArgb( ( (int)( ( (byte)( 83 ) ) ) ) , ( (int)( ( (byte)( 159 ) ) ) ) , ( (int)( ( (byte)( 171 ) ) ) ) ); this.timeTable.Scheme.ColumnHeaderCaptionColor = System.Drawing.Color.FromArgb( ( (int)( ( (byte)( 255 ) ) ) ) , ( (int)( ( (byte)( 255 ) ) ) ) , ( (int)( ( (byte)( 255 ) ) ) ) ); this.timeTable.Scheme.ColumnHeaderCaptionFont = new System.Drawing.Font( "Verdana" , 10F , System.Drawing.FontStyle.Bold ); this.timeTable.Scheme.ColumnHeaderCaptionRendering = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit; this.timeTable.Scheme.ColumnHeaderHeight = 30; this.timeTable.Scheme.DayColumnBackgroundColor1 = System.Drawing.Color.FromArgb( ( (int)( ( (byte)( 200 ) ) ) ) , ( (int)( ( (byte)( 200 ) ) ) ) , ( (int)( ( (byte)( 200 ) ) ) ) ); this.timeTable.Scheme.DayColumnBackgroundColor2 = System.Drawing.Color.FromArgb( ( (int)( ( (byte)( 240 ) ) ) ) , ( (int)( ( (byte)( 240 ) ) ) ) , ( (int)( ( (byte)( 240 ) ) ) ) ); this.timeTable.Scheme.DayColumnCaptionColor = System.Drawing.Color.FromArgb( ( (int)( ( (byte)( 0 ) ) ) ) , ( (int)( ( (byte)( 0 ) ) ) ) , ( (int)( ( (byte)( 0 ) ) ) ) ); this.timeTable.Scheme.DayColumnCaptionFont = new System.Drawing.Font( "Verdana" , 8F ); this.timeTable.Scheme.DayColumnCaptionRendering = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit; this.timeTable.Scheme.DayColumnWidth = 50; this.timeTable.Scheme.SummaryBoxWidth = 50; this.timeTable.Scheme.SummaryRowBackgroundColor1 = System.Drawing.Color.FromArgb( ( (int)( ( (byte)( 255 ) ) ) ) , ( (int)( ( (byte)( 255 ) ) ) ) , ( (int)( ( (byte)( 255 ) ) ) ) ); this.timeTable.Scheme.SummaryRowBackgroundColor2 = System.Drawing.Color.FromArgb( ( (int)( ( (byte)( 215 ) ) ) ) , ( (int)( ( (byte)( 215 ) ) ) ) , ( (int)( ( (byte)( 215 ) ) ) ) ); this.timeTable.Scheme.SummaryRowBackgroundColor3 = System.Drawing.Color.FromArgb( ( (int)( ( (byte)( 171 ) ) ) ) , ( (int)( ( (byte)( 171 ) ) ) ) , ( (int)( ( (byte)( 171 ) ) ) ) ); this.timeTable.Scheme.SummaryRowBackgroundColor4 = System.Drawing.Color.FromArgb( ( (int)( ( (byte)( 222 ) ) ) ) , ( (int)( ( (byte)( 222 ) ) ) ) , ( (int)( ( (byte)( 222 ) ) ) ) ); this.timeTable.Scheme.SummaryRowCaptionColor = System.Drawing.Color.FromArgb( ( (int)( ( (byte)( 0 ) ) ) ) , ( (int)( ( (byte)( 0 ) ) ) ) , ( (int)( ( (byte)( 0 ) ) ) ) ); this.timeTable.Scheme.SummaryRowCaptionFont = new System.Drawing.Font( "Verdana" , 8F , System.Drawing.FontStyle.Bold ); this.timeTable.Scheme.SummaryRowHeight = 30; this.timeTable.Selection = new System.DateTime( 2009 , 3 , 25 , 0 , 0 , 0 , 0 ); this.timeTable.Size = new System.Drawing.Size( 664 , 586 ); this.timeTable.TabIndex = 36; this.timeTable.TemplateApply = false; this.timeTable.TemplateDesign = false; this.timeTable.TimeTableTemplateColumn = null; this.timeTable.DataNeeded += new System.EventHandler<System.EventArgs>( this.timeTable_DataNeeded ); this.timeTable.DataClicked += new System.EventHandler<SwmSuite.Presentation.Common.TimeTable.DataClickedEventArgs>( this.timeTable_DataClicked ); // // templateManagementToolStripButton // this.templateManagementToolStripButton.Image = global::SimpleWorkfloorManagementSuite.Properties.Resources.sjabloon_24; this.templateManagementToolStripButton.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; this.templateManagementToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.templateManagementToolStripButton.Name = "templateManagementToolStripButton"; this.templateManagementToolStripButton.Size = new System.Drawing.Size( 87 , 32 ); this.templateManagementToolStripButton.Text = "Sjablonen"; this.templateManagementToolStripButton.Click += new System.EventHandler( this.templateManagementToolStripButton_Click ); // // timeTablePurposeToolStripButton // this.timeTablePurposeToolStripButton.Image = global::SimpleWorkfloorManagementSuite.Properties.Resources.categorieen_24; this.timeTablePurposeToolStripButton.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; this.timeTablePurposeToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.timeTablePurposeToolStripButton.Name = "timeTablePurposeToolStripButton"; this.timeTablePurposeToolStripButton.Size = new System.Drawing.Size( 99 , 32 ); this.timeTablePurposeToolStripButton.Text = "Categorieën"; this.timeTablePurposeToolStripButton.Click += new System.EventHandler( this.timeTablePurposeToolStripButton_Click ); // // nextToolStripButton // this.nextToolStripButton.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; this.nextToolStripButton.Image = global::SimpleWorkfloorManagementSuite.Properties.Resources.next_year; this.nextToolStripButton.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; this.nextToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.nextToolStripButton.Name = "nextToolStripButton"; this.nextToolStripButton.Size = new System.Drawing.Size( 23 , 32 ); this.nextToolStripButton.Click += new System.EventHandler( this.nextToolStripButton_Click ); // // selectionToolStripButton // this.selectionToolStripButton.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; this.selectionToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; this.selectionToolStripButton.Image = ( (System.Drawing.Image)( resources.GetObject( "selectionToolStripButton.Image" ) ) ); this.selectionToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.selectionToolStripButton.Name = "selectionToolStripButton"; this.selectionToolStripButton.Size = new System.Drawing.Size( 69 , 32 ); this.selectionToolStripButton.Text = "01/01/2000"; this.selectionToolStripButton.Click += new System.EventHandler( this.selectionToolStripButton_Click ); // // previousToolStripButton // this.previousToolStripButton.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; this.previousToolStripButton.Image = global::SimpleWorkfloorManagementSuite.Properties.Resources.previous_year; this.previousToolStripButton.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; this.previousToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.previousToolStripButton.Name = "previousToolStripButton"; this.previousToolStripButton.Size = new System.Drawing.Size( 23 , 32 ); this.previousToolStripButton.Click += new System.EventHandler( this.previousToolStripButton_Click ); // // occupationToolStripButton // this.occupationToolStripButton.Image = global::SimpleWorkfloorManagementSuite.Properties.Resources.bezetting_241; this.occupationToolStripButton.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; this.occupationToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.occupationToolStripButton.Name = "occupationToolStripButton"; this.occupationToolStripButton.Size = new System.Drawing.Size( 84 , 32 ); this.occupationToolStripButton.Text = "Bezetting"; this.occupationToolStripButton.Click += new System.EventHandler( this.occupationToolStripButton_Click ); // // templateToolStripButton // this.templateToolStripButton.Image = global::SimpleWorkfloorManagementSuite.Properties.Resources.sjabloon_24; this.templateToolStripButton.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; this.templateToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.templateToolStripButton.Name = "templateToolStripButton"; this.templateToolStripButton.Size = new System.Drawing.Size( 137 , 32 ); this.templateToolStripButton.Text = "Sjabloon toepassen"; this.templateToolStripButton.Click += new System.EventHandler( this.templateToolStripButton_Click ); // // mondayToolStripButton // this.mondayToolStripButton.AutoSize = false; this.mondayToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; this.mondayToolStripButton.Image = ( (System.Drawing.Image)( resources.GetObject( "mondayToolStripButton.Image" ) ) ); this.mondayToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.mondayToolStripButton.Name = "mondayToolStripButton"; this.mondayToolStripButton.Size = new System.Drawing.Size( 32 , 32 ); this.mondayToolStripButton.Text = "Ma"; this.mondayToolStripButton.ToolTipText = "Maandag"; this.mondayToolStripButton.Visible = false; this.mondayToolStripButton.Click += new System.EventHandler( this.mondayToolStripButton_Click ); // // tuesdayToolStripButton // this.tuesdayToolStripButton.AutoSize = false; this.tuesdayToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; this.tuesdayToolStripButton.Image = ( (System.Drawing.Image)( resources.GetObject( "tuesdayToolStripButton.Image" ) ) ); this.tuesdayToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.tuesdayToolStripButton.Name = "tuesdayToolStripButton"; this.tuesdayToolStripButton.Size = new System.Drawing.Size( 32 , 32 ); this.tuesdayToolStripButton.Text = "Di"; this.tuesdayToolStripButton.ToolTipText = "Dinsdag"; this.tuesdayToolStripButton.Visible = false; this.tuesdayToolStripButton.Click += new System.EventHandler( this.tuesdayToolStripButton_Click ); // // wednesdayToolStripButton // this.wednesdayToolStripButton.AutoSize = false; this.wednesdayToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; this.wednesdayToolStripButton.Image = ( (System.Drawing.Image)( resources.GetObject( "wednesdayToolStripButton.Image" ) ) ); this.wednesdayToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.wednesdayToolStripButton.Name = "wednesdayToolStripButton"; this.wednesdayToolStripButton.Size = new System.Drawing.Size( 32 , 32 ); this.wednesdayToolStripButton.Text = "Wo"; this.wednesdayToolStripButton.ToolTipText = "Woensdag"; this.wednesdayToolStripButton.Visible = false; this.wednesdayToolStripButton.Click += new System.EventHandler( this.wednesdayToolStripButton_Click ); // // thursdayToolStripButton // this.thursdayToolStripButton.AutoSize = false; this.thursdayToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; this.thursdayToolStripButton.Image = ( (System.Drawing.Image)( resources.GetObject( "thursdayToolStripButton.Image" ) ) ); this.thursdayToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.thursdayToolStripButton.Name = "thursdayToolStripButton"; this.thursdayToolStripButton.Size = new System.Drawing.Size( 32 , 32 ); this.thursdayToolStripButton.Text = "Do"; this.thursdayToolStripButton.ToolTipText = "Donderdag"; this.thursdayToolStripButton.Visible = false; this.thursdayToolStripButton.Click += new System.EventHandler( this.thursdayToolStripButton_Click ); // // fridayToolStripButton // this.fridayToolStripButton.AutoSize = false; this.fridayToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; this.fridayToolStripButton.Image = ( (System.Drawing.Image)( resources.GetObject( "fridayToolStripButton.Image" ) ) ); this.fridayToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.fridayToolStripButton.Name = "fridayToolStripButton"; this.fridayToolStripButton.Size = new System.Drawing.Size( 32 , 32 ); this.fridayToolStripButton.Text = "Vr"; this.fridayToolStripButton.ToolTipText = "Vrijdag"; this.fridayToolStripButton.Visible = false; this.fridayToolStripButton.Click += new System.EventHandler( this.fridayToolStripButton_Click ); // // saturdayToolStripButton // this.saturdayToolStripButton.AutoSize = false; this.saturdayToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; this.saturdayToolStripButton.Image = ( (System.Drawing.Image)( resources.GetObject( "saturdayToolStripButton.Image" ) ) ); this.saturdayToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.saturdayToolStripButton.Name = "saturdayToolStripButton"; this.saturdayToolStripButton.Size = new System.Drawing.Size( 32 , 32 ); this.saturdayToolStripButton.Text = "Za"; this.saturdayToolStripButton.ToolTipText = "Zaterdag"; this.saturdayToolStripButton.Visible = false; this.saturdayToolStripButton.Click += new System.EventHandler( this.saturdayToolStripButton_Click ); // // sundayToolStripButton // this.sundayToolStripButton.AutoSize = false; this.sundayToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; this.sundayToolStripButton.Image = ( (System.Drawing.Image)( resources.GetObject( "sundayToolStripButton.Image" ) ) ); this.sundayToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.sundayToolStripButton.Name = "sundayToolStripButton"; this.sundayToolStripButton.Size = new System.Drawing.Size( 32 , 32 ); this.sundayToolStripButton.Text = "Zo"; this.sundayToolStripButton.ToolTipText = "Zondag"; this.sundayToolStripButton.Visible = false; this.sundayToolStripButton.Click += new System.EventHandler( this.sundayToolStripButton_Click ); // // TimeTableManagementModule // this.AutoScaleDimensions = new System.Drawing.SizeF( 6F , 13F ); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.White; this.Controls.Add( this.splitContainer1 ); this.Controls.Add( this.toolStrip ); this.Name = "TimeTableManagementModule"; this.Size = new System.Drawing.Size( 873 , 631 ); this.Load += new System.EventHandler( this.TimeTableManagementModule_Load ); this.toolStrip.ResumeLayout( false ); this.toolStrip.PerformLayout(); this.splitContainer1.Panel1.ResumeLayout( false ); this.splitContainer1.Panel2.ResumeLayout( false ); this.splitContainer1.ResumeLayout( false ); this.ResumeLayout( false ); } #endregion private System.Windows.Forms.ToolStrip toolStrip; private System.Windows.Forms.ToolStripButton templateManagementToolStripButton; private System.Windows.Forms.ToolStripButton timeTablePurposeToolStripButton; private System.Windows.Forms.SplitContainer splitContainer1; private SwmSuite.Presentation.Common.BrowserTreeView.BrowserTreeViewControl employeeTreeView; private System.Windows.Forms.ImageList ImageList; private SwmSuite.Presentation.Common.TimeTable.TimeTableControl timeTable; private System.Windows.Forms.ToolStripButton previousToolStripButton; private System.Windows.Forms.ToolStripButton selectionToolStripButton; private System.Windows.Forms.ToolStripButton nextToolStripButton; private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; private SwmSuite.Presentation.Common.TimeTable.OccupationControl occupationControl; private System.Windows.Forms.ToolStripButton occupationToolStripButton; private System.Windows.Forms.ToolStripButton templateToolStripButton; private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; private System.Windows.Forms.ToolStripButton mondayToolStripButton; private System.Windows.Forms.ToolStripButton tuesdayToolStripButton; private System.Windows.Forms.ToolStripButton wednesdayToolStripButton; private System.Windows.Forms.ToolStripButton thursdayToolStripButton; private System.Windows.Forms.ToolStripButton fridayToolStripButton; private System.Windows.Forms.ToolStripButton saturdayToolStripButton; private System.Windows.Forms.ToolStripButton sundayToolStripButton; } }
66.009217
194
0.737573
[ "Unlicense" ]
Djohnnie/SwmSuite-Original
SimpleWorkfloorManagementSuite/Modules/TimeTableManagementModule.Designer.cs
28,651
C#
/* * Copyright (c) Dominick Baier, Brock Allen. All rights reserved. * see license.txt */ using System.Web.Mvc; namespace Thinktecture.AuthorizationServer.WebHost.Areas.InitialConfiguration { public class InitialConfigurationAreaRegistration : AreaRegistration { public override string AreaName { get { return "InitialConfiguration"; } } public override void RegisterArea(AreaRegistrationContext context) { GlobalFilters.Filters.Add(new InitialConfigurationFilter()); if (Settings.EnableInitialConfiguration) { context.MapRoute( "InitialConfiguration_default", "InitialConfiguration", new { controller = "Home", action = "Index" } ); } } } }
26.052632
77
0.516162
[ "BSD-3-Clause" ]
Bringsy/Thinktecture.AuthorizationServer
source/WebHost/Areas/InitialConfiguration/InitialConfigurationAreaRegistration.cs
992
C#
using System.Threading.Tasks; using Microsoft.AspNet.SignalR; using Microsoft.AspNet.SignalR.Hubs; namespace Chat.Hubs { [HubName("chat")] public class ChatHub : Hub { public Task Send(string message) { return Clients.All.newMessageReceived(message); } [KnowUserBasicAuthentication] public Task SetTopic(string topic) { return Clients.All.topicChanged(topic, Context.User.Identity.Name); } public Task RequestError() { throw new HubException("This is expected exception"); } } }
19.807692
70
0.732039
[ "Apache-2.0" ]
BornRaccoon/signalr-client-threads
examples/Chat/Hubs/ChatHub.cs
517
C#
// Copyright (c) 2010-2013 SharpDoc - Alexandre Mutel // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml; using HtmlAgilityPack; namespace SharpDoc.Model { /// <summary> /// An abstract member of a <see cref="NType"/>. /// </summary> public abstract class NMember : NModelBase, INMemberReference { /// <summary> /// Initializes a new instance of the <see cref="NMember"/> class. /// </summary> protected NMember() { Members = new List<NMember>(); Attributes = new List<string>(); GenericParameters = new List<NGenericParameter>(); GenericArguments = new List<INTypeReference>(); } /// <summary> /// Gets or sets the name without any generic parameters. /// </summary> public string RawName { get; set; } /// <summary> /// Gets or sets a value indicating whether this instance is an array. /// </summary> /// <value> /// <c>true</c> if this instance is an array; otherwise, <c>false</c>. /// </value> public bool IsArray {get;set;} /// <summary> /// Gets or sets a value indicating whether this instance is pointer. /// </summary> /// <value> /// <c>true</c> if this instance is pointer; otherwise, <c>false</c>. /// </value> public bool IsPointer { get; set; } /// <summary> /// Gets or sets a value indicating whether this instance is sentinel. /// </summary> /// <value> /// <c>true</c> if this instance is sentinel; otherwise, <c>false</c>. /// </value> public bool IsSentinel { get; set; } /// <summary> /// Gets or sets a value indicating whether this instance is generic instance. /// </summary> /// <value> /// <c>true</c> if this instance is generic instance; otherwise, <c>false</c>. /// </value> public bool IsGenericInstance { get; set; } /// <summary> /// Gets or sets a value indicating whether this instance is generic parameter. /// </summary> /// <value> /// <c>true</c> if this instance is generic parameter; otherwise, <c>false</c>. /// </value> public bool IsGenericParameter { get; set; } /// <summary> /// Gets or sets a value indicating whether this instance is the definition ofan extension method. /// </summary> /// <value> /// <c>true</c> if this instance is the definition ofan extension method; otherwise, <c>false</c>. /// </value> public bool IsExtensionDefinition { get; set; } /// <summary> /// Gets or sets a value indicating whether this instance is an extension method. /// </summary> /// <value> /// <c>true</c> if this instance is an extension method; otherwise, <c>false</c>. /// </value> public bool IsExtensionMethod { get; set; } /// <summary> /// Gets or sets the type of the element. /// </summary> /// <value>The type of the element.</value> public INTypeReference ElementType { get; set; } /// <summary> /// Gets or sets the generic parameters. /// </summary> /// <value>The generic parameters.</value> public List<NGenericParameter> GenericParameters { get; set; } /// <summary> /// Gets or sets the generic arguments. /// </summary> /// <value>The generic arguments.</value> public List<INTypeReference> GenericArguments {get;set;} /// <summary> /// Gets or sets the type that is declaring this member. /// </summary> /// <value>The type of the declaring.</value> public INTypeReference DeclaringType { get; set; } /// <summary> /// Gets or sets a value indicating whether this instance is static. /// </summary> /// <value><c>true</c> if this instance is static; otherwise, <c>false</c>.</value> public bool IsStatic { get; set; } /// <summary> /// Gets or sets a value indicating whether this instance is final. /// </summary> /// <value><c>true</c> if this instance is final; otherwise, <c>false</c>.</value> public bool IsFinal { get; set; } /// <summary> /// Gets or sets a value indicating whether this instance is abstract. /// </summary> /// <value> /// <c>true</c> if this instance is abstract; otherwise, <c>false</c>. /// </value> public bool IsAbstract { get; set; } /// <summary> /// Gets or sets the visibility. /// </summary> /// <value>The visibility.</value> public NVisibility Visibility { get; set; } /// <summary> /// Gets the name of the visibility. /// </summary> /// <value>The name of the visibility.</value> public string VisibilityName { get { switch (Visibility) { case NVisibility.Public: return "public"; case NVisibility.Protected: return "protected"; case NVisibility.Private: return "private"; case NVisibility.ProtectedInternal: return "protected internal"; case NVisibility.Internal: return "internal"; } return ""; } } /// <summary> /// Gets the name of the visibility. /// </summary> /// <value> /// The name of the visibility. /// </value> public string VisibilityFullName { get { var text = new StringBuilder(VisibilityName); if (IsStatic) text.Append(" static"); if (IsAbstract) text.Append(" abstract"); if (IsFinal) text.Append(" sealed"); return text.ToString(); } } /// <summary> /// Gets or sets the namespace this member is attached. /// </summary> /// <value>The namespace.</value> public NNamespace Namespace { get; set; } /// <summary> /// Gets or sets the type of the member. /// </summary> /// <value>The type of the member.</value> public NMemberType MemberType { get; set; } /// <summary> /// Gets or sets the parent. This is null for root type. /// </summary> /// <value>The parent.</value> public NMember Parent { get; set; } /// <summary> /// Gets or sets all the members. /// </summary> /// <value>The members.</value> public List<NMember> Members { get; private set; } /// <summary> /// Gets or sets the attributes declaration (as string). /// </summary> /// <value>The attributes.</value> public List<string> Attributes { get; private set; } /// <summary> /// Gets the type member. /// </summary> /// <value>The type member.</value> public virtual string TypeMember { get { return GetType().Name.Substring(1); } } /// <summary> /// Helper method to return a particular collection of members. /// </summary> /// <typeparam name="T">A member</typeparam> /// <returns>A collection of <paramref name="T"/></returns> protected IEnumerable<T> MembersAs<T>() where T : NMember { return Members.OfType<T>(); } /// <summary> /// Adds a member. /// </summary> /// <param name="member">The member.</param> public void AddMember(NMember member) { member.Parent = this; Members.Add(member); } public override string ToString() { return string.Format("{0}", FullName); } /// <summary> /// Use class inheritance and/or interfaces to find corresponding documentation. /// </summary> public virtual void InheritDocumentation() { } /// <summary> /// The basical documentation inheritence copy &lt;summary&gt;, &lt;remarks&gt;, &lt;webdoc&gt; tags and all other sections /// </summary> public virtual void CopyDocumentation(INMemberReference crefMember) { if (string.IsNullOrEmpty(Description) && !string.IsNullOrEmpty(crefMember.Description)) Description = crefMember.Description; if (string.IsNullOrEmpty(Remarks) && !string.IsNullOrEmpty(crefMember.Remarks)) Remarks = crefMember.Remarks; if (WebDocPage == null && crefMember.WebDocPage != null) WebDocPage = crefMember.WebDocPage; // copy all sections of the reference that are not defined in this member if (crefMember.DocNode != null) { // clone the reference node XmlNode newDocNode = crefMember.DocNode.Clone(); if (DocNode == null) { DocNode = newDocNode; } else { HtmlDocument DocNodeContent = new HtmlDocument(); DocNodeContent.LoadHtml(DocNode.InnerXml); var sections = DocNodeContent.DocumentNode.SelectNodes("section"); if (sections != null) { foreach (var section in sections) { var sectionName = section.Attributes["name"]; if (sectionName != null) { string xpath = string.Format("//section[@name=\"{0}\"]", sectionName.Value); var correspondingSection = newDocNode.SelectSingleNode(xpath); if (correspondingSection != null) correspondingSection.InnerXml = section.InnerHtml; else { var newSection = newDocNode.OwnerDocument.CreateElement("section"); newSection.SetAttribute("name", sectionName.Value); var title = section.Attributes["title"]; if(title != null) newSection.SetAttribute("title", title.Value); newSection.InnerXml = section.InnerHtml; newDocNode.AppendChild(newSection); } } } } DocNode = newDocNode; } } } } }
37.64526
131
0.528432
[ "MIT" ]
Robmaister/SharpDoc
src/SharpDoc/Model/NMember.cs
12,310
C#
 namespace MangoPay.SDK.Core.Enumerations { /// <summary>Scheme of mandate.</summary> public enum MandateScheme { /// <summary>Not specified.</summary> NotSpecified = 0, /// <summary>SEPA scheme.</summary> SEPA, /// <summary>BACS scheme.</summary> BACS } }
16.235294
42
0.663043
[ "MIT" ]
M0ns1gn0r/mangopay2-net-sdk
MangoPay.SDK/Core/Enumerations/MandateScheme.cs
278
C#
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("ZooSystem.UI")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ZooSystem.UI")] [assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("8a1ac944-5a42-4ed8-8f0a-ebd4bdd5ec68")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
37.756757
84
0.743737
[ "MIT" ]
crDahaka/Zoo
ZooSystem/ZooSystem.UI/Properties/AssemblyInfo.cs
1,400
C#
/* * Overture API * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git */ using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.IO; using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Yaksa.OrckestraCommerce.Client.Client.OpenAPIDateConverter; namespace Yaksa.OrckestraCommerce.Client.Model { /// <summary> /// API calls used during the fulfillment process. /// </summary> [DataContract(Name = "FindFulfillmentCompetitionsRequest")] public partial class FindFulfillmentCompetitionsRequest : IEquatable<FindFulfillmentCompetitionsRequest>, IValidatableObject { /// <summary> /// Initializes a new instance of the <see cref="FindFulfillmentCompetitionsRequest" /> class. /// </summary> /// <param name="fulfillmentCompetitionLocationStatuses">The list of fulfillment competition location statuses..</param> /// <param name="fulfillmentCompetitionStatuses">The list of fulfillment competition statuses..</param> /// <param name="fulfillmentLocationId">The fulfillment location identifier..</param> /// <param name="orderId">The order identifier..</param> /// <param name="shipmentId">The shipment identifier..</param> public FindFulfillmentCompetitionsRequest(List<string> fulfillmentCompetitionLocationStatuses = default(List<string>), List<string> fulfillmentCompetitionStatuses = default(List<string>), string fulfillmentLocationId = default(string), string orderId = default(string), string shipmentId = default(string)) { this.FulfillmentCompetitionLocationStatuses = fulfillmentCompetitionLocationStatuses; this.FulfillmentCompetitionStatuses = fulfillmentCompetitionStatuses; this.FulfillmentLocationId = fulfillmentLocationId; this.OrderId = orderId; this.ShipmentId = shipmentId; } /// <summary> /// The list of fulfillment competition location statuses. /// </summary> /// <value>The list of fulfillment competition location statuses.</value> [DataMember(Name = "fulfillmentCompetitionLocationStatuses", EmitDefaultValue = false)] public List<string> FulfillmentCompetitionLocationStatuses { get; set; } /// <summary> /// The list of fulfillment competition statuses. /// </summary> /// <value>The list of fulfillment competition statuses.</value> [DataMember(Name = "fulfillmentCompetitionStatuses", EmitDefaultValue = false)] public List<string> FulfillmentCompetitionStatuses { get; set; } /// <summary> /// The fulfillment location identifier. /// </summary> /// <value>The fulfillment location identifier.</value> [DataMember(Name = "fulfillmentLocationId", EmitDefaultValue = false)] public string FulfillmentLocationId { get; set; } /// <summary> /// The order identifier. /// </summary> /// <value>The order identifier.</value> [DataMember(Name = "orderId", EmitDefaultValue = false)] public string OrderId { get; set; } /// <summary> /// The shipment identifier. /// </summary> /// <value>The shipment identifier.</value> [DataMember(Name = "shipmentId", EmitDefaultValue = false)] public string ShipmentId { get; set; } /// <summary> /// Returns the string presentation of the object /// </summary> /// <returns>String presentation of the object</returns> public override string ToString() { var sb = new StringBuilder(); sb.Append("class FindFulfillmentCompetitionsRequest {\n"); sb.Append(" FulfillmentCompetitionLocationStatuses: ").Append(FulfillmentCompetitionLocationStatuses).Append("\n"); sb.Append(" FulfillmentCompetitionStatuses: ").Append(FulfillmentCompetitionStatuses).Append("\n"); sb.Append(" FulfillmentLocationId: ").Append(FulfillmentLocationId).Append("\n"); sb.Append(" OrderId: ").Append(OrderId).Append("\n"); sb.Append(" ShipmentId: ").Append(ShipmentId).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// <summary> /// Returns the JSON string presentation of the object /// </summary> /// <returns>JSON string presentation of the object</returns> public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// <summary> /// Returns true if objects are equal /// </summary> /// <param name="input">Object to be compared</param> /// <returns>Boolean</returns> public override bool Equals(object input) { return this.Equals(input as FindFulfillmentCompetitionsRequest); } /// <summary> /// Returns true if FindFulfillmentCompetitionsRequest instances are equal /// </summary> /// <param name="input">Instance of FindFulfillmentCompetitionsRequest to be compared</param> /// <returns>Boolean</returns> public bool Equals(FindFulfillmentCompetitionsRequest input) { if (input == null) return false; return ( this.FulfillmentCompetitionLocationStatuses == input.FulfillmentCompetitionLocationStatuses || this.FulfillmentCompetitionLocationStatuses != null && input.FulfillmentCompetitionLocationStatuses != null && this.FulfillmentCompetitionLocationStatuses.SequenceEqual(input.FulfillmentCompetitionLocationStatuses) ) && ( this.FulfillmentCompetitionStatuses == input.FulfillmentCompetitionStatuses || this.FulfillmentCompetitionStatuses != null && input.FulfillmentCompetitionStatuses != null && this.FulfillmentCompetitionStatuses.SequenceEqual(input.FulfillmentCompetitionStatuses) ) && ( this.FulfillmentLocationId == input.FulfillmentLocationId || (this.FulfillmentLocationId != null && this.FulfillmentLocationId.Equals(input.FulfillmentLocationId)) ) && ( this.OrderId == input.OrderId || (this.OrderId != null && this.OrderId.Equals(input.OrderId)) ) && ( this.ShipmentId == input.ShipmentId || (this.ShipmentId != null && this.ShipmentId.Equals(input.ShipmentId)) ); } /// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { int hashCode = 41; if (this.FulfillmentCompetitionLocationStatuses != null) hashCode = hashCode * 59 + this.FulfillmentCompetitionLocationStatuses.GetHashCode(); if (this.FulfillmentCompetitionStatuses != null) hashCode = hashCode * 59 + this.FulfillmentCompetitionStatuses.GetHashCode(); if (this.FulfillmentLocationId != null) hashCode = hashCode * 59 + this.FulfillmentLocationId.GetHashCode(); if (this.OrderId != null) hashCode = hashCode * 59 + this.OrderId.GetHashCode(); if (this.ShipmentId != null) hashCode = hashCode * 59 + this.ShipmentId.GetHashCode(); return hashCode; } } /// <summary> /// To validate all properties of the instance /// </summary> /// <param name="validationContext">Validation context</param> /// <returns>Validation Result</returns> IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext) { yield break; } } }
44.609137
314
0.623464
[ "MIT" ]
Yaksa-ca/eShopOnWeb
src/Yaksa.OrckestraCommerce.Client/Model/FindFulfillmentCompetitionsRequest.cs
8,788
C#
using System; using System.Collections.Concurrent; using System.Threading; using System.Threading.Tasks; using RawRabbit.Logging; namespace RawRabbit.Operations.StateMachine.Core { public interface IGlobalLock { Task ExecuteAsync(Guid modelId, Func<Task> handler, CancellationToken ct = default(CancellationToken)); } public class GlobalLock : IGlobalLock { private readonly Func<Guid, Func<Task>, CancellationToken, Task> _exclusiveExecute; public GlobalLock(Func<Guid, Func<Task>, CancellationToken, Task> exclusiveExecute = null) { if (exclusiveExecute == null) { var processLock = new ProcessGlobalLock(); exclusiveExecute = (id, handler, ct) => processLock.ExecuteAsync(id, handler, ct); } _exclusiveExecute = exclusiveExecute; } public Task ExecuteAsync(Guid modelId, Func<Task> handler, CancellationToken ct = new CancellationToken()) { return _exclusiveExecute(modelId, handler, ct); } } public class ProcessGlobalLock : IGlobalLock { private readonly ConcurrentDictionary<Guid, SemaphoreSlim> _semaphores; private readonly ILog _logger = LogProvider.For<ProcessGlobalLock>(); public ProcessGlobalLock() { _semaphores = new ConcurrentDictionary<Guid, SemaphoreSlim>(); } public async Task ExecuteAsync(Guid modelId, Func<Task> handler, CancellationToken ct = default(CancellationToken)) { var semaphore = _semaphores.GetOrAdd(modelId, guid => new SemaphoreSlim(1, 1)); await semaphore.WaitAsync(ct); try { await handler(); } catch (Exception e) { _logger.Error(e, "Unhandled exception during execution under Global Lock"); } finally { semaphore.Release(); } } } }
26.888889
117
0.733176
[ "MIT" ]
alexdawes/RawRabbit
src/RawRabbit.Operations.StateMachine/Core/GlobalLock.cs
1,696
C#
using System; using System.Collections.Generic; using System.Text; using DataAccessLayer; using Foundation.Contexts; using Foundation.Entities; namespace Foundation.Repositoris { class CategoryRepository : Repository<Category, int, MobileContext>, ICategoryRepository { public CategoryRepository(MobileContext context) : base(context) { } } }
22.411765
92
0.740157
[ "MIT" ]
Amphibian007/DotNetSelfPractise_Home
source/CRUD Demo Projects/Demo2/Foundation/Repositoris/CategoryRepository.cs
383
C#
 namespace Kar_IDE { partial class PreviewWindow { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.textEditorControl1 = new ICSharpCode.TextEditor.TextEditorControl(); this.panel1 = new System.Windows.Forms.Panel(); this.button1 = new System.Windows.Forms.Button(); this.SuspendLayout(); // // textEditorControl1 // this.textEditorControl1.Highlighting = null; this.textEditorControl1.Location = new System.Drawing.Point(474, 353); this.textEditorControl1.Name = "textEditorControl1"; this.textEditorControl1.Size = new System.Drawing.Size(361, 241); this.textEditorControl1.TabIndex = 0; this.textEditorControl1.Text = "textEditorControl1"; // // panel1 // this.panel1.Location = new System.Drawing.Point(82, 79); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(340, 221); this.panel1.TabIndex = 1; // // button1 // this.button1.Location = new System.Drawing.Point(530, 117); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(94, 29); this.button1.TabIndex = 2; this.button1.Text = "button1"; this.button1.UseVisualStyleBackColor = true; // // PreviewWindow // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(919, 606); this.Controls.Add(this.button1); this.Controls.Add(this.panel1); this.Controls.Add(this.textEditorControl1); this.Name = "PreviewWindow"; this.Text = "PreviewWindow"; this.Load += new System.EventHandler(this.PreviewWindow_Load); this.ResumeLayout(false); } #endregion private ICSharpCode.TextEditor.TextEditorControl textEditorControl1; private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Button button1; } }
37.119048
107
0.569917
[ "MIT" ]
Saumyadip-Kar/Kar-IDE
Kar_IDE/PreviewWindow.Designer.cs
3,120
C#
using Microsoft.AspNetCore.Http; using System.Threading.Tasks; namespace AspNetCore.ApiGateway.Middleware { public interface IGatewayMiddleware { Task Invoke(HttpContext context, string api, string key); } }
20.909091
65
0.743478
[ "MIT" ]
VeritasSoftware/AspNetCore.ApiGateway
AspNetCore.ApiGateway/Application/Middleware/IGatewayMiddleware.cs
232
C#
using System; using System.Collections; using System.Collections.Generic; using System.Linq; using Android.Content; using Android.Database; using XLabs.Droid.ContentProvider; namespace XLabs.Contacts.Droid { internal class ProjectionReader<T> : IEnumerable<T> { internal ProjectionReader(ContentResolver content, ContentQueryTranslator translator, Func<ICursor, int, T> selector) { this.content = content; this.translator = translator; this.selector = selector; } public IEnumerator<T> GetEnumerator() { string[] projections = null; if (this.translator.Projections != null) { projections = this.translator.Projections .Where(p => p.Columns != null) .SelectMany(t => t.Columns) .ToArray(); if (projections.Length == 0) projections = null; } ICursor cursor = null; try { cursor = content.Query(translator.Table, projections, translator.QueryString, translator.ClauseParameters, translator.SortString); while (cursor.MoveToNext()) { int colIndex = cursor.GetColumnIndex(projections[0]); yield return this.selector(cursor, colIndex); } } finally { if (cursor != null) cursor.Close(); } } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } private readonly ContentResolver content; private readonly ContentQueryTranslator translator; private readonly Func<ICursor, int, T> selector; } }
29.424242
126
0.522142
[ "Apache-2.0" ]
IAmEska/Xamarin-Forms-Labs
src/XLabs/Contacts/XLabs.Contacts.Droid/ProjectionReader.cs
1,944
C#
#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Reflection; using System.Text.RegularExpressions; #if (NET20 || NET35) using Newtonsoft.Json.Serialization; #else using System.Runtime.Serialization.Json; #endif using System.Text; using System.Threading; #if DNXCORE50 using Xunit; using Assert = Newtonsoft.Json.Tests.XUnitAssert; using XAssert = Xunit.Assert; #else using NUnit.Framework; #endif using Newtonsoft.Json.Utilities; using System.Collections; #if !(NET20 || NET35 || NET40 || PORTABLE40) using System.Threading.Tasks; #endif #if NET20 using Newtonsoft.Json.Utilities.LinqBridge; using Action = Newtonsoft.Json.Serialization.Action; #else using System.Linq; #endif namespace Newtonsoft.Json.Tests { public class TestReflectionUtils { public static IEnumerable<ConstructorInfo> GetConstructors(Type type) { #if !(DNXCORE50) return type.GetConstructors(); #else return type.GetTypeInfo().DeclaredConstructors; #endif } public static PropertyInfo GetProperty(Type type, string name) { #if !(DNXCORE50) return type.GetProperty(name); #else return type.GetTypeInfo().GetDeclaredProperty(name); #endif } public static FieldInfo GetField(Type type, string name) { #if !(DNXCORE50) return type.GetField(name); #else return type.GetTypeInfo().GetDeclaredField(name); #endif } public static MethodInfo GetMethod(Type type, string name) { #if !(DNXCORE50) return type.GetMethod(name); #else return type.GetTypeInfo().GetDeclaredMethod(name); #endif } } #if DNXCORE50 public class TestFixtureAttribute : Attribute { // xunit doesn't need a test fixture attribute // this exists so the project compiles } public class XUnitAssert { public static void IsInstanceOf(Type expectedType, object o) { XAssert.IsType(expectedType, o); } public static void AreEqual(double expected, double actual, double r) { XAssert.Equal(expected, actual, 5); // hack } public static void AreEqual(object expected, object actual, string message = null) { XAssert.Equal(expected, actual); } public static void AreEqual<T>(T expected, T actual, string message = null) { XAssert.Equal(expected, actual); } public static void AreNotEqual(object expected, object actual, string message = null) { XAssert.NotEqual(expected, actual); } public static void AreNotEqual<T>(T expected, T actual, string message = null) { XAssert.NotEqual(expected, actual); } public static void Fail(string message = null, params object[] args) { if (message != null) { message = message.FormatWith(CultureInfo.InvariantCulture, args); } XAssert.True(false, message); } public static void Pass() { } public static void IsTrue(bool condition, string message = null) { XAssert.True(condition); } public static void IsFalse(bool condition) { XAssert.False(condition); } public static void IsNull(object o) { XAssert.Null(o); } public static void IsNotNull(object o) { XAssert.NotNull(o); } public static void AreNotSame(object expected, object actual) { XAssert.NotSame(expected, actual); } public static void AreSame(object expected, object actual) { XAssert.Same(expected, actual); } } public class CollectionAssert { public static void AreEquivalent<T>(IEnumerable<T> expected, IEnumerable<T> actual) { XAssert.Equal(expected, actual); } public static void AreEqual<T>(IEnumerable<T> expected, IEnumerable<T> actual) { XAssert.Equal(expected, actual); } } #endif [TestFixture] public abstract class TestFixtureBase { #if !(NET20 || NET35) protected string GetDataContractJsonSerializeResult(object o) { MemoryStream ms = new MemoryStream(); DataContractJsonSerializer s = new DataContractJsonSerializer(o.GetType()); s.WriteObject(ms, o); var data = ms.ToArray(); return Encoding.UTF8.GetString(data, 0, data.Length); } #endif protected string GetOffset(DateTime d, DateFormatHandling dateFormatHandling) { char[] chars = new char[8]; int pos = DateTimeUtils.WriteDateTimeOffset(chars, 0, DateTime.SpecifyKind(d, DateTimeKind.Local).GetUtcOffset(), dateFormatHandling); return new string(chars, 0, pos); } protected string BytesToHex(byte[] bytes) { return BytesToHex(bytes, false); } protected string BytesToHex(byte[] bytes, bool removeDashes) { string hex = BitConverter.ToString(bytes); if (removeDashes) { hex = hex.Replace("-", ""); } return hex; } public static byte[] HexToBytes(string hex) { string fixedHex = hex.Replace("-", string.Empty); // array to put the result in byte[] bytes = new byte[fixedHex.Length / 2]; // variable to determine shift of high/low nibble int shift = 4; // offset of the current byte in the array int offset = 0; // loop the characters in the string foreach (char c in fixedHex) { // get character code in range 0-9, 17-22 // the % 32 handles lower case characters int b = (c - '0') % 32; // correction for a-f if (b > 9) { b -= 7; } // store nibble (4 bits) in byte array bytes[offset] |= (byte)(b << shift); // toggle the shift variable between 0 and 4 shift ^= 4; // move to next byte if (shift != 0) { offset++; } } return bytes; } #if DNXCORE50 protected TestFixtureBase() #else [SetUp] protected void TestSetup() #endif { #if !(DNXCORE50) //CultureInfo turkey = CultureInfo.CreateSpecificCulture("tr"); //Thread.CurrentThread.CurrentCulture = turkey; //Thread.CurrentThread.CurrentUICulture = turkey; Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture; #endif JsonConvert.DefaultSettings = null; } protected void WriteEscapedJson(string json) { Console.WriteLine(EscapeJson(json)); } protected string EscapeJson(string json) { return @"@""" + json.Replace(@"""", @"""""") + @""""; } } public static class CustomAssert { public static void IsInstanceOfType(Type t, object instance) { Assert.IsInstanceOf(t, instance); } public static void Contains(IList collection, object value) { Contains(collection, value, null); } public static void Contains(IList collection, object value, string message) { #if !(DNXCORE50) Assert.Contains(value, collection, message); #else if (!collection.Cast<object>().Any(i => i.Equals(value))) { throw new Exception(message ?? "Value not found in collection."); } #endif } } public static class StringAssert { private static readonly Regex Regex = new Regex(@"\r\n|\n\r|\n|\r", RegexOptions.CultureInvariant); public static void AreEqual(string expected, string actual) { expected = Normalize(expected); actual = Normalize(actual); Assert.AreEqual(expected, actual); } public static bool Equals(string s1, string s2) { s1 = Normalize(s1); s2 = Normalize(s2); return string.Equals(s1, s2); } public static string Normalize(string s) { if (s != null) { s = Regex.Replace(s, "\r\n"); } return s; } } public static class ExceptionAssert { public static TException Throws<TException>(Action action, params string[] possibleMessages) where TException : Exception { try { action(); Assert.Fail("Exception of type {0} expected. No exception thrown.", typeof(TException).Name); return null; } catch (TException ex) { if (possibleMessages == null || possibleMessages.Length == 0) { return ex; } foreach (string possibleMessage in possibleMessages) { if (StringAssert.Equals(possibleMessage, ex.Message)) { return ex; } } throw new Exception("Unexpected exception message." + Environment.NewLine + "Expected one of: " + string.Join(Environment.NewLine, possibleMessages) + Environment.NewLine + "Got: " + ex.Message + Environment.NewLine + Environment.NewLine + ex); } catch (Exception ex) { throw new Exception(string.Format("Exception of type {0} expected; got exception of type {1}.", typeof(TException).Name, ex.GetType().Name), ex); } } #if !(NET20 || NET35 || NET40 || PORTABLE40) public static async Task<TException> ThrowsAsync<TException>(Func<Task> action, params string[] possibleMessages) where TException : Exception { try { await action(); Assert.Fail("Exception of type {0} expected. No exception thrown.", typeof(TException).Name); return null; } catch (TException ex) { if (possibleMessages == null || possibleMessages.Length == 0) { return ex; } foreach (string possibleMessage in possibleMessages) { if (StringAssert.Equals(possibleMessage, ex.Message)) { return ex; } } throw new Exception("Unexpected exception message." + Environment.NewLine + "Expected one of: " + string.Join(Environment.NewLine, possibleMessages) + Environment.NewLine + "Got: " + ex.Message + Environment.NewLine + Environment.NewLine + ex); } catch (Exception ex) { throw new Exception(string.Format("Exception of type {0} expected; got exception of type {1}.", typeof(TException).Name, ex.GetType().Name), ex); } } #endif } }
31.138498
261
0.553185
[ "MIT" ]
rsouza01/CONTATOS_REST
references/Json100r2/Source/Src/Newtonsoft.Json.Tests/TestFixtureBase.cs
13,267
C#
// *** WARNING: this file was generated by the Pulumi SDK Generator. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Threading.Tasks; using Pulumi.Serialization; namespace Pulumi.AzureNative.Network.V20191201.Inputs { /// <summary> /// AAD Vpn authentication type related parameters. /// </summary> public sealed class AadAuthenticationParametersArgs : Pulumi.ResourceArgs { /// <summary> /// AAD Vpn authentication parameter AAD audience. /// </summary> [Input("aadAudience")] public Input<string>? AadAudience { get; set; } /// <summary> /// AAD Vpn authentication parameter AAD issuer. /// </summary> [Input("aadIssuer")] public Input<string>? AadIssuer { get; set; } /// <summary> /// AAD Vpn authentication parameter AAD tenant. /// </summary> [Input("aadTenant")] public Input<string>? AadTenant { get; set; } public AadAuthenticationParametersArgs() { } } }
28.634146
81
0.622658
[ "Apache-2.0" ]
polivbr/pulumi-azure-native
sdk/dotnet/Network/V20191201/Inputs/AadAuthenticationParametersArgs.cs
1,174
C#
using System; using System.Linq; using System.IO; using System.Text; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Runtime.Serialization; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using PureCloudPlatform.Client.V2.Client; namespace PureCloudPlatform.Client.V2.Model { /// <summary> /// LocationAddressVerificationDetails /// </summary> [DataContract] public partial class LocationAddressVerificationDetails : IEquatable<LocationAddressVerificationDetails> { /// <summary> /// Status of address verification process /// </summary> /// <value>Status of address verification process</value> [JsonConverter(typeof(UpgradeSdkEnumConverter))] public enum StatusEnum { /// <summary> /// Your SDK version is out of date and an unknown enum value was encountered. /// Please upgrade the SDK using the command "Upgrade-Package PureCloudApiSdk" /// in the Package Manager Console /// </summary> [EnumMember(Value = "OUTDATED_SDK_VERSION")] OutdatedSdkVersion, /// <summary> /// Enum Pending for "Pending" /// </summary> [EnumMember(Value = "Pending")] Pending, /// <summary> /// Enum Inprogress for "InProgress" /// </summary> [EnumMember(Value = "InProgress")] Inprogress, /// <summary> /// Enum Retry for "Retry" /// </summary> [EnumMember(Value = "Retry")] Retry, /// <summary> /// Enum Complete for "Complete" /// </summary> [EnumMember(Value = "Complete")] Complete, /// <summary> /// Enum Failed for "Failed" /// </summary> [EnumMember(Value = "Failed")] Failed } /// <summary> /// Status of address verification process /// </summary> /// <value>Status of address verification process</value> [DataMember(Name="status", EmitDefaultValue=false)] public StatusEnum? Status { get; set; } /// <summary> /// Initializes a new instance of the <see cref="LocationAddressVerificationDetails" /> class. /// </summary> /// <param name="Status">Status of address verification process.</param> /// <param name="DateFinished">Finished time of address verification process. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss[.mmm]Z.</param> /// <param name="DateStarted">Time started of address verification process. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss[.mmm]Z.</param> /// <param name="Service">Third party service used for address verification.</param> public LocationAddressVerificationDetails(StatusEnum? Status = null, DateTime? DateFinished = null, DateTime? DateStarted = null, string Service = null) { this.Status = Status; this.DateFinished = DateFinished; this.DateStarted = DateStarted; this.Service = Service; } /// <summary> /// Finished time of address verification process. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss[.mmm]Z /// </summary> /// <value>Finished time of address verification process. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss[.mmm]Z</value> [DataMember(Name="dateFinished", EmitDefaultValue=false)] public DateTime? DateFinished { get; set; } /// <summary> /// Time started of address verification process. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss[.mmm]Z /// </summary> /// <value>Time started of address verification process. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss[.mmm]Z</value> [DataMember(Name="dateStarted", EmitDefaultValue=false)] public DateTime? DateStarted { get; set; } /// <summary> /// Third party service used for address verification /// </summary> /// <value>Third party service used for address verification</value> [DataMember(Name="service", EmitDefaultValue=false)] public string Service { get; set; } /// <summary> /// Returns the string presentation of the object /// </summary> /// <returns>String presentation of the object</returns> public override string ToString() { var sb = new StringBuilder(); sb.Append("class LocationAddressVerificationDetails {\n"); sb.Append(" Status: ").Append(Status).Append("\n"); sb.Append(" DateFinished: ").Append(DateFinished).Append("\n"); sb.Append(" DateStarted: ").Append(DateStarted).Append("\n"); sb.Append(" Service: ").Append(Service).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// <summary> /// Returns the JSON string presentation of the object /// </summary> /// <returns>JSON string presentation of the object</returns> public string ToJson() { return JsonConvert.SerializeObject(this, new JsonSerializerSettings { MetadataPropertyHandling = MetadataPropertyHandling.Ignore, Formatting = Formatting.Indented }); } /// <summary> /// Returns true if objects are equal /// </summary> /// <param name="obj">Object to be compared</param> /// <returns>Boolean</returns> public override bool Equals(object obj) { // credit: http://stackoverflow.com/a/10454552/677735 return this.Equals(obj as LocationAddressVerificationDetails); } /// <summary> /// Returns true if LocationAddressVerificationDetails instances are equal /// </summary> /// <param name="other">Instance of LocationAddressVerificationDetails to be compared</param> /// <returns>Boolean</returns> public bool Equals(LocationAddressVerificationDetails other) { // credit: http://stackoverflow.com/a/10454552/677735 if (other == null) return false; return true && ( this.Status == other.Status || this.Status != null && this.Status.Equals(other.Status) ) && ( this.DateFinished == other.DateFinished || this.DateFinished != null && this.DateFinished.Equals(other.DateFinished) ) && ( this.DateStarted == other.DateStarted || this.DateStarted != null && this.DateStarted.Equals(other.DateStarted) ) && ( this.Service == other.Service || this.Service != null && this.Service.Equals(other.Service) ); } /// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { // credit: http://stackoverflow.com/a/263416/677735 unchecked // Overflow is fine, just wrap { int hash = 41; // Suitable nullity checks etc, of course :) if (this.Status != null) hash = hash * 59 + this.Status.GetHashCode(); if (this.DateFinished != null) hash = hash * 59 + this.DateFinished.GetHashCode(); if (this.DateStarted != null) hash = hash * 59 + this.DateStarted.GetHashCode(); if (this.Service != null) hash = hash * 59 + this.Service.GetHashCode(); return hash; } } } }
35.629032
182
0.529651
[ "MIT" ]
F-V-L/platform-client-sdk-dotnet
build/src/PureCloudPlatform.Client.V2/Model/LocationAddressVerificationDetails.cs
8,836
C#
using System; using System.CodeDom.Compiler; using System.ComponentModel; using System.Diagnostics; using System.Runtime.CompilerServices; using System.Xml.Schema; using System.Xml.Serialization; namespace Workday.Staffing { [GeneratedCode("System.Xml", "4.6.1590.0"), DesignerCategory("code"), DebuggerStepThrough, XmlType(Namespace = "urn:com.workday/bsvc")] [Serializable] public class Period_Salary_PlanObjectType : INotifyPropertyChanged { private Period_Salary_PlanObjectIDType[] idField; private string descriptorField; [method: CompilerGenerated] [CompilerGenerated] public event PropertyChangedEventHandler PropertyChanged; [XmlElement("ID", Order = 0)] public Period_Salary_PlanObjectIDType[] ID { get { return this.idField; } set { this.idField = value; this.RaisePropertyChanged("ID"); } } [XmlAttribute(Form = XmlSchemaForm.Qualified)] public string Descriptor { get { return this.descriptorField; } set { this.descriptorField = value; this.RaisePropertyChanged("Descriptor"); } } protected void RaisePropertyChanged(string propertyName) { PropertyChangedEventHandler propertyChanged = this.PropertyChanged; if (propertyChanged != null) { propertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } } }
22.065574
136
0.73477
[ "MIT" ]
matteofabbri/Workday.WebServices
Workday.Staffing/Period_Salary_PlanObjectType.cs
1,346
C#
// ========================================================================== // Squidex Headless CMS // ========================================================================== // Copyright (c) Squidex UG (haftungsbeschraenkt) // All rights reserved. Licensed under the MIT license. // ========================================================================== using System; using Squidex.Infrastructure.Reflection.Internal; using Xunit; namespace Squidex.Infrastructure.Reflection { public class PropertiesTypeAccessorTests { public class TestClass { private int target; public int ReadWrite { get { return target; } set { target = value; } } public int Read { get => target; } public int Write { set => target = value; } } private readonly TestClass target = new TestClass(); [Fact] public void Should_set_read_write_property() { var sut = new PropertyAccessor(typeof(TestClass), typeof(TestClass).GetProperty("ReadWrite")!); sut.Set(target, 123); Assert.Equal(123, target.Read); } [Fact] public void Should_set_write_property() { var accessor = new PropertyAccessor(typeof(TestClass), typeof(TestClass).GetProperty("Write")!); accessor.Set(target, 123); Assert.Equal(123, target.Read); } [Fact] public void Should_throw_exception_if_setting_readonly() { var sut = new PropertyAccessor(typeof(TestClass), typeof(TestClass).GetProperty("Read")!); Assert.Throws<NotSupportedException>(() => sut.Set(target, 123)); } [Fact] public void Should_get_read_write_property() { var sut = new PropertyAccessor(typeof(TestClass), typeof(TestClass).GetProperty("ReadWrite")!); target.Write = 123; Assert.Equal(123, sut.Get(target)); } [Fact] public void Should_get_read_property() { var sut = new PropertyAccessor(typeof(TestClass), typeof(TestClass).GetProperty("Read")!); target.Write = 123; Assert.Equal(123, sut.Get(target)); } [Fact] public void Should_throw_exception_if_getting_writeonly_property() { var sut = new PropertyAccessor(typeof(TestClass), typeof(TestClass).GetProperty("Write")!); Assert.Throws<NotSupportedException>(() => sut.Get(target)); } } }
27.460784
108
0.49875
[ "MIT" ]
BrightsDigi/squidex
backend/tests/Squidex.Infrastructure.Tests/Reflection/PropertiesTypeAccessorTests.cs
2,803
C#
using System.Net; using System.Net.Http; using System.Threading.Tasks; using Microsoft.Azure.WebJobs; using Microsoft.Azure.WebJobs.Extensions.Http; using Microsoft.Azure.WebJobs.Host; using Newtonsoft.Json; namespace TestFunc { public static class GenericWebHookCSharp { [FunctionName("VSTSWebhook")] public static async Task<object> Run([HttpTrigger(WebHookType = "genericJson")]HttpRequestMessage req, TraceWriter log) { log.Info($"Webhook was triggered!"); string jsonContent = await req.Content.ReadAsStringAsync(); dynamic data = JsonConvert.DeserializeObject(jsonContent); if (data.first == null || data.last == null) { return req.CreateResponse(HttpStatusCode.BadRequest, new { error = "Please pass first/last properties in the input object" }); } return req.CreateResponse(HttpStatusCode.OK, new { greeting = $"Hello {data.first} {data.last}!" }); } } }
31.485714
127
0.608893
[ "MIT" ]
faniereynders/GAB2017
test-function/TestFunc/GenericWebHookCSharp.cs
1,102
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 ec2-2016-11-15.normal.json service model. */ using System; using System.Collections.Generic; using System.Xml.Serialization; using System.Text; using System.IO; using System.Net; using Amazon.Runtime; using Amazon.Runtime.Internal; namespace Amazon.EC2.Model { /// <summary> /// The launch template to use. You must specify either the launch template ID or launch /// template name in the request, but not both. /// </summary> public partial class LaunchTemplateSpecification { private string _launchTemplateId; private string _launchTemplateName; private string _version; /// <summary> /// Gets and sets the property LaunchTemplateId. /// <para> /// The ID of the launch template. /// </para> /// </summary> public string LaunchTemplateId { get { return this._launchTemplateId; } set { this._launchTemplateId = value; } } // Check to see if LaunchTemplateId property is set internal bool IsSetLaunchTemplateId() { return this._launchTemplateId != null; } /// <summary> /// Gets and sets the property LaunchTemplateName. /// <para> /// The name of the launch template. /// </para> /// </summary> public string LaunchTemplateName { get { return this._launchTemplateName; } set { this._launchTemplateName = value; } } // Check to see if LaunchTemplateName property is set internal bool IsSetLaunchTemplateName() { return this._launchTemplateName != null; } /// <summary> /// Gets and sets the property Version. /// <para> /// The version number of the launch template. /// </para> /// /// <para> /// Default: The default version for the launch template. /// </para> /// </summary> public string Version { get { return this._version; } set { this._version = value; } } // Check to see if Version property is set internal bool IsSetVersion() { return this._version != null; } } }
30.35
102
0.581219
[ "Apache-2.0" ]
philasmar/aws-sdk-net
sdk/src/Services/EC2/Generated/Model/LaunchTemplateSpecification.cs
3,035
C#
using System; using System.Text; using System.Data; using System.Data.SqlClient; using System.Data.Common; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Configuration; using System.Xml; using System.Xml.Serialization; using SubSonic; using SubSonic.Utilities; namespace DalRis { /// <summary> /// Controller class for EMR_TipoTrauma /// </summary> [System.ComponentModel.DataObject] public partial class EmrTipoTraumaController { // Preload our schema.. EmrTipoTrauma thisSchemaLoad = new EmrTipoTrauma(); private string userName = String.Empty; protected string UserName { get { if (userName.Length == 0) { if (System.Web.HttpContext.Current != null) { userName=System.Web.HttpContext.Current.User.Identity.Name; } else { userName=System.Threading.Thread.CurrentPrincipal.Identity.Name; } } return userName; } } [DataObjectMethod(DataObjectMethodType.Select, true)] public EmrTipoTraumaCollection FetchAll() { EmrTipoTraumaCollection coll = new EmrTipoTraumaCollection(); Query qry = new Query(EmrTipoTrauma.Schema); coll.LoadAndCloseReader(qry.ExecuteReader()); return coll; } [DataObjectMethod(DataObjectMethodType.Select, false)] public EmrTipoTraumaCollection FetchByID(object IdTipoTrauma) { EmrTipoTraumaCollection coll = new EmrTipoTraumaCollection().Where("idTipoTrauma", IdTipoTrauma).Load(); return coll; } [DataObjectMethod(DataObjectMethodType.Select, false)] public EmrTipoTraumaCollection FetchByQuery(Query qry) { EmrTipoTraumaCollection coll = new EmrTipoTraumaCollection(); coll.LoadAndCloseReader(qry.ExecuteReader()); return coll; } [DataObjectMethod(DataObjectMethodType.Delete, true)] public bool Delete(object IdTipoTrauma) { return (EmrTipoTrauma.Delete(IdTipoTrauma) == 1); } [DataObjectMethod(DataObjectMethodType.Delete, false)] public bool Destroy(object IdTipoTrauma) { return (EmrTipoTrauma.Destroy(IdTipoTrauma) == 1); } /// <summary> /// Inserts a record, can be used with the Object Data Source /// </summary> [DataObjectMethod(DataObjectMethodType.Insert, true)] public void Insert(string Nombre) { EmrTipoTrauma item = new EmrTipoTrauma(); item.Nombre = Nombre; item.Save(UserName); } /// <summary> /// Updates a record, can be used with the Object Data Source /// </summary> [DataObjectMethod(DataObjectMethodType.Update, true)] public void Update(int IdTipoTrauma,string Nombre) { EmrTipoTrauma item = new EmrTipoTrauma(); item.MarkOld(); item.IsLoaded = true; item.IdTipoTrauma = IdTipoTrauma; item.Nombre = Nombre; item.Save(UserName); } } }
29.281818
116
0.623719
[ "MIT" ]
saludnqn/prosane
RIS_Publico/RIS_Publico/generated/EmrTipoTraumaController.cs
3,221
C#
using System; using System.Collections.Generic; using System.Linq; using System.Security.Cryptography; using System.Text; using System.Threading.Tasks; namespace DTO { public class Utils { public static string GetCrypt512(string texto) { StringBuilder sBuilder = new StringBuilder(); SHA512 sha512 = SHA512.Create(); byte[] data = sha512.ComputeHash(Encoding.UTF8.GetBytes(texto)); for (int i = 0; i < data.Length; i++) { sBuilder.AppendFormat("{0:x2}", data[i]); } return sBuilder.ToString().ToUpper(); } public static string GenerateToken(string login) { return GetCrypt512(login); } } }
23.96875
76
0.581486
[ "Apache-2.0" ]
franciscosens/doa-sangue
backend/DoaSangueWS/DTO/Utils.cs
769
C#
// class VengefulFi.RpcApi.BitswapController /* ############################################################################# Dual-licensed under MIT and Apache-2.0, by way of the [Permissive License Stack](https://protocol.ai/blog/announcing-the-permissive-license-stack/). Apache-2.0: https://www.apache.org/licenses/license-2.0 MIT: https://www.opensource.org/licenses/mit ################################################################################ Copyright 2021 Tomislav Petricevic 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. ################################################################################ MIT License Copyright (c) 2021 Tomislav Petricevic 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.Generic; using Microsoft.AspNetCore.Mvc; namespace VengefulFi.RpcApi { [Route("api/v0/[controller]")] // common for all actions below [ApiController] public class BitswapController: ControllerBase { // use POST, as these are all remote procedure calls [HttpPost("[action]")] public ActionResult<IEnumerable<string>> Ledger() { // this is just for demonstration purposes return new string[] { "bitswap", "Ledger" }; // TODO: async? } [HttpPost("[action]")] public ActionResult<IEnumerable<string>> Reprovide() { // this is just for demonstration purposes return new string[] { "bitswap", "Reprovide" }; // TODO: async? } [HttpPost("[action]")] public ActionResult<IEnumerable<string>> Stat() { // this is just for demonstration purposes return new string[] { "bitswap", "Stat" }; // TODO: async? } [HttpPost("[action]")] public ActionResult<IEnumerable<string>> Wantlist() { // this is just for demonstration purposes return new string[] { "bitswap", "Wantlist" }; // TODO: async? } } } // namespace VengefulFi.RpcApi
35.356436
80
0.644637
[ "Apache-2.0", "MIT" ]
bombus-lapidarius/vengeful-firewall
src/main/RpcApi/Controllers/BitswapController.cs
3,571
C#
// MIT License // Copyright(c) 2017 - 2018 Stephen Mohr // 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.IO; using System.Linq; using Microsoft.VisualStudio.TestTools.UnitTesting; using Networks.Core; namespace CoreTests { [TestClass] public class CoreTests { private TestContext testContextInstance; public TestContext TestContext { get { return testContextInstance; } set { testContextInstance = value; } } private MultilayerNetwork M; private Network G; [TestInitialize] public void Initialize() { // uncomment when we have multiple tests requiring large, random networks // MakeRandomGraph(ref G, 100, 10); // MakeRandomMultilayerNetwork(ref M, 4, 5, 1000, 100, 10); } //[Ignore] [TestCategory("Performance")] [TestMethod] public void BasicNumberNetwork() { for (int i = 1000; i <= 1000000; i *= 10) { long start, end; //G = new Network(true); start = DateTime.Now.Ticks; MakeRandomGraph(ref G, i, 10, false, true); end = DateTime.Now.Ticks; TestContext.WriteLine($"Graph degree {G.Order}, {G.Order * 10} edges time to create {(end - start) / TimeSpan.TicksPerSecond} seconds."); TestContext.WriteLine(""); } } [TestCategory("Basic")] [TestMethod] public void TestAdjacencyConstructor() { float[,] weights = { { 0.0F, 1.0F, 2.0F, 0.0F }, { 0.0F, 0.0F, 1.0F, 3.5F }, { 1.0F, 2.1F, 0.0F, 2.0F }, { 1.0F, 0.0F, 0.0F, 0.0F } }; uint[] nodes = { 1, 2, 3, 4 }; List<uint> vertices = new List<uint>(nodes); Network G = new Network(vertices, weights, true); float[,] ewts = G.AdjacencyMatrix; List<uint> outV = G.Vertices; Assert.AreEqual(nodes.Length, outV.Count, $"Count of vertices input {nodes.Length} does not equal count of vertices output {outV.Count}"); Assert.AreEqual(G.HasEdge(2, 3), true); Assert.AreEqual(G.EdgeWeight(2, 4), 3.5, 0.05); Assert.AreEqual(G.EdgeWeight(4, 3), 0.0, 0.05); } /* [TestCategory("Basic")] [TestMethod] public void TestConnectedProperty() { Network G = new Network(false); G.AddEdge(1, 2, 1); G.AddVertex(3); // C is unreachable Assert.IsTrue(!G.Connected); G = new Network(true); G.AddEdge(1, 2, 1); G.AddVertex(3); // C is unreachable Assert.IsTrue(!G.Connected); }*/ [TestCategory("Basic")] [TestMethod] public void TestNetworkVertex() { Network G = new Network(true); G.AddEdge(1, 2, 1); G.AddEdge(1, 3, 1); G.AddEdge(2, 3, 2); G.AddEdge(1, 4, 3); Assert.AreEqual(4, G.Order); Assert.AreEqual(3, G.GetNeighbors(1).Keys.Count); Assert.AreEqual(true, G.HasEdge(2, 3)); Assert.AreEqual(false, G.HasEdge(2, 1)); Assert.AreEqual(3, G.OutDegree(1)); G.RemoveVertex(3); Assert.AreEqual(false, G.HasVertex(3)); Assert.AreEqual(false, G.HasEdge(1, 3)); } [TestCategory("Basic")] [TestMethod] public void TestDensity() { Network G = new Network(true); G.AddEdge(1, 2, 1); G.AddEdge(1, 3, 1); G.AddEdge(2, 3, 2); G.AddEdge(1, 4, 3); double density = G.Density; Assert.AreEqual(0.33, density, 0.01); G = new Network(false); G.AddEdge(1, 2, 1); G.AddEdge(1, 3, 1); G.AddEdge(2, 3, 2); G.AddEdge(1, 4, 3); density = G.Density; Assert.AreEqual(0.66, density, 0.01); } [TestCategory("Basic")] [TestMethod] public void TestSize() { Network G = MakeSimple(true); int size = G.Size; Assert.AreEqual(9, size); G = MakeSimple(false); size = G.Size; Assert.AreEqual(9, size); } private Network MakeSimple(Boolean directed) { Network G = new Network(directed); G.AddEdge(1, 2, 1); G.AddEdge(1, 3, 1); G.AddEdge(1, 6, 1); G.AddEdge(2, 4, 1); G.AddEdge(4, 6, 1); G.AddEdge(3, 5, 1); G.AddEdge(5, 6, 1); G.AddEdge(2, 5, 1); G.AddEdge(3, 4, 1); return G; } [TestCategory("Multilayer")] [TestMethod] public void TestMultilayerSources() { MultilayerNetwork Q = MultilayerNetworkSerializer.ReadMultilayerNetworkFromFile(@"..\..\..\work\multilayer_test.dat", true); Dictionary<NodeLayerTuple, float> sources = Q.GetSources(new NodeLayerTuple(2, "control,SLTC"), true); Assert.AreEqual(sources.Count, 5); NodeLayerTuple test = new NodeLayerTuple(1, "control,PHL"); bool check = sources.ContainsKey(test); float wt = sources[test]; Assert.AreEqual(sources.ContainsKey(test), true); Assert.AreEqual(sources[test], 1.0F, 0.01F); sources = Q.GetSources(new NodeLayerTuple(1, "control,SLTC"), false); Assert.AreEqual(sources.Count, 1); test = new NodeLayerTuple(3, "control,PHL"); check = sources.ContainsKey(test); wt = sources[test]; Assert.AreEqual(sources.ContainsKey(test), true); Assert.AreEqual(sources[test], 4.0F, 0.01F); sources = Q.CategoricalGetSources(new NodeLayerTuple(1, "control,SLTC"), "process"); Assert.AreEqual(sources.Count, 1); test = new NodeLayerTuple(3, "control,PHL"); Assert.AreEqual(sources.ContainsKey(test), true); Assert.AreEqual(sources[test], 4.0F, 0.01F); sources = Q.CategoricalGetSources(new NodeLayerTuple(4, "flow,PHL"), "site"); test = new NodeLayerTuple(1, "flow,PHL"); NodeLayerTuple test2 = new NodeLayerTuple(2, "control,PHL"); Assert.AreEqual(sources.Count, 2); Assert.AreEqual(sources.ContainsKey(test), true); Assert.AreEqual(sources[test], 1.0F, 0.01F); Assert.AreEqual(sources.ContainsKey(test2), true); Dictionary<NodeLayerTuple, float> neighbors = Q.CategoricalGetNeighbors(new NodeLayerTuple(1, "control,PHL"), "site"); Assert.AreEqual(neighbors.Count, 6); Assert.AreEqual(neighbors.ContainsKey(test2), true); } [TestCategory("Multilayer")] [TestMethod] public void TestSupraAdjacencyMatrix() { MultilayerNetwork Q = MultilayerNetworkSerializer.ReadMultilayerNetworkFromFile(@"..\..\..\work\multilayer_three_aspects.dat", true); float[,] mtx = Q.MakeSupraAdjacencyMatrix(); for (int i = 0; i < 36; i++) { for (int j = 0; j < 36; j++) { Console.Write(mtx[i, j] + " "); } Console.WriteLine(); } } //[TestMethod] //public void TestRandomGraph() //{ //Network n = MakeRandomGraph(5, 4); // MultilayerNetwork M = MakeRandomMultilayerNetwork(3, 4, 20, 5, 6); //} [TestCategory("Multilayer")] [TestMethod] public void TestMultilayerSerialization() { MakeRandomMultilayerNetwork(ref M, 3, 4, 20, 5, 6); TestContext.WriteLine($"Random network created, {M.Aspects().Count()} aspects, Order {M.Order}"); foreach (string aspect in M.Aspects()) { TestContext.WriteLine($"Aspect {aspect}:"); foreach (string index in M.Indices(aspect)) { TestContext.WriteLine($"\t{index}"); } } int aspectCt = M.Aspects().Count(); int order = M.Order; List<string> coord1 = new List<string>(); List<string> coord2 = new List<string>(); // lowest and hightest NodeLayerTuples for (int i = 0; i < aspectCt; i++) { coord1.Add(M.Indices(M.Aspects().ElementAt(i)).ElementAt(0)); coord2.Add(M.Indices(M.Aspects().ElementAt(i)).ElementAt(M.Indices(M.Aspects().ElementAt(i)).Count() - 1)); } int vtx = 0; while (!M.HasVertex(new NodeLayerTuple((uint)vtx, coord1)) && vtx < M.UniqueVertices().Count()) vtx++; int degree1 = M.Degree(new NodeLayerTuple((uint)vtx, coord1)); int vtx2 = 0; while (!M.HasVertex(new NodeLayerTuple((uint)vtx2, coord1)) && vtx2 < M.UniqueVertices().Count()) vtx2++; int degree2 = M.Degree(new NodeLayerTuple((uint)vtx2, coord2)); string testFile = "c:\\\\temp\\TestMulti.txt"; try { MultilayerNetworkSerializer.WriteMultiLayerNetworkToFile(M, testFile); } catch (Exception ex) { Assert.Fail($"Failed to write network to {testFile}: " + ex.Message); } MultilayerNetwork MPrime = null; try { MPrime = MultilayerNetworkSerializer.ReadMultilayerNetworkFromFile(testFile, true); TestContext.WriteLine($"Random network read, {MPrime.Aspects().Count()} aspects, Order {MPrime.Order}"); foreach (string aspect in M.Aspects()) { TestContext.WriteLine($"Aspect {aspect}:"); foreach (string index in M.Indices(aspect)) { TestContext.WriteLine($"\t{index}"); } } } catch (Exception ex) { Assert.Fail($"Failed to read network from {testFile}: " + ex.Message); File.Delete(testFile); } // int orderPrime = -1; int degree1Prime = -1; int degree2Prime = -1; try { orderPrime = MPrime.Order; degree1Prime = M.Degree(new NodeLayerTuple((uint)vtx, coord1)); degree2Prime = M.Degree(new NodeLayerTuple((uint)vtx2, coord2)); } catch (Exception ex) { Assert.Fail($"Error getting order or degree: {ex.Message}"); File.Delete(testFile); } Assert.AreEqual(order, orderPrime, $"Orders do not agree"); Assert.AreEqual(degree1, degree1Prime, $"Degrees of lowest node layer tuple do not agree"); Assert.AreEqual(degree2, degree2Prime, $"Degrees of highest node layer tuple do not agree"); File.Delete(testFile); // } #region initialization for random multilayer networks /// <summary> /// Creates a multilayer network for testing. There will be a high degree of node coupling (identity edges) due to the way vertices are named. /// While the MultilayerNetwork class permits the number of actual elementary layers to be less than the possible number of elementary layers (i.e., the number of possible /// permutations of aspect indices), the networks returned from this method will have all possible elementary layers instantiated. /// </summary> /// <param name="aspectCt">Maximum number of aspects; range is [2..aspectCt]</param> /// <param name="maxIndices">Maximum number of discrete values per aspect, range is [1..maxIndices]</param> /// <param name="maxVertices">Maximum number of vertices to create per elementary layer. Given the naming convention for vertices, this will /// also be the maximum order for the network.</param> /// <param name="maxDegree">Maximum degree per vertex, neglecting node coupling, i.e., maximum number of explicit edges to create.</param> /// <param name="maxInterLayerEdges">Maximum number of explicit interlayer edges to create per elementary layer.</param> /// <returns>Instance of a multilayer network with no omitted elementary layers and parameters as above.</returns> private void MakeRandomMultilayerNetwork(ref MultilayerNetwork mNet, int aspectCt, int maxIndices, int maxVertices, int maxDegree, int maxInterLayerEdges) { // Create the aspects and their indices, then instantiate the multilayer network and determine how many elementary layers it can contain. IEnumerable<Tuple<string, IEnumerable<string>>> aspects = MakeRandomAspects(aspectCt, maxIndices); mNet = new MultilayerNetwork(aspects, true); int elementaryCt = CountCross(aspects); // Generate a list of elementary layer tuples such that each possible permutation is created. List<List<string>> coords = new List<List<string>>(); for (int i = 0; i < elementaryCt; i++) { coords.Add(new List<string>()); } int step = 1; int indicesLength = 1; foreach (Tuple<string, IEnumerable<string>> tpl in aspects) { // This ugly code is needed to ensure we generate all possible permutations of the indices on each aspect. // There are 2..n possible aspects, and each aspect will have 1..k discrete indices. Index values are arbitrary strings. // The first aspect rotates through its indices on each iteration. Each subsequent aspect rotates to a new index value each j iterations of the loop, where j is the product // of the number of indices of each prior aspect. Yes, it is ugly. Yes, it works. Go ahead, try it out on paper. int ptr = 0; indicesLength = tpl.Item2.Count<string>(); List<string> indices = tpl.Item2.ToList(); for (int k = 0; k < elementaryCt; k++) { coords[k].Add(indices[ptr]); if (k % step == 0) { ptr++; if (ptr == indicesLength) ptr = 0; } } step *= indicesLength; } // Make a random network to form the basis of each elementary layer, then add an elementary layer using the network and // one of the elementary layer tuples for the previously created list. for (int i = 0; i < elementaryCt; i++) { Network G = new Network(true); MakeRandomGraph(ref G, maxVertices, maxDegree); mNet.AddElementaryLayer(coords[i], G); } // Now that all the elemntary layers exist, create interlayer edges. The while loops are needed to ensure the vertices // generated exist in the elementary layers and that no self-edges are created. Random rand = new Random(DateTime.UtcNow.Millisecond); for (int j = 0; j < maxInterLayerEdges; j++) { int source = rand.Next(elementaryCt); int target = rand.Next(elementaryCt); while (target == source) target = rand.Next(elementaryCt); int srcV = rand.Next(maxVertices); while (!mNet.HasVertex(new NodeLayerTuple((uint)srcV, coords[source]))) srcV = rand.Next(maxVertices); int tgtV = rand.Next(maxVertices); while (!mNet.HasVertex(new NodeLayerTuple((uint)tgtV, coords[target])) || srcV == tgtV) tgtV = rand.Next(maxVertices); // If the edge already exists, skip it. if (!mNet.HasEdge(new NodeLayerTuple((uint)srcV, coords[source]), new NodeLayerTuple((uint)tgtV, coords[target]))) mNet.AddEdge(new NodeLayerTuple((uint)srcV, coords[source]), new NodeLayerTuple((uint)tgtV, coords[target]), 1); } } /// <summary> /// Construct a graph with a randomly selected number of vertices and randomly selected degree per vertex created. /// The target of each edge is randomly selected and is guaranteed not to be a self-edge or duplicate. If a duplicate is generated, /// the edge will not be created and the final degree of the vertex will be less than the randomly selected degree. /// </summary> /// <param name="maxVertices">Maximum number of vertices to create in the graph. Actual order will be [1..maxVertices]</param> /// <param name="maxDegree">Maximum degree. Actual number of edges will be [0..maxDegree]</param> /// <returns></returns> private void MakeRandomGraph(ref Network net, int maxVertices, int maxDegree, bool randomMax = true, bool directed = true) { net = new Network(directed); try { Random rand = new Random(DateTime.UtcNow.Millisecond); int order = maxVertices; if (randomMax) order = rand.Next(1, maxVertices + 1); for (int i = 0; i < order; i++) { net.AddVertex((uint)i); } for (int j = 0; j < order; j++) { int degree = maxDegree; if (randomMax) degree = rand.Next(maxDegree + 1); for (int k = 0; k < degree; k++) { int tgt = rand.Next(maxVertices); while (tgt == j) tgt = rand.Next(maxVertices); if (!net.HasEdge((uint)j, (uint)tgt)) net.AddEdge((uint)j, (uint)tgt, 1); } } } catch (OutOfMemoryException) { TestContext.WriteLine($"Out of memory: order {net.Order}"); Assert.Fail($"Failure to generate a random network, maxVertices {maxVertices}, maxDegree {maxDegree}, randomMax is {randomMax}"); } catch (IOException) { } } /// <summary> /// Randomly create [2..aspects] number of aspects and [1..indices] index values per aspect /// and return as a colleciton of aspects and indices suitable for use in instantiation of a multilayer network /// </summary> /// <param name="aspects">Maximum number of aspects to create. Since we are testing a multilayer network and wish to /// test multiple aspects, the number of aspects created will be [2..aspects]. Aspect names are of the form "Aspect_[n]</param> /// <param name="indices">Maximum number of discrete indices to create per aspect. The actual number will be [1..indices]. /// The name of each index value for an aspect named "Aspect_[n] will be of the form "A[n]_[k]". </param> /// <returns>Enumerable collection of tuples, each of which describes an aspect and consists of the aspect name in Item1 /// and an enumerable collection of indices in Item2.</returns> private IEnumerable<Tuple<string, IEnumerable<string>>> MakeRandomAspects(int aspects, int indices) { List<Tuple<string, IEnumerable<string>>> aspectCollection = new List<Tuple<string, IEnumerable<string>>>(); Random rand = new Random(DateTime.UtcNow.Millisecond); int aspectCt = rand.Next(2, aspects + 1); for (int i = 0; i < aspectCt; i++) { string aspectName = $"Aspect_{i}"; int indexCt = rand.Next(1, indices + 1); List<string> indexNames = new List<string>(); for (int k = 0; k < indexCt; k++) { string indexName = $"A{i}_{k}"; indexNames.Add(indexName); } aspectCollection.Add(new Tuple<string, IEnumerable<string>>(aspectName, indexNames)); } return aspectCollection; } private int CountCross(IEnumerable<Tuple<string, IEnumerable<string>>> collection) { int count = 1; foreach (Tuple<string, IEnumerable<string>> tple in collection) { count *= tple.Item2.Count<string>(); } return count; } #endregion } }
42.096774
190
0.557314
[ "MIT" ]
smohr1824/Graphs
Core_Tests/CoreTests.cs
22,187
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.Collections.Generic; using System.IO; using System.IO.Compression; using System.Linq; using System.Net; using System.Net.Http; using System.Runtime.CompilerServices; using System.Threading.Tasks; using Microsoft.DotNet.ImageBuilder.Commands; using Microsoft.DotNet.ImageBuilder.Models.Image; using Microsoft.DotNet.ImageBuilder.Models.Manifest; using Microsoft.DotNet.ImageBuilder.Models.Subscription; using Microsoft.DotNet.ImageBuilder.Tests.Helpers; using Microsoft.DotNet.VersionTools.Automation; using Microsoft.DotNet.VersionTools.Automation.GitHubApi; using Microsoft.TeamFoundation.Build.WebApi; using Microsoft.TeamFoundation.Core.WebApi; using Microsoft.VisualStudio.Services.WebApi; using Moq; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Xunit; using static Microsoft.DotNet.ImageBuilder.Tests.Helpers.ImageInfoHelper; namespace Microsoft.DotNet.ImageBuilder.Tests { public class GetStaleImagesCommandTests { private const string GitHubBranch = "my-branch"; private const string GitHubRepo = "my-repo"; private const string GitHubOwner = "my-owner"; /// <summary> /// Verifies the correct path arguments are passed to the queued build for a basic /// scenario involving one image that has changed. /// </summary> [Fact] public async Task GetStaleImagesCommand_SingleDigestChanged() { const string repo1 = "test-repo"; const string dockerfile1Path = "dockerfile1/Dockerfile"; const string dockerfile2Path = "dockerfile2/Dockerfile"; SubscriptionInfo[] subscriptionInfos = new SubscriptionInfo[] { new SubscriptionInfo( CreateSubscription(repo1), ManifestHelper.CreateManifest( ManifestHelper.CreateRepo( repo1, ManifestHelper.CreateImage( ManifestHelper.CreatePlatform(dockerfile1Path, new string[] { "tag1" }), ManifestHelper.CreatePlatform(dockerfile2Path, new string[] { "tag2" })))), new ImageArtifactDetails { Repos = { new RepoData { Repo = repo1, Images = { new ImageData { Platforms = { CreatePlatform( dockerfile1Path, baseImageDigest: "base1digest-diff"), CreatePlatform( dockerfile2Path, baseImageDigest: "base2digest") } } } } } } ) }; Dictionary<GitFile, List<DockerfileInfo>> dockerfileInfos = new Dictionary<GitFile, List<DockerfileInfo>> { { subscriptionInfos[0].Subscription.Manifest, new List<DockerfileInfo> { new DockerfileInfo(dockerfile1Path, new FromImageInfo("base1", "base1digest")), new DockerfileInfo(dockerfile2Path, new FromImageInfo("base2", "base2digest")) } } }; using (TestContext context = new TestContext(subscriptionInfos, dockerfileInfos)) { await context.ExecuteCommandAsync(); // Only one of the images has a changed digest Dictionary<Subscription, IList<string>> expectedPathsBySubscription = new Dictionary<Subscription, IList<string>> { { subscriptionInfos[0].Subscription, new List<string> { dockerfile1Path } } }; context.Verify(expectedPathsBySubscription); } } /// <summary> /// Verifies the correct path arguments are passed to the queued build for a multi-stage /// Dockerfile scenario involving one image that has changed. /// </summary> [Fact] public async Task GetStaleImagesCommand_MultiStage_SingleDigestChanged() { const string repo1 = "test-repo"; const string dockerfile1Path = "dockerfile1/Dockerfile"; const string dockerfile2Path = "dockerfile2/Dockerfile"; SubscriptionInfo[] subscriptionInfos = new SubscriptionInfo[] { new SubscriptionInfo( CreateSubscription(repo1), ManifestHelper.CreateManifest( ManifestHelper.CreateRepo( repo1, ManifestHelper.CreateImage( ManifestHelper.CreatePlatform(dockerfile1Path, new string[] { "tag1" }), ManifestHelper.CreatePlatform(dockerfile2Path, new string[] { "tag2" })))), new ImageArtifactDetails { Repos = { new RepoData { Repo = repo1, Images = { new ImageData { Platforms = { CreatePlatform( dockerfile1Path, baseImageDigest: "base2digest-diff"), CreatePlatform( dockerfile2Path, baseImageDigest: "base3digest") } } } } } } ) }; Dictionary<GitFile, List<DockerfileInfo>> dockerfileInfos = new Dictionary<GitFile, List<DockerfileInfo>> { { subscriptionInfos[0].Subscription.Manifest, new List<DockerfileInfo> { new DockerfileInfo( dockerfile1Path, new FromImageInfo("base1", "base1digest"), new FromImageInfo("base2", "base2digest")), new DockerfileInfo( dockerfile2Path, new FromImageInfo("base2", "base2digest"), new FromImageInfo("base3", "base3digest")) } } }; using (TestContext context = new TestContext(subscriptionInfos, dockerfileInfos)) { await context.ExecuteCommandAsync(); // The base image of the final stage has changed for only one of the images. Dictionary<Subscription, IList<string>> expectedPathsBySubscription = new Dictionary<Subscription, IList<string>> { { subscriptionInfos[0].Subscription, new List<string> { dockerfile1Path } } }; context.Verify(expectedPathsBySubscription); } } /// <summary> /// Verifies that a subscription will be skipped if it's associated with a different OS type than the command is assigned with. /// </summary> [Fact] public async Task GetStaleImagesCommand_OsTypeFiltering_MatchingCommandFilter() { const string repo1 = "test-repo"; const string dockerfile1Path = "dockerfile1"; const string dockerfile2Path = "dockerfile2"; const string dockerfile3Path = "dockerfile3"; SubscriptionInfo[] subscriptionInfos = new SubscriptionInfo[] { new SubscriptionInfo( CreateSubscription(repo1, osType: "windows"), ManifestHelper.CreateManifest( ManifestHelper.CreateRepo( repo1, ManifestHelper.CreateImage( ManifestHelper.CreatePlatform(dockerfile1Path, new string[] { "tag1" }, OS.Windows), ManifestHelper.CreatePlatform(dockerfile2Path, new string[] { "tag2" }, OS.Linux), ManifestHelper.CreatePlatform(dockerfile3Path, new string[] { "tag3" }, OS.Windows)))), new ImageArtifactDetails() ) }; Dictionary<GitFile, List<DockerfileInfo>> dockerfileInfos = new Dictionary<GitFile, List<DockerfileInfo>> { { subscriptionInfos[0].Subscription.Manifest, new List<DockerfileInfo> { new DockerfileInfo(dockerfile1Path, new FromImageInfo("base1", "base1digest")), new DockerfileInfo(dockerfile2Path, new FromImageInfo("base2", "base2digest")), new DockerfileInfo(dockerfile3Path, new FromImageInfo("base3", "base3digest")) } } }; // Use windows here for the command's OsType filter which is the same as the subscription's OsType. // This should cause the subscription to be processed. const string commandOsType = "windows"; using (TestContext context = new TestContext(subscriptionInfos, dockerfileInfos, commandOsType)) { await context.ExecuteCommandAsync(); Dictionary<Subscription, IList<string>> expectedPathsBySubscription = new Dictionary<Subscription, IList<string>> { { subscriptionInfos[0].Subscription, new List<string> { dockerfile1Path, dockerfile3Path } } }; context.Verify(expectedPathsBySubscription); } } /// <summary> /// Verifies that a subscription will be skipped if it's associated with a different OS type than the command is assigned with. /// </summary> [Fact] public async Task GetStaleImagesCommand_OsTypeFiltering_NonMatchingCommandFilter() { const string repo1 = "test-repo"; const string dockerfile1Path = "dockerfile1"; const string dockerfile2Path = "dockerfile2"; const string dockerfile3Path = "dockerfile3"; SubscriptionInfo[] subscriptionInfos = new SubscriptionInfo[] { new SubscriptionInfo( CreateSubscription(repo1, osType: "windows"), ManifestHelper.CreateManifest( ManifestHelper.CreateRepo( repo1, ManifestHelper.CreateImage( ManifestHelper.CreatePlatform(dockerfile1Path, new string[] { "tag1" }, OS.Windows), ManifestHelper.CreatePlatform(dockerfile2Path, new string[] { "tag2" }, OS.Linux), ManifestHelper.CreatePlatform(dockerfile3Path, new string[] { "tag3" }, OS.Windows)))), new ImageArtifactDetails() ) }; Dictionary<GitFile, List<DockerfileInfo>> dockerfileInfos = new Dictionary<GitFile, List<DockerfileInfo>> { { subscriptionInfos[0].Subscription.Manifest, new List<DockerfileInfo> { new DockerfileInfo(dockerfile1Path, new FromImageInfo("base1", "base1digest")), new DockerfileInfo(dockerfile2Path, new FromImageInfo("base2", "base2digest")), new DockerfileInfo(dockerfile3Path, new FromImageInfo("base3", "base3digest")) } } }; // Use linux here for the command's OsType filter which is different than the subscription's OsType of Windows. // This should cause the subscription to be ignored. const string commandOsType = "linux"; using (TestContext context = new TestContext(subscriptionInfos, dockerfileInfos, commandOsType)) { await context.ExecuteCommandAsync(); Dictionary<Subscription, IList<string>> expectedPathsBySubscription = new Dictionary<Subscription, IList<string>> { }; context.Verify(expectedPathsBySubscription); } } /// <summary> /// Verifies the correct path arguments are passed to the queued build when /// the images have no data reflected in the image info data. /// </summary> [Fact] public async Task GetStaleImagesCommand_MissingImageInfo() { const string repo1 = "test-repo"; const string dockerfile1Path = "dockerfile1/Dockerfile"; const string dockerfile2Path = "dockerfile2/Dockerfile"; SubscriptionInfo[] subscriptionInfos = new SubscriptionInfo[] { new SubscriptionInfo( CreateSubscription(repo1), ManifestHelper.CreateManifest( ManifestHelper.CreateRepo( repo1, ManifestHelper.CreateImage( ManifestHelper.CreatePlatform(dockerfile1Path, new string[] { "tag1" }), ManifestHelper.CreatePlatform(dockerfile2Path, new string[] { "tag2" })))), new ImageArtifactDetails() ) }; Dictionary<GitFile, List<DockerfileInfo>> dockerfileInfos = new Dictionary<GitFile, List<DockerfileInfo>> { { subscriptionInfos[0].Subscription.Manifest, new List<DockerfileInfo> { new DockerfileInfo(dockerfile1Path, new FromImageInfo("base1", "base1digest")), new DockerfileInfo(dockerfile2Path, new FromImageInfo("base2", "base2digest")) } } }; using (TestContext context = new TestContext(subscriptionInfos, dockerfileInfos)) { await context.ExecuteCommandAsync(); // Since neither of the images existed in the image info data, both should be queued. Dictionary<Subscription, IList<string>> expectedPathsBySubscription = new Dictionary<Subscription, IList<string>> { { subscriptionInfos[0].Subscription, new List<string> { dockerfile1Path, dockerfile2Path } } }; context.Verify(expectedPathsBySubscription); } } /// <summary> /// Verifies the correct path arguments are passed to the queued builds for two /// subscriptions that have changed images. /// </summary> [Fact] public async Task GetStaleImagesCommand_MultiSubscription() { const string repo1 = "test-repo"; const string repo2 = "test-repo2"; const string repo3 = "test-repo3"; const string dockerfile1Path = "dockerfile1/Dockerfile"; const string dockerfile2Path = "dockerfile2/Dockerfile"; const string dockerfile3Path = "dockerfile3/Dockerfile"; SubscriptionInfo[] subscriptionInfos = new SubscriptionInfo[] { new SubscriptionInfo( CreateSubscription(repo1, 1), ManifestHelper.CreateManifest( ManifestHelper.CreateRepo( repo1, ManifestHelper.CreateImage( ManifestHelper.CreatePlatform(dockerfile1Path, new string[] { "tag1" })))), new ImageArtifactDetails { Repos = { new RepoData { Repo = repo1, Images = { new ImageData { Platforms = { CreatePlatform( dockerfile1Path, baseImageDigest: "base1digest-diff") } } } }, new RepoData { Repo = repo2, Images = { new ImageData { Platforms = { CreatePlatform( dockerfile2Path, baseImageDigest: "base2digest-diff") } } } } } } ), new SubscriptionInfo( CreateSubscription(repo2, 2), ManifestHelper.CreateManifest( ManifestHelper.CreateRepo( repo2, ManifestHelper.CreateImage( ManifestHelper.CreatePlatform(dockerfile2Path, new string[] { "tag2" }))), ManifestHelper.CreateRepo( repo3, ManifestHelper.CreateImage( ManifestHelper.CreatePlatform(dockerfile3Path, new string[] { "tag3" })))), new ImageArtifactDetails { Repos = { new RepoData { Repo = repo1, Images = { new ImageData { Platforms = { CreatePlatform( dockerfile1Path, baseImageDigest: "base1digest-diff") } } } }, new RepoData { Repo = repo2, Images = { new ImageData { Platforms = { CreatePlatform( dockerfile2Path, baseImageDigest: "base2digest-diff") } } } }, new RepoData { Repo = repo3, Images = { new ImageData { Platforms = { CreatePlatform( dockerfile3Path, baseImageDigest: "base3digest") } } } } } } ) }; Dictionary<GitFile, List<DockerfileInfo>> dockerfileInfos = new Dictionary<GitFile, List<DockerfileInfo>> { { subscriptionInfos[0].Subscription.Manifest, new List<DockerfileInfo> { new DockerfileInfo(dockerfile1Path, new FromImageInfo("base1", "base1digest")) } }, { subscriptionInfos[1].Subscription.Manifest, new List<DockerfileInfo> { new DockerfileInfo(dockerfile2Path, new FromImageInfo("base2", "base2digest")), new DockerfileInfo(dockerfile3Path, new FromImageInfo("base3", "base3digest")) } } }; using (TestContext context = new TestContext(subscriptionInfos, dockerfileInfos)) { await context.ExecuteCommandAsync(); Dictionary<Subscription, IList<string>> expectedPathsBySubscription = new Dictionary<Subscription, IList<string>> { { subscriptionInfos[0].Subscription, new List<string> { dockerfile1Path } }, { subscriptionInfos[1].Subscription, new List<string> { dockerfile2Path } } }; context.Verify(expectedPathsBySubscription); } } /// <summary> /// Verifies that a base image's digest will be cached and not pulled for a subsequent image. /// </summary> [Fact] public async Task GetStaleImagesCommand_BaseImageCaching() { const string repo1 = "test-repo"; const string dockerfile1Path = "dockerfile1/Dockerfile"; const string dockerfile2Path = "dockerfile2/Dockerfile"; const string baseImage = "base1"; const string baseImageDigest = "base1digest"; SubscriptionInfo[] subscriptionInfos = new SubscriptionInfo[] { new SubscriptionInfo( CreateSubscription(repo1), ManifestHelper.CreateManifest( ManifestHelper.CreateRepo( repo1, ManifestHelper.CreateImage( ManifestHelper.CreatePlatform(dockerfile1Path, new string[] { "tag1" }), ManifestHelper.CreatePlatform(dockerfile2Path, new string[] { "tag2" })))), new ImageArtifactDetails { Repos = { new RepoData { Repo = repo1, Images = new List<ImageData> { new ImageData { Platforms = new List<PlatformData> { CreatePlatform( dockerfile1Path, baseImageDigest: baseImageDigest + "-diff"), CreatePlatform( dockerfile2Path, baseImageDigest: baseImageDigest + "-diff") } } } } } } ) }; Dictionary<GitFile, List<DockerfileInfo>> dockerfileInfos = new Dictionary<GitFile, List<DockerfileInfo>> { { subscriptionInfos[0].Subscription.Manifest, new List<DockerfileInfo> { new DockerfileInfo(dockerfile1Path, new FromImageInfo(baseImage, baseImageDigest)), new DockerfileInfo(dockerfile2Path, new FromImageInfo(baseImage, baseImageDigest)) } } }; using (TestContext context = new TestContext(subscriptionInfos, dockerfileInfos)) { await context.ExecuteCommandAsync(); // Both of the images has a changed digest Dictionary<Subscription, IList<string>> expectedPathsBySubscription = new Dictionary<Subscription, IList<string>> { { subscriptionInfos[0].Subscription, new List<string> { dockerfile1Path, dockerfile2Path } } }; context.Verify(expectedPathsBySubscription); // Verify the image was pulled only once context.DockerServiceMock .Verify(o => o.PullImage(baseImage, false), Times.Once); context.DockerServiceMock .Verify(o => o.GetImageDigest(baseImage, false), Times.Once); } } /// <summary> /// Verifies that no build will be queued if the base image has not changed. /// </summary> [Fact] public async Task GetStaleImagesCommand_NoBaseImageChange() { const string repo1 = "test-repo"; const string dockerfile1Path = "dockerfile1/Dockerfile"; const string baseImage = "base1"; const string baseImageDigest = "base1digest"; SubscriptionInfo[] subscriptionInfos = new SubscriptionInfo[] { new SubscriptionInfo( CreateSubscription(repo1), ManifestHelper.CreateManifest( ManifestHelper.CreateRepo( repo1, ManifestHelper.CreateImage( ManifestHelper.CreatePlatform(dockerfile1Path, new string[] { "tag1" })))), new ImageArtifactDetails { Repos = { new RepoData { Repo = repo1, Images = { new ImageData { Platforms = { CreatePlatform( dockerfile1Path, baseImageDigest: baseImageDigest) } } } } } } ) }; Dictionary<GitFile, List<DockerfileInfo>> dockerfileInfos = new Dictionary<GitFile, List<DockerfileInfo>> { { subscriptionInfos[0].Subscription.Manifest, new List<DockerfileInfo> { new DockerfileInfo(dockerfile1Path, new FromImageInfo(baseImage, baseImageDigest)) } } }; using (TestContext context = new TestContext(subscriptionInfos, dockerfileInfos)) { await context.ExecuteCommandAsync(); // No paths are expected Dictionary<Subscription, IList<string>> expectedPathsBySubscription = new Dictionary<Subscription, IList<string>>(); context.Verify(expectedPathsBySubscription); } } /// <summary> /// Verifies the correct path arguments are passed to the queued build when /// a base image changes where the image referencing that base image has other /// images dependent upon it. /// </summary> [Fact] public async Task GetStaleImagesCommand_DependencyGraph() { const string runtimeDepsRepo = "runtimedeps-repo"; const string runtimeRepo = "runtime-repo"; const string sdkRepo = "sdk-repo"; const string aspnetRepo = "aspnet-repo"; const string otherRepo = "other-repo"; const string runtimeDepsDockerfilePath = "runtime-deps/Dockerfile"; const string runtimeDockerfilePath = "runtime/Dockerfile"; const string sdkDockerfilePath = "sdk/Dockerfile"; const string aspnetDockerfilePath = "aspnet/Dockerfile"; const string otherDockerfilePath = "other/Dockerfile"; const string baseImage = "base1"; const string baseImageDigest = "base1digest"; const string otherImage = "other"; const string otherImageDigest = "otherDigest"; SubscriptionInfo[] subscriptionInfos = new SubscriptionInfo[] { new SubscriptionInfo( CreateSubscription("repo1"), ManifestHelper.CreateManifest( ManifestHelper.CreateRepo( runtimeDepsRepo, ManifestHelper.CreateImage( ManifestHelper.CreatePlatform(runtimeDepsDockerfilePath, new string[] { "tag1" }))), ManifestHelper.CreateRepo( runtimeRepo, ManifestHelper.CreateImage( CreatePlatformWithRepoBuildArg(runtimeDockerfilePath, runtimeDepsRepo, new string[] { "tag1" }))), ManifestHelper.CreateRepo( sdkRepo, ManifestHelper.CreateImage( CreatePlatformWithRepoBuildArg(sdkDockerfilePath, runtimeRepo, new string[] { "tag1" }))), ManifestHelper.CreateRepo( aspnetRepo, ManifestHelper.CreateImage( CreatePlatformWithRepoBuildArg(aspnetDockerfilePath, runtimeRepo, new string[] { "tag1" }))), ManifestHelper.CreateRepo( otherRepo, ManifestHelper.CreateImage( ManifestHelper.CreatePlatform(otherDockerfilePath, new string[] { "tag1" })))), new ImageArtifactDetails { Repos = { new RepoData { Repo = runtimeDepsRepo, Images = { new ImageData { Platforms = { CreatePlatform( runtimeDepsDockerfilePath, baseImageDigest: baseImageDigest + "-diff") } } } }, new RepoData { Repo = runtimeRepo }, new RepoData { Repo = sdkRepo }, new RepoData { Repo = aspnetRepo }, // Include an image that has not been changed and should not be included in the expected paths. new RepoData { Repo = otherRepo, Images = { new ImageData { Platforms = { CreatePlatform( otherDockerfilePath, baseImageDigest: otherImageDigest) } } } } } } ) }; Dictionary<GitFile, List<DockerfileInfo>> dockerfileInfos = new Dictionary<GitFile, List<DockerfileInfo>> { { subscriptionInfos[0].Subscription.Manifest, new List<DockerfileInfo> { new DockerfileInfo(runtimeDepsDockerfilePath, new FromImageInfo(baseImage, baseImageDigest)), new DockerfileInfo(runtimeDockerfilePath, new FromImageInfo("tag1", null, isInternal: true)), new DockerfileInfo(sdkDockerfilePath, new FromImageInfo("tag1", null, isInternal: true)), new DockerfileInfo(aspnetDockerfilePath, new FromImageInfo("tag1", null, isInternal: true)), new DockerfileInfo(otherDockerfilePath, new FromImageInfo(otherImage, otherImageDigest)) } } }; using (TestContext context = new TestContext(subscriptionInfos, dockerfileInfos)) { await context.ExecuteCommandAsync(); Dictionary<Subscription, IList<string>> expectedPathsBySubscription = new Dictionary<Subscription, IList<string>> { { subscriptionInfos[0].Subscription, new List<string> { runtimeDepsDockerfilePath, runtimeDockerfilePath, sdkDockerfilePath, aspnetDockerfilePath } } }; context.Verify(expectedPathsBySubscription); } } /// <summary> /// Verifies the correct path arguments are passed to the queued build when /// a base image changes where the image referencing that base image has other /// images dependent upon it and no image info data exists. /// </summary> [Fact] public async Task GetStaleImagesCommand_DependencyGraph_MissingImageInfo() { const string runtimeDepsRepo = "runtimedeps-repo"; const string runtimeRepo = "runtime-repo"; const string sdkRepo = "sdk-repo"; const string aspnetRepo = "aspnet-repo"; const string otherRepo = "other-repo"; const string runtimeDepsDockerfilePath = "runtime-deps/Dockerfile"; const string runtimeDockerfilePath = "runtime/Dockerfile"; const string sdkDockerfilePath = "sdk/Dockerfile"; const string aspnetDockerfilePath = "aspnet/Dockerfile"; const string otherDockerfilePath = "other/Dockerfile"; const string baseImage = "base1"; const string baseImageDigest = "base1digest"; const string otherImage = "other"; const string otherImageDigest = "otherDigest"; SubscriptionInfo[] subscriptionInfos = new SubscriptionInfo[] { new SubscriptionInfo( CreateSubscription("repo1"), ManifestHelper.CreateManifest( ManifestHelper.CreateRepo( runtimeDepsRepo, ManifestHelper.CreateImage( ManifestHelper.CreatePlatform(runtimeDepsDockerfilePath, new string[] { "tag1" }))), ManifestHelper.CreateRepo( runtimeRepo, ManifestHelper.CreateImage( CreatePlatformWithRepoBuildArg(runtimeDockerfilePath, runtimeDepsRepo, new string[] { "tag1" }))), ManifestHelper.CreateRepo( sdkRepo, ManifestHelper.CreateImage( CreatePlatformWithRepoBuildArg(sdkDockerfilePath, aspnetRepo, new string[] { "tag1" }))), ManifestHelper.CreateRepo( aspnetRepo, ManifestHelper.CreateImage( CreatePlatformWithRepoBuildArg(aspnetDockerfilePath, runtimeRepo, new string[] { "tag1" }))), ManifestHelper.CreateRepo( otherRepo, ManifestHelper.CreateImage( ManifestHelper.CreatePlatform(otherDockerfilePath, new string[] { "tag1" })))), new ImageArtifactDetails { } ) }; Dictionary<GitFile, List<DockerfileInfo>> dockerfileInfos = new Dictionary<GitFile, List<DockerfileInfo>> { { subscriptionInfos[0].Subscription.Manifest, new List<DockerfileInfo> { new DockerfileInfo(runtimeDepsDockerfilePath, new FromImageInfo(baseImage, baseImageDigest)), new DockerfileInfo(runtimeDockerfilePath, new FromImageInfo("tag1", null, isInternal: true)), new DockerfileInfo(sdkDockerfilePath, new FromImageInfo("tag1", null, isInternal: true)), new DockerfileInfo(aspnetDockerfilePath, new FromImageInfo("tag1", null, isInternal: true)), new DockerfileInfo(otherDockerfilePath, new FromImageInfo(otherImage, otherImageDigest)) } } }; using (TestContext context = new TestContext(subscriptionInfos, dockerfileInfos)) { await context.ExecuteCommandAsync(); Dictionary<Subscription, IList<string>> expectedPathsBySubscription = new Dictionary<Subscription, IList<string>> { { subscriptionInfos[0].Subscription, new List<string> { runtimeDepsDockerfilePath, runtimeDockerfilePath, aspnetDockerfilePath, sdkDockerfilePath, otherDockerfilePath } } }; context.Verify(expectedPathsBySubscription); } } /// <summary> /// Verifies the correct path arguments are passed to the queued build when an image /// built from a custom named Dockerfile. /// </summary> [Fact] public async Task GetStaleImagesCommand_CustomDockerfilePath() { const string repo1 = "test-repo"; const string dockerfile1Path = "path/to/Dockerfile.custom"; const string dockerfile2Path = "path/to/Dockerfile"; SubscriptionInfo[] subscriptionInfos = new SubscriptionInfo[] { new SubscriptionInfo( CreateSubscription(repo1), ManifestHelper.CreateManifest( ManifestHelper.CreateRepo( repo1, ManifestHelper.CreateImage( ManifestHelper.CreatePlatform(dockerfile1Path, new string[] { "tag1" }), ManifestHelper.CreatePlatform(dockerfile2Path, new string[] { "tag2" })))), new ImageArtifactDetails { Repos = { new RepoData { Repo = repo1, Images = { new ImageData { Platforms = { CreatePlatform( dockerfile1Path, baseImageDigest: "base1digest-diff"), CreatePlatform( dockerfile2Path, baseImageDigest: "base2digest") } } } } } } ) }; Dictionary<GitFile, List<DockerfileInfo>> dockerfileInfos = new Dictionary<GitFile, List<DockerfileInfo>> { { subscriptionInfos[0].Subscription.Manifest, new List<DockerfileInfo> { new DockerfileInfo(dockerfile1Path, new FromImageInfo("base1", "base1digest")), new DockerfileInfo(dockerfile2Path, new FromImageInfo("base2", "base2digest")) } } }; using (TestContext context = new TestContext(subscriptionInfos, dockerfileInfos)) { await context.ExecuteCommandAsync(); // Only one of the images has a changed digest Dictionary<Subscription, IList<string>> expectedPathsBySubscription = new Dictionary<Subscription, IList<string>> { { subscriptionInfos[0].Subscription, new List<string> { dockerfile1Path } } }; context.Verify(expectedPathsBySubscription); } } /// <summary> /// Verifies an image will be marked to be rebuilt if its base image is not included in the list of image data. /// </summary> [Fact] public async Task GetStaleImagesCommand_NoExistingImageData() { const string repo1 = "test-repo"; const string dockerfile1Path = "dockerfile1/Dockerfile"; SubscriptionInfo[] subscriptionInfos = new SubscriptionInfo[] { new SubscriptionInfo( CreateSubscription(repo1), ManifestHelper.CreateManifest( ManifestHelper.CreateRepo( repo1, ManifestHelper.CreateImage( ManifestHelper.CreatePlatform(dockerfile1Path, new string[] { "tag1" })))), new ImageArtifactDetails { Repos = { new RepoData { Repo = repo1, Images = { new ImageData { Platforms = { CreatePlatform( dockerfile1Path, baseImageDigest: "base1digest") } } } } } } ) }; Dictionary<GitFile, List<DockerfileInfo>> dockerfileInfos = new Dictionary<GitFile, List<DockerfileInfo>> { { subscriptionInfos[0].Subscription.Manifest, new List<DockerfileInfo> { new DockerfileInfo(dockerfile1Path, new FromImageInfo("base2", "base2digest")), } } }; using (TestContext context = new TestContext(subscriptionInfos, dockerfileInfos)) { await context.ExecuteCommandAsync(); Dictionary<Subscription, IList<string>> expectedPathsBySubscription = new Dictionary<Subscription, IList<string>> { { subscriptionInfos[0].Subscription, new List<string> { dockerfile1Path } } }; context.Verify(expectedPathsBySubscription); } } /// <summary> /// Verifies that a Dockerfile with only an internal FROM should not be considered stale. /// </summary> [Fact] public async Task GetStaleImagesCommand_InternalFromOnly() { const string repo1 = "test-repo"; const string dockerfile1Path = "dockerfile1/Dockerfile"; const string dockerfile2Path = "dockerfile2/Dockerfile"; SubscriptionInfo[] subscriptionInfos = new SubscriptionInfo[] { new SubscriptionInfo( CreateSubscription(repo1), ManifestHelper.CreateManifest( ManifestHelper.CreateRepo( repo1, ManifestHelper.CreateImage( CreatePlatformWithRepoBuildArg(dockerfile1Path, $"{repo1}:tag2", new string[] { "tag1" })), ManifestHelper.CreateImage( ManifestHelper.CreatePlatform(dockerfile2Path, new string[] { "tag2" })))), new ImageArtifactDetails { Repos = { new RepoData { Repo = repo1, Images = { new ImageData { Platforms = { CreatePlatform(dockerfile1Path), CreatePlatform( dockerfile2Path, baseImageDigest: "base1digest") } } } } } } ) }; Dictionary<GitFile, List<DockerfileInfo>> dockerfileInfos = new Dictionary<GitFile, List<DockerfileInfo>> { { subscriptionInfos[0].Subscription.Manifest, new List<DockerfileInfo> { new DockerfileInfo(dockerfile1Path, new FromImageInfo(null, null, isInternal: true)), new DockerfileInfo(dockerfile2Path, new FromImageInfo("base1", "base1digest")) } } }; using (TestContext context = new TestContext(subscriptionInfos, dockerfileInfos)) { await context.ExecuteCommandAsync(); // No paths are expected Dictionary<Subscription, IList<string>> expectedPathsBySubscription = new Dictionary<Subscription, IList<string>>(); context.Verify(expectedPathsBySubscription); } } /// <summary> /// Verifies the correct path arguments are passed to the queued build for a /// scenario involving two platforms sharing the same Dockerfile. /// </summary> [Fact] public async Task GetStaleImagesCommand_SharedDockerfile() { const string repo1 = "test-repo"; const string dockerfile1Path = "dockerfile1/Dockerfile"; SubscriptionInfo[] subscriptionInfos = new SubscriptionInfo[] { new SubscriptionInfo( CreateSubscription(repo1), ManifestHelper.CreateManifest( ManifestHelper.CreateRepo( repo1, ManifestHelper.CreateImage( ManifestHelper.CreatePlatform(dockerfile1Path, new string[] { "tag1" }, osVersion: "alpine3.10"), ManifestHelper.CreatePlatform(dockerfile1Path, new string[] { "tag2" }, osVersion: "alpine3.11")))), new ImageArtifactDetails { Repos = { new RepoData { Repo = repo1, Images = { new ImageData { Platforms = { CreatePlatform( dockerfile1Path, baseImageDigest: "base1digest", osVersion: "Alpine 3.10"), CreatePlatform( dockerfile1Path, baseImageDigest: "base2digest-diff", osVersion: "Alpine 3.11") } } } } } } ) }; Dictionary<GitFile, List<DockerfileInfo>> dockerfileInfos = new Dictionary<GitFile, List<DockerfileInfo>> { { subscriptionInfos[0].Subscription.Manifest, new List<DockerfileInfo> { new DockerfileInfo(dockerfile1Path, new FromImageInfo("base1", "base1digest")), new DockerfileInfo(dockerfile1Path, new FromImageInfo("base2", "base2digest")) } } }; using (TestContext context = new TestContext(subscriptionInfos, dockerfileInfos)) { await context.ExecuteCommandAsync(); // Only one of the images has a changed digest Dictionary<Subscription, IList<string>> expectedPathsBySubscription = new Dictionary<Subscription, IList<string>> { { subscriptionInfos[0].Subscription, new List<string> { dockerfile1Path } } }; context.Verify(expectedPathsBySubscription); } } /// <summary> /// Use this method to generate a unique repo owner name for the tests. This ensures that each test /// uses a different name and prevents collisions when running the tests in parallel. This is because /// the <see cref="GetStaleImagesCommand"/> generates temp folders partially based on the name of /// the repo owner. /// </summary> private static string GetRepoOwner([CallerMemberName] string testMethodName = null, string suffix = null) { return testMethodName + suffix; } private static Platform CreatePlatformWithRepoBuildArg(string dockerfilePath, string repo, string[] tags, OS os = OS.Linux) { Platform platform = ManifestHelper.CreatePlatform(dockerfilePath, tags, os); platform.BuildArgs = new Dictionary<string, string> { { "REPO", repo } }; return platform; } private static Subscription CreateSubscription( string repoName, int index = 0, string osType = null, [CallerMemberName] string testMethodName = null) { return new Subscription { PipelineTrigger = new PipelineTrigger { Id = 1, PathVariable = "--my-path" }, Manifest = new GitFile { Branch = "testBranch" + index, Repo = repoName, Owner = GetRepoOwner(testMethodName, index.ToString()), Path = "testmanifest.json" }, ImageInfo = new GitFile { Owner = GetStaleImagesCommandTests.GitHubOwner, Repo = GetStaleImagesCommandTests.GitHubRepo, Branch = GetStaleImagesCommandTests.GitHubBranch, Path = "docker/image-info.json" }, OsType = osType }; } /// <summary> /// Sets up the test state from the provided metadata, executes the test, and verifies the results. /// </summary> private class TestContext : IDisposable { private readonly List<string> filesToCleanup = new List<string>(); private readonly List<string> foldersToCleanup = new List<string>(); private readonly Dictionary<string, string> imageDigests = new Dictionary<string, string>(); private readonly string subscriptionsPath; private readonly IHttpClientFactory httpClientFactory; private readonly GetStaleImagesCommand command; private readonly Mock<ILoggerService> loggerServiceMock = new Mock<ILoggerService>(); private readonly string osType; private readonly IGitHubClientFactory gitHubClientFactory; private const string VariableName = "my-var"; public Mock<IDockerService> DockerServiceMock { get; } /// <summary> /// Initializes a new instance of <see cref="TestContext"/>. /// </summary> /// <param name="subscriptionInfos">Mapping of data to subscriptions.</param> /// <param name="dockerfileInfos">A mapping of Git repos to their associated set of Dockerfiles.</param> /// <param name="osType">The OS type to filter the command with.</param> public TestContext( SubscriptionInfo[] subscriptionInfos, Dictionary<GitFile, List<DockerfileInfo>> dockerfileInfos, string osType = "*") { this.osType = osType; this.subscriptionsPath = this.SerializeJsonObjectToTempFile( subscriptionInfos.Select(tuple => tuple.Subscription).ToArray()); // Cache image digests lookup foreach (FromImageInfo fromImage in dockerfileInfos.Values.SelectMany(infos => infos).SelectMany(info => info.FromImages)) { if (fromImage.Name != null) { this.imageDigests[fromImage.Name] = fromImage.Digest; } } TeamProject project = new TeamProject { Id = Guid.NewGuid() }; this.httpClientFactory = CreateHttpClientFactory(subscriptionInfos, dockerfileInfos); this.gitHubClientFactory = CreateGitHubClientFactory(subscriptionInfos); this.DockerServiceMock = this.CreateDockerServiceMock(); this.command = this.CreateCommand(); } public Task ExecuteCommandAsync() { return this.command.ExecuteAsync(); } /// <summary> /// Verifies the test execution to ensure the results match the expected state. /// </summary> public void Verify(IDictionary<Subscription, IList<string>> expectedPathsBySubscription) { IInvocation invocation = this.loggerServiceMock.Invocations .First(invocation => invocation.Method.Name == nameof(ILoggerService.WriteMessage) && invocation.Arguments[0].ToString().StartsWith("##vso")); string message = invocation.Arguments[0].ToString(); int variableNameStartIndex = message.IndexOf("=") + 1; string actualVariableName = message.Substring(variableNameStartIndex, message.IndexOf(";") - variableNameStartIndex); Assert.Equal(VariableName, actualVariableName); string variableValue = message .Substring(message.IndexOf("]") + 1); SubscriptionImagePaths[] pathsBySubscription = JsonConvert.DeserializeObject<SubscriptionImagePaths[]>(variableValue.Replace("\\\"", "\"")); Assert.Equal(expectedPathsBySubscription.Count, pathsBySubscription.Length); foreach (KeyValuePair<Subscription, IList<string>> kvp in expectedPathsBySubscription) { string[] actualPaths = pathsBySubscription .First(imagePaths => imagePaths.SubscriptionId == kvp.Key.Id).ImagePaths; Assert.Equal(kvp.Value, actualPaths); } } private string SerializeJsonObjectToTempFile(object jsonObject) { string path = Path.GetTempFileName(); File.WriteAllText(path, JsonConvert.SerializeObject(jsonObject)); this.filesToCleanup.Add(path); return path; } private GetStaleImagesCommand CreateCommand() { GetStaleImagesCommand command = new GetStaleImagesCommand( this.DockerServiceMock.Object, this.httpClientFactory, this.loggerServiceMock.Object, this.gitHubClientFactory); command.Options.SubscriptionsPath = this.subscriptionsPath; command.Options.VariableName = VariableName; command.Options.FilterOptions.OsType = this.osType; command.Options.GitOptions.Email = "test"; command.Options.GitOptions.Username = "test"; command.Options.GitOptions.AuthToken = "test"; return command; } private IGitHubClientFactory CreateGitHubClientFactory(SubscriptionInfo[] subscriptionInfos) { Mock<IGitHubClient> gitHubClientMock = new Mock<IGitHubClient>(); foreach (SubscriptionInfo subscriptionInfo in subscriptionInfos) { if (subscriptionInfo.ImageInfo != null) { string imageInfoContents = JsonConvert.SerializeObject(subscriptionInfo.ImageInfo); gitHubClientMock .Setup(o => o.GetGitHubFileContentsAsync(It.IsAny<string>(), It.Is<GitHubBranch>(branch => IsMatchingBranch(branch)))) .ReturnsAsync(imageInfoContents); } } Mock<IGitHubClientFactory> gitHubClientFactoryMock = new Mock<IGitHubClientFactory>(); gitHubClientFactoryMock .Setup(o => o.GetClient(It.IsAny<GitHubAuth>(), false)) .Returns(gitHubClientMock.Object); return gitHubClientFactoryMock.Object; } private static bool IsMatchingBranch(GitHubBranch branch) { return branch.Name == GitHubBranch && branch.Project.Name == GitHubRepo && branch.Project.Owner == GitHubOwner; } /// <summary> /// Returns an <see cref="IHttpClientFactory"/> that creates an <see cref="HttpClient"/> which /// bypasses the network and return back pre-built responses for GitHub repo zip files. /// </summary> /// <param name="subscriptionInfos">Mapping of data to subscriptions.</param> /// <param name="dockerfileInfos">A mapping of Git repos to their associated set of Dockerfiles.</param> private IHttpClientFactory CreateHttpClientFactory( SubscriptionInfo[] subscriptionInfos, Dictionary<GitFile, List<DockerfileInfo>> dockerfileInfos) { Dictionary<string, HttpResponseMessage> responses = new Dictionary<string, HttpResponseMessage>(); foreach (SubscriptionInfo subscriptionInfo in subscriptionInfos) { Subscription subscription = subscriptionInfo.Subscription; List<DockerfileInfo> repoDockerfileInfos = dockerfileInfos[subscription.Manifest]; string repoZipPath = GenerateRepoZipFile(subscription, subscriptionInfo.Manifest, repoDockerfileInfos); responses.Add( $"https://github.com/{subscription.Manifest.Owner}/{subscription.Manifest.Repo}/archive/{subscription.Manifest.Branch}.zip", new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new ByteArrayContent(File.ReadAllBytes(repoZipPath)) }); } HttpClient client = new HttpClient(new TestHttpMessageHandler(responses)); Mock<IHttpClientFactory> httpClientFactoryMock = new Mock<IHttpClientFactory>(); httpClientFactoryMock .Setup(o => o.GetClient()) .Returns(client); return httpClientFactoryMock.Object; } /// <summary> /// Generates a zip file in a temp location that represents the contents of a GitHub repo. /// </summary> /// <param name="subscription">The subscription associated with the GitHub repo.</param> /// <param name="manifest">Manifest model associated with the subscription.</param> /// <param name="repoDockerfileInfos">Set of <see cref="DockerfileInfo"/> objects that describe the Dockerfiles contained in the repo.</param> /// <returns></returns> private string GenerateRepoZipFile( Subscription subscription, Manifest manifest, List<DockerfileInfo> repoDockerfileInfos) { // Create a temp folder to store everything in. string tempDir = Directory.CreateDirectory( Path.Combine(Path.GetTempPath(), Path.GetRandomFileName())).FullName; this.foldersToCleanup.Add(tempDir); // Create a sub-folder inside the temp folder that represents the repo contents. string repoPath = Directory.CreateDirectory( Path.Combine(tempDir, $"{subscription.Manifest.Repo}-{subscription.Manifest.Branch}")).FullName; // Serialize the manifest model to a file in the repo folder. string manifestPath = Path.Combine(repoPath, subscription.Manifest.Path); File.WriteAllText(manifestPath, JsonConvert.SerializeObject(manifest)); foreach (DockerfileInfo dockerfileInfo in repoDockerfileInfos) { GenerateDockerfile(dockerfileInfo, repoPath); } string repoZipPath = Path.Combine(tempDir, "repo.zip"); ZipFile.CreateFromDirectory(repoPath, repoZipPath, CompressionLevel.Fastest, true); return repoZipPath; } /// <summary> /// Generates a Dockerfile from the <see cref="DockerfileInfo"/> metatada and stores it the specified path. /// </summary> /// <param name="dockerfileInfo">The metadata for the Dockerfile.</param> /// <param name="destinationPath">Folder path to store the Dockerfile.</param> private static void GenerateDockerfile(DockerfileInfo dockerfileInfo, string destinationPath) { string dockerfileContents = string.Empty; foreach (FromImageInfo fromImage in dockerfileInfo.FromImages) { string repo = string.Empty; if (fromImage.IsInternal) { repo = "$REPO:"; } dockerfileContents += $"FROM {repo}{fromImage.Name}{Environment.NewLine}"; } string dockerfilePath = Directory.CreateDirectory( Path.Combine(destinationPath, Path.GetDirectoryName(dockerfileInfo.DockerfilePath))).FullName; File.WriteAllText( Path.Combine(dockerfilePath, Path.GetFileName(dockerfileInfo.DockerfilePath)), dockerfileContents); } private Mock<IDockerService> CreateDockerServiceMock() { Mock<IDockerService> dockerServiceMock = new Mock<IDockerService>(); dockerServiceMock .Setup(o => o.GetImageDigest(It.IsAny<string>(), false)) .Returns((string image, bool isDryRun) => this.imageDigests[image]); return dockerServiceMock; } /// <summary> /// Returns a value indicating whether the <see cref="Build"/> object contains the expected state. /// </summary> /// <param name="build">The <see cref="Build"/> to validate.</param> /// <param name="subscription">Subscription object that contains metadata to compare against the <paramref name="build"/>.</param> /// <param name="expectedPaths">The set of expected path arguments that should have been passed to the build.</param> private static bool FilterBuildToSubscription(Build build, Subscription subscription, IList<string> expectedPaths) { return build.Definition.Id == subscription.PipelineTrigger.Id && build.SourceBranch == subscription.Manifest.Branch && FilterBuildToParameters(build.Parameters, subscription.PipelineTrigger.PathVariable, expectedPaths); } /// <summary> /// Returns a value indicating whether <paramref name="buildParametersJson"/> matches the expected results. /// </summary> /// <param name="buildParametersJson">The raw JSON parameters value that was provided to a <see cref="Build"/>.</param> /// <param name="pathVariable">Name of the path variable that the arguments are assigned to.</param> /// <param name="expectedPaths">The set of expected path arguments that should have been passed to the build.</param> private static bool FilterBuildToParameters(string buildParametersJson, string pathVariable, IList<string> expectedPaths) { JObject buildParameters = JsonConvert.DeserializeObject<JObject>(buildParametersJson); string pathString = buildParameters[pathVariable].ToString(); IList<string> paths = pathString .Split("--path ", StringSplitOptions.RemoveEmptyEntries) .Select(p => p.Trim().Trim('\'')) .ToList(); return TestHelper.CompareLists(expectedPaths, paths); } public void Dispose() { foreach (string file in this.filesToCleanup) { File.Delete(file); } foreach (string folder in this.foldersToCleanup) { Directory.Delete(folder, true); } this.command?.Dispose(); } } private class DockerfileInfo { public DockerfileInfo(string dockerfilePath, params FromImageInfo[] fromImages) { this.DockerfilePath = dockerfilePath; this.FromImages = fromImages; } public string DockerfilePath { get; } public FromImageInfo[] FromImages { get; } } private class FromImageInfo { public FromImageInfo (string name, string digest, bool isInternal = false) { Name = name; Digest = digest; IsInternal = isInternal; } public string Digest { get; } public bool IsInternal { get; } public string Name { get; } } private class PagedList<T> : List<T>, IPagedList<T> { public string ContinuationToken => throw new NotImplementedException(); } private class SubscriptionInfo { public SubscriptionInfo(Subscription subscription, Manifest manifest, ImageArtifactDetails imageInfo) { Subscription = subscription; Manifest = manifest; ImageInfo = imageInfo; } public Subscription Subscription { get; } public Manifest Manifest { get; } public ImageArtifactDetails ImageInfo { get; } } } }
44.209371
154
0.461086
[ "MIT" ]
mthalman/docker-tools
src/Microsoft.DotNet.ImageBuilder/tests/GetStaleImagesCommandTests.cs
74,539
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. /****************************************************************************** * This file is auto-generated from a template file by the GenerateTests.csx * * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * * changes, please update the corresponding template and run according to the * * directions listed in the file. * ******************************************************************************/ using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Intrinsics; using System.Runtime.Intrinsics.Arm; namespace JIT.HardwareIntrinsics.Arm { public static partial class Program { private static void AddWideningUpper_Vector128_Int32_Vector128_Int32() { var test = new SimpleBinaryOpTest__AddWideningUpper_Vector128_Int32_Vector128_Int32(); if (test.IsSupported) { // Validates basic functionality works, using Unsafe.Read test.RunBasicScenario_UnsafeRead(); if (AdvSimd.IsSupported) { // Validates basic functionality works, using Load test.RunBasicScenario_Load(); } // Validates calling via reflection works, using Unsafe.Read test.RunReflectionScenario_UnsafeRead(); if (AdvSimd.IsSupported) { // Validates calling via reflection works, using Load test.RunReflectionScenario_Load(); } // Validates passing a static member works test.RunClsVarScenario(); if (AdvSimd.IsSupported) { // Validates passing a static member works, using pinning and Load test.RunClsVarScenario_Load(); } // Validates passing a local works, using Unsafe.Read test.RunLclVarScenario_UnsafeRead(); if (AdvSimd.IsSupported) { // Validates passing a local works, using Load test.RunLclVarScenario_Load(); } // Validates passing the field of a local class works test.RunClassLclFldScenario(); if (AdvSimd.IsSupported) { // Validates passing the field of a local class works, using pinning and Load test.RunClassLclFldScenario_Load(); } // Validates passing an instance member of a class works test.RunClassFldScenario(); if (AdvSimd.IsSupported) { // Validates passing an instance member of a class works, using pinning and Load test.RunClassFldScenario_Load(); } // Validates passing the field of a local struct works test.RunStructLclFldScenario(); if (AdvSimd.IsSupported) { // Validates passing the field of a local struct works, using pinning and Load test.RunStructLclFldScenario_Load(); } // Validates passing an instance member of a struct works test.RunStructFldScenario(); if (AdvSimd.IsSupported) { // Validates passing an instance member of a struct works, using pinning and Load test.RunStructFldScenario_Load(); } } else { // Validates we throw on unsupported hardware test.RunUnsupportedScenario(); } if (!test.Succeeded) { throw new Exception("One or more scenarios did not complete as expected."); } } } public sealed unsafe class SimpleBinaryOpTest__AddWideningUpper_Vector128_Int32_Vector128_Int32 { private struct DataTable { private byte[] inArray1; private byte[] inArray2; private byte[] outArray; private GCHandle inHandle1; private GCHandle inHandle2; private GCHandle outHandle; private ulong alignment; public DataTable(Int32[] inArray1, Int32[] inArray2, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<Int32>(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<Int32>(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Int64>(); if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } this.inArray1 = new byte[alignment * 2]; this.inArray2 = new byte[alignment * 2]; this.outArray = new byte[alignment * 2]; this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); this.alignment = (ulong)alignment; Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<Int32, byte>(ref inArray1[0]), (uint)sizeOfinArray1); Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<Int32, byte>(ref inArray2[0]), (uint)sizeOfinArray2); } public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); public void Dispose() { inHandle1.Free(); inHandle2.Free(); outHandle.Free(); } private static unsafe void* Align(byte* buffer, ulong expectedAlignment) { return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); } } private struct TestStruct { public Vector128<Int32> _fld1; public Vector128<Int32> _fld2; public static TestStruct Create() { var testStruct = new TestStruct(); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref testStruct._fld1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref testStruct._fld2), ref Unsafe.As<Int32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>()); return testStruct; } public void RunStructFldScenario(SimpleBinaryOpTest__AddWideningUpper_Vector128_Int32_Vector128_Int32 testClass) { var result = AdvSimd.AddWideningUpper(_fld1, _fld2); Unsafe.Write(testClass._dataTable.outArrayPtr, result); testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); } public void RunStructFldScenario_Load(SimpleBinaryOpTest__AddWideningUpper_Vector128_Int32_Vector128_Int32 testClass) { fixed (Vector128<Int32>* pFld1 = &_fld1) fixed (Vector128<Int32>* pFld2 = &_fld2) { var result = AdvSimd.AddWideningUpper( AdvSimd.LoadVector128((Int32*)(pFld1)), AdvSimd.LoadVector128((Int32*)(pFld2)) ); Unsafe.Write(testClass._dataTable.outArrayPtr, result); testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); } } } private static readonly int LargestVectorSize = 16; private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<Int32>>() / sizeof(Int32); private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector128<Int32>>() / sizeof(Int32); private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<Int64>>() / sizeof(Int64); private static Int32[] _data1 = new Int32[Op1ElementCount]; private static Int32[] _data2 = new Int32[Op2ElementCount]; private static Vector128<Int32> _clsVar1; private static Vector128<Int32> _clsVar2; private Vector128<Int32> _fld1; private Vector128<Int32> _fld2; private DataTable _dataTable; static SimpleBinaryOpTest__AddWideningUpper_Vector128_Int32_Vector128_Int32() { for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref _clsVar1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref _clsVar2), ref Unsafe.As<Int32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>()); } public SimpleBinaryOpTest__AddWideningUpper_Vector128_Int32_Vector128_Int32() { Succeeded = true; for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref _fld1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref _fld2), ref Unsafe.As<Int32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>()); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } _dataTable = new DataTable(_data1, _data2, new Int64[RetElementCount], LargestVectorSize); } public bool IsSupported => AdvSimd.IsSupported; public bool Succeeded { get; set; } public void RunBasicScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); var result = AdvSimd.AddWideningUpper( Unsafe.Read<Vector128<Int32>>(_dataTable.inArray1Ptr), Unsafe.Read<Vector128<Int32>>(_dataTable.inArray2Ptr) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunBasicScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); var result = AdvSimd.AddWideningUpper( AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)), AdvSimd.LoadVector128((Int32*)(_dataTable.inArray2Ptr)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunReflectionScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.AddWideningUpper), new Type[] { typeof(Vector128<Int32>), typeof(Vector128<Int32>) }) .Invoke(null, new object[] { Unsafe.Read<Vector128<Int32>>(_dataTable.inArray1Ptr), Unsafe.Read<Vector128<Int32>>(_dataTable.inArray2Ptr) }); Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Int64>)(result)); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunReflectionScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.AddWideningUpper), new Type[] { typeof(Vector128<Int32>), typeof(Vector128<Int32>) }) .Invoke(null, new object[] { AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)), AdvSimd.LoadVector128((Int32*)(_dataTable.inArray2Ptr)) }); Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Int64>)(result)); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunClsVarScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); var result = AdvSimd.AddWideningUpper( _clsVar1, _clsVar2 ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); } public void RunClsVarScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); fixed (Vector128<Int32>* pClsVar1 = &_clsVar1) fixed (Vector128<Int32>* pClsVar2 = &_clsVar2) { var result = AdvSimd.AddWideningUpper( AdvSimd.LoadVector128((Int32*)(pClsVar1)), AdvSimd.LoadVector128((Int32*)(pClsVar2)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); } } public void RunLclVarScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); var op1 = Unsafe.Read<Vector128<Int32>>(_dataTable.inArray1Ptr); var op2 = Unsafe.Read<Vector128<Int32>>(_dataTable.inArray2Ptr); var result = AdvSimd.AddWideningUpper(op1, op2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(op1, op2, _dataTable.outArrayPtr); } public void RunLclVarScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); var op1 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)); var op2 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray2Ptr)); var result = AdvSimd.AddWideningUpper(op1, op2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(op1, op2, _dataTable.outArrayPtr); } public void RunClassLclFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); var test = new SimpleBinaryOpTest__AddWideningUpper_Vector128_Int32_Vector128_Int32(); var result = AdvSimd.AddWideningUpper(test._fld1, test._fld2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); } public void RunClassLclFldScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); var test = new SimpleBinaryOpTest__AddWideningUpper_Vector128_Int32_Vector128_Int32(); fixed (Vector128<Int32>* pFld1 = &test._fld1) fixed (Vector128<Int32>* pFld2 = &test._fld2) { var result = AdvSimd.AddWideningUpper( AdvSimd.LoadVector128((Int32*)(pFld1)), AdvSimd.LoadVector128((Int32*)(pFld2)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); } } public void RunClassFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); var result = AdvSimd.AddWideningUpper(_fld1, _fld2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); } public void RunClassFldScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); fixed (Vector128<Int32>* pFld1 = &_fld1) fixed (Vector128<Int32>* pFld2 = &_fld2) { var result = AdvSimd.AddWideningUpper( AdvSimd.LoadVector128((Int32*)(pFld1)), AdvSimd.LoadVector128((Int32*)(pFld2)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); } } public void RunStructLclFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); var test = TestStruct.Create(); var result = AdvSimd.AddWideningUpper(test._fld1, test._fld2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); } public void RunStructLclFldScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); var test = TestStruct.Create(); var result = AdvSimd.AddWideningUpper( AdvSimd.LoadVector128((Int32*)(&test._fld1)), AdvSimd.LoadVector128((Int32*)(&test._fld2)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); } public void RunStructFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); var test = TestStruct.Create(); test.RunStructFldScenario(this); } public void RunStructFldScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); var test = TestStruct.Create(); test.RunStructFldScenario_Load(this); } public void RunUnsupportedScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); bool succeeded = false; try { RunBasicScenario_UnsafeRead(); } catch (PlatformNotSupportedException) { succeeded = true; } if (!succeeded) { Succeeded = false; } } private void ValidateResult(Vector128<Int32> op1, Vector128<Int32> op2, void* result, [CallerMemberName] string method = "") { Int32[] inArray1 = new Int32[Op1ElementCount]; Int32[] inArray2 = new Int32[Op2ElementCount]; Int64[] outArray = new Int64[RetElementCount]; Unsafe.WriteUnaligned(ref Unsafe.As<Int32, byte>(ref inArray1[0]), op1); Unsafe.WriteUnaligned(ref Unsafe.As<Int32, byte>(ref inArray2[0]), op2); Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int64, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Int64>>()); ValidateResult(inArray1, inArray2, outArray, method); } private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") { Int32[] inArray1 = new Int32[Op1ElementCount]; Int32[] inArray2 = new Int32[Op2ElementCount]; Int64[] outArray = new Int64[RetElementCount]; Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector128<Int32>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector128<Int32>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int64, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Int64>>()); ValidateResult(inArray1, inArray2, outArray, method); } private void ValidateResult(Int32[] left, Int32[] right, Int64[] result, [CallerMemberName] string method = "") { bool succeeded = true; for (var i = 0; i < RetElementCount; i++) { if (Helpers.AddWideningUpper(left, right, i) != result[i]) { succeeded = false; break; } } if (!succeeded) { TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.AddWideningUpper)}<Int64>(Vector128<Int32>, Vector128<Int32>): {method} failed:"); TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); TestLibrary.TestFramework.LogInformation(string.Empty); Succeeded = false; } } } }
42.596226
187
0.589918
[ "MIT" ]
2m0nd/runtime
src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd/AddWideningUpper.Vector128.Int32.Vector128.Int32.cs
22,576
C#
// ------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. // ------------------------------------------------------------------------------ // **NOTE** This file was generated by a tool and any changes will be overwritten. // Template Source: Templates\CSharp\Requests\EntityRequestBuilder.cs.tt namespace Microsoft.Graph { using System; using System.Collections.Generic; using System.IO; /// <summary> /// The type RemoteAssistancePartnerRequestBuilder. /// </summary> public partial class RemoteAssistancePartnerRequestBuilder : EntityRequestBuilder, IRemoteAssistancePartnerRequestBuilder { /// <summary> /// Constructs a new RemoteAssistancePartnerRequestBuilder. /// </summary> /// <param name="requestUrl">The URL for the built request.</param> /// <param name="client">The <see cref="IBaseClient"/> for handling requests.</param> public RemoteAssistancePartnerRequestBuilder( string requestUrl, IBaseClient client) : base(requestUrl, client) { } /// <summary> /// Builds the request. /// </summary> /// <returns>The built request.</returns> public new IRemoteAssistancePartnerRequest Request() { return this.Request(null); } /// <summary> /// Builds the request. /// </summary> /// <param name="options">The query and header options for the request.</param> /// <returns>The built request.</returns> public new IRemoteAssistancePartnerRequest Request(IEnumerable<Option> options) { return new RemoteAssistancePartnerRequest(this.RequestUrl, this.Client, options); } /// <summary> /// Gets the request builder for RemoteAssistancePartnerBeginOnboarding. /// </summary> /// <returns>The <see cref="IRemoteAssistancePartnerBeginOnboardingRequestBuilder"/>.</returns> public IRemoteAssistancePartnerBeginOnboardingRequestBuilder BeginOnboarding() { return new RemoteAssistancePartnerBeginOnboardingRequestBuilder( this.AppendSegmentToRequestUrl("microsoft.graph.beginOnboarding"), this.Client); } /// <summary> /// Gets the request builder for RemoteAssistancePartnerDisconnect. /// </summary> /// <returns>The <see cref="IRemoteAssistancePartnerDisconnectRequestBuilder"/>.</returns> public IRemoteAssistancePartnerDisconnectRequestBuilder Disconnect() { return new RemoteAssistancePartnerDisconnectRequestBuilder( this.AppendSegmentToRequestUrl("microsoft.graph.disconnect"), this.Client); } } }
39.171053
153
0.613033
[ "MIT" ]
AzureMentor/msgraph-sdk-dotnet
src/Microsoft.Graph/Requests/Generated/RemoteAssistancePartnerRequestBuilder.cs
2,977
C#
// Copyright (c) Mathias Thierbach // Licensed under the MIT License. See LICENSE in the project root for license information. using System.Collections.Generic; using System.Data.OleDb; using System.Xml; using System.Xml.XPath; using Newtonsoft.Json.Linq; using PbiTools.Serialization; using PbiTools.Utils; using Xunit; namespace PbiTools.Tests { public class TabularModelSerializerTests : HasTempFolder { #region Tables [Fact] public void SerializeTables__RemovesTablesArrayFromOriginalJson() { var folder = new MockProjectFolder(); var db = JObject.Parse(@" { ""model"": { ""tables"": [], ""relationships"": [] } }"); var db2 = TabularModelSerializer.SerializeTables(db, folder, new MockQueriesLookup()); Assert.Null(db2.Value<JObject>("model").Property("tables")); } [Fact] public void SerializeTables__CreatesFolderForEachTableUsingName() { var folder = new MockProjectFolder(); var db = JObject.Parse(@" { ""model"": { ""tables"": [ { ""name"" : ""table1"" } , { ""name"" : ""table2"" } ] } }"); TabularModelSerializer.SerializeTables(db, folder, new MockQueriesLookup()); Assert.True(folder.ContainsPath(@"tables\table1\table.json")); Assert.True(folder.ContainsPath(@"tables\table2\table.json")); } [Theory] [InlineData(@"foo/bar", "foo%2Fbar")] [InlineData(@"foo\bar", "foo%5Cbar")] [InlineData(@"foo""bar", "foo%22bar")] [InlineData(@"foo<bar", "foo%3Cbar")] [InlineData(@"foo>bar", "foo%3Ebar")] [InlineData(@"foo|bar", "foo%7Cbar")] [InlineData(@"foo:bar", "foo%3Abar")] [InlineData(@"foo*bar", "foo%2Abar")] [InlineData(@"foo?bar", "foo%3Fbar")] public void SerializeTables__SanitizesTableName(string tableName, string expectedFolderName) { var folder = new MockProjectFolder(); var db = new JObject { { "model", new JObject { { "tables", new JArray( new JObject { { "name", tableName} } )} }} }; TabularModelSerializer.SerializeTables(db, folder, new MockQueriesLookup()); Assert.True(folder.ContainsPath($@"tables\{expectedFolderName}\table.json")); } [Fact] public void SerializeTables__CreatesDaxFileForCalculatedTables() { var folder = new MockProjectFolder(); var table = Resources.GetEmbeddedResourceFromString("table--calculated.json", JObject.Parse); var table2 = TabularModelSerializer.SerializeTablePartitions(table, folder, @"tables\calculated", new MockQueriesLookup()); Assert.NotNull(table.SelectToken("partitions[0].source.expression")); Assert.Null(table2.SelectToken("partitions[0].source.expression")); // folder.ContainsFile(@"tables\calculated\table.dax"); Assert.Equal(Resources.GetEmbeddedResourceString("table--calculated.dax"), folder.GetAsString(@"tables\calculated\table.dax")); } #endregion #region Columns public class SerializeColumnsTests { public SerializeColumnsTests() { var table = Resources.GetEmbeddedResourceFromString("table--with-calc-column.json", JObject.Parse); _tableJsonWithoutColumns = TabularModelSerializer.SerializeColumns(table, _folder, @"tables\calculated"); } private readonly MockProjectFolder _folder = new MockProjectFolder(); private readonly JObject _tableJsonWithoutColumns; private readonly string[] _columnNames = new[] { "DateKey", "Date", "Fiscal Year", "Fiscal Quarter", "Month", "MonthKey", "Full Date", "Is Current Month" }; [Fact] public void RemovesColumnsArrayFromTable() { Assert.Null(_tableJsonWithoutColumns["columns"]); } [Fact] public void CreatesJsonFileForEachColumn() { Assert.All(_columnNames, name => Assert.True(_folder.ContainsFile(@$"tables\calculated\columns\{name}.json")) ); } [Fact] public void ColumnFilesContainValidJson() { Assert.All(_columnNames, name => _folder.GetAsJson(@$"tables\calculated\columns\{name}.json") ); } [Fact] public void CreatesDaxFileForCalculatedColumns() { var path = @"tables\calculated\columns\Is Current Month.dax"; Assert.True(_folder.ContainsFile(path)); Assert.Equal("MONTH([Date]) = MONTH(TODAY()) && YEAR([Date]) = YEAR(TODAY())", _folder.GetAsString(path)); } } #endregion #region Measures [Fact] public void SerializeMeasures__DoesNothingIfThereAreNoMeasures() { var table = new JObject {}; var folder = new MockProjectFolder(); var result = TabularModelSerializer.SerializeMeasures(table, folder, @"tables\table1\"); Assert.Equal(table.ToString(), result.ToString()); Assert.Equal(0, folder.NumberOfFilesWritten); } [Fact] public void SerializeMeasures__CreatesFileForEachMeasure() { var table = JObject.Parse(@" { ""name"": ""table1"", ""measures"": [ { ""name"" : ""measure1"" } , { ""name"" : ""measure2"" } ] }"); var folder = new MockProjectFolder(); TabularModelSerializer.SerializeMeasures(table, folder, @"tables\table1\"); Assert.True(folder.ContainsPath(@"tables\table1\measures\measure1.xml")); Assert.True(folder.ContainsPath(@"tables\table1\measures\measure2.xml")); } [Fact] public void SerializeMeasures__RemovesMeasuresFromTableJson() { var table = JObject.Parse(@" { ""name"": ""table1"", ""measures"": [ { ""name"" : ""measure1"" } , { ""name"" : ""measure2"" } ] }"); var folder = new MockProjectFolder(); var result = TabularModelSerializer.SerializeMeasures(table, folder, @"tables\table1\"); Assert.Null(result.Property("measure")); } [Fact] public void SerializeMeasures__ConvertsAnnotationXmlToNativeXml() { var table = JObject.Parse(@" { ""name"": ""table1"", ""measures"": [ { ""name"" : ""measure1"", ""expression"" : ""COUNTROWS(Date)"", ""annotations"" : [ { ""name"" : ""Format"", ""value"" : ""<Format Format=\""Text\"" />"" } ] } ] }"); var folder = new MockProjectFolder(); TabularModelSerializer.SerializeMeasures(table, folder, @"tables\table1"); var xml = folder.GetAsXml(@"tables\table1\measures\measure1.xml"); Assert.Equal("Text", xml.XPathSelectElement("Measure/Annotation[@Name='Format']/Format").Attribute("Format").Value); } [Fact] public void SerializeMeasures__ConvertsExpressionToDAXFile() { var table = JObject.Parse(@" { ""name"": ""table1"", ""measures"": [ { ""name"" : ""measure1"", ""expression"" : [ ""CALCULATE ("", "" [SalesAmount],"", "" ALLSELECTED ( Customer[Occupation] )"", "")"" ] } ] }"); var folder = new MockProjectFolder(); TabularModelSerializer.SerializeMeasures(table, folder, @"tables\table1"); var expression = folder.GetAsString(@"tables\table1\measures\measure1.dax"); Assert.Equal( "CALCULATE (\n [SalesAmount],\n ALLSELECTED ( Customer[Occupation] )\n)", expression.Replace("\r\n", "\n")); } [Fact] public void SerializeMeasures__ConvertsSingleLineExpression() { var table = JObject.Parse(@" { ""name"": ""table1"", ""measures"": [ { ""name"" : ""measure1"", ""expression"" : ""CALCULATE ([SalesAmount], ALLSELECTED ( Customer[Occupation] ) )"" } ] }"); var folder = new MockProjectFolder(); TabularModelSerializer.SerializeMeasures(table, folder, @"tables\table1"); var expression = folder.GetAsString(@"tables\table1\measures\measure1.dax"); Assert.Equal("CALCULATE ([SalesAmount], ALLSELECTED ( Customer[Occupation] ) )", expression); } #endregion #region Hierarchies [Fact] public void SerializeHierarchies__CreatesFileForEachHierarchy() { var table = JObject.Parse(@" { ""name"": ""table1"", ""hierarchies"": [ { ""name"" : ""hierarchy1"" } , { ""name"" : ""hierarchy2"" } ] }"); var folder = new MockProjectFolder(); TabularModelSerializer.SerializeHierarchies(table, folder, @"tables\table1\"); Assert.True(folder.ContainsPath(@"tables\table1\hierarchies\hierarchy1.json")); Assert.True(folder.ContainsPath(@"tables\table1\hierarchies\hierarchy2.json")); } #endregion public class SerializeDataSources { private readonly JObject _databaseJson = new JObject { { "model", new JObject { { "dataSources", new JArray( new JObject { { "name", "1b4f67fe-4f1c-4828-9971-b258a79f5b79" }, { "connectionString", MashupHelpers.BuildPowerBIConnectionString(TestData.GlobalPipe, TestData.MinimalMashupPackageBytes, "Table1" ) } }, new JObject { { "name", "a6312d03-f6eb-4455-bfd4-04f472995193" }, { "connectionString", MashupHelpers.BuildPowerBIConnectionString(TestData.GlobalPipe, TestData.MinimalMashupPackageBytes, "Table2" ) } } )} }} }; private readonly IQueriesLookup _queriesLookup = new MockQueriesLookup(new Dictionary<string, string> { { "1b4f67fe-4f1c-4828-9971-b258a79f5b79", "09a6f778-cfbd-4153-9354-15085bdbf371" }, /* Table1 */ { "a6312d03-f6eb-4455-bfd4-04f472995193", "d85453b6-f15f-4116-9a65-cad48a4bc967" } /* Table2 */ }); private readonly MockProjectFolder _folder; public SerializeDataSources() { _folder = new MockProjectFolder(); TabularModelSerializer.SerializeDataSources(_databaseJson, _folder, _queriesLookup); } [Fact] public void UsesLocationNameForDatasourceFolder() { Assert.True(_folder.ContainsPath(@"dataSources\Table1\dataSource.json")); Assert.True(_folder.ContainsPath(@"dataSources\Table2\dataSource.json")); } [Fact] public void ReplaceDatasourceNamePropertyWithStaticLookupValue() { var table1 = _folder.GetAsJson(@"dataSources\Table1\dataSource.json"); var table2 = _folder.GetAsJson(@"dataSources\Table2\dataSource.json"); Assert.Equal("09a6f778-cfbd-4153-9354-15085bdbf371", table1["name"].Value<string>()); Assert.Equal("d85453b6-f15f-4116-9a65-cad48a4bc967", table2["name"].Value<string>()); } [Fact] public void RemovesGlobalPipeFromConnectionString() { var table1 = _folder.GetAsJson(@"dataSources\Table1\dataSource.json"); var table2 = _folder.GetAsJson(@"dataSources\Table2\dataSource.json"); var connStr1 = new OleDbConnectionStringBuilder(table1["connectionString"].Value<string>()); Assert.False(connStr1.ContainsKey("Global Pipe")); var connStr2 = new OleDbConnectionStringBuilder(table2["connectionString"].Value<string>()); Assert.False(connStr2.ContainsKey("Global Pipe")); } [Fact] public void RemovesMashupFromConnectionString() { var table1 = _folder.GetAsJson(@"dataSources\Table1\dataSource.json"); var table2 = _folder.GetAsJson(@"dataSources\Table2\dataSource.json"); var connStr1 = new OleDbConnectionStringBuilder(table1["connectionString"].Value<string>()); Assert.False(connStr1.ContainsKey("Mashup")); var connStr2 = new OleDbConnectionStringBuilder(table2["connectionString"].Value<string>()); Assert.False(connStr2.ContainsKey("Mashup")); } } } }
34.895141
162
0.547713
[ "MIT" ]
mitch-d-b/pbi-tools
tests/PBI-Tools.Tests/Serializers/TabularModelSerializerTests.cs
13,646
C#
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Threading.Tasks; using Pulumi.Serialization; namespace Pulumi.Aws.S3.Inputs { public sealed class BucketV2ObjectLockConfigurationRuleArgs : Pulumi.ResourceArgs { [Input("defaultRetentions")] private InputList<Inputs.BucketV2ObjectLockConfigurationRuleDefaultRetentionArgs>? _defaultRetentions; /// <summary> /// The default retention period applied to new objects placed in this bucket. /// </summary> [Obsolete(@"Use the aws_s3_bucket_object_lock_configuration resource instead")] public InputList<Inputs.BucketV2ObjectLockConfigurationRuleDefaultRetentionArgs> DefaultRetentions { get => _defaultRetentions ?? (_defaultRetentions = new InputList<Inputs.BucketV2ObjectLockConfigurationRuleDefaultRetentionArgs>()); set => _defaultRetentions = value; } public BucketV2ObjectLockConfigurationRuleArgs() { } } }
36.818182
144
0.719342
[ "ECL-2.0", "Apache-2.0" ]
chivandikwa/pulumi-aws
sdk/dotnet/S3/Inputs/BucketV2ObjectLockConfigurationRuleArgs.cs
1,215
C#
using System.Windows; using System.Windows.Controls; using System.Windows.Media; using Szofttech_WPF.Logic; using Szofttech_WPF.Utils; namespace Szofttech_WPF.View.Game { /// <summary> /// Interaction logic for CellGUI.xaml /// </summary> public partial class CellGUI : UserControl { //private readonly Color BackGroundColor = Color.FromRgb(82, 137, 200); //private readonly Color shipColor = Color.FromRgb(18, 73, 136); private Color BackGroundColor; private Color shipColor; public readonly int I; public readonly int J; public CellStatus CellStatus { get; private set; } public CellGUI(int i, int j) { InitializeComponent(); BackGroundColor = ColorChanger.DarkeningColor(Settings.getBackgroundColor(), 32); if (BackGroundColor.R == 218 && BackGroundColor.G == 249 && BackGroundColor.B == 255) shipColor = ColorChanger.DarkeningColor(BackGroundColor, -128); else shipColor = ColorChanger.DarkeningColor(BackGroundColor, -64); this.I = i; this.J = j; CellStatus = CellStatus.Empty; Background = new SolidColorBrush(BackGroundColor); } public void select() { if (CellStatus == CellStatus.Empty) setColorSelected(); } public void unSelect() { if (CellStatus == CellStatus.Empty) SetColorUnSelected(); } private void setColorSelected() => Background = new SolidColorBrush(ColorChanger.DarkeningColor(shipColor, 32)); private void SetColorUnSelected() => Background = new SolidColorBrush(BackGroundColor); public void setCell(CellStatus cell) { CellStatus = cell; Dispatcher.Invoke(() => { switch (cell) { case CellStatus.Empty: Background = new SolidColorBrush(BackGroundColor); break; case CellStatus.EmptyHit: break; case CellStatus.NearShip: break; case CellStatus.Ship: Background = new SolidColorBrush(shipColor); break; case CellStatus.ShipHit: break; case CellStatus.ShipSunk: break; default: break; } InvalidateVisual(); }); } protected override void OnRender(DrawingContext drawingContext) { base.OnRender(drawingContext); ImageBrush imageBrush = new ImageBrush(); Pen pen; Brush brush; Rect rect; Point xp; Point yp; SolidColorBrush solidColorBrush; switch (CellStatus) { case CellStatus.Empty: break; case CellStatus.EmptyHit: //háttér solidColorBrush = new SolidColorBrush(BackGroundColor); pen = new Pen(solidColorBrush, 1); rect = new Rect(0, 0, 30, 30); drawingContext.DrawRectangle(solidColorBrush, pen, rect); //hullám pen = new Pen(Brushes.Blue, 1); for (int k = 0; k < 6; k++) { int[] x = { 0, 5, 10, 15, 20, 25, 30 }; int[] y = { 0 + k * 5, 5 + k * 5, 0 + k * 5, 5 + k * 5, 0 + k * 5, 5 + k * 5, 0 + k * 5 }; for (int i = 1; i < x.Length; i++) { drawingContext.DrawLine(pen, new Point(x[i - 1], y[i - 1]), new Point(x[i], y[i])); } } //hogy látszódjon is... Background = null; break; case CellStatus.NearShip: break; case CellStatus.Ship: break; case CellStatus.ShipHit: //háttér solidColorBrush = new SolidColorBrush(shipColor); pen = new Pen(solidColorBrush, 1); rect = new Rect(0, 0, 30, 30); drawingContext.DrawRectangle(solidColorBrush, pen, rect); //X pen = new Pen(Brushes.Red, 3); xp = new Point(0, 0); yp = new Point(30, 30); drawingContext.DrawLine(pen, xp, yp); xp = new Point(0, 30); yp = new Point(30, 0); drawingContext.DrawLine(pen, xp, yp); //hogy látszódjon is... Background = null; break; case CellStatus.ShipSunk: break; default: break; } } } }
36.089655
120
0.461112
[ "MIT" ]
CDZR0/Szofttech-WPF
Szofttech-WPF/View/Game/CellGUI.xaml.cs
5,244
C#
using System; using System.Collections.Generic; using System.Data; using System.Data.Entity; using System.Data.Entity.Infrastructure; using System.Linq; using System.Net; using System.Web; using System.Web.Mvc; using UPT.Data_Access_Layer; using UPT.Models; using UPT.ViewModels; namespace UPT.Controllers { public class ProfesorController : Controller { private ContextUniversitate db = new ContextUniversitate(); // GET: Profesor public ActionResult Index(int? id, int? IDCurs) { var viewModel = new ProfesorIndexData(); viewModel.Profesori = db.Profesori .Include(i => i.Cabinet) .Include(i => i.Cursuri.Select(c => c.Departament)) .OrderBy(i => i.Nume); if (id != null) { ViewBag.IDProfesor = id.Value; viewModel.Cursuri = viewModel.Profesori.Where( i => i.ID == id.Value).Single().Cursuri; } if (IDCurs != null) { ViewBag.CourseID = IDCurs.Value; var cursSelectat = viewModel.Cursuri.Where(x => x.IDCurs == IDCurs).Single(); db.Entry(cursSelectat).Collection(x => x.Inscriere).Load(); foreach (Inscriere inscriere in cursSelectat.Inscriere) { db.Entry(inscriere).Reference(x => x.Student).Load(); } viewModel.Inscriere = cursSelectat.Inscriere; } return View(viewModel); } // GET: Profesor/Details/5 public ActionResult Details(int? id) { if (id == null) { return new HttpStatusCodeResult(HttpStatusCode.BadRequest); } Profesor profesor = db.Profesori.Find(id); if (profesor == null) { return HttpNotFound(); } return View(profesor); } // GET: Profesor/Create public ActionResult Create() { var prof = new Profesor(); prof.Cursuri = new List<Curs>(); TitularCurs(prof); return View(); } [HttpPost] [ValidateAntiForgeryToken] public ActionResult Create([Bind(Include = "Nume,Prenume,DataANgajarii,Cabinet")]Profesor profesor, string[] cursuriSelectate) { if (cursuriSelectate != null) { profesor.Cursuri = new List<Curs>(); foreach (var curs in cursuriSelectate) { var cursNou = db.Cursuri.Find(int.Parse(curs)); profesor.Cursuri.Add(cursNou); } } if (ModelState.IsValid) { db.Profesori.Add(profesor); db.SaveChanges(); return RedirectToAction("Index"); } TitularCurs(profesor); return View(profesor); } // GET: Profesor/Edit/5 public ActionResult Edit(int? id) { if (id == null) { return new HttpStatusCodeResult(HttpStatusCode.BadRequest); } Profesor profesor = db.Profesori .Include(i => i.Cabinet) .Include(i => i.Cursuri) .Where(i => i.ID == id) .Single(); TitularCurs(profesor); if (profesor == null) { return HttpNotFound(); } ViewBag.ID = new SelectList(db.Cabinete, "IDProfesor", "LocatieCabinet", profesor.ID); return View(profesor); } private void TitularCurs(Profesor profesor) { var cursuri = db.Cursuri; var cursuriProf = new HashSet<int>(profesor.Cursuri.Select(c => c.IDCurs)); var viewModel = new List<ImpartireCursuri>(); foreach (var curs in cursuri) { viewModel.Add(new ImpartireCursuri { IDCurs = curs.IDCurs, Titlu = curs.Titlu, Titular = cursuriProf.Contains(curs.IDCurs) }); } ViewBag.Cursuri = viewModel; } // POST: Profesor/Edit/5 // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see https://go.microsoft.com/fwlink/?LinkId=317598. [HttpPost, ActionName("Edit")] [ValidateAntiForgeryToken] public ActionResult Edit(int? id, string[] cursuriSelectate) { if (id == null) { return new HttpStatusCodeResult(HttpStatusCode.BadRequest); } var profesoriUpdate = db.Profesori .Include(i => i.Cabinet) .Include(i => i.Cursuri) .Where(i => i.ID == id) .Single(); if (TryUpdateModel(profesoriUpdate, "", new string[] { "Nume", "Prenume", "DataAngajarii", "Cabinet" })) { try { if (String.IsNullOrWhiteSpace(profesoriUpdate.Cabinet.LocatieCabinet)) { profesoriUpdate.Cabinet = null; } UpdateCursuri(cursuriSelectate, profesoriUpdate); db.SaveChanges(); return RedirectToAction("Index"); } catch (RetryLimitExceededException /* dex */) { //Log the error (uncomment dex variable name and add a line here to write a log. ModelState.AddModelError("", "Unable to save changes. Try again, and if the problem persists, see your system administrator."); } } TitularCurs(profesoriUpdate); return View(profesoriUpdate); } private void UpdateCursuri(string[] cursuriSelectate, Profesor profUpdate) { if (cursuriSelectate == null) { profUpdate.Cursuri = new List<Curs>(); return; } var cursuriSelectateHS = new HashSet<string>(cursuriSelectate); var profesorCurs = new HashSet<int> (profUpdate.Cursuri.Select(c => c.IDCurs)); foreach (var curs in db.Cursuri) { if (cursuriSelectate.Contains(curs.IDCurs.ToString())) { if (!profesorCurs.Contains(curs.IDCurs)) { profUpdate.Cursuri.Add(curs); } } else { if (profesorCurs.Contains(curs.IDCurs)) { profUpdate.Cursuri.Remove(curs); } } } } // GET: Profesor/Delete/5 public ActionResult Delete(int? id) { if (id == null) { return new HttpStatusCodeResult(HttpStatusCode.BadRequest); } Profesor profesor = db.Profesori.Find(id); if (profesor == null) { return HttpNotFound(); } return View(profesor); } // POST: Profesor/Delete/5 [HttpPost, ActionName("Delete")] [ValidateAntiForgeryToken] public ActionResult DeleteConfirmed(int id) { Profesor profesor = db.Profesori.Find(id); db.Profesori.Remove(profesor); db.SaveChanges(); return RedirectToAction("Index"); } protected override void Dispose(bool disposing) { if (disposing) { db.Dispose(); } base.Dispose(disposing); } } }
33.946502
148
0.480058
[ "MIT" ]
roxanabogdan/PSSC-2018
Proiect/Controllers/ProfesorController.cs
8,251
C#
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; namespace Spot.Ebnf { /// <summary> /// Defines a list of rules that should be called by the /// <see cref="SyntaxValidator"/> when validating a syntax. /// Any rule that is not defined in this list is not called. /// </summary> [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = Justifications.MissingCollectionSuffix)] public sealed class IncludedRules : IEnumerable<string> { private List<string> includedRules; /// <summary> /// Initializes a new instance of the <see cref="IncludedRules"/> class. /// </summary> /// <param name="rules">The rules that is to be included.</param> /// <exception cref="ArgumentException"> /// <paramref name="rules"/> is null. /// </exception> public IncludedRules(IEnumerable<string> rules) { if (rules == null) throw new ArgumentNullException(nameof(rules)); includedRules = new List<string>(rules); } /// <summary> /// Initializes a new instance of the <see cref="IncludedRules"/> class. /// </summary> /// <param name="rules">The rules that is to be included.</param> /// <exception cref="ArgumentException"> /// <paramref name="rules"/> is null. /// </exception> public IncludedRules(params string[] rules) { if (rules == null) throw new ArgumentNullException(nameof(rules)); includedRules = new List<string>(rules); } /// <summary> /// Returns an enumerator that iterates through the included rules. /// </summary> /// <returns>An enumerator that iterates through the included rules.</returns> public IEnumerator<string> GetEnumerator() { return includedRules.GetEnumerator(); } /// <summary> /// Returns an enumerator that iterates through the included rules. /// </summary> /// <returns>An enumerator that iterates through the included rules.</returns> IEnumerator IEnumerable.GetEnumerator() { return includedRules.GetEnumerator(); } } }
37.075758
143
0.586432
[ "MIT" ]
pawwkm/Spot
Spot.Ebnf/IncludedRules.cs
2,449
C#
using System; using System.Net.Http; using System.Net.Http.Headers; namespace PayPalHttp { public interface ISerializer { string GetContentTypeRegexPattern(); HttpContent Encode(HttpRequest request); object Decode(HttpContent content, Type responseType); } }
22.538462
62
0.723549
[ "MIT" ]
paypal/paypalhttp_dotnet
PayPalHttp-Dotnet/ISerializer.cs
295
C#
/* * Copyright (c) 2018 THL A29 Limited, a Tencent company. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ namespace TencentCloud.Cat.V20180409.Models { using Newtonsoft.Json; using System.Collections.Generic; using TencentCloud.Common; public class AlarmInfo : AbstractModel { /// <summary> /// 告警对象的名称 /// </summary> [JsonProperty("ObjName")] public string ObjName{ get; set; } /// <summary> /// 告警发生的时间 /// </summary> [JsonProperty("FirstOccurTime")] public string FirstOccurTime{ get; set; } /// <summary> /// 告警结束的时间 /// </summary> [JsonProperty("LastOccurTime")] public string LastOccurTime{ get; set; } /// <summary> /// 告警状态。1 表示已恢复,0 表示未恢复,2表示数据不足 /// </summary> [JsonProperty("Status")] public ulong? Status{ get; set; } /// <summary> /// 告警的内容 /// </summary> [JsonProperty("Content")] public string Content{ get; set; } /// <summary> /// 拨测任务ID /// </summary> [JsonProperty("TaskId")] public ulong? TaskId{ get; set; } /// <summary> /// 特征项名字 /// </summary> [JsonProperty("MetricName")] public string MetricName{ get; set; } /// <summary> /// 特征项数值 /// </summary> [JsonProperty("MetricValue")] public string MetricValue{ get; set; } /// <summary> /// 告警对象的ID /// </summary> [JsonProperty("ObjId")] public string ObjId{ get; set; } /// <summary> /// For internal usage only. DO NOT USE IT. /// </summary> public override void ToMap(Dictionary<string, string> map, string prefix) { this.SetParamSimple(map, prefix + "ObjName", this.ObjName); this.SetParamSimple(map, prefix + "FirstOccurTime", this.FirstOccurTime); this.SetParamSimple(map, prefix + "LastOccurTime", this.LastOccurTime); this.SetParamSimple(map, prefix + "Status", this.Status); this.SetParamSimple(map, prefix + "Content", this.Content); this.SetParamSimple(map, prefix + "TaskId", this.TaskId); this.SetParamSimple(map, prefix + "MetricName", this.MetricName); this.SetParamSimple(map, prefix + "MetricValue", this.MetricValue); this.SetParamSimple(map, prefix + "ObjId", this.ObjId); } } }
30.72
85
0.580404
[ "Apache-2.0" ]
TencentCloud/tencentcloud-sdk-dotnet
TencentCloud/Cat/V20180409/Models/AlarmInfo.cs
3,208
C#
using System; using System.Collections.Generic; using CustomerTestsExcel.ExcelToCode; using NUnit.Framework; namespace CustomerTestsExcel.Test { [TestFixture] public class NoBlankLineBetweenGivenAndWhen : TestBase { [Test] public void SheetConverterAddsWarningCommentIfNoBlankLineBetweenGivenAndWhen() { var sheetConverter = new ExcelToCode.ExcelToCode(new CodeNameToExcelNameConverter(ANY_STRING)); using (var workbook = Workbook(@"TestExcelFiles\NoBlankLineBetweenGivenAndWhen\NoBlankLineBetweenGivenAndWhen.xlsx")) { string generatedCode = sheetConverter.GenerateCSharpTestCode(NO_USINGS, workbook.GetPage(0), ANY_ROOT_NAMESPACE, ANY_WORKBOOKNAME).Code; StringAssert.Contains("RoundTrippable() => false", generatedCode); StringAssert.Contains( "no blank line between the end of the Given section (Row 5) and the start of the When section (Row 6)", generatedCode); } } [Test] public void TestProjectCreatorReturnsWarningIfNoBlankLineBetweenGivenAndWhen() { var results = GenerateTestsAndReturnResults(@"TestExcelFiles\NoBlankLineBetweenGivenAndWhen\"); StringAssert.Contains("Workbook 'NoBlankLineBetweenGivenAndWhen'", results.LogMessages); StringAssert.Contains("Worksheet 'NoBlankLineBetweenGivenAndWhen'", results.LogMessages); StringAssert.Contains( "no blank line between the end of the Given section (Row 5) and the start of the When section (Row 6)", results.LogMessages); } } }
39.395349
152
0.681228
[ "MIT" ]
DanielKirkwood/customer-tests-excel
CustomerTestsExcel.Test/NoBlankLineBetweenGivenAndWhen.cs
1,696
C#
namespace PlayersAndMonsters.Core.Factories { using PlayersAndMonsters.Core.Factories.Contracts; using PlayersAndMonsters.Models.Players; using PlayersAndMonsters.Models.Players.Contracts; using PlayersAndMonsters.Repositories; using System; using System.Collections.Generic; using System.Text; public class PlayerFactory : IPlayerFactory { public IPlayer CreatePlayer(string type, string username) { IPlayer player = null; CardRepository cardRepository = new CardRepository(); switch (type) { case "Beginner": player = new Beginner(cardRepository, username); break; case "Advanced": player = new Advanced(cardRepository, username); break; } return player; } } }
28.59375
68
0.589071
[ "MIT" ]
ilinatsoneva3/SoftUni-Official
C# OOP Exam Previous/Players and monsters/PlayersAndMonsters/Core/Factories/PlayerFactory.cs
917
C#